65 lines
2.0 KiB
Java
65 lines
2.0 KiB
Java
package com.klp.hrm.controller;
|
|
|
|
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.HrmPayRunBo;
|
|
import com.klp.hrm.domain.vo.HrmPayRunVo;
|
|
import com.klp.hrm.service.IHrmPayRunService;
|
|
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/pay/run")
|
|
public class HrmPayRunController extends BaseController {
|
|
|
|
private final IHrmPayRunService service;
|
|
|
|
@GetMapping("/list")
|
|
public TableDataInfo<HrmPayRunVo> list(HrmPayRunBo bo, PageQuery pageQuery) {
|
|
return service.queryPageList(bo, pageQuery);
|
|
}
|
|
|
|
@GetMapping("/{runId}")
|
|
public R<HrmPayRunVo> getInfo(@PathVariable @NotNull Long runId) {
|
|
return R.ok(service.queryById(runId));
|
|
}
|
|
|
|
@Log(title = "薪酬批次", businessType = BusinessType.INSERT)
|
|
@PostMapping
|
|
public R<Void> add(@Validated @RequestBody HrmPayRunBo bo) {
|
|
return toAjax(service.insertByBo(bo));
|
|
}
|
|
|
|
@Log(title = "薪酬批次", businessType = BusinessType.UPDATE)
|
|
@PutMapping
|
|
public R<Void> edit(@Validated @RequestBody HrmPayRunBo bo) {
|
|
return toAjax(service.updateByBo(bo));
|
|
}
|
|
|
|
@Log(title = "薪酬批次", businessType = BusinessType.DELETE)
|
|
@DeleteMapping("/{runIds}")
|
|
public R<Void> remove(@PathVariable @NotEmpty Long[] runIds) {
|
|
return toAjax(service.deleteWithValidByIds(Arrays.asList(runIds), true));
|
|
}
|
|
|
|
@GetMapping("/all")
|
|
public R<List<HrmPayRunVo>> all(HrmPayRunBo bo) {
|
|
return R.ok(service.queryList(bo));
|
|
}
|
|
}
|