需求编辑所处阶段支持产品验收中/产品已验收,复用验收流程核心

- 抽取 doEnterProductWaitVerified/doEnterProductVerified 私有核心(原样搬自 testSubmitVerified/storyProductUserYs),接口方法改为校验+调核心,行为不变
- changeStatus 命中两个验收状态时走流程核心(innerYs=1 校验/迭代校验沿用),编辑与批量接口与流程按钮语义一致
- 修复 ZtStory.innerYsTime/testSubmitYsTime 误标 @TableField(exist=false) 导致验收时间从未落库的存量问题

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
2026-10-22 10:46:29 +08:00
co-authored by Claude Fable 5
parent a4df7e06f6
commit 41955cff3f
2 changed files with 44 additions and 15 deletions
@@ -191,10 +191,8 @@ public class ZtStory implements Serializable {
//结束日期 测试结束 //结束日期 测试结束
private Date endDate; private Date endDate;
//内部验收时间 //内部验收时间
@TableField(exist = false)
private Date innerYsTime; private Date innerYsTime;
//测试提交验收时间 //测试提交验收时间
@TableField(exist = false)
private Date testSubmitYsTime; private Date testSubmitYsTime;
private Integer project; private Integer project;
//1通过 2不通过 //1通过 2不通过
@@ -996,6 +996,31 @@ public class ZtStoryServiceImpl extends ServiceImpl<ZtStoryMapper, ZtStory> impl
if(!ObjectUtil.equal(ztStory.getInnerYsFlag(),1)){ if(!ObjectUtil.equal(ztStory.getInnerYsFlag(),1)){
throw new BusinessException("无需内部验收,不需要提交,需求ID: " + qo.getId()); throw new BusinessException("无需内部验收,不需要提交,需求ID: " + qo.getId());
} }
//产品验收中
this.doEnterProductWaitVerified(ztStory);
}
@Override
public void storyProductUserYs(ZtStoryDTO qo) {
ZtStory ztStory = this.baseMapper.selectById(qo.getId());
if(ztStory==null){
throw new BusinessException("未查询到需求,需求ID: " + qo.getId());
}
if(!StoryStatusEnums.active.getValue().equals(ztStory.getStatus())){
throw new BusinessException("需求状态不是激活状态,无法验收,当前状态: " + ztStory.getStatus() + ",需求ID: " + qo.getId());
}
if(!StoryStageEnums.productWaitVerified.getValue().equals(ztStory.getStage())){
throw new BusinessException("需求阶段不是待验收状态,无法验收,当前阶段: " + ztStory.getStage() + ",需求ID: " + qo.getId());
}
//产品已验收
this.doEnterProductVerified(ztStory);
}
/**
* 进入"产品验收中"的核心动作:写阶段+提交验收时间+看板同步+操作日志。
* testSubmitVerified(流程按钮) 与 changeStatus(编辑/批量改阶段) 共用,验收语义单一来源。
*/
private void doEnterProductWaitVerified(ZtStory ztStory) {
//产品验收中 //产品验收中
ztStory.setStage(StoryStageEnums.productWaitVerified.getValue()); ztStory.setStage(StoryStageEnums.productWaitVerified.getValue());
ztStory.setTestSubmitYsTime(new Date()); ztStory.setTestSubmitYsTime(new Date());
@@ -1015,19 +1040,12 @@ public class ZtStoryServiceImpl extends ServiceImpl<ZtStoryMapper, ZtStory> impl
RiskUserThreadLocal.get().getName(), "", ""); RiskUserThreadLocal.get().getName(), "", "");
} }
@Override /**
public void storyProductUserYs(ZtStoryDTO qo) { * 进入"产品已验收"的核心动作:写阶段+验收时间+看板同步+操作日志。
ZtStory ztStory = this.baseMapper.selectById(qo.getId()); * storyProductUserYs(流程按钮) 与 changeStatus(编辑/批量改阶段) 共用,验收语义单一来源。
if(ztStory==null){ */
throw new BusinessException("未查询到需求,需求ID: " + qo.getId()); private void doEnterProductVerified(ZtStory ztStory) {
} //产品已验收
if(!StoryStatusEnums.active.getValue().equals(ztStory.getStatus())){
throw new BusinessException("需求状态不是激活状态,无法验收,当前状态: " + ztStory.getStatus() + ",需求ID: " + qo.getId());
}
if(!StoryStageEnums.productWaitVerified.getValue().equals(ztStory.getStage())){
throw new BusinessException("需求阶段不是待验收状态,无法验收,当前阶段: " + ztStory.getStage() + ",需求ID: " + qo.getId());
}
//产品验收中
ztStory.setStage(StoryStageEnums.productVerified.getValue()); ztStory.setStage(StoryStageEnums.productVerified.getValue());
ztStory.setLasteditedby(RiskUserThreadLocal.get().getName()); ztStory.setLasteditedby(RiskUserThreadLocal.get().getName());
ztStory.setLastediteddate(new Date()); ztStory.setLastediteddate(new Date());
@@ -1732,6 +1750,19 @@ public class ZtStoryServiceImpl extends ServiceImpl<ZtStoryMapper, ZtStory> impl
throw new BusinessException("当前无迭代,不可以更改"); throw new BusinessException("当前无迭代,不可以更改");
} }
//编辑/批量改阶段到产品验收状态时,复用验收流程核心(时间字段+看板+日志与流程按钮一致)
if (StoryStageEnums.productWaitVerified.getValue().equalsIgnoreCase(dto.getStage())) {
if (!ObjectUtil.equal(ztStory.getInnerYsFlag(), 1)) {
throw new BusinessException("无需内部验收,不允许进入产品验收中,需求ID: " + ztStory.getId());
}
this.doEnterProductWaitVerified(ztStory);
continue;
}
if (StoryStageEnums.productVerified.getValue().equalsIgnoreCase(dto.getStage())) {
this.doEnterProductVerified(ztStory);
continue;
}
String oldStatus = ztStory.getStage(); String oldStatus = ztStory.getStage();