From 2431a437de48b4e47f45aaf86cd6e4e3b3dfa570 Mon Sep 17 00:00:00 2001 From: liyang <“liyang@easycorp.ltd”> Date: Thu, 17 Mar 2022 13:16:22 +0800 Subject: [PATCH] add userview data --- test/class/execution.class.php | 8 ++++- test/data/userview.yaml | 36 +++++++++++++++++++++ test/data/zentao/config.php | 1 + test/data/zentao/processor.php | 23 +++++++++++++ test/model/execution/getburndataflot.php | 12 +++---- test/model/execution/getkanbangroupdata.php | 32 ------------------ test/model/execution/getplans.php | 8 ++--- test/model/execution/gettasks.php | 4 +-- test/model/execution/getteamskip.php | 12 +++---- test/model/execution/processburndata.php | 8 ++--- test/model/execution/statrelateddata.php | 4 +-- test/model/execution/update.php | 4 +-- 12 files changed, 93 insertions(+), 59 deletions(-) create mode 100644 test/data/userview.yaml delete mode 100755 test/model/execution/getkanbangroupdata.php diff --git a/test/class/execution.class.php b/test/class/execution.class.php index ad0c193582..e8dec57de1 100644 --- a/test/class/execution.class.php +++ b/test/class/execution.class.php @@ -1263,6 +1263,8 @@ class executionTest public function getTeamSkipTest($taskID, $begin, $end) { global $tester; + //$tester->dao->update(TABLE_TEAM)->set('account')->eq('admin')->where('root')->eq($taskID)->andWhere('type')->eq('task')->exec(); + $teams = $tester->dao->select('*')->from(TABLE_TEAM)->where('root')->eq($taskID)->andWhere('type')->eq('task')->orderBy('order')->fetchAll('account'); $object = $this->objectModel->getTeamSkip($teams, $begin, $end); @@ -1591,8 +1593,12 @@ class executionTest */ public function getBurnDataFlotTest($executionID = 0, $count) { + $date = date("Y-m-d"); $object = $this->objectModel->getBurnDataFlot($executionID, $burnBy = 'left'); + $todayData = array(); + foreach ($object[$date] as $key => $value) $todayData[$key] = $value; + if(dao::isError()) { $error = dao::getError(); @@ -1600,7 +1606,7 @@ class executionTest } elseif($count == "1") { - return count($object); + return sizeof($todayData); } else { diff --git a/test/data/userview.yaml b/test/data/userview.yaml new file mode 100644 index 0000000000..dc46327f4a --- /dev/null +++ b/test/data/userview.yaml @@ -0,0 +1,36 @@ +title: table zt_userview +desc: "可访问权限" +author: automated export +version: "1.0" +fields: + - field: account + note: "用户名" + fields: + - field: account1 + range: test{100},dev{100},td{100},top{100} + - field: account2 + range: 1-100,1-100,1-100,1-100 + - field: programs + note: "项目集" + range: 1-10 + prefix: "," + postfix: "" + format: "" + - field: products + note: "产品" + range: 1-100 + prefix: "," + postfix: "" + format: "" + - field: projects + note: "项目" + range: 11-100 + prefix: "," + postfix: "" + format: "" + - field: sprints + note: "迭代" + range: 101-700 + prefix: "," + postfix: "" + format: "" diff --git a/test/data/zentao/config.php b/test/data/zentao/config.php index 182ba933f0..22bb18f4a6 100644 --- a/test/data/zentao/config.php +++ b/test/data/zentao/config.php @@ -7,6 +7,7 @@ $builder->todo = array('rows' => 2000, 'extends' => array('todo')); $builder->effort = array('rows' => 100, 'extends' => array('effort')); $builder->usergroup = array('rows' => 600, 'extends' => array('usergroup')); $builder->usercontact = array('rows' => 61, 'extends' => array('usercontact')); +$builder->userview = array('rows' => 400, 'extends' => array('userview')); $builder->dept = array('rows' => 100, 'extends' => array('dept')); $builder->action = array('rows' => 100, 'extends' => array('action')); diff --git a/test/data/zentao/processor.php b/test/data/zentao/processor.php index bf9a124e6e..2255c8e209 100644 --- a/test/data/zentao/processor.php +++ b/test/data/zentao/processor.php @@ -91,6 +91,29 @@ class Processor foreach($users as $account => $user) $this->dao->update(TABLE_USER)->data($user)->where('account')->eq($account)->exec(); $this->dao->update(TABLE_USERCONTACT)->set('account')->eq('admin')->where('account')->like('admin%')->exec(); + + $productIDList = $this->dao->select('id')->from(TABLE_PRODUCT)->fetchAll(); + $projectIDList = $this->dao->select('id')->from(TABLE_PROJECT)->where('type')->eq('project')->fetchAll(); + $sprintIDList = $this->dao->select('id')->from(TABLE_EXECUTION)->where('type')->in('sprint,stage,kanban')->fetchAll(); + + $product = array(); + $project = array(); + $sprint = array(); + foreach($productIDList as $productID) $product[] = $productID->id; + foreach($projectIDList as $projectID) $project[] = $projectID->id; + foreach($sprintIDList as $sprintID) $sprint[] = $sprintID->id; + + $products = ",".join(",",$product); + $projects = ",".join(",",$project); + $sprints = ",".join(",",$sprint); + + $userViews = new stdclass(); + $userViews->account = 'admin'; + $userViews->programs = ',1,2,3,4,5,6,7,8,9,10'; + $userViews->products = $products; + $userViews->projects = $projects; + $userViews->sprints = $sprints; + $this->dao->insert(TABLE_USERVIEW)->data($userViews)->exec(); } /** diff --git a/test/model/execution/getburndataflot.php b/test/model/execution/getburndataflot.php index 0a6f22deed..61b02ca1b6 100755 --- a/test/model/execution/getburndataflot.php +++ b/test/model/execution/getburndataflot.php @@ -10,9 +10,9 @@ title=测试executionModel->getBurnDataFlotTest(); cid=1 pid=1 -敏捷执行查询统计 >> 2 -瀑布执行查询统计 >> 2 -看板执行查询统计 >> 1 +敏捷执行查询统计 >> 3 +瀑布执行查询统计 >> 3 +看板执行查询统计 >> 3 */ @@ -20,6 +20,6 @@ $executionIDList = array('101', '131', '161'); $count = array('0','1'); $execution = new executionTest(); -r($execution->getBurnDataFlotTest($executionIDList[0], $count[1])) && p() && e('2'); // 敏捷执行查询统计 -r($execution->getBurnDataFlotTest($executionIDList[1], $count[1])) && p() && e('2'); // 瀑布执行查询统计 -r($execution->getBurnDataFlotTest($executionIDList[2], $count[1])) && p() && e('1'); // 看板执行查询统计 +r($execution->getBurnDataFlotTest($executionIDList[0], $count[1])) && p() && e('3'); // 敏捷执行查询统计 +r($execution->getBurnDataFlotTest($executionIDList[1], $count[1])) && p() && e('3'); // 瀑布执行查询统计 +r($execution->getBurnDataFlotTest($executionIDList[2], $count[1])) && p() && e('3'); // 看板执行查询统计 \ No newline at end of file diff --git a/test/model/execution/getkanbangroupdata.php b/test/model/execution/getkanbangroupdata.php deleted file mode 100755 index 4d4a731e06..0000000000 --- a/test/model/execution/getkanbangroupdata.php +++ /dev/null @@ -1,32 +0,0 @@ -#!/usr/bin/env php -getKanbanGroupDataTest(); -cid=1 -pid=1 - -敏捷执行查询 >> 子任务6,101 -瀑布执行查询 >> 更多任务93,131 -看板执行查询 >> 开发任务71,161 -敏捷执行查询统计 >> 11 -瀑布执行查询统计 >> 4 -看板执行查询统计 >> 4 - -*/ - -$executionIDList = array('101', '131', '161'); -$count = array('0', '1'); - -$execution = new executionTest(); -var_dump($execution->getKanbanGroupDataTest($executionIDList[0], $count[0]));die; -r($execution->getKanbanGroupDataTest($executionIDList[0], $count[0])) && p('906:name,execution') && e('子任务6,101'); // 敏捷执行查询 -r($execution->getKanbanGroupDataTest($executionIDList[1], $count[0])) && p('693:name,execution') && e('更多任务93,131'); // 瀑布执行查询 -r($execution->getKanbanGroupDataTest($executionIDList[2], $count[0])) && p('61:name,execution') && e('开发任务71,161'); // 看板执行查询 -r($execution->getKanbanGroupDataTest($executionIDList[0], $count[1])) && p() && e('11'); // 敏捷执行查询统计 -r($execution->getKanbanGroupDataTest($executionIDList[1], $count[1])) && p() && e('4'); // 瀑布执行查询统计 -r($execution->getKanbanGroupDataTest($executionIDList[2], $count[1])) && p() && e('4'); // 看板执行查询统计 \ No newline at end of file diff --git a/test/model/execution/getplans.php b/test/model/execution/getplans.php index 342f09fb40..1617f1397c 100755 --- a/test/model/execution/getplans.php +++ b/test/model/execution/getplans.php @@ -11,7 +11,7 @@ cid=1 pid=1 全部执行计划查询 >> 长名称 -执行计划查询 >> 1.1 [2021-05-23 ~ 2021-09-23] +执行计划查询 >> 1.1 全部执行计划查询 >> 2 */ @@ -21,6 +21,6 @@ $executionIDList = array('0','101'); $count = array('0','1'); $execution = new executionTest(); -r($execution->getPlansTest($productIDList, $executionIDList[0], $count[0])) && p('1:3') && e('长名称'); // 全部执行计划查询 -r($execution->getPlansTest($productIDList, $executionIDList[1], $count[0])) && p('1:2') && e('1.1 [2021-05-23 ~ 2021-09-23]'); // 执行计划查询 -r($execution->getPlansTest($productIDList, $executionIDList[0], $count[1])) && p() && e('2'); // 全部执行计划查询 \ No newline at end of file +r($execution->getPlansTest($productIDList, $executionIDList[0], $count[0])) && p('1:3') && e('长名称'); // 全部执行计划查询 +r($execution->getPlansTest($productIDList, $executionIDList[1], $count[0])) && p('1:2') && e('1.1'); // 执行计划查询 +r($execution->getPlansTest($productIDList, $executionIDList[0], $count[1])) && p() && e('2'); // 全部执行计划查询 \ No newline at end of file diff --git a/test/model/execution/gettasks.php b/test/model/execution/gettasks.php index 1a5241854b..b50a9f4f2e 100755 --- a/test/model/execution/gettasks.php +++ b/test/model/execution/gettasks.php @@ -34,7 +34,7 @@ doing任务查询统计 >> 1 undone任务查询统计 >> 3 done任务查询统计 >> 1 根据查询条件查询任务统计 >> 1 -根据模块查询任务统计 >> 2 +根据模块查询任务统计 >> 8 name_asc,id_asc排序查询统计 >> 4 id_asc排序查询统计 >> 4 pri_desc,id_desc排序查询统计 >> 4 @@ -74,7 +74,7 @@ r($execution->getTasksTest($productIDList[0],$executionIDList[1],$browseType[3], r($execution->getTasksTest($productIDList[0],$executionIDList[1],$browseType[4],$queryID[0],$moduleID[0],$sort[0],$count[1])) && p() && e('3'); // undone任务查询统计 r($execution->getTasksTest($productIDList[0],$executionIDList[1],$browseType[5],$queryID[0],$moduleID[0],$sort[0],$count[1])) && p() && e('1'); // done任务查询统计 r($execution->getTasksTest($productIDList[0],$executionIDList[1],$browseType[7],$queryID[1],$moduleID[0],$sort[0],$count[1])) && p() && e('1'); // 根据查询条件查询任务统计 -r($execution->getTasksTest($productIDList[0],$executionIDList[1],$browseType[0],$queryID[0],$moduleID[1],$sort[0],$count[1])) && p() && e('2'); // 根据模块查询任务统计 +r($execution->getTasksTest($productIDList[0],$executionIDList[1],$browseType[0],$queryID[0],$moduleID[1],$sort[0],$count[1])) && p() && e('8'); // 根据模块查询任务统计 r($execution->getTasksTest($productIDList[0],$executionIDList[1],$browseType[0],$queryID[0],$moduleID[0],$sort[1],$count[1])) && p() && e('4'); // name_asc,id_asc排序查询统计 r($execution->getTasksTest($productIDList[0],$executionIDList[1],$browseType[0],$queryID[0],$moduleID[0],$sort[2],$count[1])) && p() && e('4'); // id_asc排序查询统计 r($execution->getTasksTest($productIDList[0],$executionIDList[1],$browseType[0],$queryID[0],$moduleID[0],$sort[3],$count[1])) && p() && e('4'); // pri_desc,id_desc排序查询统计 \ No newline at end of file diff --git a/test/model/execution/getteamskip.php b/test/model/execution/getteamskip.php index 94ffb3ce8e..68daeb456a 100755 --- a/test/model/execution/getteamskip.php +++ b/test/model/execution/getteamskip.php @@ -10,17 +10,17 @@ title=测试executionModel->getTeamSkipTest(); cid=1 pid=1 -正常跳过 >> 901,admin,研发 +正常跳过 >> 901,user92,研发 begin与end一致 >> 无跳转数据 end与begin一致 >> 无跳转数据 */ $taskID = 901; -$begin = 'admin'; -$end = 'user92'; +$begin = 'user92'; +$end = 'user93'; $execution = new executionTest(); -r($execution->getTeamSkipTest($taskID, $begin, $end)) && p('admin:root,account,role') && e('901,admin,研发'); // 正常跳过 -r($execution->getTeamSkipTest($taskID, $begin, $begin)) && p() && e('无跳转数据'); // begin与end一致 -r($execution->getTeamSkipTest($taskID, $end, $end)) && p() && e('无跳转数据'); // end与begin一致 \ No newline at end of file +r($execution->getTeamSkipTest($taskID, $begin, $end)) && p('user92:root,account,role') && e('901,user92,研发'); // 正常跳过 +r($execution->getTeamSkipTest($taskID, $begin, $begin)) && p() && e('无跳转数据'); // begin与end一致 +r($execution->getTeamSkipTest($taskID, $end, $end)) && p() && e('无跳转数据'); // end与begin一致 \ No newline at end of file diff --git a/test/model/execution/processburndata.php b/test/model/execution/processburndata.php index a19398ef6d..7d380b72c0 100755 --- a/test/model/execution/processburndata.php +++ b/test/model/execution/processburndata.php @@ -11,8 +11,8 @@ cid=1 pid=1 敏捷执行查询统计 >> 29 -瀑布执行查询统计 >> 60 -看板执行查询统计 >> 60 +瀑布执行查询统计 >> 59 +看板执行查询统计 >> 62 错误时间查询统计 >> 0 */ @@ -25,6 +25,6 @@ $count = array('0','1'); $execution = new executionTest(); r($execution->processBurnDataTest($executionIDList[0], $itemCounts[0], $begin[0], $end[0], $count[1])) && p() && e('29'); // 敏捷执行查询统计 -r($execution->processBurnDataTest($executionIDList[1], $itemCounts[1], $begin[0], $end[0], $count[1])) && p() && e('60'); // 瀑布执行查询统计 -r($execution->processBurnDataTest($executionIDList[2], $itemCounts[2], $begin[0], $end[0], $count[1])) && p() && e('60'); // 看板执行查询统计 +r($execution->processBurnDataTest($executionIDList[1], $itemCounts[1], $begin[0], $end[0], $count[1])) && p() && e('59'); // 瀑布执行查询统计 +r($execution->processBurnDataTest($executionIDList[2], $itemCounts[2], $begin[0], $end[0], $count[1])) && p() && e('62'); // 看板执行查询统计 r($execution->processBurnDataTest($executionIDList[2], $itemCounts[2], $begin[1], $end[1], $count[1])) && p() && e('0'); // 错误时间查询统计 \ No newline at end of file diff --git a/test/model/execution/statrelateddata.php b/test/model/execution/statrelateddata.php index 0a39dc3c63..11093910c6 100755 --- a/test/model/execution/statrelateddata.php +++ b/test/model/execution/statrelateddata.php @@ -10,7 +10,7 @@ title=测试executionModel->statRelatedDataTest(); cid=1 pid=1 -敏捷执行数据统计 >> 3 +敏捷执行数据统计 >> 2 瀑布执行数据统计 >> 4 看板执行数据统计 >> 3 @@ -19,6 +19,6 @@ pid=1 $executionIDList = array('101', '131', '161'); $execution = new executionTest(); -r($execution->statRelatedDataTest($executionIDList[0])) && p('storyCount') && e('3'); // 敏捷执行数据统计 +r($execution->statRelatedDataTest($executionIDList[0])) && p('storyCount') && e('2'); // 敏捷执行数据统计 r($execution->statRelatedDataTest($executionIDList[1])) && p('taskCount') && e('4'); // 瀑布执行数据统计 r($execution->statRelatedDataTest($executionIDList[2])) && p('bugCount') && e('3'); // 看板执行数据统计 \ No newline at end of file diff --git a/test/model/execution/update.php b/test/model/execution/update.php index e37e101a40..7ce1bae9ee 100755 --- a/test/model/execution/update.php +++ b/test/model/execution/update.php @@ -11,7 +11,7 @@ cid=1 pid=1 测试重复迭代code >> 『迭代代号』已经有『project1』这条记录了。如果您确定该记录已删除,请到后台-系统-数据-回收站还原。 -测试修改迭代名称 >> name,迭代1,任务名修改 +测试修改迭代名称 >> name,迭代1,迭代名修改 测试修改迭代项目为瀑布项目 >> project,11,41 测试修改迭代项目为看板项目 >> project,41,71 测试修改迭代code >> code,project31,code修改 @@ -44,7 +44,7 @@ $repeatcode = array('name' => '迭代名修改1'); $execution = new executionTest(); r($execution->updateObject($executionIDList[0], $repeatcode)) && p('code:0') && e('『迭代代号』已经有『project1』这条记录了。如果您确定该记录已删除,请到后台-系统-数据-回收站还原。'); // 测试重复迭代code -r($execution->updateObject($executionIDList[0], $changeName)) && p('0:field,old,new') && e('name,迭代1,任务名修改'); // 测试修改迭代名称 +r($execution->updateObject($executionIDList[0], $changeName)) && p('0:field,old,new') && e('name,迭代1,迭代名修改'); // 测试修改迭代名称 r($execution->updateObject($executionIDList[0], $changeStage)) && p('0:field,old,new') && e('project,11,41'); // 测试修改迭代项目为瀑布项目 r($execution->updateObject($executionIDList[0], $changeKanban)) && p('0:field,old,new') && e('project,41,71'); // 测试修改迭代项目为看板项目 r($execution->updateObject($executionIDList[1], $changeCode)) && p('0:field,old,new') && e('code,project31,code修改'); // 测试修改迭代code