鉴定申请

new
parent 9c8eaf7a4b
commit 1e6ddc6e9b

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

@ -63,4 +63,7 @@ public class AuthenticateBaseVO {
@Schema(description = "备注", example = "你猜") @Schema(description = "备注", example = "你猜")
private String remark; private String remark;
@Schema(description = "鉴定结果", example = "鉴定结果")
private String result;
} }

@ -66,4 +66,7 @@ public class AuthenticateExcelVO {
@ExcelProperty("备注") @ExcelProperty("备注")
private String remark; private String remark;
@ExcelProperty("鉴定结果")
private String result;
} }

@ -67,4 +67,10 @@ public interface AuthenticateService {
*/ */
List<AuthenticateDO> getAuthenticateList(AuthenticateExportReqVO exportReqVO); List<AuthenticateDO> getAuthenticateList(AuthenticateExportReqVO exportReqVO);
/**
*
* @param createReqVO
* @return
*/
Long createApply(AuthenticateCreateReqVO createReqVO);
} }

@ -1,7 +1,15 @@
package cn.iocoder.yudao.module.archives.service.authenticate; 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 org.springframework.stereotype.Service;
import javax.annotation.Resource; import javax.annotation.Resource;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
import java.util.*; import java.util.*;
@ -27,6 +35,9 @@ public class AuthenticateServiceImpl implements AuthenticateService {
@Resource @Resource
private AuthenticateMapper authenticateMapper; private AuthenticateMapper authenticateMapper;
@Resource
private RecordMapper recordMapper;
@Override @Override
public Long createAuthenticate(AuthenticateCreateReqVO createReqVO) { public Long createAuthenticate(AuthenticateCreateReqVO createReqVO) {
// 插入 // 插入
@ -79,4 +90,24 @@ public class AuthenticateServiceImpl implements AuthenticateService {
return authenticateMapper.selectList(exportReqVO); 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<RecordDO> wrapper = new LambdaUpdateWrapper<>();
wrapper.set(RecordDO::getIdentifyStatus,1).eq(RecordDO::getId,createReqVO.getRecordId());
recordMapper.update(recordDO,wrapper);
//新增鉴定申请记录
authenticateMapper.insert(authenticate);
return authenticate.getId();
}
} }

Loading…
Cancel
Save