feat(bpm): 为采购申请功能增加项目名称展示
- 在 BpmOAProcureDO 中添加 projectNo 字段,用于存储项目编号 - 在 BpmOAProcureRespVO 中添加 projectNo 和 projectName 字段,用于展示项目编号和名称 - 在 BpmOAProcureSaveReqVO 中添加 projectNo 字段,允许用户在创建采购申请时选择项目 - 修改 BpmOAProcureController 中的 getOaProcure 和 getByProcessInstanceId 方法,通过 ProjectApi 获取项目名称并设置到响应中
This commit is contained in:
parent
effe65d8d1
commit
1d80ee957e
@ -7,6 +7,8 @@ import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.procure.BpmOAProcureSa
|
||||
import cn.iocoder.yudao.module.bpm.convert.oa.BpmOAProcureConvert;
|
||||
import cn.iocoder.yudao.module.bpm.dal.dataobject.oa.BpmOAProcureDO;
|
||||
import cn.iocoder.yudao.module.bpm.service.oa.BpmOAProcureService;
|
||||
import cn.iocoder.yudao.module.system.api.project.ProjectApi;
|
||||
import cn.iocoder.yudao.module.system.api.project.dto.ProjectDTO;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
@ -27,6 +29,9 @@ public class BpmOAProcureController {
|
||||
@Resource
|
||||
private BpmOAProcureService bpmOaProcureService;
|
||||
|
||||
@Resource
|
||||
private ProjectApi projectApi;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建OA 采购申请")
|
||||
// @PreAuthorize("@ss.hasPermission('bpm:oa-procure:create')")
|
||||
@ -57,7 +62,13 @@ public class BpmOAProcureController {
|
||||
// @PreAuthorize("@ss.hasPermission('bpm:oa-procure:query')")
|
||||
public CommonResult<BpmOAProcureRespVO> getOaProcure(@RequestParam("id") Long id) {
|
||||
BpmOAProcureDO oaProcure = bpmOaProcureService.getOaProcure(id);
|
||||
return success(BpmOAProcureConvert.INSTANCE.convert(oaProcure));
|
||||
BpmOAProcureRespVO respVO = BpmOAProcureConvert.INSTANCE.convert(oaProcure);
|
||||
if (respVO != null && respVO.getProjectNo() != null) {
|
||||
ProjectDTO projectDTO = projectApi.getProject(respVO.getProjectNo()).getCheckedData();
|
||||
respVO.setProjectName(projectDTO.getName());
|
||||
}
|
||||
|
||||
return success(respVO);
|
||||
}
|
||||
|
||||
|
||||
@ -74,7 +85,13 @@ public class BpmOAProcureController {
|
||||
public CommonResult<BpmOAProcureRespVO> getByProcessInstanceId(@RequestParam("processInstanceId") String processInstanceId) {
|
||||
|
||||
BpmOAProcureDO oaProcure = bpmOaProcureService.getByProcessInstanceId(processInstanceId);
|
||||
return success(BpmOAProcureConvert.INSTANCE.convert(oaProcure));
|
||||
BpmOAProcureRespVO respVO = BpmOAProcureConvert.INSTANCE.convert(oaProcure);
|
||||
if (respVO != null && respVO.getProjectNo() != null) {
|
||||
ProjectDTO projectDTO = projectApi.getProject(respVO.getProjectNo()).getCheckedData();
|
||||
respVO.setProjectName(projectDTO.getName());
|
||||
}
|
||||
|
||||
return success(respVO);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -22,6 +22,12 @@ public class BpmOAProcureRespVO {
|
||||
@Schema(description = "申请人的用户编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "26976")
|
||||
private Long userId;
|
||||
|
||||
@Schema(description = "项目编号", example = "26976")
|
||||
private String projectNo;
|
||||
|
||||
@Schema(description = "项目名称", example = "26976")
|
||||
private String projectName;
|
||||
|
||||
@Schema(description = "申请事由", example = "不喜欢")
|
||||
private String reason;
|
||||
|
||||
|
@ -21,6 +21,9 @@ public class BpmOAProcureSaveReqVO {
|
||||
@Schema(description = "申请人的用户编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "26976")
|
||||
private Long userId;
|
||||
|
||||
@Schema(description = "项目编号", example = "26976")
|
||||
private String projectNo;
|
||||
|
||||
@Schema(description = "申请事由", example = "不喜欢")
|
||||
private String reason;
|
||||
|
||||
|
@ -49,6 +49,10 @@ public class BpmOAProcureDO extends BaseDO {
|
||||
* 申请人的用户编号
|
||||
*/
|
||||
private Long userId;
|
||||
/**
|
||||
* 项目编号
|
||||
*/
|
||||
private String projectNo;
|
||||
/**
|
||||
* 申请事由
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user