feat(hrm): 添加流程实例评论功能

- 新增 HrmFlowComment 实体类定义评论数据结构
- 创建 HrmFlowCommentBo 业务对象用于数据传输
- 实现 HrmFlowCommentController 提供完整的CRUD接口
- 开发 HrmFlowCommentService 业务逻辑处理层
- 配置 HrmFlowCommentMapper 数据访问接口
- 设计 HrmFlowCommentVo 视图对象支持Excel导出
- 在SysUserService中添加用户昵称映射查询方法
- 实现评论列表的分页查询和用户名称转换功能
- 支持评论内容和附件信息的存储与展示
This commit is contained in:
2026-02-28 15:09:18 +08:00
parent cb41bcf367
commit 682f650745
10 changed files with 519 additions and 4 deletions

View File

@@ -0,0 +1,101 @@
package com.ruoyi.hrm.controller;
import java.util.List;
import java.util.Arrays;
import java.util.concurrent.TimeUnit;
import lombok.RequiredArgsConstructor;
import javax.servlet.http.HttpServletResponse;
import javax.validation.constraints.*;
import org.springframework.web.bind.annotation.*;
import org.springframework.validation.annotation.Validated;
import com.ruoyi.common.annotation.RepeatSubmit;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.PageQuery;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.common.core.validate.AddGroup;
import com.ruoyi.common.core.validate.EditGroup;
import com.ruoyi.common.core.validate.QueryGroup;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.hrm.domain.vo.HrmFlowCommentVo;
import com.ruoyi.hrm.domain.bo.HrmFlowCommentBo;
import com.ruoyi.hrm.service.IHrmFlowCommentService;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* 流程实例评论
*
* @author ruoyi
* @date 2026-02-28
*/
@Validated
@RequiredArgsConstructor
@RestController
@RequestMapping("/hrm/flowComment")
public class HrmFlowCommentController extends BaseController {
private final IHrmFlowCommentService iHrmFlowCommentService;
/**
* 查询流程实例评论列表
*/
@GetMapping("/list")
public TableDataInfo<HrmFlowCommentVo> list(HrmFlowCommentBo bo, PageQuery pageQuery) {
return iHrmFlowCommentService.queryPageList(bo, pageQuery);
}
/**
* 导出流程实例评论列表
*/
@Log(title = "流程实例评论", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HrmFlowCommentBo bo, HttpServletResponse response) {
List<HrmFlowCommentVo> list = iHrmFlowCommentService.queryList(bo);
ExcelUtil.exportExcel(list, "流程实例评论", HrmFlowCommentVo.class, response);
}
/**
* 获取流程实例评论详细信息
*
* @param commentId 主键
*/
@GetMapping("/{commentId}")
public R<HrmFlowCommentVo> getInfo(@NotNull(message = "主键不能为空")
@PathVariable Long commentId) {
return R.ok(iHrmFlowCommentService.queryById(commentId));
}
/**
* 新增流程实例评论
*/
@Log(title = "流程实例评论", businessType = BusinessType.INSERT)
@RepeatSubmit()
@PostMapping()
public R<Void> add(@Validated(AddGroup.class) @RequestBody HrmFlowCommentBo bo) {
return toAjax(iHrmFlowCommentService.insertByBo(bo));
}
/**
* 修改流程实例评论
*/
@Log(title = "流程实例评论", businessType = BusinessType.UPDATE)
@RepeatSubmit()
@PutMapping()
public R<Void> edit(@Validated(EditGroup.class) @RequestBody HrmFlowCommentBo bo) {
return toAjax(iHrmFlowCommentService.updateByBo(bo));
}
/**
* 删除流程实例评论
*
* @param commentIds 主键串
*/
@Log(title = "流程实例评论", businessType = BusinessType.DELETE)
@DeleteMapping("/{commentIds}")
public R<Void> remove(@NotEmpty(message = "主键不能为空")
@PathVariable Long[] commentIds) {
return toAjax(iHrmFlowCommentService.deleteWithValidByIds(Arrays.asList(commentIds), true));
}
}