档案鉴定申请逻辑

new
parent b0ef8ed4ba
commit e291408535

@ -68,7 +68,7 @@ public class AuthenticateController {
@PostMapping("/create/apply")
@Operation(summary = "创建档案鉴定申请")
@PreAuthorize("@ss.hasPermission('archives:authenticate:create')")
public CommonResult<Long> createApply(@Valid @RequestBody AuthenticateCreateReqVO createReqVO) {
public CommonResult<Long> createApply(@Valid @RequestBody List<AuthenticateCreateReqVO> createReqVO) {
return success(authenticateService.createApply(createReqVO));
}

@ -72,5 +72,5 @@ public interface AuthenticateService {
* @param createReqVO
* @return
*/
Long createApply(AuthenticateCreateReqVO createReqVO);
Long createApply(List<AuthenticateCreateReqVO> createReqVO);
}

@ -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<RecordDO> 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<AuthenticateCreateReqVO> 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;
}
}

Loading…
Cancel
Save