diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/projectlib/controller/ProjectStoppedChangeController.java b/hz-pm-api/src/main/java/com/hz/pm/api/projectlib/controller/ProjectStoppedChangeController.java index 9cea9be..4addcdb 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/projectlib/controller/ProjectStoppedChangeController.java +++ b/hz-pm-api/src/main/java/com/hz/pm/api/projectlib/controller/ProjectStoppedChangeController.java @@ -38,14 +38,14 @@ public class ProjectStoppedChangeController { @PostMapping("/stopped/submitApply") @ApiOperation("提交项目终止申请") @WebLog("提交项目终止申请") - public void submitProjectStoppedApply(@RequestBody @Valid SubmitProjectStoppedApplyReq req) { + public void submitStoppedApply(@RequestBody @Valid SubmitProjectStoppedApplyReq req) { projectStoppedManage.submitProjectStoppedApply(req); } @PostMapping("/change/submitApply") @ApiOperation("提交项目变更申请") @WebLog("提交项目变更申请") - public void submitProjectChangeApply(@RequestBody @Valid SubmitProjectChangeApplyReq req) { + public void submitChangeApply(@RequestBody @Valid SubmitProjectChangeApplyReq req) { projectChangeManage.submitProjectChangeApply(req); } @@ -70,12 +70,11 @@ public class ProjectStoppedChangeController { return projectChangeManage.page(req); } - @GetMapping("/change/detail/{projectCode}/{instCode}") + @GetMapping("/change/detail/{id}") @ApiOperation("项目变更详情") @WebLog("项目变更详情") - public ProjectChangeDetailVO changeDetail(@PathVariable("projectCode") String projectCode, - @PathVariable("instCode") String instCode) { - return projectChangeManage.changeDetail(projectCode, instCode); + public ProjectChangeDetailVO changeDetail(@PathVariable("id") Long id) { + return projectChangeManage.changeDetail(id); } @GetMapping("/change/options") diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/projectlib/manage/ProjectChangeManage.java b/hz-pm-api/src/main/java/com/hz/pm/api/projectlib/manage/ProjectChangeManage.java index 6f9485e..dc6464a 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/projectlib/manage/ProjectChangeManage.java +++ b/hz-pm-api/src/main/java/com/hz/pm/api/projectlib/manage/ProjectChangeManage.java @@ -134,7 +134,7 @@ public class ProjectChangeManage { ProcessStartParamsVo params = new ProcessStartParamsVo(); params.setUser(declaredProjectHelper.buildUser(userDetail)); params.setProcessUsers(Collections.emptyMap()); - params.setFormData(Collections.emptyMap()); + params.setFormData(BeanUtil.beanToMap(req)); // 获取发起单位、发起单位主管单位、发起单位上级主管条线单位信息 Map orgModelMap = declaredProjectHelper.buildOrgModelMap(userDetail, project); @@ -154,7 +154,8 @@ public class ProjectChangeManage { projectChangeHistory.setProjectCode(project.getProjectCode()); projectChangeHistory.setStatus(ProjectChangeStatus.ON_CHANGE_APPLY.getCode()); projectChangeHistory.setInstCode(instId); - projectChangeHistoryService.save(projectChangeHistory); + projectChangeHistory.setId(req.getId()); + projectChangeHistoryService.saveOrUpdate(projectChangeHistory); } public PageVo page(ProjectListReq req) { @@ -178,11 +179,8 @@ public class ProjectChangeManage { return PageVo.of(data, page.getTotal()); } - public ProjectChangeDetailVO changeDetail(String projectCode, String instCode) { - LambdaQueryWrapper wrapper = Wrappers.lambdaQuery(ProjectChangeHistory.class) - .eq(ProjectChangeHistory::getProjectCode, projectCode) - .eq(ProjectChangeHistory::getInstCode, instCode); - ProjectChangeHistory changeHistory = projectChangeHistoryService.getOne(wrapper); + public ProjectChangeDetailVO changeDetail(Long id) { + ProjectChangeHistory changeHistory = projectChangeHistoryService.getById(id); if (changeHistory == null) { return null; } diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/projectlib/manage/ProjectStoppedManage.java b/hz-pm-api/src/main/java/com/hz/pm/api/projectlib/manage/ProjectStoppedManage.java index 7b369fe..f914f8e 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/projectlib/manage/ProjectStoppedManage.java +++ b/hz-pm-api/src/main/java/com/hz/pm/api/projectlib/manage/ProjectStoppedManage.java @@ -1,5 +1,6 @@ package com.hz.pm.api.projectlib.manage; +import cn.hutool.core.bean.BeanUtil; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; @@ -88,7 +89,7 @@ public class ProjectStoppedManage { ProcessStartParamsVo params = new ProcessStartParamsVo(); params.setUser(declaredProjectHelper.buildUser(userDetail)); params.setProcessUsers(Collections.emptyMap()); - params.setFormData(Collections.emptyMap()); + params.setFormData(BeanUtil.beanToMap(req)); // 获取发起单位、发起单位主管单位、发起单位上级主管条线单位信息 Map orgModelMap = declaredProjectHelper.buildOrgModelMap(userDetail, project); diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/projectlib/model/req/SubmitProjectChangeApplyReq.java b/hz-pm-api/src/main/java/com/hz/pm/api/projectlib/model/req/SubmitProjectChangeApplyReq.java index 39fc551..b760a59 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/projectlib/model/req/SubmitProjectChangeApplyReq.java +++ b/hz-pm-api/src/main/java/com/hz/pm/api/projectlib/model/req/SubmitProjectChangeApplyReq.java @@ -15,6 +15,9 @@ import lombok.Data; @Data public class SubmitProjectChangeApplyReq { + @ApiModelProperty("变更ID") + private Long id; + @ApiModelProperty("变更原因") private String changeReason;