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 37f0b333..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,7 +68,7 @@ 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)); } 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; } }