63 lines
2.0 KiB
Java
63 lines
2.0 KiB
Java
|
|
package com.klp.hrm.controller;
|
||
|
|
|
||
|
|
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||
|
|
import com.klp.common.annotation.Log;
|
||
|
|
import com.klp.common.core.controller.BaseController;
|
||
|
|
import com.klp.common.core.domain.PageQuery;
|
||
|
|
import com.klp.common.core.domain.R;
|
||
|
|
import com.klp.common.core.page.TableDataInfo;
|
||
|
|
import com.klp.common.enums.BusinessType;
|
||
|
|
import com.klp.hrm.domain.bo.HrmLeaveReqBo;
|
||
|
|
import com.klp.hrm.domain.vo.HrmLeaveReqVo;
|
||
|
|
import com.klp.hrm.service.IHrmLeaveReqService;
|
||
|
|
import lombok.RequiredArgsConstructor;
|
||
|
|
import org.springframework.validation.annotation.Validated;
|
||
|
|
import org.springframework.web.bind.annotation.*;
|
||
|
|
|
||
|
|
import javax.validation.constraints.NotEmpty;
|
||
|
|
import javax.validation.constraints.NotNull;
|
||
|
|
import java.util.Arrays;
|
||
|
|
import java.util.List;
|
||
|
|
|
||
|
|
@Validated
|
||
|
|
@RequiredArgsConstructor
|
||
|
|
@RestController
|
||
|
|
@RequestMapping("/hrm/leave/req")
|
||
|
|
public class HrmLeaveReqController extends BaseController {
|
||
|
|
|
||
|
|
private final IHrmLeaveReqService service;
|
||
|
|
|
||
|
|
@GetMapping("/list")
|
||
|
|
public TableDataInfo<HrmLeaveReqVo> list(HrmLeaveReqBo bo, PageQuery pageQuery) {
|
||
|
|
return service.queryPageList(bo, pageQuery);
|
||
|
|
}
|
||
|
|
|
||
|
|
@GetMapping("/{bizId}")
|
||
|
|
public R<HrmLeaveReqVo> getInfo(@PathVariable @NotNull Long bizId) {
|
||
|
|
return R.ok(service.queryById(bizId));
|
||
|
|
}
|
||
|
|
|
||
|
|
@Log(title = "请假单", businessType = BusinessType.INSERT)
|
||
|
|
@PostMapping
|
||
|
|
public R<Void> add(@Validated @RequestBody HrmLeaveReqBo bo) {
|
||
|
|
return toAjax(service.insertByBo(bo));
|
||
|
|
}
|
||
|
|
|
||
|
|
@Log(title = "请假单", businessType = BusinessType.UPDATE)
|
||
|
|
@PutMapping
|
||
|
|
public R<Void> edit(@Validated @RequestBody HrmLeaveReqBo bo) {
|
||
|
|
return toAjax(service.updateByBo(bo));
|
||
|
|
}
|
||
|
|
|
||
|
|
@Log(title = "请假单", businessType = BusinessType.DELETE)
|
||
|
|
@DeleteMapping("/{bizIds}")
|
||
|
|
public R<Void> remove(@PathVariable @NotEmpty Long[] bizIds) {
|
||
|
|
return toAjax(service.deleteWithValidByIds(Arrays.asList(bizIds), true));
|
||
|
|
}
|
||
|
|
|
||
|
|
@GetMapping("/all")
|
||
|
|
public R<List<HrmLeaveReqVo>> all(HrmLeaveReqBo bo) {
|
||
|
|
return R.ok(service.queryList(bo));
|
||
|
|
}
|
||
|
|
}
|