diff --git a/db/update18.3.sql b/db/update18.3.sql index ee4d9c2ab7..41684ad796 100644 --- a/db/update18.3.sql +++ b/db/update18.3.sql @@ -40,6 +40,8 @@ CREATE TABLE IF NOT EXISTS `zt_pivot` ( KEY `group` (`group`) ) ENGINE = InnoDB DEFAULT CHARSET=utf8; +ALTER TABLE zt_pivot ADD dataset varchar(30) NOT NULL DEFAULT ''; + ALTER TABLE zt_case ADD scene int(11) DEFAULT 0; ALTER TABLE zt_case ADD sort int(11) DEFAULT 0; @@ -301,11 +303,11 @@ REPLACE INTO `zt_chart` (`id`, `name`, `dimension`, `type`, `group`, `stage`, `d (10219,'质量数据-Bug严重程度分布',3,'pie',0,'published','','[{\"type\":\"pie\",\"group\":[{\"field\":\"severity\",\"name\":\"\\u4e25\\u91cd\\u7a0b\\u5ea6\",\"group\":\"\"}],\"metric\":[{\"field\":\"id\",\"name\":\"Bug\\u7f16\\u53f7\",\"valOrAgg\":\"count\"}]}]','[{\"field\":\"openedDate\",\"type\":\"date\",\"name\":\"\\u521b\\u5efa\\u65e5\\u671f\",\"default\":{\"begin\":\"\",\"end\":\"\"}}]','{\"id\":{\"name\":\"Bug\\u7f16\\u53f7\",\"object\":\"bug\",\"field\":\"id\",\"type\":\"number\"},\"severity\":{\"name\":\"\\u4e25\\u91cd\\u7a0b\\u5ea6\",\"object\":\"bug\",\"field\":\"severity\",\"type\":\"option\"},\"openedDate\":{\"name\":\"\\u521b\\u5efa\\u65e5\\u671f\",\"object\":\"bug\",\"field\":\"openedDate\",\"type\":\"date\"}}','','select\nid,severity,openedDate\nfrom\nzt_bug\nwhere deleted=\'0\'','1','','admin','2023-04-18 13:36:37','admin','2023-04-18 13:36:37','0'), (10220,'质量数据-Bug解决方案分布',3,'pie',0,'published','','[{\"type\":\"pie\",\"group\":[{\"field\":\"resolution\",\"name\":\"\\u89e3\\u51b3\\u65b9\\u6848\",\"group\":\"\"}],\"metric\":[{\"field\":\"id\",\"name\":\"Bug\\u7f16\\u53f7\",\"valOrAgg\":\"count\"}]}]','[{\"field\":\"resolvedDate\",\"type\":\"date\",\"name\":\"\\u89e3\\u51b3\\u65e5\\u671f\",\"default\":{\"begin\":\"\",\"end\":\"\"}}]','{\"id\":{\"name\":\"Bug\\u7f16\\u53f7\",\"object\":\"bug\",\"field\":\"id\",\"type\":\"number\"},\"resolution\":{\"name\":\"\\u89e3\\u51b3\\u65b9\\u6848\",\"object\":\"bug\",\"field\":\"resolution\",\"type\":\"option\"},\"resolvedDate\":{\"name\":\"\\u89e3\\u51b3\\u65e5\\u671f\",\"object\":\"bug\",\"field\":\"resolvedDate\",\"type\":\"date\"}}','','select id,resolution,resolvedDate from zt_bug\nwhere deleted=\'0\' and resolution!=\' \'','1','','admin','2023-04-18 13:37:24','','2023-04-18 13:37:24','0'); -REPLACE INTO `zt_pivot` VALUES (1000,2,0,'{\"zh-cn\":\"\\u5b8c\\u6210\\u9879\\u76ee\\u5de5\\u671f\\u900f\\u89c6\\u8868\",\"zh-tw\":\"\",\"en\":\"\",\"de\":\"\",\"fr\":\"\"}','','select\nt1.name,\nt2.1program,\nt1.begin,\nt1.end,\nt1.realBegan,\nt1.realEnd,\nt1.closedDate,\nt1.realduration,\nt1.realduration-t1.planduration duration_deviation,\nround((t1.realduration-t1.planduration)/t1.planduration,3) rate\nfrom\n(select \nname,\nsubstr(`path`,2,4) 1program,\nbegin,\nend,\nrealBegan,\nrealEnd,\nleft(closedDate,10) closedDate,\ndatediff(`end`,`begin`) planduration,\nifnull(if(left(`realEnd`,4) != \'0000\',datediff(`realEnd`,`realBegan`),datediff(`closedDate`,`realBegan`)),0) realduration\nfrom\nzt_project\nwhere type=\'project\' and status=\'closed\' and deleted=\'0\') t1\nleft join\n(select\nid programid,\nname 1program\nfrom\nzt_project\nwhere type=\'program\' and grade=1) t2\non t1.1program=t2.programid','{\"name\":{\"name\":\"\\u9879\\u76ee\\u540d\\u79f0\",\"object\":\"project\",\"field\":\"name\",\"type\":\"string\"},\"1program\":{\"name\":\"1program\",\"object\":\"project\",\"field\":\"1program\",\"type\":\"string\"},\"begin\":{\"name\":\"\\u8ba1\\u5212\\u5f00\\u59cb\",\"object\":\"project\",\"field\":\"begin\",\"type\":\"date\"},\"end\":{\"name\":\"\\u8ba1\\u5212\\u5b8c\\u6210\",\"object\":\"project\",\"field\":\"end\",\"type\":\"date\"},\"realBegan\":{\"name\":\"\\u5b9e\\u9645\\u5f00\\u59cb\\u65e5\\u671f\",\"object\":\"project\",\"field\":\"realBegan\",\"type\":\"date\"},\"realEnd\":{\"name\":\"\\u5b9e\\u9645\\u5b8c\\u6210\\u65e5\\u671f\",\"object\":\"project\",\"field\":\"realEnd\",\"type\":\"date\"},\"closedDate\":{\"name\":\"\\u5173\\u95ed\\u65e5\\u671f\",\"object\":\"project\",\"field\":\"closedDate\",\"type\":\"date\"},\"realduration\":{\"name\":\"realduration\",\"object\":\"project\",\"field\":\"realduration\",\"type\":\"number\"},\"duration_deviation\":{\"name\":\"duration_deviation\",\"object\":\"project\",\"field\":\"duration_deviation\",\"type\":\"number\"},\"rate\":{\"name\":\"rate\",\"object\":\"project\",\"field\":\"rate\",\"type\":\"number\"}}','{\"name\":{\"zh-cn\":\"\\u9879\\u76ee\\u540d\\u79f0\",\"zh-tw\":\"\",\"en\":\"\",\"de\":\"\",\"fr\":\"\"},\"1program\":{\"zh-cn\":\"\\u4e00\\u7ea7\\u9879\\u76ee\\u96c6\",\"zh-tw\":\"\",\"en\":\"\",\"de\":\"\",\"fr\":\"\"},\"begin\":{\"zh-cn\":\"\\u8ba1\\u5212\\u5f00\\u59cb\",\"zh-tw\":\"\",\"en\":\"\",\"de\":\"\",\"fr\":\"\"},\"end\":{\"zh-cn\":\"\\u8ba1\\u5212\\u5b8c\\u6210\",\"zh-tw\":\"\",\"en\":\"\",\"de\":\"\",\"fr\":\"\"},\"realBegan\":{\"zh-cn\":\"\\u5b9e\\u9645\\u5f00\\u59cb\\u65e5\\u671f\",\"zh-tw\":\"\",\"en\":\"\",\"de\":\"\",\"fr\":\"\"},\"realEnd\":{\"zh-cn\":\"\\u5b9e\\u9645\\u5b8c\\u6210\\u65e5\\u671f\",\"zh-tw\":\"\",\"en\":\"\",\"de\":\"\",\"fr\":\"\"},\"closedDate\":{\"zh-cn\":\"\\u5173\\u95ed\\u65e5\\u671f\",\"zh-tw\":\"\",\"en\":\"\",\"de\":\"\",\"fr\":\"\"},\"realduration\":{\"zh-cn\":\"\\u5b9e\\u9645\\u5de5\\u671f\",\"zh-tw\":\"\",\"en\":\"\",\"de\":\"\",\"fr\":\"\"},\"duration_deviation\":{\"zh-cn\":\"\\u5de5\\u671f\\u504f\\u5dee\",\"zh-tw\":\"\",\"en\":\"\",\"de\":\"\",\"fr\":\"\"},\"rate\":{\"zh-cn\":\"\\u5de5\\u671f\\u504f\\u5dee\\u7387\",\"zh-tw\":\"\",\"en\":\"\",\"de\":\"\",\"fr\":\"\"}}','','','{\"columns\":[{\"field\":\"begin\",\"stat\":\"sum\",\"slice\":\"noSlice\",\"showMode\":\"default\",\"monopolize\":\"0\",\"showTotal\":\"noShow\"},{\"field\":\"end\",\"stat\":\"sum\",\"slice\":\"noSlice\",\"showMode\":\"default\",\"monopolize\":\"0\",\"showTotal\":\"noShow\"},{\"field\":\"realBegan\",\"stat\":\"sum\",\"slice\":\"noSlice\",\"showMode\":\"default\",\"monopolize\":\"0\",\"showTotal\":\"noShow\"},{\"field\":\"realEnd\",\"stat\":\"sum\",\"slice\":\"noSlice\",\"showMode\":\"default\",\"monopolize\":\"0\",\"showTotal\":\"noShow\"},{\"field\":\"closedDate\",\"stat\":\"sum\",\"slice\":\"noSlice\",\"showMode\":\"default\",\"monopolize\":\"0\",\"showTotal\":\"noShow\"},{\"field\":\"realduration\",\"stat\":\"sum\",\"slice\":\"noSlice\",\"showMode\":\"default\",\"monopolize\":\"0\",\"showTotal\":\"noShow\"},{\"field\":\"duration_deviation\",\"stat\":\"sum\",\"slice\":\"noSlice\",\"showMode\":\"default\",\"monopolize\":\"0\",\"showTotal\":\"noShow\"},{\"field\":\"rate\",\"stat\":\"sum\",\"slice\":\"noSlice\",\"showMode\":\"default\",\"monopolize\":\"0\",\"showTotal\":\"noShow\"}],\"group3\":\"1program\",\"group6\":\"name\",\"lastStep\":\"4\"}','[]',0,'published','1','admin','2023-04-06 14:07:26','admin','2023-04-06 14:07:26','0'); +REPLACE INTO `zt_pivot` VALUES (1000,2,0,'{\"zh-cn\":\"\\u5b8c\\u6210\\u9879\\u76ee\\u5de5\\u671f\\u900f\\u89c6\\u8868\",\"zh-tw\":\"\",\"en\":\"\",\"de\":\"\",\"fr\":\"\"}','','select\nt1.name,\nt2.1program,\nt1.begin,\nt1.end,\nt1.realBegan,\nt1.realEnd,\nt1.closedDate,\nt1.realduration,\nt1.realduration-t1.planduration duration_deviation,\nround((t1.realduration-t1.planduration)/t1.planduration,3) rate\nfrom\n(select \nname,\nsubstr(`path`,2,4) 1program,\nbegin,\nend,\nrealBegan,\nrealEnd,\nleft(closedDate,10) closedDate,\ndatediff(`end`,`begin`) planduration,\nifnull(if(left(`realEnd`,4) != \'0000\',datediff(`realEnd`,`realBegan`),datediff(`closedDate`,`realBegan`)),0) realduration\nfrom\nzt_project\nwhere type=\'project\' and status=\'closed\' and deleted=\'0\') t1\nleft join\n(select\nid programid,\nname 1program\nfrom\nzt_project\nwhere type=\'program\' and grade=1) t2\non t1.1program=t2.programid','{\"name\":{\"name\":\"\\u9879\\u76ee\\u540d\\u79f0\",\"object\":\"project\",\"field\":\"name\",\"type\":\"string\"},\"1program\":{\"name\":\"1program\",\"object\":\"project\",\"field\":\"1program\",\"type\":\"string\"},\"begin\":{\"name\":\"\\u8ba1\\u5212\\u5f00\\u59cb\",\"object\":\"project\",\"field\":\"begin\",\"type\":\"date\"},\"end\":{\"name\":\"\\u8ba1\\u5212\\u5b8c\\u6210\",\"object\":\"project\",\"field\":\"end\",\"type\":\"date\"},\"realBegan\":{\"name\":\"\\u5b9e\\u9645\\u5f00\\u59cb\\u65e5\\u671f\",\"object\":\"project\",\"field\":\"realBegan\",\"type\":\"date\"},\"realEnd\":{\"name\":\"\\u5b9e\\u9645\\u5b8c\\u6210\\u65e5\\u671f\",\"object\":\"project\",\"field\":\"realEnd\",\"type\":\"date\"},\"closedDate\":{\"name\":\"\\u5173\\u95ed\\u65e5\\u671f\",\"object\":\"project\",\"field\":\"closedDate\",\"type\":\"date\"},\"realduration\":{\"name\":\"realduration\",\"object\":\"project\",\"field\":\"realduration\",\"type\":\"number\"},\"duration_deviation\":{\"name\":\"duration_deviation\",\"object\":\"project\",\"field\":\"duration_deviation\",\"type\":\"number\"},\"rate\":{\"name\":\"rate\",\"object\":\"project\",\"field\":\"rate\",\"type\":\"number\"}}','{\"name\":{\"zh-cn\":\"\\u9879\\u76ee\\u540d\\u79f0\",\"zh-tw\":\"\",\"en\":\"\",\"de\":\"\",\"fr\":\"\"},\"1program\":{\"zh-cn\":\"\\u4e00\\u7ea7\\u9879\\u76ee\\u96c6\",\"zh-tw\":\"\",\"en\":\"\",\"de\":\"\",\"fr\":\"\"},\"begin\":{\"zh-cn\":\"\\u8ba1\\u5212\\u5f00\\u59cb\",\"zh-tw\":\"\",\"en\":\"\",\"de\":\"\",\"fr\":\"\"},\"end\":{\"zh-cn\":\"\\u8ba1\\u5212\\u5b8c\\u6210\",\"zh-tw\":\"\",\"en\":\"\",\"de\":\"\",\"fr\":\"\"},\"realBegan\":{\"zh-cn\":\"\\u5b9e\\u9645\\u5f00\\u59cb\\u65e5\\u671f\",\"zh-tw\":\"\",\"en\":\"\",\"de\":\"\",\"fr\":\"\"},\"realEnd\":{\"zh-cn\":\"\\u5b9e\\u9645\\u5b8c\\u6210\\u65e5\\u671f\",\"zh-tw\":\"\",\"en\":\"\",\"de\":\"\",\"fr\":\"\"},\"closedDate\":{\"zh-cn\":\"\\u5173\\u95ed\\u65e5\\u671f\",\"zh-tw\":\"\",\"en\":\"\",\"de\":\"\",\"fr\":\"\"},\"realduration\":{\"zh-cn\":\"\\u5b9e\\u9645\\u5de5\\u671f\",\"zh-tw\":\"\",\"en\":\"\",\"de\":\"\",\"fr\":\"\"},\"duration_deviation\":{\"zh-cn\":\"\\u5de5\\u671f\\u504f\\u5dee\",\"zh-tw\":\"\",\"en\":\"\",\"de\":\"\",\"fr\":\"\"},\"rate\":{\"zh-cn\":\"\\u5de5\\u671f\\u504f\\u5dee\\u7387\",\"zh-tw\":\"\",\"en\":\"\",\"de\":\"\",\"fr\":\"\"}}','','','{\"columns\":[{\"field\":\"begin\",\"stat\":\"sum\",\"slice\":\"noSlice\",\"showMode\":\"default\",\"monopolize\":\"0\",\"showTotal\":\"noShow\"},{\"field\":\"end\",\"stat\":\"sum\",\"slice\":\"noSlice\",\"showMode\":\"default\",\"monopolize\":\"0\",\"showTotal\":\"noShow\"},{\"field\":\"realBegan\",\"stat\":\"sum\",\"slice\":\"noSlice\",\"showMode\":\"default\",\"monopolize\":\"0\",\"showTotal\":\"noShow\"},{\"field\":\"realEnd\",\"stat\":\"sum\",\"slice\":\"noSlice\",\"showMode\":\"default\",\"monopolize\":\"0\",\"showTotal\":\"noShow\"},{\"field\":\"closedDate\",\"stat\":\"sum\",\"slice\":\"noSlice\",\"showMode\":\"default\",\"monopolize\":\"0\",\"showTotal\":\"noShow\"},{\"field\":\"realduration\",\"stat\":\"sum\",\"slice\":\"noSlice\",\"showMode\":\"default\",\"monopolize\":\"0\",\"showTotal\":\"noShow\"},{\"field\":\"duration_deviation\",\"stat\":\"sum\",\"slice\":\"noSlice\",\"showMode\":\"default\",\"monopolize\":\"0\",\"showTotal\":\"noShow\"},{\"field\":\"rate\",\"stat\":\"sum\",\"slice\":\"noSlice\",\"showMode\":\"default\",\"monopolize\":\"0\",\"showTotal\":\"noShow\"}],\"group3\":\"1program\",\"group6\":\"name\",\"lastStep\":\"4\"}','[]',0,'published','1','admin','2023-04-06 14:07:26','admin','2023-04-06 14:07:26','0',''); -REPLACE INTO `zt_pivot` VALUES (1001,2,0,'{\"zh-cn\":\"\\u5b8c\\u6210\\u9879\\u76ee\\u5de5\\u65f6\\u900f\\u89c6\\u8868\",\"zh-tw\":\"\",\"en\":\"\",\"de\":\"\",\"fr\":\"\"}','','select\nt1.name \'项目名称\',\nt1.1program \'一级项目集\',\nround(t2.estimate,2) \'预计工时\',\nround(t2.consumed,2) \'消耗工时\',\nround(t2.consumed-t2.estimate,2) \'工时偏差\',\nround((t2.consumed-t2.estimate)/t2.estimate,2) \'工时偏差率\',\nifnull(t3.storys,0) \'完成需求数\',\nifnull(t3.storyestimate,0) \'完成需求规模数\',\nround(ifnull(t3.storyestimate,0)/ifnull(t2.consumed,0),2) \'单位时间交付需求规模数\',\nt1.closedDate closedDate\nfrom(\nselect\nid,\nname,\nsubstr(`path`,2,4) 1program,\nclosedDate\nfrom\nzt_project\nwhere deleted=\'0\' and type=\'project\' and status=\'closed\') t1\nleft join(\nselect\nproject,\nsum(estimate) estimate,\nsum(consumed) consumed\nfrom\nzt_task\nwhere deleted=\'0\' and project !=0\ngroup by project) t2\non t1.id=t2.project\nleft join (\nselect\ntt3.project,\ncount(tt3.id) storys,\nsum(estimate) storyestimate\nfrom(\nselect\ntt1.id,\ntt1.estimate,\ntt2.project\nfrom\nzt_story tt1\nleft join\nzt_projectstory tt2\non tt1.id=tt2.story\nwhere tt1.deleted=\'0\' and tt1.status=\'closed\' and tt1.closedReason=\'done\') tt3\ngroup by tt3.project) t3\non t1.id=t3.project','{\"\\u9879\\u76ee\\u540d\\u79f0\":{\"name\":\"\\u9879\\u76ee\\u540d\\u79f0\",\"object\":\"story\",\"field\":\"\\u9879\\u76ee\\u540d\\u79f0\",\"type\":\"string\"},\"\\u4e00\\u7ea7\\u9879\\u76ee\\u96c6\":{\"name\":\"\\u4e00\\u7ea7\\u9879\\u76ee\\u96c6\",\"object\":\"story\",\"field\":\"\\u4e00\\u7ea7\\u9879\\u76ee\\u96c6\",\"type\":\"string\"},\"\\u9884\\u8ba1\\u5de5\\u65f6\":{\"name\":\"\\u9884\\u8ba1\\u5de5\\u65f6\",\"object\":\"story\",\"field\":\"\\u9884\\u8ba1\\u5de5\\u65f6\",\"type\":\"number\"},\"\\u6d88\\u8017\\u5de5\\u65f6\":{\"name\":\"\\u6d88\\u8017\\u5de5\\u65f6\",\"object\":\"story\",\"field\":\"\\u6d88\\u8017\\u5de5\\u65f6\",\"type\":\"number\"},\"\\u5de5\\u65f6\\u504f\\u5dee\":{\"name\":\"\\u5de5\\u65f6\\u504f\\u5dee\",\"object\":\"story\",\"field\":\"\\u5de5\\u65f6\\u504f\\u5dee\",\"type\":\"number\"},\"\\u5de5\\u65f6\\u504f\\u5dee\\u7387\":{\"name\":\"\\u5de5\\u65f6\\u504f\\u5dee\\u7387\",\"object\":\"story\",\"field\":\"\\u5de5\\u65f6\\u504f\\u5dee\\u7387\",\"type\":\"number\"},\"\\u5b8c\\u6210\\u9700\\u6c42\\u6570\":{\"name\":\"\\u5b8c\\u6210\\u9700\\u6c42\\u6570\",\"object\":\"story\",\"field\":\"\\u5b8c\\u6210\\u9700\\u6c42\\u6570\",\"type\":\"string\"},\"\\u5b8c\\u6210\\u9700\\u6c42\\u89c4\\u6a21\\u6570\":{\"name\":\"\\u5b8c\\u6210\\u9700\\u6c42\\u89c4\\u6a21\\u6570\",\"object\":\"story\",\"field\":\"\\u5b8c\\u6210\\u9700\\u6c42\\u89c4\\u6a21\\u6570\",\"type\":\"number\"},\"\\u5355\\u4f4d\\u65f6\\u95f4\\u4ea4\\u4ed8\\u9700\\u6c42\\u89c4\\u6a21\\u6570\":{\"name\":\"\\u5355\\u4f4d\\u65f6\\u95f4\\u4ea4\\u4ed8\\u9700\\u6c42\\u89c4\\u6a21\\u6570\",\"object\":\"story\",\"field\":\"\\u5355\\u4f4d\\u65f6\\u95f4\\u4ea4\\u4ed8\\u9700\\u6c42\\u89c4\\u6a21\\u6570\",\"type\":\"number\"},\"closedDate\":{\"name\":\"\\u5173\\u95ed\\u65e5\\u671f\",\"object\":\"story\",\"field\":\"closedDate\",\"type\":\"date\"}}','','','','{\"columns\":[{\"field\":\"\\u9884\\u8ba1\\u5de5\\u65f6\",\"stat\":\"sum\",\"slice\":\"noSlice\",\"showMode\":\"default\",\"monopolize\":\"0\",\"showTotal\":\"noShow\"},{\"field\":\"\\u6d88\\u8017\\u5de5\\u65f6\",\"stat\":\"sum\",\"slice\":\"noSlice\",\"showMode\":\"default\",\"monopolize\":\"0\",\"showTotal\":\"noShow\"},{\"field\":\"\\u5de5\\u65f6\\u504f\\u5dee\",\"stat\":\"sum\",\"slice\":\"noSlice\",\"showMode\":\"default\",\"monopolize\":\"0\",\"showTotal\":\"noShow\"},{\"field\":\"\\u5de5\\u65f6\\u504f\\u5dee\\u7387\",\"stat\":\"sum\",\"slice\":\"noSlice\",\"showMode\":\"default\",\"monopolize\":\"0\",\"showTotal\":\"noShow\"},{\"field\":\"\\u5b8c\\u6210\\u9700\\u6c42\\u6570\",\"stat\":\"sum\",\"slice\":\"noSlice\",\"showMode\":\"default\",\"monopolize\":\"0\",\"showTotal\":\"noShow\"},{\"field\":\"\\u5b8c\\u6210\\u9700\\u6c42\\u89c4\\u6a21\\u6570\",\"stat\":\"sum\",\"slice\":\"noSlice\",\"showMode\":\"default\",\"monopolize\":\"0\",\"showTotal\":\"noShow\"},{\"field\":\"\\u5355\\u4f4d\\u65f6\\u95f4\\u4ea4\\u4ed8\\u9700\\u6c42\\u89c4\\u6a21\\u6570\",\"stat\":\"sum\",\"slice\":\"noSlice\",\"showMode\":\"default\",\"monopolize\":\"0\",\"showTotal\":\"noShow\"}],\"group1\":\"\\u4e00\\u7ea7\\u9879\\u76ee\\u96c6\",\"group2\":\"\\u9879\\u76ee\\u540d\\u79f0\",\"lastStep\":\"4\"}','[{\"field\":\"closedDate\",\"type\":\"date\",\"name\":\"\\u5173\\u95ed\\u65e5\\u671f\",\"default\":{\"begin\":\"\",\"end\":\"\"}}]',0,'published','1','admin','2023-04-11 13:14:37','admin','2023-04-11 13:14:37','0'); +REPLACE INTO `zt_pivot` VALUES (1001,2,0,'{\"zh-cn\":\"\\u5b8c\\u6210\\u9879\\u76ee\\u5de5\\u65f6\\u900f\\u89c6\\u8868\",\"zh-tw\":\"\",\"en\":\"\",\"de\":\"\",\"fr\":\"\"}','','select\nt1.name \'项目名称\',\nt1.1program \'一级项目集\',\nround(t2.estimate,2) \'预计工时\',\nround(t2.consumed,2) \'消耗工时\',\nround(t2.consumed-t2.estimate,2) \'工时偏差\',\nround((t2.consumed-t2.estimate)/t2.estimate,2) \'工时偏差率\',\nifnull(t3.storys,0) \'完成需求数\',\nifnull(t3.storyestimate,0) \'完成需求规模数\',\nround(ifnull(t3.storyestimate,0)/ifnull(t2.consumed,0),2) \'单位时间交付需求规模数\',\nt1.closedDate closedDate\nfrom(\nselect\nid,\nname,\nsubstr(`path`,2,4) 1program,\nclosedDate\nfrom\nzt_project\nwhere deleted=\'0\' and type=\'project\' and status=\'closed\') t1\nleft join(\nselect\nproject,\nsum(estimate) estimate,\nsum(consumed) consumed\nfrom\nzt_task\nwhere deleted=\'0\' and project !=0\ngroup by project) t2\non t1.id=t2.project\nleft join (\nselect\ntt3.project,\ncount(tt3.id) storys,\nsum(estimate) storyestimate\nfrom(\nselect\ntt1.id,\ntt1.estimate,\ntt2.project\nfrom\nzt_story tt1\nleft join\nzt_projectstory tt2\non tt1.id=tt2.story\nwhere tt1.deleted=\'0\' and tt1.status=\'closed\' and tt1.closedReason=\'done\') tt3\ngroup by tt3.project) t3\non t1.id=t3.project','{\"\\u9879\\u76ee\\u540d\\u79f0\":{\"name\":\"\\u9879\\u76ee\\u540d\\u79f0\",\"object\":\"story\",\"field\":\"\\u9879\\u76ee\\u540d\\u79f0\",\"type\":\"string\"},\"\\u4e00\\u7ea7\\u9879\\u76ee\\u96c6\":{\"name\":\"\\u4e00\\u7ea7\\u9879\\u76ee\\u96c6\",\"object\":\"story\",\"field\":\"\\u4e00\\u7ea7\\u9879\\u76ee\\u96c6\",\"type\":\"string\"},\"\\u9884\\u8ba1\\u5de5\\u65f6\":{\"name\":\"\\u9884\\u8ba1\\u5de5\\u65f6\",\"object\":\"story\",\"field\":\"\\u9884\\u8ba1\\u5de5\\u65f6\",\"type\":\"number\"},\"\\u6d88\\u8017\\u5de5\\u65f6\":{\"name\":\"\\u6d88\\u8017\\u5de5\\u65f6\",\"object\":\"story\",\"field\":\"\\u6d88\\u8017\\u5de5\\u65f6\",\"type\":\"number\"},\"\\u5de5\\u65f6\\u504f\\u5dee\":{\"name\":\"\\u5de5\\u65f6\\u504f\\u5dee\",\"object\":\"story\",\"field\":\"\\u5de5\\u65f6\\u504f\\u5dee\",\"type\":\"number\"},\"\\u5de5\\u65f6\\u504f\\u5dee\\u7387\":{\"name\":\"\\u5de5\\u65f6\\u504f\\u5dee\\u7387\",\"object\":\"story\",\"field\":\"\\u5de5\\u65f6\\u504f\\u5dee\\u7387\",\"type\":\"number\"},\"\\u5b8c\\u6210\\u9700\\u6c42\\u6570\":{\"name\":\"\\u5b8c\\u6210\\u9700\\u6c42\\u6570\",\"object\":\"story\",\"field\":\"\\u5b8c\\u6210\\u9700\\u6c42\\u6570\",\"type\":\"string\"},\"\\u5b8c\\u6210\\u9700\\u6c42\\u89c4\\u6a21\\u6570\":{\"name\":\"\\u5b8c\\u6210\\u9700\\u6c42\\u89c4\\u6a21\\u6570\",\"object\":\"story\",\"field\":\"\\u5b8c\\u6210\\u9700\\u6c42\\u89c4\\u6a21\\u6570\",\"type\":\"number\"},\"\\u5355\\u4f4d\\u65f6\\u95f4\\u4ea4\\u4ed8\\u9700\\u6c42\\u89c4\\u6a21\\u6570\":{\"name\":\"\\u5355\\u4f4d\\u65f6\\u95f4\\u4ea4\\u4ed8\\u9700\\u6c42\\u89c4\\u6a21\\u6570\",\"object\":\"story\",\"field\":\"\\u5355\\u4f4d\\u65f6\\u95f4\\u4ea4\\u4ed8\\u9700\\u6c42\\u89c4\\u6a21\\u6570\",\"type\":\"number\"},\"closedDate\":{\"name\":\"\\u5173\\u95ed\\u65e5\\u671f\",\"object\":\"story\",\"field\":\"closedDate\",\"type\":\"date\"}}','','','','{\"columns\":[{\"field\":\"\\u9884\\u8ba1\\u5de5\\u65f6\",\"stat\":\"sum\",\"slice\":\"noSlice\",\"showMode\":\"default\",\"monopolize\":\"0\",\"showTotal\":\"noShow\"},{\"field\":\"\\u6d88\\u8017\\u5de5\\u65f6\",\"stat\":\"sum\",\"slice\":\"noSlice\",\"showMode\":\"default\",\"monopolize\":\"0\",\"showTotal\":\"noShow\"},{\"field\":\"\\u5de5\\u65f6\\u504f\\u5dee\",\"stat\":\"sum\",\"slice\":\"noSlice\",\"showMode\":\"default\",\"monopolize\":\"0\",\"showTotal\":\"noShow\"},{\"field\":\"\\u5de5\\u65f6\\u504f\\u5dee\\u7387\",\"stat\":\"sum\",\"slice\":\"noSlice\",\"showMode\":\"default\",\"monopolize\":\"0\",\"showTotal\":\"noShow\"},{\"field\":\"\\u5b8c\\u6210\\u9700\\u6c42\\u6570\",\"stat\":\"sum\",\"slice\":\"noSlice\",\"showMode\":\"default\",\"monopolize\":\"0\",\"showTotal\":\"noShow\"},{\"field\":\"\\u5b8c\\u6210\\u9700\\u6c42\\u89c4\\u6a21\\u6570\",\"stat\":\"sum\",\"slice\":\"noSlice\",\"showMode\":\"default\",\"monopolize\":\"0\",\"showTotal\":\"noShow\"},{\"field\":\"\\u5355\\u4f4d\\u65f6\\u95f4\\u4ea4\\u4ed8\\u9700\\u6c42\\u89c4\\u6a21\\u6570\",\"stat\":\"sum\",\"slice\":\"noSlice\",\"showMode\":\"default\",\"monopolize\":\"0\",\"showTotal\":\"noShow\"}],\"group1\":\"\\u4e00\\u7ea7\\u9879\\u76ee\\u96c6\",\"group2\":\"\\u9879\\u76ee\\u540d\\u79f0\",\"lastStep\":\"4\"}','[{\"field\":\"closedDate\",\"type\":\"date\",\"name\":\"\\u5173\\u95ed\\u65e5\\u671f\",\"default\":{\"begin\":\"\",\"end\":\"\"}}]',0,'published','1','admin','2023-04-11 13:14:37','admin','2023-04-11 13:14:37','0', ''); -REPLACE INTO `zt_pivot` VALUES (1002,3,0,'{\"zh-cn\":\"\\u4ea7\\u54c1\\u7f3a\\u9677\\u6570\\u636e\\u6c47\\u603b\\u8868\",\"zh-tw\":\"\",\"en\":\"\",\"de\":\"\",\"fr\":\"\"}','','SELECT \n t1.name AS \'产品\', \n IFNULL(t2.name, \'/\') AS \'一级项目集\', \n IFNULL(t3.name, \'/\') AS \'产品线\', \n IFNULL(t6.exfixedstorys, 0) AS \'研发完成需求数\', \n round(IFNULL(t6.exfixedstorysmate, 0),3) AS \'研发完成需求规模数\',\n IFNULL(t8.storycases, 0) AS \'需求用例数\',\n round(storycases/exfixedstorysmate,3) AS \'用例密度\',\n round(IFNULL(t10.casestorys/t6.exfixedstorys,0),3) AS \'用例覆盖率\',\n IFNULL(t7.bug, 0) AS \'Bug数\',\n IFNULL(t7.effbugs, 0) AS \'有效Bug数\',\n IFNULL(t7.pri12bugs, 0) AS \'优先级为1,2的Bug数\',\n round(bug/exfixedstorysmate,3) AS \'Bug密度\',\n IFNULL(t7.fixedbugs, 0) AS \'修复Bug数\',\n round(fixedbugs/bug,3) \'Bug修复率\'\nFROM \n zt_product AS t1 \n LEFT JOIN zt_project AS t2 ON t1.program = t2.id AND t2.type = \'program\' AND t2.grade = 1 \n LEFT JOIN zt_module AS t3 ON t1.line = t3.id AND t3.type = \'line\' \n LEFT JOIN (\n SELECT\n product, \n count(id) exfixedstorys, \n sum(estimate) exfixedstorysmate\n FROM zt_story \n WHERE deleted = \'0\' and (stage in (\'developed\',\'testing\',\'verfied\',\'released\') or (status=\'closed\' and closedReason=\'done\'))\n GROUP BY product) AS t6 ON t1.id = t6.product \n LEFT JOIN (SELECT product, COUNT(id) AS bug,\n SUM(case when resolution in (\'fixed\',\'postponed\') or status=\'active\' then 1 else 0 end) effbugs, \n SUM(CASE WHEN resolution=\'fixed\' then 1 else 0 end) fixedbugs,\n SUM(CASE WHEN severity in (1,2) then 1 else 0 end) pri12bugs\n FROM zt_bug WHERE deleted = \'0\' GROUP BY product) AS t7 ON t1.id = t7.product \n LEFT JOIN (SELECT product, COUNT(id) AS storycases FROM zt_case WHERE deleted=\'0\' GROUP BY product) AS t8 ON t1.id=t8.product\n LEFT JOIN (\n select \n t9.product, \n count(t9.story) casestorys\n from(\n SELECT \n zt_case.product,zt_case.story \n FROM zt_case \n left join zt_story\n on zt_case.story=zt_story.id\n WHERE zt_case.deleted=\'0\' and zt_case.story !=\'0\' and zt_story.deleted=\'0\' and (zt_story.stage in (\'developed\',\'testing\',\'verfied\',\'released\') or (zt_story.status=\'closed\' and zt_story.closedReason=\'done\'))\n GROUP BY product, story) t9\n group by product) t10\n on t1.id=t10.product\nWHERE t1.deleted = \'0\' AND t1.status != \'closed\' AND t1.shadow = \'0\'AND t1.vision = \'rnd\'\nORDER BY t1.order','{\"\\u4ea7\\u54c1\":{\"name\":\"\\u4ea7\\u54c1\",\"object\":\"story\",\"field\":\"\\u4ea7\\u54c1\",\"type\":\"string\"},\"\\u4e00\\u7ea7\\u9879\\u76ee\\u96c6\":{\"name\":\"\\u4e00\\u7ea7\\u9879\\u76ee\\u96c6\",\"object\":\"story\",\"field\":\"\\u4e00\\u7ea7\\u9879\\u76ee\\u96c6\",\"type\":\"string\"},\"\\u4ea7\\u54c1\\u7ebf\":{\"name\":\"\\u4ea7\\u54c1\\u7ebf\",\"object\":\"story\",\"field\":\"\\u4ea7\\u54c1\\u7ebf\",\"type\":\"string\"},\"\\u7814\\u53d1\\u5b8c\\u6210\\u9700\\u6c42\\u6570\":{\"name\":\"\\u7814\\u53d1\\u5b8c\\u6210\\u9700\\u6c42\\u6570\",\"object\":\"story\",\"field\":\"\\u7814\\u53d1\\u5b8c\\u6210\\u9700\\u6c42\\u6570\",\"type\":\"string\"},\"\\u7814\\u53d1\\u5b8c\\u6210\\u9700\\u6c42\\u89c4\\u6a21\\u6570\":{\"name\":\"\\u7814\\u53d1\\u5b8c\\u6210\\u9700\\u6c42\\u89c4\\u6a21\\u6570\",\"object\":\"story\",\"field\":\"\\u7814\\u53d1\\u5b8c\\u6210\\u9700\\u6c42\\u89c4\\u6a21\\u6570\",\"type\":\"number\"},\"\\u9700\\u6c42\\u7528\\u4f8b\\u6570\":{\"name\":\"\\u9700\\u6c42\\u7528\\u4f8b\\u6570\",\"object\":\"story\",\"field\":\"\\u9700\\u6c42\\u7528\\u4f8b\\u6570\",\"type\":\"string\"},\"\\u7528\\u4f8b\\u5bc6\\u5ea6\":{\"name\":\"\\u7528\\u4f8b\\u5bc6\\u5ea6\",\"object\":\"story\",\"field\":\"\\u7528\\u4f8b\\u5bc6\\u5ea6\",\"type\":\"number\"},\"\\u7528\\u4f8b\\u8986\\u76d6\\u7387\":{\"name\":\"\\u7528\\u4f8b\\u8986\\u76d6\\u7387\",\"object\":\"story\",\"field\":\"\\u7528\\u4f8b\\u8986\\u76d6\\u7387\",\"type\":\"number\"},\"Bug\\u6570\":{\"name\":\"Bug\\u6570\",\"object\":\"story\",\"field\":\"Bug\\u6570\",\"type\":\"string\"},\"\\u6709\\u6548Bug\\u6570\":{\"name\":\"\\u6709\\u6548Bug\\u6570\",\"object\":\"story\",\"field\":\"\\u6709\\u6548Bug\\u6570\",\"type\":\"number\"},\"\\u4f18\\u5148\\u7ea7\\u4e3a1\\uff0c2\\u7684Bug\\u6570\":{\"name\":\"\\u4f18\\u5148\\u7ea7\\u4e3a1\\uff0c2\\u7684Bug\\u6570\",\"object\":\"story\",\"field\":\"\\u4f18\\u5148\\u7ea7\\u4e3a1\\uff0c2\\u7684Bug\\u6570\",\"type\":\"number\"},\"Bug\\u5bc6\\u5ea6\":{\"name\":\"Bug\\u5bc6\\u5ea6\",\"object\":\"story\",\"field\":\"Bug\\u5bc6\\u5ea6\",\"type\":\"number\"},\"\\u4fee\\u590dBug\\u6570\":{\"name\":\"\\u4fee\\u590dBug\\u6570\",\"object\":\"story\",\"field\":\"\\u4fee\\u590dBug\\u6570\",\"type\":\"number\"},\"Bug\\u4fee\\u590d\\u7387\":{\"name\":\"Bug\\u4fee\\u590d\\u7387\",\"object\":\"story\",\"field\":\"Bug\\u4fee\\u590d\\u7387\",\"type\":\"number\"}}','','','','{\"columns\":[{\"field\":\"\\u7814\\u53d1\\u5b8c\\u6210\\u9700\\u6c42\\u6570\",\"stat\":\"sum\",\"slice\":\"noSlice\",\"showMode\":\"default\",\"monopolize\":\"0\",\"showTotal\":\"noShow\"},{\"field\":\"\\u7814\\u53d1\\u5b8c\\u6210\\u9700\\u6c42\\u89c4\\u6a21\\u6570\",\"stat\":\"sum\",\"slice\":\"noSlice\",\"showMode\":\"default\",\"monopolize\":\"0\",\"showTotal\":\"noShow\"},{\"field\":\"\\u9700\\u6c42\\u7528\\u4f8b\\u6570\",\"stat\":\"sum\",\"slice\":\"noSlice\",\"showMode\":\"default\",\"monopolize\":\"0\",\"showTotal\":\"noShow\"},{\"field\":\"\\u7528\\u4f8b\\u5bc6\\u5ea6\",\"stat\":\"sum\",\"slice\":\"noSlice\",\"showMode\":\"default\",\"monopolize\":\"0\",\"showTotal\":\"noShow\"},{\"field\":\"\\u7528\\u4f8b\\u8986\\u76d6\\u7387\",\"stat\":\"sum\",\"slice\":\"noSlice\",\"showMode\":\"default\",\"monopolize\":\"0\",\"showTotal\":\"noShow\"},{\"field\":\"Bug\\u6570\",\"stat\":\"sum\",\"slice\":\"noSlice\",\"showMode\":\"default\",\"monopolize\":\"0\",\"showTotal\":\"noShow\"},{\"field\":\"\\u6709\\u6548Bug\\u6570\",\"stat\":\"sum\",\"slice\":\"noSlice\",\"showMode\":\"default\",\"monopolize\":\"0\",\"showTotal\":\"noShow\"},{\"field\":\"\\u4f18\\u5148\\u7ea7\\u4e3a1\\uff0c2\\u7684Bug\\u6570\",\"stat\":\"sum\",\"slice\":\"noSlice\",\"showMode\":\"default\",\"monopolize\":\"0\",\"showTotal\":\"noShow\"},{\"field\":\"Bug\\u5bc6\\u5ea6\",\"stat\":\"sum\",\"slice\":\"noSlice\",\"showMode\":\"default\",\"monopolize\":\"0\",\"showTotal\":\"noShow\"},{\"field\":\"\\u4fee\\u590dBug\\u6570\",\"stat\":\"sum\",\"slice\":\"noSlice\",\"showMode\":\"default\",\"monopolize\":\"0\",\"showTotal\":\"noShow\"},{\"field\":\"Bug\\u4fee\\u590d\\u7387\",\"stat\":\"sum\",\"slice\":\"noSlice\",\"showMode\":\"default\",\"monopolize\":\"0\",\"showTotal\":\"noShow\"}],\"columnTotal\":\"noShow\",\"group1\":\"\\u4e00\\u7ea7\\u9879\\u76ee\\u96c6\",\"group3\":\"\\u4ea7\\u54c1\\u7ebf\",\"group2\":\"\\u4ea7\\u54c1\",\"lastStep\":\"4\"}','[]',0,'published','1','admin','2023-04-06 13:16:52','admin','2023-04-06 13:16:52','0'); +REPLACE INTO `zt_pivot` VALUES (1002,3,0,'{\"zh-cn\":\"\\u4ea7\\u54c1\\u7f3a\\u9677\\u6570\\u636e\\u6c47\\u603b\\u8868\",\"zh-tw\":\"\",\"en\":\"\",\"de\":\"\",\"fr\":\"\"}','','SELECT \n t1.name AS \'产品\', \n IFNULL(t2.name, \'/\') AS \'一级项目集\', \n IFNULL(t3.name, \'/\') AS \'产品线\', \n IFNULL(t6.exfixedstorys, 0) AS \'研发完成需求数\', \n round(IFNULL(t6.exfixedstorysmate, 0),3) AS \'研发完成需求规模数\',\n IFNULL(t8.storycases, 0) AS \'需求用例数\',\n round(storycases/exfixedstorysmate,3) AS \'用例密度\',\n round(IFNULL(t10.casestorys/t6.exfixedstorys,0),3) AS \'用例覆盖率\',\n IFNULL(t7.bug, 0) AS \'Bug数\',\n IFNULL(t7.effbugs, 0) AS \'有效Bug数\',\n IFNULL(t7.pri12bugs, 0) AS \'优先级为1,2的Bug数\',\n round(bug/exfixedstorysmate,3) AS \'Bug密度\',\n IFNULL(t7.fixedbugs, 0) AS \'修复Bug数\',\n round(fixedbugs/bug,3) \'Bug修复率\'\nFROM \n zt_product AS t1 \n LEFT JOIN zt_project AS t2 ON t1.program = t2.id AND t2.type = \'program\' AND t2.grade = 1 \n LEFT JOIN zt_module AS t3 ON t1.line = t3.id AND t3.type = \'line\' \n LEFT JOIN (\n SELECT\n product, \n count(id) exfixedstorys, \n sum(estimate) exfixedstorysmate\n FROM zt_story \n WHERE deleted = \'0\' and (stage in (\'developed\',\'testing\',\'verfied\',\'released\') or (status=\'closed\' and closedReason=\'done\'))\n GROUP BY product) AS t6 ON t1.id = t6.product \n LEFT JOIN (SELECT product, COUNT(id) AS bug,\n SUM(case when resolution in (\'fixed\',\'postponed\') or status=\'active\' then 1 else 0 end) effbugs, \n SUM(CASE WHEN resolution=\'fixed\' then 1 else 0 end) fixedbugs,\n SUM(CASE WHEN severity in (1,2) then 1 else 0 end) pri12bugs\n FROM zt_bug WHERE deleted = \'0\' GROUP BY product) AS t7 ON t1.id = t7.product \n LEFT JOIN (SELECT product, COUNT(id) AS storycases FROM zt_case WHERE deleted=\'0\' GROUP BY product) AS t8 ON t1.id=t8.product\n LEFT JOIN (\n select \n t9.product, \n count(t9.story) casestorys\n from(\n SELECT \n zt_case.product,zt_case.story \n FROM zt_case \n left join zt_story\n on zt_case.story=zt_story.id\n WHERE zt_case.deleted=\'0\' and zt_case.story !=\'0\' and zt_story.deleted=\'0\' and (zt_story.stage in (\'developed\',\'testing\',\'verfied\',\'released\') or (zt_story.status=\'closed\' and zt_story.closedReason=\'done\'))\n GROUP BY product, story) t9\n group by product) t10\n on t1.id=t10.product\nWHERE t1.deleted = \'0\' AND t1.status != \'closed\' AND t1.shadow = \'0\'AND t1.vision = \'rnd\'\nORDER BY t1.order','{\"\\u4ea7\\u54c1\":{\"name\":\"\\u4ea7\\u54c1\",\"object\":\"story\",\"field\":\"\\u4ea7\\u54c1\",\"type\":\"string\"},\"\\u4e00\\u7ea7\\u9879\\u76ee\\u96c6\":{\"name\":\"\\u4e00\\u7ea7\\u9879\\u76ee\\u96c6\",\"object\":\"story\",\"field\":\"\\u4e00\\u7ea7\\u9879\\u76ee\\u96c6\",\"type\":\"string\"},\"\\u4ea7\\u54c1\\u7ebf\":{\"name\":\"\\u4ea7\\u54c1\\u7ebf\",\"object\":\"story\",\"field\":\"\\u4ea7\\u54c1\\u7ebf\",\"type\":\"string\"},\"\\u7814\\u53d1\\u5b8c\\u6210\\u9700\\u6c42\\u6570\":{\"name\":\"\\u7814\\u53d1\\u5b8c\\u6210\\u9700\\u6c42\\u6570\",\"object\":\"story\",\"field\":\"\\u7814\\u53d1\\u5b8c\\u6210\\u9700\\u6c42\\u6570\",\"type\":\"string\"},\"\\u7814\\u53d1\\u5b8c\\u6210\\u9700\\u6c42\\u89c4\\u6a21\\u6570\":{\"name\":\"\\u7814\\u53d1\\u5b8c\\u6210\\u9700\\u6c42\\u89c4\\u6a21\\u6570\",\"object\":\"story\",\"field\":\"\\u7814\\u53d1\\u5b8c\\u6210\\u9700\\u6c42\\u89c4\\u6a21\\u6570\",\"type\":\"number\"},\"\\u9700\\u6c42\\u7528\\u4f8b\\u6570\":{\"name\":\"\\u9700\\u6c42\\u7528\\u4f8b\\u6570\",\"object\":\"story\",\"field\":\"\\u9700\\u6c42\\u7528\\u4f8b\\u6570\",\"type\":\"string\"},\"\\u7528\\u4f8b\\u5bc6\\u5ea6\":{\"name\":\"\\u7528\\u4f8b\\u5bc6\\u5ea6\",\"object\":\"story\",\"field\":\"\\u7528\\u4f8b\\u5bc6\\u5ea6\",\"type\":\"number\"},\"\\u7528\\u4f8b\\u8986\\u76d6\\u7387\":{\"name\":\"\\u7528\\u4f8b\\u8986\\u76d6\\u7387\",\"object\":\"story\",\"field\":\"\\u7528\\u4f8b\\u8986\\u76d6\\u7387\",\"type\":\"number\"},\"Bug\\u6570\":{\"name\":\"Bug\\u6570\",\"object\":\"story\",\"field\":\"Bug\\u6570\",\"type\":\"string\"},\"\\u6709\\u6548Bug\\u6570\":{\"name\":\"\\u6709\\u6548Bug\\u6570\",\"object\":\"story\",\"field\":\"\\u6709\\u6548Bug\\u6570\",\"type\":\"number\"},\"\\u4f18\\u5148\\u7ea7\\u4e3a1\\uff0c2\\u7684Bug\\u6570\":{\"name\":\"\\u4f18\\u5148\\u7ea7\\u4e3a1\\uff0c2\\u7684Bug\\u6570\",\"object\":\"story\",\"field\":\"\\u4f18\\u5148\\u7ea7\\u4e3a1\\uff0c2\\u7684Bug\\u6570\",\"type\":\"number\"},\"Bug\\u5bc6\\u5ea6\":{\"name\":\"Bug\\u5bc6\\u5ea6\",\"object\":\"story\",\"field\":\"Bug\\u5bc6\\u5ea6\",\"type\":\"number\"},\"\\u4fee\\u590dBug\\u6570\":{\"name\":\"\\u4fee\\u590dBug\\u6570\",\"object\":\"story\",\"field\":\"\\u4fee\\u590dBug\\u6570\",\"type\":\"number\"},\"Bug\\u4fee\\u590d\\u7387\":{\"name\":\"Bug\\u4fee\\u590d\\u7387\",\"object\":\"story\",\"field\":\"Bug\\u4fee\\u590d\\u7387\",\"type\":\"number\"}}','','','','{\"columns\":[{\"field\":\"\\u7814\\u53d1\\u5b8c\\u6210\\u9700\\u6c42\\u6570\",\"stat\":\"sum\",\"slice\":\"noSlice\",\"showMode\":\"default\",\"monopolize\":\"0\",\"showTotal\":\"noShow\"},{\"field\":\"\\u7814\\u53d1\\u5b8c\\u6210\\u9700\\u6c42\\u89c4\\u6a21\\u6570\",\"stat\":\"sum\",\"slice\":\"noSlice\",\"showMode\":\"default\",\"monopolize\":\"0\",\"showTotal\":\"noShow\"},{\"field\":\"\\u9700\\u6c42\\u7528\\u4f8b\\u6570\",\"stat\":\"sum\",\"slice\":\"noSlice\",\"showMode\":\"default\",\"monopolize\":\"0\",\"showTotal\":\"noShow\"},{\"field\":\"\\u7528\\u4f8b\\u5bc6\\u5ea6\",\"stat\":\"sum\",\"slice\":\"noSlice\",\"showMode\":\"default\",\"monopolize\":\"0\",\"showTotal\":\"noShow\"},{\"field\":\"\\u7528\\u4f8b\\u8986\\u76d6\\u7387\",\"stat\":\"sum\",\"slice\":\"noSlice\",\"showMode\":\"default\",\"monopolize\":\"0\",\"showTotal\":\"noShow\"},{\"field\":\"Bug\\u6570\",\"stat\":\"sum\",\"slice\":\"noSlice\",\"showMode\":\"default\",\"monopolize\":\"0\",\"showTotal\":\"noShow\"},{\"field\":\"\\u6709\\u6548Bug\\u6570\",\"stat\":\"sum\",\"slice\":\"noSlice\",\"showMode\":\"default\",\"monopolize\":\"0\",\"showTotal\":\"noShow\"},{\"field\":\"\\u4f18\\u5148\\u7ea7\\u4e3a1\\uff0c2\\u7684Bug\\u6570\",\"stat\":\"sum\",\"slice\":\"noSlice\",\"showMode\":\"default\",\"monopolize\":\"0\",\"showTotal\":\"noShow\"},{\"field\":\"Bug\\u5bc6\\u5ea6\",\"stat\":\"sum\",\"slice\":\"noSlice\",\"showMode\":\"default\",\"monopolize\":\"0\",\"showTotal\":\"noShow\"},{\"field\":\"\\u4fee\\u590dBug\\u6570\",\"stat\":\"sum\",\"slice\":\"noSlice\",\"showMode\":\"default\",\"monopolize\":\"0\",\"showTotal\":\"noShow\"},{\"field\":\"Bug\\u4fee\\u590d\\u7387\",\"stat\":\"sum\",\"slice\":\"noSlice\",\"showMode\":\"default\",\"monopolize\":\"0\",\"showTotal\":\"noShow\"}],\"columnTotal\":\"noShow\",\"group1\":\"\\u4e00\\u7ea7\\u9879\\u76ee\\u96c6\",\"group3\":\"\\u4ea7\\u54c1\\u7ebf\",\"group2\":\"\\u4ea7\\u54c1\",\"lastStep\":\"4\"}','[]',0,'published','1','admin','2023-04-06 13:16:52','admin','2023-04-06 13:16:52','0', ''); REPLACE INTO `zt_grouppriv` (`group`, `module`, `method`) SELECT `group`, 'projectbuild', 'browse' FROM `zt_grouppriv` WHERE `module` = 'project' AND `method` = 'build'; diff --git a/module/bug/config/form.php b/module/bug/config/form.php new file mode 100644 index 0000000000..c7bd406bac --- /dev/null +++ b/module/bug/config/form.php @@ -0,0 +1,38 @@ +bug->createform = array(); +$config->bug->createform['title'] = array('required' => true, 'type' => 'string', 'filter' => 'trim'); +$config->bug->createform['openedBuild'] = array('required' => true, 'type' => 'array', 'filter' => 'join'); + +$config->bug->createform['product'] = array('required' => false, 'type' => 'int', 'default' => 0); +$config->bug->createform['branch'] = array('required' => false, 'type' => 'int', 'default' => 0); +$config->bug->createform['module'] = array('required' => false, 'type' => 'int', 'default' => 0); +$config->bug->createform['project'] = array('required' => false, 'type' => 'int', 'default' => 0); +$config->bug->createform['execution'] = array('required' => false, 'type' => 'int', 'default' => 0); +$config->bug->createform['assignedTo'] = array('required' => false, 'type' => 'string', 'default' => ''); +$config->bug->createform['deadline'] = array('required' => false, 'type' => 'date', 'default' => ''); +$config->bug->createform['feedbackBy'] = array('required' => false, 'type' => 'string', 'default' => ''); +$config->bug->createform['notifyEmail'] = array('required' => false, 'type' => 'string', 'default' => ''); +$config->bug->createform['type'] = array('required' => false, 'type' => 'string', 'default' => ''); + +$config->bug->createform['os'] = array('required' => false, 'type' => 'array', 'default' => array(''), 'filter' => 'join'); +$config->bug->createform['browser'] = array('required' => false, 'type' => 'array', 'default' => array(''), 'filter' => 'join'); +$config->bug->createform['color'] = array('required' => false, 'type' => 'string', 'default' => ''); +$config->bug->createform['severity'] = array('required' => false, 'type' => 'int', 'default' => 3); +$config->bug->createform['pri'] = array('required' => false, 'type' => 'int', 'default' => 3); +$config->bug->createform['steps'] = array('required' => false, 'type' => 'string', 'default' => '

[步骤]


[结果]


[期望]


'); + +$config->bug->createform['story'] = array('required' => false, 'type' => 'int', 'default' => 0); +$config->bug->createform['task'] = array('required' => false, 'type' => 'int', 'default' => 0); +$config->bug->createform['oldTaskID'] = array('required' => false, 'type' => 'int', 'default' => 0); +$config->bug->createform['case'] = array('required' => false, 'type' => 'int', 'default' => 0); +$config->bug->createform['caseVersion'] = array('required' => false, 'type' => 'int', 'default' => 0); +$config->bug->createform['result'] = array('required' => false, 'type' => 'int', 'default' => 0); +$config->bug->createform['testtask'] = array('required' => false, 'type' => 'int', 'default' => 0); + +$config->bug->createform['mailto'] = array('required' => false, 'type' => 'array', 'default' => array(''), 'filter' => 'join'); +$config->bug->createform['keywords'] = array('required' => false, 'type' => 'string', 'default' => ''); +$config->bug->createform['status'] = array('required' => false, 'type' => 'string', 'default' => 'active'); +$config->bug->createform['issueKey'] = array('required' => false, 'type' => 'string', 'default' => ''); +$config->bug->createform['uid'] = array('required' => false, 'type' => 'string', 'default' => ''); diff --git a/module/bug/zen.php b/module/bug/zen.php new file mode 100644 index 0000000000..45be7a8c42 --- /dev/null +++ b/module/bug/zen.php @@ -0,0 +1,103 @@ +setDefault('openedBy', $this->app->user->account) + ->setDefault('openedDate', $now) + ->setIF($this->lang->navGroup->bug != 'qa', 'project', $this->session->project) + ->setIF($this->post->assignedTo != '', 'assignedDate', $now) + ->setIF($this->post->story != false, 'storyVersion', $this->loadModel('story')->getVersion($this->post->story)) + ->setIF(strpos($this->config->bug->create->requiredFields, 'deadline') !== false, 'deadline', $this->post->deadline) + ->setIF(strpos($this->config->bug->create->requiredFields, 'execution') !== false, 'execution', $this->post->execution) + ->stripTags($this->config->bug->editor->create['id'], $this->config->allowedTags) + ->cleanInt('product,execution,module,severity') + ->remove('files,labels,uid,oldTaskID,contactListMenu,region,lane,ticket,deleteFiles,resultFiles') + ->get(); + + $bug = $this->loadModel('file')->processImgURL($bug, $this->config->bug->editor->create['id'], $formData->rawdata->uid); + + return $bug; + } + + /** + * 创建bug。 + * Create a bug. + * + * @param object $bug + * @access protected + * @return array|false + */ + protected function doCreate(object $bug): array|bool + { + /* Check repeat bug. */ + $result = $this->loadModel('common')->removeDuplicate('bug', $bug, "product={$bug->product}"); + if($result and $result['stop']) return array('status' => 'exists', 'id' => $result['duplicate']); + + return $this->bug->create($bug); + } + + /** + * 创建bug后数据处理 + * Do thing after create a bug. + * + * @param object $bug + * @param object $formData + * @param string $extra + * @return void + */ + protected function afterCreate(object $bug, object $formData, string $extras): void + { + $extras = str_replace(array(',', ' '), array('&', ''), $extras); + parse_str($extras, $output); + $from = isset($output['from']) ? $output['from'] : ''; + + if(isset($formData->rawdata['resultFiles'])) + { + $resultFiles = $formData->rawdata['resultFiles']; + if(isset($formData->rawdata['deleteFiles'])) + { + foreach($formData->rawdata['deleteFiles'] as $deletedCaseFileID) $resultFiles = trim(str_replace(",$deletedCaseFileID,", ',', ",$resultFiles,"), ','); + } + $files = $this->dao->select('*')->from(TABLE_FILE)->where('id')->in($resultFiles)->fetchAll('id'); + foreach($files as $file) + { + unset($file->id); + $file->objectType = 'bug'; + $file->objectID = $bugID; + $this->dao->insert(TABLE_FILE)->data($file)->exec(); + } + } + + $this->file->updateObjectID($formData->rawdata->uid, $bugID, 'bug'); + $this->file->saveUpload('bug', $bugID); + empty($bug->case) ? $this->loadModel('score')->create('bug', 'create', $bugID) : $this->loadModel('score')->create('bug', 'createFormCase', $bug->case); + + if($bug->execution) + { + $this->loadModel('kanban'); + + $laneID = isset($output['laneID']) ? $output['laneID'] : 0; + if(!empty($formData->rawdata['lane'])) $laneID = $formData->rawdata['lane']; + + $columnID = $this->kanban->getColumnIDByLaneID($laneID, 'unconfirmed'); + if(empty($columnID)) $columnID = isset($output['columnID']) ? $output['columnID'] : 0; + + if(!empty($laneID) and !empty($columnID)) $this->kanban->addKanbanCell($bug->execution, $laneID, $columnID, 'bug', $bugID); + if(empty($laneID) or empty($columnID)) $this->kanban->updateLane($bug->execution, 'bug'); + } + + /* Callback the callable method to process the related data for object that is transfered to bug. */ + if($from && is_callable(array($this, $this->config->bug->fromObjects[$from]['callback']))) call_user_func(array($this, $this->config->bug->fromObjects[$from]['callback']), $bugID); + } + +} diff --git a/module/group/model.php b/module/group/model.php index f77beb7e91..9729bade76 100644 --- a/module/group/model.php +++ b/module/group/model.php @@ -2159,6 +2159,7 @@ class groupModel extends model { $key = "{$module}-{$method}"; $priv = new stdclass(); + $priv->id = $key; $priv->module = $module; $priv->method = $method; $priv->action = $key; @@ -2181,6 +2182,7 @@ class groupModel extends model $key = "{$module}-{$method}"; $priv = new stdclass(); + $priv->id = $key; $priv->module = $module; $priv->method = $method; $priv->action = $key; diff --git a/module/screen/model.php b/module/screen/model.php index 4b211cb96d..43ba7c0dfd 100644 --- a/module/screen/model.php +++ b/module/screen/model.php @@ -159,7 +159,7 @@ class screenModel extends model } } - foreach($scheme->componentList as $component) + foreach($scheme->componentList as $index => $component) { if(!empty($component->isGroup)) { @@ -168,10 +168,14 @@ class screenModel extends model $groupComponent = $this->getLatestChart($groupComponent); } } - else + else if($component) { $component = $this->getLatestChart($component); } + else + { + unset($scheme->componentList[$index]); + } } return $scheme; diff --git a/module/upgrade/model.php b/module/upgrade/model.php index 41c7d8634e..401520f1d6 100644 --- a/module/upgrade/model.php +++ b/module/upgrade/model.php @@ -8209,11 +8209,21 @@ class upgradeModel extends model $pivots = $this->dao->select('*')->from(TABLE_PIVOT)->fetchAll('id'); foreach($pivots as $pivotID => $pivot) { - if(is_numeric($pivot->group)) continue; + $modules = explode(',', $pivot->group); + + /* Upgrade group only pivot written by sql, group is string (possibly use , separated). */ + $continue = false; + foreach($modules as $module) + { + if(is_numeric($module)) $continue = true; + } + if($continue) continue; $insertGroup = array(); - $modules = explode(',', $pivot->group); - foreach($modules as $module) $insertGroup[] = $pivotModules[$module]; + foreach($modules as $module) + { + if($module) $insertGroup[] = $pivotModules[$module]; + } $this->dao->update(TABLE_PIVOT)->set('`group`')->eq(implode(',', $insertGroup))->where('id')->eq($pivotID)->exec(); } @@ -8437,6 +8447,9 @@ class upgradeModel extends model $screen->createdDate = $dashboard->createdDate; $this->dao->insert(TABLE_SCREEN)->data($screen)->exec(); } + + $this->dao->exec("ALTER TABLE " . TABLE_CHART . " DROP `dataset`"); + $this->dao->exec("ALTER TABLE " . TABLE_PIVOT . " DROP `dataset`"); } /** @@ -8861,8 +8874,6 @@ class upgradeModel extends model if(dao::isError()) return false; - $this->dao->exec("ALTER TABLE " . TABLE_CHART . " DROP `dataset`"); - return !dao::isError(); } @@ -8887,6 +8898,7 @@ class upgradeModel extends model $pivot->sql = $table->sql; $pivot->createdBy = $table->createdBy; $pivot->createdDate = $table->createdDate; + $pivot->dataset = $table->dataset; $name = array(); $name['zh-cn'] = $table->name;