From 1e6ddc6e9b988d1cbe73128063bd8acda76770a9 Mon Sep 17 00:00:00 2001 From: "LAPTOP-0SF788NU\\admin" <3306174053@qq.com> Date: Fri, 15 Sep 2023 13:33:11 +0800 Subject: [PATCH] =?UTF-8?q?=E9=89=B4=E5=AE=9A=E7=94=B3=E8=AF=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../authenticate/AuthenticateController.java | 12 ++++++- .../authenticate/vo/AuthenticateBaseVO.java | 3 ++ .../authenticate/vo/AuthenticateExcelVO.java | 3 ++ .../authenticate/AuthenticateService.java | 6 ++++ .../authenticate/AuthenticateServiceImpl.java | 31 +++++++++++++++++++ 5 files changed, 54 insertions(+), 1 deletion(-) 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 f52a86d5..bc82b0ed 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 @@ -60,7 +60,17 @@ public class AuthenticateController { return recordService.getRecordPage(recordPageReqVO); } - @PostMapping("/create") + /** + * 新增鉴定申请 + * @param createReqVO + * @return + */ + @PostMapping("create/apply") + @Operation(summary = "创建档案鉴定申请") + @PreAuthorize("@ss.hasPermission('archives:authenticate:create')") + public CommonResult createApply(@Valid @RequestBody AuthenticateCreateReqVO createReqVO) { + return success(authenticateService.createApply(createReqVO)); + } @Operation(summary = "创建档案鉴定历史") @PreAuthorize("@ss.hasPermission('archives:authenticate:create')") public CommonResult createAuthenticate(@Valid @RequestBody AuthenticateCreateReqVO createReqVO) { 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 index d12f610c..fdf93d0e 100644 --- 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 @@ -63,4 +63,7 @@ public class AuthenticateBaseVO { @Schema(description = "备注", example = "你猜") private String remark; + @Schema(description = "鉴定结果", example = "鉴定结果") + private String result; + } 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 index 6f3eb844..31c27ee0 100644 --- 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 @@ -66,4 +66,7 @@ public class AuthenticateExcelVO { @ExcelProperty("备注") private String remark; + @ExcelProperty("鉴定结果") + private String result; + } 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 b9b1cb9c..902e3031 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 @@ -67,4 +67,10 @@ public interface AuthenticateService { */ List getAuthenticateList(AuthenticateExportReqVO exportReqVO); + /** + * 创建档案鉴定申请 + * @param createReqVO + * @return + */ + Long createApply(AuthenticateCreateReqVO 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 178943f3..b5a96135 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 @@ -1,7 +1,15 @@ package cn.iocoder.yudao.module.archives.service.authenticate; +import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX; +import cn.iocoder.yudao.module.archives.dal.dataobject.record.RecordDO; +import cn.iocoder.yudao.module.archives.dal.mysql.record.RecordMapper; +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; +import com.baomidou.mybatisplus.extension.conditions.update.LambdaUpdateChainWrapper; +import org.apache.poi.hssf.record.Record; import org.springframework.stereotype.Service; import javax.annotation.Resource; + +import org.springframework.transaction.annotation.Transactional; import org.springframework.validation.annotation.Validated; import java.util.*; @@ -27,6 +35,9 @@ public class AuthenticateServiceImpl implements AuthenticateService { @Resource private AuthenticateMapper authenticateMapper; + @Resource + private RecordMapper recordMapper; + @Override public Long createAuthenticate(AuthenticateCreateReqVO createReqVO) { // 插入 @@ -79,4 +90,24 @@ public class AuthenticateServiceImpl implements AuthenticateService { return authenticateMapper.selectList(exportReqVO); } + /** + * 新增鉴定申请 + * @param createReqVO + * @return + */ + @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(); + } + }