diff --git a/sql/archives_authenticate20230914JS.sql b/sql/archives_authenticate20230914JS.sql index 9eeb77d8..76fe18d1 100644 --- a/sql/archives_authenticate20230914JS.sql +++ b/sql/archives_authenticate20230914JS.sql @@ -21,4 +21,12 @@ CREATE TABLE `lyr-one`.`archives_authenticate` ( `tenant_id` bigint(20) NULL DEFAULT NULL COMMENT '住户编号', `deleted` bit(1) NULL DEFAULT b'0' COMMENT '是否删除', PRIMARY KEY (`id`) USING BTREE -) ENGINE = MyISAM AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '档案鉴定表' ROW_FORMAT = Dynamic; \ No newline at end of file +) ENGINE = MyISAM AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '档案鉴定表' ROW_FORMAT = Dynamic; + +-- 新增档案鉴定列表,鉴定历史列表 +INSERT INTO `lyr-one`.`system_menu` ( `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES ( '鉴定管理', '', 1, 1, 0, '/fileAuth', 'checkbox', NULL, NULL, 0, b'1', b'1', b'1', '', '2023-09-14 13:45:31', '', '2023-09-14 15:26:21', b'0'); +SET @menuId = LAST_INSERT_ID(); + +INSERT INTO `lyr-one`.`system_menu` ( `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES ('鉴定', 'fileAuth:authenticate:list', 2, 1, @menuId, 'authenticate', 'clipboard', 'fileAuth/authenticate/index', 'authenticate', 0, b'1', b'1', b'1', '', '2023-09-14 13:57:30', '', '2023-09-14 13:57:30', b'0'); + +INSERT INTO `lyr-one`.`system_menu` ( `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES ( '鉴定历史记录', 'fileAuth:authRecord:list', 2, 2, @menuId, 'authRecord', 'build', 'fileAuth/authRecord/index', 'authRecord', 0, b'1', b'1', b'1', '', '2023-09-14 13:59:15', '', '2023-09-14 13:59:38', b'0'); diff --git a/yudao-framework/yudao-spring-boot-starter-file/pom.xml b/yudao-framework/yudao-spring-boot-starter-file/pom.xml index 5ce48a85..aad4c7c6 100644 --- a/yudao-framework/yudao-spring-boot-starter-file/pom.xml +++ b/yudao-framework/yudao-spring-boot-starter-file/pom.xml @@ -78,6 +78,12 @@ yudao-spring-boot-starter-test test + + + org.springframework + spring-web + test + diff --git a/yudao-framework/yudao-spring-boot-starter-file/src/test/java/cn/iocoder/yudao/framework/file/core/client/s3/S3FileClientTest.java b/yudao-framework/yudao-spring-boot-starter-file/src/test/java/cn/iocoder/yudao/framework/file/core/client/s3/S3FileClientTest.java index 1d0ed209..d6098f4a 100644 --- a/yudao-framework/yudao-spring-boot-starter-file/src/test/java/cn/iocoder/yudao/framework/file/core/client/s3/S3FileClientTest.java +++ b/yudao-framework/yudao-spring-boot-starter-file/src/test/java/cn/iocoder/yudao/framework/file/core/client/s3/S3FileClientTest.java @@ -5,6 +5,7 @@ import cn.hutool.core.util.IdUtil; import cn.iocoder.yudao.framework.common.util.validation.ValidationUtils; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; +import org.springframework.web.multipart.MultipartFile; import javax.validation.Validation; @@ -12,23 +13,23 @@ public class S3FileClientTest { @Test @Disabled // MinIO,如果要集成测试,可以注释本行 - public void testMinIO() throws Exception { + public void testMinIO(MultipartFile file) throws Exception { S3FileClientConfig config = new S3FileClientConfig(); // 配置成你自己的 - config.setAccessKey("admin"); - config.setAccessSecret("password"); - config.setBucket("yudaoyuanma"); + config.setAccessKey("minioadmin"); + config.setAccessSecret("minioadmin"); + config.setBucket("ktg-mes"); config.setDomain(null); // 默认 9000 endpoint - config.setEndpoint("http://127.0.0.1:9000"); + config.setEndpoint("https://www.lyrfp.com"); // 执行上传 - testExecuteUpload(config); + testExecuteUpload(config,file); } @Test @Disabled // 阿里云 OSS,如果要集成测试,可以注释本行 - public void testAliyun() throws Exception { + public void testAliyun(MultipartFile file) throws Exception { S3FileClientConfig config = new S3FileClientConfig(); // 配置成你自己的 config.setAccessKey(System.getenv("ALIYUN_ACCESS_KEY")); @@ -39,12 +40,12 @@ public class S3FileClientTest { config.setEndpoint("oss-cn-beijing.aliyuncs.com"); // 执行上传 - testExecuteUpload(config); + testExecuteUpload(config,file); } @Test @Disabled // 腾讯云 COS,如果要集成测试,可以注释本行 - public void testQCloud() throws Exception { + public void testQCloud(MultipartFile file) throws Exception { S3FileClientConfig config = new S3FileClientConfig(); // 配置成你自己的 config.setAccessKey(System.getenv("QCLOUD_ACCESS_KEY")); @@ -55,12 +56,12 @@ public class S3FileClientTest { config.setEndpoint("cos.ap-shanghai.myqcloud.com"); // 执行上传 - testExecuteUpload(config); + testExecuteUpload(config,file); } @Test @Disabled // 七牛云存储,如果要集成测试,可以注释本行 - public void testQiniu() throws Exception { + public void testQiniu(MultipartFile file) throws Exception { S3FileClientConfig config = new S3FileClientConfig(); // 配置成你自己的 // config.setAccessKey(System.getenv("QINIU_ACCESS_KEY")); @@ -73,12 +74,12 @@ public class S3FileClientTest { config.setEndpoint("s3-cn-south-1.qiniucs.com"); // 执行上传 - testExecuteUpload(config); + testExecuteUpload(config,file); } @Test @Disabled // 华为云存储,如果要集成测试,可以注释本行 - public void testHuaweiCloud() throws Exception { + public void testHuaweiCloud(MultipartFile file) throws Exception { S3FileClientConfig config = new S3FileClientConfig(); // 配置成你自己的 // config.setAccessKey(System.getenv("HUAWEI_CLOUD_ACCESS_KEY")); @@ -89,19 +90,19 @@ public class S3FileClientTest { config.setEndpoint("obs.cn-east-3.myhuaweicloud.com"); // 执行上传 - testExecuteUpload(config); + testExecuteUpload(config,file); } - private void testExecuteUpload(S3FileClientConfig config) throws Exception { + private String testExecuteUpload(S3FileClientConfig config,MultipartFile file) throws Exception { // 校验配置 ValidationUtils.validate(Validation.buildDefaultValidatorFactory().getValidator(), config); // 创建 Client S3FileClient client = new S3FileClient(0L, config); client.init(); // 上传文件 - String path = IdUtil.fastSimpleUUID() + ".jpg"; - byte[] content = ResourceUtil.readBytes("file/erweima.jpg"); - String fullPath = client.upload(content, path, "image/jpeg"); + String path = IdUtil.fastSimpleUUID() + ".xlsx"; +// byte[] content = ResourceUtil.readBytes(file); + String fullPath = client.upload(file.getBytes(), path, "xlsx"); System.out.println("访问地址:" + fullPath); // 读取文件 if (true) { @@ -112,6 +113,7 @@ public class S3FileClientTest { if (false) { client.delete(path); } + return fullPath; } } 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 index a894f6f1..c8b1cf32 100644 --- 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 @@ -68,9 +68,11 @@ public class AuthenticateController { @PostMapping("/create/apply") @Operation(summary = "创建档案鉴定申请") @PreAuthorize("@ss.hasPermission('archives:authenticate:create')") - public CommonResult createApply(@Valid @RequestBody AuthenticateCreateReqVO createReqVO) { + public CommonResult createApply(@Valid @RequestBody List createReqVO) { return success(authenticateService.createApply(createReqVO)); } + + @Operation(summary = "创建档案鉴定历史") @PreAuthorize("@ss.hasPermission('archives:authenticate:create')") @PostMapping("/create") 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 index 902e3031..c06b9ca9 100644 --- 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 @@ -72,5 +72,5 @@ public interface AuthenticateService { * @param createReqVO * @return */ - Long createApply(AuthenticateCreateReqVO createReqVO); + Long createApply(List createReqVO); } 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 index b5a96135..21720534 100644 --- 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 @@ -97,17 +97,21 @@ public class AuthenticateServiceImpl implements AuthenticateService { */ @Override @Transactional - public Long createApply(AuthenticateCreateReqVO createReqVO) { - AuthenticateDO authenticate = AuthenticateConvert.INSTANCE.convert(createReqVO); - //修改档案状态为已鉴定 - RecordDO recordDO = new RecordDO(); - LambdaUpdateWrapper wrapper = new LambdaUpdateWrapper<>(); - wrapper.set(RecordDO::getIdentifyStatus,1).eq(RecordDO::getId,createReqVO.getRecordId()); - recordMapper.update(recordDO,wrapper); - - //新增鉴定申请记录 - authenticateMapper.insert(authenticate); - return authenticate.getId(); + public Long createApply(List createReqVO) { + for (AuthenticateCreateReqVO vo: createReqVO) { + RecordDO record = recordMapper.selectById(vo.getRecordId()); + //修改档案状态为已鉴定 + record.setIdentifyStatus("1"); + recordMapper.updateById(record); + + //设置档案类型和档案位置 + vo.setType(record.getFileType()); + vo.setPosition(record.getSite()); + AuthenticateDO authenticate = AuthenticateConvert.INSTANCE.convert(vo); + //新增鉴定申请记录 + authenticateMapper.insert(authenticate); + } + return 200L; } } diff --git a/yudao-module-electronic/yudao-module-ea-api/src/main/java/cn/iocoder/yudao/module/ea/enums/ErrorCodeConstants.java b/yudao-module-electronic/yudao-module-ea-api/src/main/java/cn/iocoder/yudao/module/ea/enums/ErrorCodeConstants.java index fef34492..fa709ecc 100644 --- a/yudao-module-electronic/yudao-module-ea-api/src/main/java/cn/iocoder/yudao/module/ea/enums/ErrorCodeConstants.java +++ b/yudao-module-electronic/yudao-module-ea-api/src/main/java/cn/iocoder/yudao/module/ea/enums/ErrorCodeConstants.java @@ -4,5 +4,5 @@ import cn.iocoder.yudao.framework.common.exception.ErrorCode; public interface ErrorCodeConstants { ErrorCode ELECTRONIC_ASSETS_NOT_EXISTS = new ErrorCode(300010, "资产档案不存在"); - -} \ No newline at end of file + ErrorCode ELECTRONIC_CONTRACTS_NOT_EXISTS = new ErrorCode(300011, "合同档案不存在"); +} diff --git a/yudao-module-electronic/yudao-module-ea-biz/src/main/java/cn/iocoder/yudao/module/ea/controller/admin/electroniccontracts/ElectronicContractsController.java b/yudao-module-electronic/yudao-module-ea-biz/src/main/java/cn/iocoder/yudao/module/ea/controller/admin/electroniccontracts/ElectronicContractsController.java new file mode 100644 index 00000000..c98f83f6 --- /dev/null +++ b/yudao-module-electronic/yudao-module-ea-biz/src/main/java/cn/iocoder/yudao/module/ea/controller/admin/electroniccontracts/ElectronicContractsController.java @@ -0,0 +1,102 @@ +package cn.iocoder.yudao.module.ea.controller.admin.electroniccontracts; + +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.ea.controller.admin.electroniccontracts.vo.*; +import cn.iocoder.yudao.module.ea.dal.dataobject.electroniccontracts.ElectronicContractsDO; +import cn.iocoder.yudao.module.ea.convert.electroniccontracts.ElectronicContractsConvert; +import cn.iocoder.yudao.module.ea.service.electroniccontracts.ElectronicContractsService; + +@Tag(name = "管理后台 - 合同档案") +@RestController +@RequestMapping("/ea/electronic-contracts") +@Validated +public class ElectronicContractsController { + + @Resource + private ElectronicContractsService electronicContractsService; + + @PostMapping("/create") + @Operation(summary = "创建合同档案") + @PreAuthorize("@ss.hasPermission('ea:electronic-contracts:create')") + public CommonResult createElectronicContracts(@Valid @RequestBody ElectronicContractsCreateReqVO createReqVO) { + return success(electronicContractsService.createElectronicContracts(createReqVO)); + } + + @PutMapping("/update") + @Operation(summary = "更新合同档案") + @PreAuthorize("@ss.hasPermission('ea:electronic-contracts:update')") + public CommonResult updateElectronicContracts(@Valid @RequestBody ElectronicContractsUpdateReqVO updateReqVO) { + electronicContractsService.updateElectronicContracts(updateReqVO); + return success(true); + } + + @DeleteMapping("/delete") + @Operation(summary = "删除合同档案") + @Parameter(name = "id", description = "编号", required = true) + @PreAuthorize("@ss.hasPermission('ea:electronic-contracts:delete')") + public CommonResult deleteElectronicContracts(@RequestParam("id") Long id) { + electronicContractsService.deleteElectronicContracts(id); + return success(true); + } + + @GetMapping("/get") + @Operation(summary = "获得合同档案") + @Parameter(name = "id", description = "编号", required = true, example = "1024") + @PreAuthorize("@ss.hasPermission('ea:electronic-contracts:query')") + public CommonResult getElectronicContracts(@RequestParam("id") Long id) { + ElectronicContractsDO electronicContracts = electronicContractsService.getElectronicContracts(id); + return success(ElectronicContractsConvert.INSTANCE.convert(electronicContracts)); + } + + @GetMapping("/list") + @Operation(summary = "获得合同档案列表") + @Parameter(name = "ids", description = "编号列表", required = true, example = "1024,2048") + @PreAuthorize("@ss.hasPermission('ea:electronic-contracts:query')") + public CommonResult> getElectronicContractsList(@RequestParam("ids") Collection ids) { + List list = electronicContractsService.getElectronicContractsList(ids); + return success(ElectronicContractsConvert.INSTANCE.convertList(list)); + } + + @GetMapping("/page") + @Operation(summary = "获得合同档案分页") + @PreAuthorize("@ss.hasPermission('ea:electronic-contracts:query')") + public CommonResult> getElectronicContractsPage(@Valid ElectronicContractsPageReqVO pageVO) { + PageResult pageResult = electronicContractsService.getElectronicContractsPage(pageVO); + return success(ElectronicContractsConvert.INSTANCE.convertPage(pageResult)); + } + + @GetMapping("/export-excel") + @Operation(summary = "导出合同档案 Excel") + @PreAuthorize("@ss.hasPermission('ea:electronic-contracts:export')") + @OperateLog(type = EXPORT) + public void exportElectronicContractsExcel(@Valid ElectronicContractsExportReqVO exportReqVO, + HttpServletResponse response) throws IOException { + List list = electronicContractsService.getElectronicContractsList(exportReqVO); + // 导出 Excel + List datas = ElectronicContractsConvert.INSTANCE.convertList02(list); + ExcelUtils.write(response, "合同档案.xls", "数据", ElectronicContractsExcelVO.class, datas); + } + +} diff --git a/yudao-module-electronic/yudao-module-ea-biz/src/main/java/cn/iocoder/yudao/module/ea/controller/admin/electroniccontracts/vo/ElectronicContractsBaseVO.java b/yudao-module-electronic/yudao-module-ea-biz/src/main/java/cn/iocoder/yudao/module/ea/controller/admin/electroniccontracts/vo/ElectronicContractsBaseVO.java new file mode 100644 index 00000000..22ba4be9 --- /dev/null +++ b/yudao-module-electronic/yudao-module-ea-biz/src/main/java/cn/iocoder/yudao/module/ea/controller/admin/electroniccontracts/vo/ElectronicContractsBaseVO.java @@ -0,0 +1,94 @@ +package cn.iocoder.yudao.module.ea.controller.admin.electroniccontracts.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; + +import java.time.LocalDate; +import java.util.*; +import java.time.LocalDateTime; +import java.time.LocalDateTime; +import javax.validation.constraints.*; + +/** + * 合同档案 Base VO,提供给添加、修改、详细的子 VO 使用 + * 如果子 VO 存在差异的字段,请不要添加到这里,影响 Swagger 文档生成 + */ +@Data +public class ElectronicContractsBaseVO { + + @Schema(description = "制单人") + private String createBy; + + @Schema(description = "业务实体id", example = "15565") + private Long companyId; + + @Schema(description = "业务实体") + private String company; + + @Schema(description = "所属部门id", example = "10629") + private Long deptId; + + @Schema(description = "所属部门", example = "赵六") + private String deptName; + + @Schema(description = "合同编号") + private String contractCode; + + @Schema(description = "合同名称") + private String contractTitle; + + @Schema(description = "合同类型", example = "2") + private String contractType; + + @Schema(description = "签署方") + private String signatory; + + @Schema(description = "签署日期") + private LocalDate signDate; + + @Schema(description = "生效日期") + private LocalDate effectiveDate; + + @Schema(description = "截止日期") + private LocalDate expiryDate; + + @Schema(description = "状态", example = "1") + private String contractStatus; + + @Schema(description = "金额") + private Long contractAmount; + + @Schema(description = "附件") + private String contractAttachment; + + @Schema(description = "处理结果") + private String handleResult; + + @Schema(description = "年度") + private String year; + + @Schema(description = "月份") + private String period; + + @Schema(description = "借阅状态", example = "1") + private String borrowStatus; + + @Schema(description = "归档时间") + private String recordTime; + + @Schema(description = "纸档位置") + private String position; + + @Schema(description = "完整性") + private Integer cherks; + + @Schema(description = "归档id,一个归档id对应多个合同档案", example = "26409") + private Long recordId; + + @Schema(description = "用户id", example = "7723") + private Long userId; + + @Schema(description = "归档状态", example = "1") + private String fileStatus; + +} diff --git a/yudao-module-electronic/yudao-module-ea-biz/src/main/java/cn/iocoder/yudao/module/ea/controller/admin/electroniccontracts/vo/ElectronicContractsCreateReqVO.java b/yudao-module-electronic/yudao-module-ea-biz/src/main/java/cn/iocoder/yudao/module/ea/controller/admin/electroniccontracts/vo/ElectronicContractsCreateReqVO.java new file mode 100644 index 00000000..2008c5d2 --- /dev/null +++ b/yudao-module-electronic/yudao-module-ea-biz/src/main/java/cn/iocoder/yudao/module/ea/controller/admin/electroniccontracts/vo/ElectronicContractsCreateReqVO.java @@ -0,0 +1,14 @@ +package cn.iocoder.yudao.module.ea.controller.admin.electroniccontracts.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 ElectronicContractsCreateReqVO extends ElectronicContractsBaseVO { + +} diff --git a/yudao-module-electronic/yudao-module-ea-biz/src/main/java/cn/iocoder/yudao/module/ea/controller/admin/electroniccontracts/vo/ElectronicContractsExcelVO.java b/yudao-module-electronic/yudao-module-ea-biz/src/main/java/cn/iocoder/yudao/module/ea/controller/admin/electroniccontracts/vo/ElectronicContractsExcelVO.java new file mode 100644 index 00000000..083df6bb --- /dev/null +++ b/yudao-module-electronic/yudao-module-ea-biz/src/main/java/cn/iocoder/yudao/module/ea/controller/admin/electroniccontracts/vo/ElectronicContractsExcelVO.java @@ -0,0 +1,102 @@ +package cn.iocoder.yudao.module.ea.controller.admin.electroniccontracts.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; + +import java.time.LocalDate; +import java.util.*; +import java.time.LocalDateTime; +import java.time.LocalDateTime; + +import com.alibaba.excel.annotation.ExcelProperty; + +/** + * 合同档案 Excel VO + * + * @author 芋道源码 + */ +@Data +public class ElectronicContractsExcelVO { + + @ExcelProperty("主键") + private Long id; + + @ExcelProperty("制单人") + private String createBy; + + @ExcelProperty("创建日期") + private LocalDateTime createTime; + + @ExcelProperty("业务实体id") + private Long companyId; + + @ExcelProperty("业务实体") + private String company; + + @ExcelProperty("所属部门id") + private Long deptId; + + @ExcelProperty("所属部门") + private String deptName; + + @ExcelProperty("合同编号") + private String contractCode; + + @ExcelProperty("合同名称") + private String contractTitle; + + @ExcelProperty("合同类型") + private String contractType; + + @ExcelProperty("签署方") + private String signatory; + + @ExcelProperty("签署日期") + private LocalDate signDate; + + @ExcelProperty("生效日期") + private LocalDate effectiveDate; + + @ExcelProperty("截止日期") + private LocalDate expiryDate; + + @ExcelProperty("状态") + private String contractStatus; + + @ExcelProperty("金额") + private Long contractAmount; + + @ExcelProperty("附件") + private String contractAttachment; + + @ExcelProperty("处理结果") + private String handleResult; + + @ExcelProperty("年度") + private String year; + + @ExcelProperty("月份") + private String period; + + @ExcelProperty("借阅状态") + private String borrowStatus; + + @ExcelProperty("归档时间") + private String recordTime; + + @ExcelProperty("纸档位置") + private String position; + + @ExcelProperty("完整性") + private Integer cherks; + + @ExcelProperty("归档id,一个归档id对应多个合同档案") + private Long recordId; + + @ExcelProperty("用户id") + private Long userId; + + @ExcelProperty("归档状态") + private String fileStatus; + +} diff --git a/yudao-module-electronic/yudao-module-ea-biz/src/main/java/cn/iocoder/yudao/module/ea/controller/admin/electroniccontracts/vo/ElectronicContractsExportReqVO.java b/yudao-module-electronic/yudao-module-ea-biz/src/main/java/cn/iocoder/yudao/module/ea/controller/admin/electroniccontracts/vo/ElectronicContractsExportReqVO.java new file mode 100644 index 00000000..8388f070 --- /dev/null +++ b/yudao-module-electronic/yudao-module-ea-biz/src/main/java/cn/iocoder/yudao/module/ea/controller/admin/electroniccontracts/vo/ElectronicContractsExportReqVO.java @@ -0,0 +1,101 @@ +package cn.iocoder.yudao.module.ea.controller.admin.electroniccontracts.vo; + +import lombok.*; + +import java.time.LocalDate; +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,参数和 ElectronicContractsPageReqVO 是一致的") +@Data +public class ElectronicContractsExportReqVO { + + @Schema(description = "制单人") + private String createBy; + + @Schema(description = "创建日期") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] createTime; + + @Schema(description = "业务实体id", example = "15565") + private Long companyId; + + @Schema(description = "业务实体") + private String company; + + @Schema(description = "所属部门id", example = "10629") + private Long deptId; + + @Schema(description = "所属部门", example = "赵六") + private String deptName; + + @Schema(description = "合同编号") + private String contractCode; + + @Schema(description = "合同名称") + private String contractTitle; + + @Schema(description = "合同类型", example = "2") + private String contractType; + + @Schema(description = "签署方") + private String signatory; + + @Schema(description = "签署日期") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDate[] signDate; + + @Schema(description = "生效日期") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDate[] effectiveDate; + + @Schema(description = "截止日期") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDate[] expiryDate; + + @Schema(description = "状态", example = "1") + private String contractStatus; + + @Schema(description = "金额") + private Long contractAmount; + + @Schema(description = "附件") + private String contractAttachment; + + @Schema(description = "处理结果") + private String handleResult; + + @Schema(description = "年度") + private String year; + + @Schema(description = "月份") + private String period; + + @Schema(description = "借阅状态", example = "1") + private String borrowStatus; + + @Schema(description = "归档时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private String[] recordTime; + + @Schema(description = "纸档位置") + private String position; + + @Schema(description = "完整性") + private Integer cherks; + + @Schema(description = "归档id,一个归档id对应多个合同档案", example = "26409") + private Long recordId; + + @Schema(description = "用户id", example = "7723") + private Long userId; + + @Schema(description = "归档状态", example = "1") + private String fileStatus; + +} diff --git a/yudao-module-electronic/yudao-module-ea-biz/src/main/java/cn/iocoder/yudao/module/ea/controller/admin/electroniccontracts/vo/ElectronicContractsPageReqVO.java b/yudao-module-electronic/yudao-module-ea-biz/src/main/java/cn/iocoder/yudao/module/ea/controller/admin/electroniccontracts/vo/ElectronicContractsPageReqVO.java new file mode 100644 index 00000000..82948511 --- /dev/null +++ b/yudao-module-electronic/yudao-module-ea-biz/src/main/java/cn/iocoder/yudao/module/ea/controller/admin/electroniccontracts/vo/ElectronicContractsPageReqVO.java @@ -0,0 +1,103 @@ +package cn.iocoder.yudao.module.ea.controller.admin.electroniccontracts.vo; + +import lombok.*; + +import java.time.LocalDate; +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 ElectronicContractsPageReqVO extends PageParam { + + @Schema(description = "制单人") + private String createBy; + + @Schema(description = "创建日期") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] createTime; + + @Schema(description = "业务实体id", example = "15565") + private Long companyId; + + @Schema(description = "业务实体") + private String company; + + @Schema(description = "所属部门id", example = "10629") + private Long deptId; + + @Schema(description = "所属部门", example = "赵六") + private String deptName; + + @Schema(description = "合同编号") + private String contractCode; + + @Schema(description = "合同名称") + private String contractTitle; + + @Schema(description = "合同类型", example = "2") + private String contractType; + + @Schema(description = "签署方") + private String signatory; + + @Schema(description = "签署日期") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDate[] signDate; + + @Schema(description = "生效日期") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDate[] effectiveDate; + + @Schema(description = "截止日期") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDate[] expiryDate; + + @Schema(description = "状态", example = "1") + private String contractStatus; + + @Schema(description = "金额") + private Long contractAmount; + + @Schema(description = "附件") + private String contractAttachment; + + @Schema(description = "处理结果") + private String handleResult; + + @Schema(description = "年度") + private String year; + + @Schema(description = "月份") + private String period; + + @Schema(description = "借阅状态", example = "1") + private String borrowStatus; + + @Schema(description = "归档时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private String[] recordTime; + + @Schema(description = "纸档位置") + private String position; + + @Schema(description = "完整性") + private Integer cherks; + + @Schema(description = "归档id,一个归档id对应多个合同档案", example = "26409") + private Long recordId; + + @Schema(description = "用户id", example = "7723") + private Long userId; + + @Schema(description = "归档状态", example = "1") + private String fileStatus; + +} diff --git a/yudao-module-electronic/yudao-module-ea-biz/src/main/java/cn/iocoder/yudao/module/ea/controller/admin/electroniccontracts/vo/ElectronicContractsRespVO.java b/yudao-module-electronic/yudao-module-ea-biz/src/main/java/cn/iocoder/yudao/module/ea/controller/admin/electroniccontracts/vo/ElectronicContractsRespVO.java new file mode 100644 index 00000000..dfe99fc1 --- /dev/null +++ b/yudao-module-electronic/yudao-module-ea-biz/src/main/java/cn/iocoder/yudao/module/ea/controller/admin/electroniccontracts/vo/ElectronicContractsRespVO.java @@ -0,0 +1,19 @@ +package cn.iocoder.yudao.module.ea.controller.admin.electroniccontracts.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 ElectronicContractsRespVO extends ElectronicContractsBaseVO { + + @Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "32308") + private Long id; + + @Schema(description = "创建日期") + private LocalDateTime createTime; + +} diff --git a/yudao-module-electronic/yudao-module-ea-biz/src/main/java/cn/iocoder/yudao/module/ea/controller/admin/electroniccontracts/vo/ElectronicContractsUpdateReqVO.java b/yudao-module-electronic/yudao-module-ea-biz/src/main/java/cn/iocoder/yudao/module/ea/controller/admin/electroniccontracts/vo/ElectronicContractsUpdateReqVO.java new file mode 100644 index 00000000..27085a66 --- /dev/null +++ b/yudao-module-electronic/yudao-module-ea-biz/src/main/java/cn/iocoder/yudao/module/ea/controller/admin/electroniccontracts/vo/ElectronicContractsUpdateReqVO.java @@ -0,0 +1,18 @@ +package cn.iocoder.yudao.module.ea.controller.admin.electroniccontracts.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 ElectronicContractsUpdateReqVO extends ElectronicContractsBaseVO { + + @Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "32308") + @NotNull(message = "主键不能为空") + private Long id; + +} diff --git a/yudao-module-electronic/yudao-module-ea-biz/src/main/java/cn/iocoder/yudao/module/ea/convert/electroniccontracts/ElectronicContractsConvert.java b/yudao-module-electronic/yudao-module-ea-biz/src/main/java/cn/iocoder/yudao/module/ea/convert/electroniccontracts/ElectronicContractsConvert.java new file mode 100644 index 00000000..d5708c32 --- /dev/null +++ b/yudao-module-electronic/yudao-module-ea-biz/src/main/java/cn/iocoder/yudao/module/ea/convert/electroniccontracts/ElectronicContractsConvert.java @@ -0,0 +1,34 @@ +package cn.iocoder.yudao.module.ea.convert.electroniccontracts; + +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.ea.controller.admin.electroniccontracts.vo.*; +import cn.iocoder.yudao.module.ea.dal.dataobject.electroniccontracts.ElectronicContractsDO; + +/** + * 合同档案 Convert + * + * @author 芋道源码 + */ +@Mapper +public interface ElectronicContractsConvert { + + ElectronicContractsConvert INSTANCE = Mappers.getMapper(ElectronicContractsConvert.class); + + ElectronicContractsDO convert(ElectronicContractsCreateReqVO bean); + + ElectronicContractsDO convert(ElectronicContractsUpdateReqVO bean); + + ElectronicContractsRespVO convert(ElectronicContractsDO bean); + + List convertList(List list); + + PageResult convertPage(PageResult page); + + List convertList02(List list); + +} diff --git a/yudao-module-electronic/yudao-module-ea-biz/src/main/java/cn/iocoder/yudao/module/ea/dal/dataobject/electroniccontracts/ElectronicContractsDO.java b/yudao-module-electronic/yudao-module-ea-biz/src/main/java/cn/iocoder/yudao/module/ea/dal/dataobject/electroniccontracts/ElectronicContractsDO.java new file mode 100644 index 00000000..281f9469 --- /dev/null +++ b/yudao-module-electronic/yudao-module-ea-biz/src/main/java/cn/iocoder/yudao/module/ea/dal/dataobject/electroniccontracts/ElectronicContractsDO.java @@ -0,0 +1,132 @@ +package cn.iocoder.yudao.module.ea.dal.dataobject.electroniccontracts; + +import lombok.*; + +import java.time.LocalDate; +import java.util.*; +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("ea_electronic_contracts") +@KeySequence("ea_electronic_contracts_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class ElectronicContractsDO extends BaseDO { + + /** + * 主键 + */ + @TableId(type = IdType.AUTO) + private Long id; + /** + * 制单人 + */ + private String createBy; + /** + * 业务实体id + */ + private Long companyId; + /** + * 业务实体 + */ + private String company; + /** + * 所属部门id + */ + private Long deptId; + /** + * 所属部门 + */ + private String deptName; + /** + * 合同编号 + */ + private String contractCode; + /** + * 合同名称 + */ + private String contractTitle; + /** + * 合同类型 + */ + private String contractType; + /** + * 签署方 + */ + private String signatory; + /** + * 签署日期 + */ + private LocalDate signDate; + /** + * 生效日期 + */ + private LocalDate effectiveDate; + /** + * 截止日期 + */ + private LocalDate expiryDate; + /** + * 状态 + */ + private String contractStatus; + /** + * 金额 + */ + private Long contractAmount; + /** + * 附件 + */ + private String contractAttachment; + /** + * 处理结果 + */ + private String handleResult; + /** + * 年度 + */ + private String year; + /** + * 月份 + */ + private String period; + /** + * 借阅状态 + */ + private String borrowStatus; + /** + * 归档时间 + */ + private String recordTime; + /** + * 纸档位置 + */ + private String position; + /** + * 完整性 + */ + private Integer cherks; + /** + * 归档id,一个归档id对应多个合同档案 + */ + private Long recordId; + /** + * 用户id + */ + private Long userId; + /** + * 归档状态 + */ + private String fileStatus; + +} diff --git a/yudao-module-electronic/yudao-module-ea-biz/src/main/java/cn/iocoder/yudao/module/ea/dal/mysql/electroniccontracts/ElectronicContractsMapper.java b/yudao-module-electronic/yudao-module-ea-biz/src/main/java/cn/iocoder/yudao/module/ea/dal/mysql/electroniccontracts/ElectronicContractsMapper.java new file mode 100644 index 00000000..c41cbbd0 --- /dev/null +++ b/yudao-module-electronic/yudao-module-ea-biz/src/main/java/cn/iocoder/yudao/module/ea/dal/mysql/electroniccontracts/ElectronicContractsMapper.java @@ -0,0 +1,82 @@ +package cn.iocoder.yudao.module.ea.dal.mysql.electroniccontracts; + +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.ea.dal.dataobject.electroniccontracts.ElectronicContractsDO; +import org.apache.ibatis.annotations.Mapper; +import cn.iocoder.yudao.module.ea.controller.admin.electroniccontracts.vo.*; + +/** + * 合同档案 Mapper + * + * @author 芋道源码 + */ +@Mapper +public interface ElectronicContractsMapper extends BaseMapperX { + + default PageResult selectPage(ElectronicContractsPageReqVO reqVO) { + return selectPage(reqVO, new LambdaQueryWrapperX() + .eqIfPresent(ElectronicContractsDO::getCreateBy, reqVO.getCreateBy()) + .betweenIfPresent(ElectronicContractsDO::getCreateTime, reqVO.getCreateTime()) + .eqIfPresent(ElectronicContractsDO::getCompanyId, reqVO.getCompanyId()) + .eqIfPresent(ElectronicContractsDO::getCompany, reqVO.getCompany()) + .eqIfPresent(ElectronicContractsDO::getDeptId, reqVO.getDeptId()) + .likeIfPresent(ElectronicContractsDO::getDeptName, reqVO.getDeptName()) + .eqIfPresent(ElectronicContractsDO::getContractCode, reqVO.getContractCode()) + .eqIfPresent(ElectronicContractsDO::getContractTitle, reqVO.getContractTitle()) + .eqIfPresent(ElectronicContractsDO::getContractType, reqVO.getContractType()) + .eqIfPresent(ElectronicContractsDO::getSignatory, reqVO.getSignatory()) + .betweenIfPresent(ElectronicContractsDO::getSignDate, reqVO.getSignDate()) + .betweenIfPresent(ElectronicContractsDO::getEffectiveDate, reqVO.getEffectiveDate()) + .betweenIfPresent(ElectronicContractsDO::getExpiryDate, reqVO.getExpiryDate()) + .eqIfPresent(ElectronicContractsDO::getContractStatus, reqVO.getContractStatus()) + .eqIfPresent(ElectronicContractsDO::getContractAmount, reqVO.getContractAmount()) + .eqIfPresent(ElectronicContractsDO::getContractAttachment, reqVO.getContractAttachment()) + .eqIfPresent(ElectronicContractsDO::getHandleResult, reqVO.getHandleResult()) + .eqIfPresent(ElectronicContractsDO::getYear, reqVO.getYear()) + .eqIfPresent(ElectronicContractsDO::getPeriod, reqVO.getPeriod()) + .eqIfPresent(ElectronicContractsDO::getBorrowStatus, reqVO.getBorrowStatus()) + .betweenIfPresent(ElectronicContractsDO::getRecordTime, reqVO.getRecordTime()) + .eqIfPresent(ElectronicContractsDO::getPosition, reqVO.getPosition()) + .eqIfPresent(ElectronicContractsDO::getCherks, reqVO.getCherks()) + .eqIfPresent(ElectronicContractsDO::getRecordId, reqVO.getRecordId()) + .eqIfPresent(ElectronicContractsDO::getUserId, reqVO.getUserId()) + .eqIfPresent(ElectronicContractsDO::getFileStatus, reqVO.getFileStatus()) + .orderByDesc(ElectronicContractsDO::getId)); + } + + default List selectList(ElectronicContractsExportReqVO reqVO) { + return selectList(new LambdaQueryWrapperX() + .eqIfPresent(ElectronicContractsDO::getCreateBy, reqVO.getCreateBy()) + .betweenIfPresent(ElectronicContractsDO::getCreateTime, reqVO.getCreateTime()) + .eqIfPresent(ElectronicContractsDO::getCompanyId, reqVO.getCompanyId()) + .eqIfPresent(ElectronicContractsDO::getCompany, reqVO.getCompany()) + .eqIfPresent(ElectronicContractsDO::getDeptId, reqVO.getDeptId()) + .likeIfPresent(ElectronicContractsDO::getDeptName, reqVO.getDeptName()) + .eqIfPresent(ElectronicContractsDO::getContractCode, reqVO.getContractCode()) + .eqIfPresent(ElectronicContractsDO::getContractTitle, reqVO.getContractTitle()) + .eqIfPresent(ElectronicContractsDO::getContractType, reqVO.getContractType()) + .eqIfPresent(ElectronicContractsDO::getSignatory, reqVO.getSignatory()) + .betweenIfPresent(ElectronicContractsDO::getSignDate, reqVO.getSignDate()) + .betweenIfPresent(ElectronicContractsDO::getEffectiveDate, reqVO.getEffectiveDate()) + .betweenIfPresent(ElectronicContractsDO::getExpiryDate, reqVO.getExpiryDate()) + .eqIfPresent(ElectronicContractsDO::getContractStatus, reqVO.getContractStatus()) + .eqIfPresent(ElectronicContractsDO::getContractAmount, reqVO.getContractAmount()) + .eqIfPresent(ElectronicContractsDO::getContractAttachment, reqVO.getContractAttachment()) + .eqIfPresent(ElectronicContractsDO::getHandleResult, reqVO.getHandleResult()) + .eqIfPresent(ElectronicContractsDO::getYear, reqVO.getYear()) + .eqIfPresent(ElectronicContractsDO::getPeriod, reqVO.getPeriod()) + .eqIfPresent(ElectronicContractsDO::getBorrowStatus, reqVO.getBorrowStatus()) + .betweenIfPresent(ElectronicContractsDO::getRecordTime, reqVO.getRecordTime()) + .eqIfPresent(ElectronicContractsDO::getPosition, reqVO.getPosition()) + .eqIfPresent(ElectronicContractsDO::getCherks, reqVO.getCherks()) + .eqIfPresent(ElectronicContractsDO::getRecordId, reqVO.getRecordId()) + .eqIfPresent(ElectronicContractsDO::getUserId, reqVO.getUserId()) + .eqIfPresent(ElectronicContractsDO::getFileStatus, reqVO.getFileStatus()) + .orderByDesc(ElectronicContractsDO::getId)); + } + +} diff --git a/yudao-module-electronic/yudao-module-ea-biz/src/main/java/cn/iocoder/yudao/module/ea/service/electroniccontracts/ElectronicContractsService.java b/yudao-module-electronic/yudao-module-ea-biz/src/main/java/cn/iocoder/yudao/module/ea/service/electroniccontracts/ElectronicContractsService.java new file mode 100644 index 00000000..90592a45 --- /dev/null +++ b/yudao-module-electronic/yudao-module-ea-biz/src/main/java/cn/iocoder/yudao/module/ea/service/electroniccontracts/ElectronicContractsService.java @@ -0,0 +1,70 @@ +package cn.iocoder.yudao.module.ea.service.electroniccontracts; + +import java.util.*; +import javax.validation.*; +import cn.iocoder.yudao.module.ea.controller.admin.electroniccontracts.vo.*; +import cn.iocoder.yudao.module.ea.dal.dataobject.electroniccontracts.ElectronicContractsDO; +import cn.iocoder.yudao.framework.common.pojo.PageResult; + +/** + * 合同档案 Service 接口 + * + * @author 芋道源码 + */ +public interface ElectronicContractsService { + + /** + * 创建合同档案 + * + * @param createReqVO 创建信息 + * @return 编号 + */ + Long createElectronicContracts(@Valid ElectronicContractsCreateReqVO createReqVO); + + /** + * 更新合同档案 + * + * @param updateReqVO 更新信息 + */ + void updateElectronicContracts(@Valid ElectronicContractsUpdateReqVO updateReqVO); + + /** + * 删除合同档案 + * + * @param id 编号 + */ + void deleteElectronicContracts(Long id); + + /** + * 获得合同档案 + * + * @param id 编号 + * @return 合同档案 + */ + ElectronicContractsDO getElectronicContracts(Long id); + + /** + * 获得合同档案列表 + * + * @param ids 编号 + * @return 合同档案列表 + */ + List getElectronicContractsList(Collection ids); + + /** + * 获得合同档案分页 + * + * @param pageReqVO 分页查询 + * @return 合同档案分页 + */ + PageResult getElectronicContractsPage(ElectronicContractsPageReqVO pageReqVO); + + /** + * 获得合同档案列表, 用于 Excel 导出 + * + * @param exportReqVO 查询条件 + * @return 合同档案列表 + */ + List getElectronicContractsList(ElectronicContractsExportReqVO exportReqVO); + +} diff --git a/yudao-module-electronic/yudao-module-ea-biz/src/main/java/cn/iocoder/yudao/module/ea/service/electroniccontracts/ElectronicContractsServiceImpl.java b/yudao-module-electronic/yudao-module-ea-biz/src/main/java/cn/iocoder/yudao/module/ea/service/electroniccontracts/ElectronicContractsServiceImpl.java new file mode 100644 index 00000000..1051c0b1 --- /dev/null +++ b/yudao-module-electronic/yudao-module-ea-biz/src/main/java/cn/iocoder/yudao/module/ea/service/electroniccontracts/ElectronicContractsServiceImpl.java @@ -0,0 +1,82 @@ +package cn.iocoder.yudao.module.ea.service.electroniccontracts; + +import org.springframework.stereotype.Service; +import javax.annotation.Resource; +import org.springframework.validation.annotation.Validated; + +import java.util.*; +import cn.iocoder.yudao.module.ea.controller.admin.electroniccontracts.vo.*; +import cn.iocoder.yudao.module.ea.dal.dataobject.electroniccontracts.ElectronicContractsDO; +import cn.iocoder.yudao.framework.common.pojo.PageResult; + +import cn.iocoder.yudao.module.ea.convert.electroniccontracts.ElectronicContractsConvert; +import cn.iocoder.yudao.module.ea.dal.mysql.electroniccontracts.ElectronicContractsMapper; + +import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception; +import static cn.iocoder.yudao.module.ea.enums.ErrorCodeConstants.*; + +/** + * 合同档案 Service 实现类 + * + * @author 芋道源码 + */ +@Service +@Validated +public class ElectronicContractsServiceImpl implements ElectronicContractsService { + + @Resource + private ElectronicContractsMapper electronicContractsMapper; + + @Override + public Long createElectronicContracts(ElectronicContractsCreateReqVO createReqVO) { + // 插入 + ElectronicContractsDO electronicContracts = ElectronicContractsConvert.INSTANCE.convert(createReqVO); + electronicContractsMapper.insert(electronicContracts); + // 返回 + return electronicContracts.getId(); + } + + @Override + public void updateElectronicContracts(ElectronicContractsUpdateReqVO updateReqVO) { + // 校验存在 + validateElectronicContractsExists(updateReqVO.getId()); + // 更新 + ElectronicContractsDO updateObj = ElectronicContractsConvert.INSTANCE.convert(updateReqVO); + electronicContractsMapper.updateById(updateObj); + } + + @Override + public void deleteElectronicContracts(Long id) { + // 校验存在 + validateElectronicContractsExists(id); + // 删除 + electronicContractsMapper.deleteById(id); + } + + private void validateElectronicContractsExists(Long id) { + if (electronicContractsMapper.selectById(id) == null) { + throw exception(ELECTRONIC_CONTRACTS_NOT_EXISTS); + } + } + + @Override + public ElectronicContractsDO getElectronicContracts(Long id) { + return electronicContractsMapper.selectById(id); + } + + @Override + public List getElectronicContractsList(Collection ids) { + return electronicContractsMapper.selectBatchIds(ids); + } + + @Override + public PageResult getElectronicContractsPage(ElectronicContractsPageReqVO pageReqVO) { + return electronicContractsMapper.selectPage(pageReqVO); + } + + @Override + public List getElectronicContractsList(ElectronicContractsExportReqVO exportReqVO) { + return electronicContractsMapper.selectList(exportReqVO); + } + +} diff --git a/yudao-module-electronic/yudao-module-ea-biz/src/main/resources/mapper/electroniccontracts/ElectronicContractsMapper.xml b/yudao-module-electronic/yudao-module-ea-biz/src/main/resources/mapper/electroniccontracts/ElectronicContractsMapper.xml new file mode 100644 index 00000000..77074f46 --- /dev/null +++ b/yudao-module-electronic/yudao-module-ea-biz/src/main/resources/mapper/electroniccontracts/ElectronicContractsMapper.xml @@ -0,0 +1,12 @@ + + + + + + +