* Finish task #98404,98405.

This commit is contained in:
zhouxin
2023-07-24 15:41:06 +08:00
parent 473b6d33e3
commit dae38002a2
2 changed files with 35 additions and 25 deletions
@@ -10,14 +10,14 @@
* 单位:个
* 描述:按全局统计的年度关闭一级项目集数表示每年结束并关闭的一级项目集的数量。此度量项反映了组织每年关闭的一级项目集数量,可以用于评估组织的项目管理的绩效和成果。
* 定义:所有的一级项目集的个数求和
关闭时间为某年
状态为已关闭
过滤已删除的项目集
* 关闭时间为某年
* 状态为已关闭
* 过滤已删除的项目集
* 度量库:
* 收集方式:realtime
*
* @copyright Copyright 2009-2023 禅道软件(青岛)有限公司(ZenTao Software (Qingdao) Co., Ltd. www.zentao.net)
* @author qixinzhi <qixinzhi@easycorp.ltd>
* @author zhouxin <zhouxin@easycorp.ltd>
* @package
* @uses func
* @license ZPL(https://zpl.pub/page/zplv12.html) or AGPL(https://www.gnu.org/licenses/agpl-3.0.en.html)
@@ -25,20 +25,25 @@
*/
class count_of_annual_closed_top_program extends baseCalc
{
public $dataset = null;
public $dataset = 'getTopPrograms';
public $fieldList = array();
public $fieldList = array('status', 'closedDate');
//public funtion getStatement($dao)
//{
//}
public function calculate($data)
public function calculate($row)
{
if(empty($row->closedDate) or $row->status != 'closed') return;
$year = substr($row->closedDate, 0, 4);
if($year == '0000') return;
if(!isset($this->result[$year])) $this->result[$year] = 0;
$this->result[$year] += 1;
}
public function getResult($options = array())
{
return $this->filterByOptions($this->result, $options);
$records = array();
foreach($this->result as $year => $value) $records[] = array('year' => $year, 'value' => $value);
return $this->filterByOptions($records, $options);
}
}
}
@@ -10,13 +10,13 @@
* 单位:个
* 描述:按全局统计的年度新增一级项目集数表示每年新建立的一级项目集的数量。此度量项反映了组织每年新开展的重要项目集数量,可以用于评估组织的项目管理的扩张和战略规划情况。
* 定义:所有的一级项目集的个数求和
创建时间为某年
过滤已删除的项目集
* 创建时间为某年
* 过滤已删除的项目集
* 度量库:
* 收集方式:realtime
*
* @copyright Copyright 2009-2023 禅道软件(青岛)有限公司(ZenTao Software (Qingdao) Co., Ltd. www.zentao.net)
* @author qixinzhi <qixinzhi@easycorp.ltd>
* @author zhouxin <zhouxin@easycorp.ltd>
* @package
* @uses func
* @license ZPL(https://zpl.pub/page/zplv12.html) or AGPL(https://www.gnu.org/licenses/agpl-3.0.en.html)
@@ -24,20 +24,25 @@
*/
class count_of_annual_created_top_program extends baseCalc
{
public $dataset = null;
public $dataset = 'getTopPrograms';
public $fieldList = array();
public $fieldList = array('openedDate');
//public funtion getStatement($dao)
//{
//}
public function calculate($data)
public function calculate($row)
{
if(empty($row->openedDate)) return;
$year = substr($row->openedDate, 0, 4);
if($year == '0000') return;
if(!isset($this->result[$year])) $this->result[$year] = 0;
$this->result[$year] += 1;
}
public function getResult($options = array())
{
return $this->filterByOptions($this->result, $options);
$records = array();
foreach($this->result as $year => $value) $records[] = array('year' => $year, 'value' => $value);
return $this->filterByOptions($records, $options);
}
}
}