feat: 项目绩效统计新增当月规划/准时上线指标并修复准时率口径
- ProgramCountDTO +2 字段:planReleaseStoryNum / onTimeNum - IZtCountService.monthScopeByProgram 接入 storyReleaseOnTimeByProducts (自然月1~31口径,复用产品经理绩效同款 SQL,老 ±15 天口径不动) - IZtCountService 团队准时率:零任务成员(无分配工时)不参与平均, 避免个人准时率按 0 拉低团队值 - ZtStoryMapper storyReleaseOnTimeByProducts 准时子查询增加 releasedDate >= '2000-01-01' 哨兵,排除禅道历史零日期('0000-00-00') 导致未发布需求被误计准时的缺陷 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -15,6 +15,10 @@ public class ProgramCountDTO implements Serializable {
|
|||||||
private BigDecimal finishedStoryCount;
|
private BigDecimal finishedStoryCount;
|
||||||
//上线需求总量
|
//上线需求总量
|
||||||
private BigDecimal releaseStoryCount;
|
private BigDecimal releaseStoryCount;
|
||||||
|
//当月规划上线的需求总量(自然月1~31口径:预计完成时间plan_end_date落在当月、按产品过滤、状态非closed)
|
||||||
|
private BigDecimal planReleaseStoryNum;
|
||||||
|
//当月准时上线的需求量(上述规划需求中,实际上线时间releasedDate<=预计完成时间plan_end_date)
|
||||||
|
private BigDecimal onTimeNum;
|
||||||
//完成验收数量
|
//完成验收数量
|
||||||
private BigDecimal ysStoryCount;
|
private BigDecimal ysStoryCount;
|
||||||
//完成需求验收率
|
//完成需求验收率
|
||||||
|
|||||||
@@ -3427,8 +3427,11 @@ public class IZtCountService {
|
|||||||
|
|
||||||
workTime = workTime.add(performanceDTO.getWorkTime());
|
workTime = workTime.add(performanceDTO.getWorkTime());
|
||||||
taskCount=taskCount.add(performanceDTO.getTotalTask());
|
taskCount=taskCount.add(performanceDTO.getTotalTask());
|
||||||
finishPunctuality=finishPunctuality.add(performanceDTO.getFinishPunctuality());
|
//零任务成员不参与准时率平均:个人无分配工时则准时率按0计,纳入平均会拉低团队值
|
||||||
kfzCount+=1;
|
if (!BigDecimalUtils.isZero(performanceDTO.getAllocationTime())) {
|
||||||
|
finishPunctuality=finishPunctuality.add(performanceDTO.getFinishPunctuality());
|
||||||
|
kfzCount+=1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
dto.setAllocationTime(allocationTime);
|
dto.setAllocationTime(allocationTime);
|
||||||
@@ -3468,6 +3471,10 @@ public class IZtCountService {
|
|||||||
// //需求完成验收率
|
// //需求完成验收率
|
||||||
|
|
||||||
dto.setYsStoryRate((BigDecimalUtils.isZero(dto.getYsStoryCount())||BigDecimalUtils.isZero(dto.getReleaseStoryCount())) ? BigDecimal.ZERO : dto.getYsStoryCount().divide(dto.getReleaseStoryCount(), 2, BigDecimal.ROUND_HALF_UP));
|
dto.setYsStoryRate((BigDecimalUtils.isZero(dto.getYsStoryCount())||BigDecimalUtils.isZero(dto.getReleaseStoryCount())) ? BigDecimal.ZERO : dto.getYsStoryCount().divide(dto.getReleaseStoryCount(), 2, BigDecimal.ROUND_HALF_UP));
|
||||||
|
// //当月规划上线/准时上线需求(自然月1~31口径,独立于上方±15天口径;复用产品经理绩效同款SQL,不改动老逻辑)
|
||||||
|
Map<String,Object> planOnTimeMap = this.storyService.storyReleaseOnTimeByProducts(pIds, firstDayOfMonth, lastDayOfMonth);
|
||||||
|
dto.setPlanReleaseStoryNum(BigDecimal.valueOf(Integer.valueOf(planOnTimeMap.getOrDefault("planReleaseStoryNum", 0).toString())));
|
||||||
|
dto.setOnTimeNum(BigDecimal.valueOf(Integer.valueOf(planOnTimeMap.getOrDefault("onTimeNum", 0).toString())));
|
||||||
// //线上bug率
|
// //线上bug率
|
||||||
List<ZtBug> prodBugList = bugList.stream().filter(o -> o.getBugType().equals("prod")).collect(Collectors.toList());
|
List<ZtBug> prodBugList = bugList.stream().filter(o -> o.getBugType().equals("prod")).collect(Collectors.toList());
|
||||||
|
|
||||||
|
|||||||
@@ -1397,6 +1397,7 @@
|
|||||||
</foreach>) planReleaseStoryNum,
|
</foreach>) planReleaseStoryNum,
|
||||||
(SELECT count(1) waitRelease from zt_story
|
(SELECT count(1) waitRelease from zt_story
|
||||||
WHERE plan_end_date >=#{startTime} and plan_end_date <=#{endTime}
|
WHERE plan_end_date >=#{startTime} and plan_end_date <=#{endTime}
|
||||||
|
and releasedDate >='2000-01-01'
|
||||||
and releasedDate <=plan_end_date
|
and releasedDate <=plan_end_date
|
||||||
and releasedDate <=#{endTime}
|
and releasedDate <=#{endTime}
|
||||||
and status not in ('closed')
|
and status not in ('closed')
|
||||||
|
|||||||
Reference in New Issue
Block a user