办公V3
This commit is contained in:
@@ -0,0 +1,70 @@
|
||||
package com.klp.hrm.controller;
|
||||
|
||||
import cn.dev33.satoken.stp.StpUtil;
|
||||
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.hrm.domain.bo.HrmFlowCcBo;
|
||||
import com.klp.hrm.domain.vo.HrmFlowCcVo;
|
||||
import com.klp.hrm.service.IHrmFlowCcService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/hrm/flow/cc")
|
||||
public class HrmFlowCcController extends BaseController {
|
||||
|
||||
private final IHrmFlowCcService service;
|
||||
|
||||
/**
|
||||
* 抄送我的
|
||||
*/
|
||||
@GetMapping("/my")
|
||||
public TableDataInfo<HrmFlowCcVo> my(@RequestParam(required = false) Long ccUserId, PageQuery pageQuery) {
|
||||
Long uid = ccUserId;
|
||||
if (uid == null) {
|
||||
try {
|
||||
uid = StpUtil.getLoginIdAsLong();
|
||||
} catch (Exception e) {
|
||||
uid = null;
|
||||
}
|
||||
}
|
||||
HrmFlowCcBo bo = new HrmFlowCcBo();
|
||||
bo.setCcUserId(uid);
|
||||
return service.queryPageList(bo, pageQuery);
|
||||
}
|
||||
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<HrmFlowCcVo> list(HrmFlowCcBo bo, PageQuery pageQuery) {
|
||||
return service.queryPageList(bo, pageQuery);
|
||||
}
|
||||
|
||||
/**
|
||||
* 手动抄送(支持批量)
|
||||
*/
|
||||
@PostMapping
|
||||
public R<Void> add(@RequestBody HrmFlowCcBo bo) {
|
||||
return toAjax(service.insertBatch(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 标记抄送已读
|
||||
*/
|
||||
@PostMapping("/{ccId}/read")
|
||||
public R<Void> read(@PathVariable Long ccId) {
|
||||
Long uid = StpUtil.getLoginIdAsLong();
|
||||
return toAjax(service.markRead(ccId, uid));
|
||||
}
|
||||
|
||||
@GetMapping("/ping")
|
||||
public R<String> ping(@RequestParam @NotNull String x) {
|
||||
return R.ok(x);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user