L3HRM后端推送
This commit is contained in:
@@ -0,0 +1,68 @@
|
||||
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.HrmPunchBo;
|
||||
import com.klp.hrm.domain.vo.HrmPunchVo;
|
||||
import com.klp.hrm.service.IHrmPunchService;
|
||||
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/punch")
|
||||
public class HrmPunchController extends BaseController {
|
||||
|
||||
private final IHrmPunchService service;
|
||||
|
||||
@SaCheckPermission("hrm:punch:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<HrmPunchVo> list(HrmPunchBo bo, PageQuery pageQuery) {
|
||||
return service.queryPageList(bo, pageQuery);
|
||||
}
|
||||
|
||||
@SaCheckPermission("hrm:punch:query")
|
||||
@GetMapping("/{punchId}")
|
||||
public R<HrmPunchVo> getInfo(@PathVariable @NotNull Long punchId) {
|
||||
return R.ok(service.queryById(punchId));
|
||||
}
|
||||
|
||||
@SaCheckPermission("hrm:punch:add")
|
||||
@Log(title = "打卡记录", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public R<Void> add(@Validated @RequestBody HrmPunchBo bo) {
|
||||
return toAjax(service.insertByBo(bo));
|
||||
}
|
||||
|
||||
@SaCheckPermission("hrm:punch:edit")
|
||||
@Log(title = "打卡记录", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public R<Void> edit(@Validated @RequestBody HrmPunchBo bo) {
|
||||
return toAjax(service.updateByBo(bo));
|
||||
}
|
||||
|
||||
@SaCheckPermission("hrm:punch:remove")
|
||||
@Log(title = "打卡记录", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{punchIds}")
|
||||
public R<Void> remove(@PathVariable @NotEmpty Long[] punchIds) {
|
||||
return toAjax(service.deleteWithValidByIds(Arrays.asList(punchIds), true));
|
||||
}
|
||||
|
||||
@SaCheckPermission("hrm:punch:list")
|
||||
@GetMapping("/all")
|
||||
public R<List<HrmPunchVo>> all(HrmPunchBo bo) {
|
||||
return R.ok(service.queryList(bo));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user