From d98024d18f2b2cd4e18e9dc64e39c6cfee78ddd0 Mon Sep 17 00:00:00 2001 From: zhujinyong Date: Thu, 13 Jan 2022 09:38:23 +0800 Subject: [PATCH] + Add relationship of projectproduct. --- test/data/execution.yaml | 2 +- test/data/product.yaml | 2 +- test/data/team.yaml | 10 +++++----- test/data/zentao/config.php | 2 ++ test/data/zentao/processor.php | 21 +++++++++++++++++++++ 5 files changed, 30 insertions(+), 7 deletions(-) diff --git a/test/data/execution.yaml b/test/data/execution.yaml index 83b768f349..5a171e0d3e 100644 --- a/test/data/execution.yaml +++ b/test/data/execution.yaml @@ -1,4 +1,4 @@ -title: project +title: table zt_execution author: Zhu Jinyong version: "1.0" fields: diff --git a/test/data/product.yaml b/test/data/product.yaml index aed1457d67..35fb5e44d2 100644 --- a/test/data/product.yaml +++ b/test/data/product.yaml @@ -7,7 +7,7 @@ fields: range: 1-1000 - field: program note: "所属项目集" - range: 1-10 + range: 0-10 - field: name note: "产品名称" fields: diff --git a/test/data/team.yaml b/test/data/team.yaml index dae936b1f1..4b608b67e8 100644 --- a/test/data/team.yaml +++ b/test/data/team.yaml @@ -13,7 +13,7 @@ fields: format: "" - field: root note: "项目/执行ID" - range: 121-130{100},241-250{100} + range: 11-300 #range: 4{100},5{100} prefix: "" postfix: "" @@ -21,7 +21,7 @@ fields: format: "" - field: type note: "项目类型" - range: project{100},execution{100} + range: project{90},execution{200} prefix: "" postfix: "" loop: 0 @@ -30,16 +30,16 @@ fields: note: "用户账号" fields: - field: account1 - range: test,dev + range: admin,user{98},test{100},pm{100},po{100} - field: account2 - range: 1-100 + range: [],3-100,1-100,1-100,1-100 prefix: "" postfix: "" loop: 0 format: "" - field: role note: "角色" - range: 研发{60},测试{30},项目经理{5},产品经理{5} + range: 研发{99},测试{100},项目经理{100},产品经理{5} prefix: "" postfix: "" loop: 0 diff --git a/test/data/zentao/config.php b/test/data/zentao/config.php index c5be7d82e2..7aa432a6b3 100644 --- a/test/data/zentao/config.php +++ b/test/data/zentao/config.php @@ -14,6 +14,8 @@ $builder->productplan = array('rows' => 360, 'extends' => array('productplan' $builder->branch = array('rows' => 240, 'extends' => array('branch')); $builder->projectproduct = array('rows' => 200, 'extends' => array('projectproduct')); +$builder->team = array('rows' => 400, 'extends' => array('team')); + $builder->build = array('rows' => 8, 'extends' => array('build')); $builder->release = array('rows' => 8, 'extends' => array('release')); diff --git a/test/data/zentao/processor.php b/test/data/zentao/processor.php index 0ac32f1635..047bc13b93 100644 --- a/test/data/zentao/processor.php +++ b/test/data/zentao/processor.php @@ -156,6 +156,27 @@ class Processor */ private function initExecution() { + /* Add relationship of projectproduct. */ + $projectProducts = $this->dao->select('*')->from(TABLE_PROJECTPRODUCT)->fetchAll(); + $productsInProject = array(); + foreach($projectProducts as $relation) + { + if(!isset($productsInProject[$relation->project])) $productsInProject[$relation->project] = array(); + $productsInProject[$relation->project][] = $relation->product; + } + + $executions = $this->dao->select('*')->from(TABLE_PROJECT)->where('type')->in('sprint,kanban,stage')->fetchAll(); + foreach($executions as $execution) + { + $products = $productsInProject[$execution->project]; + foreach($products as $product) + { + $data = new stdclass(); + $data->project = $execution->id; + $data->product = $product; + $this->dao->insert(TABLE_PROJECTPRODUCT)->data($data)->exec(); + } + } } /**