考勤草稿
This commit is contained in:
parent
0ff959525d
commit
4735aadfc8
@ -94,4 +94,19 @@ public class KqglController {
|
||||
BeanUtils.toBean(list, KqglRespVO.class));
|
||||
}
|
||||
|
||||
@PostMapping("/saveDraft")
|
||||
@Operation(summary = "创建请假为草稿")
|
||||
@PreAuthorize("@ss.hasPermission('home:kqgl:create')")
|
||||
public CommonResult<Long> saveDraft(@Valid @RequestBody KqglSaveReqVO createReqVO) {
|
||||
return success(kqglService.saveDraft(getLoginUserId(),createReqVO));
|
||||
}
|
||||
|
||||
@GetMapping("/draft")
|
||||
@Operation(summary = "获得请假草稿分页")
|
||||
@PreAuthorize("@ss.hasPermission('home:kqgl:query')")
|
||||
public CommonResult<PageResult<KqglRespVO>> getDraft(@Valid KqglPageReqVO pageReqVO) {
|
||||
PageResult<KqglDO> pageResult = kqglService.getDraft(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, KqglRespVO.class));
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -27,6 +27,7 @@ public interface KqglMapper extends BaseMapperX<KqglDO> {
|
||||
.likeIfPresent(KqglDO::getDeptName, reqVO.getDeptName())
|
||||
.betweenIfPresent(KqglDO::getDate, reqVO.getDate())
|
||||
.betweenIfPresent(KqglDO::getCreateTime, reqVO.getCreateTime())
|
||||
.ne(KqglDO::getStatus, 100) // 排除 status = 100
|
||||
.orderByDesc(KqglDO::getId));
|
||||
}
|
||||
default PageResult<KqglDO> selectPage(Long userId, KqglPageReqVO reqVO) {
|
||||
@ -42,4 +43,18 @@ public interface KqglMapper extends BaseMapperX<KqglDO> {
|
||||
.orderByDesc(KqglDO::getId));
|
||||
}
|
||||
|
||||
default PageResult<KqglDO> selectPageDraft(KqglPageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<KqglDO>()
|
||||
.eqIfPresent(KqglDO::getId, reqVO.getId())
|
||||
.eqIfPresent(KqglDO::getTitle, reqVO.getTitle())
|
||||
.eqIfPresent(KqglDO::getUserId, reqVO.getUserId())
|
||||
.likeIfPresent(KqglDO::getUserName, reqVO.getUserName())
|
||||
.eqIfPresent(KqglDO::getDeptId, reqVO.getDeptId())
|
||||
.likeIfPresent(KqglDO::getDeptName, reqVO.getDeptName())
|
||||
.betweenIfPresent(KqglDO::getDate, reqVO.getDate())
|
||||
.betweenIfPresent(KqglDO::getCreateTime, reqVO.getCreateTime())
|
||||
.eq(KqglDO::getStatus, 100) // 强制过滤 status = 100
|
||||
.orderByDesc(KqglDO::getId));
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -62,4 +62,13 @@ public interface KqglService {
|
||||
*/
|
||||
void updateClglStatus(Long id, Integer status);
|
||||
|
||||
/**
|
||||
* 草稿
|
||||
* @param userId
|
||||
* @param createReqVO
|
||||
* @return
|
||||
*/
|
||||
Long saveDraft(Long userId, KqglSaveReqVO createReqVO);
|
||||
PageResult<KqglDO> getDraft(KqglPageReqVO pageReqVO);
|
||||
|
||||
}
|
||||
|
@ -47,7 +47,11 @@ public class KqglServiceImpl implements KqglService {
|
||||
// 插入
|
||||
KqglDO kqgl = BeanUtils.toBean(createReqVO, KqglDO.class)
|
||||
.setUserId(userId).setStatus(BpmTaskStatusEnum.RUNNING.getStatus());
|
||||
kqglMapper.insert(kqgl);
|
||||
if (createReqVO.getCurfullpath().contains("?") ) {
|
||||
kqglMapper.updateById(kqgl);
|
||||
} else {
|
||||
kqglMapper.insert(kqgl);
|
||||
}
|
||||
Map<String, Object> processInstanceVariables = new HashMap<>();
|
||||
processInstanceId = processInstanceApi.createProcessInstance(userId,
|
||||
new BpmProcessInstanceCreateReqDTO().setProcessDefinitionKey(PROCESS_KEY)
|
||||
@ -123,5 +127,16 @@ public class KqglServiceImpl implements KqglService {
|
||||
throw exception(KNOWLEDGE_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public Long saveDraft(Long userId, KqglSaveReqVO createReqVO) {
|
||||
KqglDO kqgl = BeanUtils.toBean(createReqVO, KqglDO.class).setUserId(userId).setStatus(100);
|
||||
kqglMapper.insert(kqgl);
|
||||
return kqgl.getId();
|
||||
}
|
||||
@Override
|
||||
public PageResult<KqglDO> getDraft(KqglPageReqVO pageReqVO) {
|
||||
return kqglMapper.selectPageDraft(pageReqVO);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user