档案鉴定申请逻辑

new
parent b0ef8ed4ba
commit e291408535

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

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

@ -97,17 +97,21 @@ public class AuthenticateServiceImpl implements AuthenticateService {
*/ */
@Override @Override
@Transactional @Transactional
public Long createApply(AuthenticateCreateReqVO createReqVO) { public Long createApply(List<AuthenticateCreateReqVO> createReqVO) {
AuthenticateDO authenticate = AuthenticateConvert.INSTANCE.convert(createReqVO); for (AuthenticateCreateReqVO vo: createReqVO) {
//修改档案状态为已鉴定 RecordDO record = recordMapper.selectById(vo.getRecordId());
RecordDO recordDO = new RecordDO(); //修改档案状态为已鉴定
LambdaUpdateWrapper<RecordDO> wrapper = new LambdaUpdateWrapper<>(); record.setIdentifyStatus("1");
wrapper.set(RecordDO::getIdentifyStatus,1).eq(RecordDO::getId,createReqVO.getRecordId()); recordMapper.updateById(record);
recordMapper.update(recordDO,wrapper);
//设置档案类型和档案位置
//新增鉴定申请记录 vo.setType(record.getFileType());
authenticateMapper.insert(authenticate); vo.setPosition(record.getSite());
return authenticate.getId(); AuthenticateDO authenticate = AuthenticateConvert.INSTANCE.convert(vo);
//新增鉴定申请记录
authenticateMapper.insert(authenticate);
}
return 200L;
} }
} }

Loading…
Cancel
Save