From e8df269c7cb033e65e2173b3e816d2734728911b Mon Sep 17 00:00:00 2001 From: seagull <24163551@qq.com> Date: Wed, 15 Nov 2017 17:31:56 +0800 Subject: [PATCH] update .gitignore --- .classpath | 66 +- .gitignore | 1 + .project | 70 +- .settings/.jsdtscope | 26 +- .settings/org.eclipse.core.resources.prefs | 18 +- .settings/org.eclipse.jdt.core.prefs | 26 +- .settings/org.eclipse.m2e.core.prefs | 8 +- .settings/org.eclipse.m2e.wtp.prefs | 4 +- .settings/org.eclipse.wst.common.component | 20 +- ....eclipse.wst.common.project.facet.core.xml | 16 +- .settings/org.eclipse.wst.validation.prefs | 4 +- README.md | 146 +- .../V1.0初始化.sql | 900 +- .../V1.1初始化.sql | 912 +- .../V2.0 初始化 .sql | 1080 +- .../V2.1 初始化.sql | 1092 +- .../V2.2 初始化 .sql | 1378 +- .../V2.3 初始化.sql | 1410 +- .../V2.4 初始化 .sql | 708 + .../V1.0 upgrade V1.1/V1.1.sql | 16 +- .../V1.1 upgrade V2.0/V2.0.sql | 174 +- .../V2.0 upgrade V2.1/V2.1.sql | 12 +- .../V2.1 upgrade V2.2/V2.2.sql | 290 +- .../V2.2 upgrade V2.3/V2.3.sql | 40 +- .../V2.3 upgrade V2.4/V2.4.sql | 4 + pom.xml | 728 +- .../luckyweb/seagull/comm/QueueListener.java | 164 +- .../luckyweb/seagull/quartz/QuartzJob.java | 484 +- .../seagull/quartz/QuartzManager.java | 452 +- .../seagull/quartz/QuratzJobDataMgr.java | 88 +- .../seagull/spring/dao/AccidentDao.java | 96 +- .../seagull/spring/dao/AccidentDaoImpl.java | 408 +- .../seagull/spring/dao/FlowCheckDao.java | 106 +- .../seagull/spring/dao/FlowCheckDaoImpl.java | 528 +- .../seagull/spring/dao/FlowInfoDao.java | 50 +- .../seagull/spring/dao/FlowInfoDaoImpl.java | 150 +- .../seagull/spring/dao/OperationLogDao.java | 44 +- .../spring/dao/OperationLogDaoImpl.java | 230 +- .../seagull/spring/dao/PlanFlowCheckDao.java | 52 +- .../spring/dao/PlanFlowCheckDaoImpl.java | 236 +- .../seagull/spring/dao/ProjectCaseDao.java | 98 +- .../spring/dao/ProjectCaseDaoImpl.java | 440 +- .../spring/dao/ProjectCasestepsDao.java | 96 +- .../spring/dao/ProjectCasestepsDaoImpl.java | 394 +- .../seagull/spring/dao/ProjectModuleDao.java | 90 +- .../spring/dao/ProjectModuleDaoImpl.java | 400 +- .../spring/dao/ProjectPlanCaseDao.java | 98 +- .../spring/dao/ProjectPlanCaseDaoImpl.java | 410 +- .../seagull/spring/dao/ProjectPlanDao.java | 98 +- .../spring/dao/ProjectPlanDaoImpl.java | 392 +- .../dao/ProjectProtocolTemplateDao.java | 46 +- .../dao/ProjectProtocolTemplateImpl.java | 294 +- .../spring/dao/ProjectTemplateParamsDao.java | 48 +- .../spring/dao/ProjectTemplateParamsImpl.java | 278 +- .../seagull/spring/dao/ProjectVersionDao.java | 102 +- .../spring/dao/ProjectVersionDaoImpl.java | 478 +- .../seagull/spring/dao/ReviewDao.java | 54 +- .../seagull/spring/dao/ReviewDaoImpl.java | 284 +- .../seagull/spring/dao/ReviewInfoDao.java | 58 +- .../seagull/spring/dao/ReviewInfoDaoImpl.java | 258 +- .../spring/dao/SecondarySectorDao.java | 84 +- .../spring/dao/SecondarySectorDaoImpl.java | 308 +- .../seagull/spring/dao/SectorProjectsDao.java | 90 +- .../spring/dao/SectorProjectsDaoImpl.java | 428 +- .../spring/dao/TempCasestepDebugDao.java | 48 +- .../spring/dao/TempCasestepDebugImpl.java | 278 +- .../seagull/spring/dao/TestCasedetailDao.java | 54 +- .../spring/dao/TestCasedetailDaoImpl.java | 290 +- .../seagull/spring/dao/TestClientDao.java | 52 +- .../seagull/spring/dao/TestClientDaoImpl.java | 312 +- .../seagull/spring/dao/TestJobsDao.java | 90 +- .../seagull/spring/dao/TestJobsDaoImpl.java | 702 +- .../seagull/spring/dao/TestLogdetailDao.java | 50 +- .../spring/dao/TestLogdetailDaoImpl.java | 232 +- .../seagull/spring/dao/TestTastExcuteDao.java | 68 +- .../spring/dao/TestTastExcuteDaoImpl.java | 462 +- .../seagull/spring/dao/UserAuthorityDao.java | 34 +- .../spring/dao/UserAuthorityDaoImpl.java | 96 +- .../seagull/spring/dao/UserInfoDao.java | 52 +- .../seagull/spring/dao/UserInfoDaoImpl.java | 310 +- .../seagull/spring/dao/UserRoleDao.java | 40 +- .../seagull/spring/dao/UserRoleDaoImpl.java | 138 +- .../seagull/spring/dao/ZtTaskDao.java | 52 +- .../seagull/spring/dao/ZtTaskDaoImpl.java | 308 +- .../seagull/spring/entity/Accident.java | 396 +- .../seagull/spring/entity/Barchart3.java | 92 +- .../seagull/spring/entity/Barchart4.java | 94 +- .../seagull/spring/entity/FlowCheck.java | 252 +- .../seagull/spring/entity/FlowInfo.java | 140 +- .../seagull/spring/entity/OperationLog.java | 170 +- .../seagull/spring/entity/PieLasagna.java | 50 +- .../seagull/spring/entity/Piechart5.java | 42 +- .../seagull/spring/entity/PlanFlowCheck.java | 154 +- .../seagull/spring/entity/ProjectCase.java | 240 +- .../spring/entity/ProjectCasesteps.java | 208 +- .../seagull/spring/entity/ProjectModule.java | 96 +- .../spring/entity/ProjectModuleJson.java | 66 +- .../seagull/spring/entity/ProjectPlan.java | 138 +- .../spring/entity/ProjectPlanCase.java | 84 +- .../entity/ProjectProtocolTemplate.java | 170 +- .../spring/entity/ProjectTemplateParams.java | 82 +- .../seagull/spring/entity/ProjectVersion.java | 736 +- .../seagull/spring/entity/Review.java | 236 +- .../seagull/spring/entity/ReviewInfo.java | 254 +- .../spring/entity/SecondarySector.java | 70 +- .../seagull/spring/entity/SectorProjects.java | 138 +- .../spring/entity/TempCasestepDebug.java | 98 +- .../seagull/spring/entity/TestCasedetail.java | 320 +- .../seagull/spring/entity/TestClient.java | 152 +- .../seagull/spring/entity/TestJobs.java | 690 +- .../seagull/spring/entity/TestLogdetail.java | 244 +- .../seagull/spring/entity/TestTaskexcute.java | 400 +- .../seagull/spring/entity/UserAuthority.java | 82 +- .../seagull/spring/entity/UserInfo.java | 170 +- .../seagull/spring/entity/UserRole.java | 86 +- .../seagull/spring/entity/ZtTask.java | 212 +- .../spring/mvc/AccidentController.java | 1274 +- .../spring/mvc/AutoTestChartController.java | 216 +- .../spring/mvc/CasedetailController.java | 558 +- .../spring/mvc/FlowCheckController.java | 2072 +- .../spring/mvc/LogdetailController.java | 468 +- .../spring/mvc/OperationLogController.java | 242 +- .../spring/mvc/PlanFlowCheckController.java | 1270 +- .../spring/mvc/ProjectCaseController.java | 1436 +- .../mvc/ProjectCasestepsController.java | 1124 +- .../spring/mvc/ProjectPlanCaseController.java | 860 +- .../spring/mvc/ProjectPlanController.java | 688 +- .../ProjectProtocolTemplateController.java | 828 +- .../mvc/ProjectTemplateParamsController.java | 472 +- .../spring/mvc/ProjectVersionController.java | 2826 +-- .../seagull/spring/mvc/ReviewController.java | 560 +- .../spring/mvc/ReviewInfoController.java | 830 +- .../spring/mvc/SecondarySectorController.java | 430 +- .../spring/mvc/SectorProjectsController.java | 692 +- .../spring/mvc/TastExcuteController.java | 584 +- .../spring/mvc/TestClientController.java | 670 +- .../spring/mvc/TestJobsController.java | 2254 +-- .../spring/mvc/UserInfoController.java | 1840 +- .../spring/mvc/UserLoginController.java | 518 +- .../seagull/spring/mvc/ZentaoController.java | 524 +- .../spring/service/AccidentService.java | 38 +- .../spring/service/AccidentServiceImpl.java | 248 +- .../spring/service/CaseDetailService.java | 50 +- .../spring/service/CaseDetailServiceImpl.java | 240 +- .../spring/service/FlowCheckService.java | 102 +- .../spring/service/FlowCheckServiceImpl.java | 412 +- .../spring/service/FlowInfoService.java | 64 +- .../spring/service/FlowInfoServiceImpl.java | 130 +- .../spring/service/LogDetailService.java | 44 +- .../spring/service/LogDetailServiceImpl.java | 176 +- .../spring/service/LogServiceImpl.java | 80 +- .../spring/service/OperationLogService.java | 40 +- .../service/OperationLogServiceImpl.java | 200 +- .../spring/service/PlanFlowCheckService.java | 44 +- .../service/PlanFlowCheckServiceImpl.java | 172 +- .../spring/service/ProjectCaseService.java | 40 +- .../service/ProjectCaseServiceImpl.java | 198 +- .../service/ProjectCasestepsService.java | 34 +- .../service/ProjectCasestepsServiceImpl.java | 118 +- .../spring/service/ProjectModuleService.java | 46 +- .../service/ProjectModuleServiceImpl.java | 292 +- .../service/ProjectPlanCaseService.java | 42 +- .../service/ProjectPlanCaseServiceImpl.java | 186 +- .../spring/service/ProjectPlanService.java | 40 +- .../service/ProjectPlanServiceImpl.java | 184 +- .../service/ProjectProtocolTemplateImpl.java | 212 +- .../ProjectProtocolTemplateService.java | 42 +- .../service/ProjectTemplateParamsImpl.java | 184 +- .../service/ProjectTemplateParamsService.java | 42 +- .../service/ProjectVersionServiceImpl.java | 354 +- .../service/ProjectsVersionService.java | 98 +- .../spring/service/ReviewInfoService.java | 46 +- .../spring/service/ReviewInfoServiceImpl.java | 170 +- .../seagull/spring/service/ReviewService.java | 38 +- .../spring/service/ReviewServiceImpl.java | 194 +- .../service/SecondarySectorService.java | 76 +- .../service/SecondarySectorServiceImpl.java | 242 +- .../spring/service/SectorProjectsService.java | 90 +- .../service/SectorProjectsServiceImpl.java | 316 +- .../spring/service/TempCasestepDebugImpl.java | 190 +- .../service/TempCasestepDebugService.java | 42 +- .../spring/service/TestClientService.java | 50 +- .../spring/service/TestClientServiceImpl.java | 206 +- .../spring/service/TestJobsService.java | 80 +- .../spring/service/TestJobsServiceImpl.java | 412 +- .../spring/service/TestTastExcuteService.java | 62 +- .../service/TestTastExcuteServiceImpl.java | 306 +- .../spring/service/UserAuthorityService.java | 32 +- .../service/UserAuthorityServiceImpl.java | 74 +- .../spring/service/UserInfoService.java | 52 +- .../spring/service/UserInfoServiceImpl.java | 212 +- .../spring/service/UserRoleService.java | 40 +- .../spring/service/UserRoleServiceImpl.java | 110 +- .../seagull/spring/service/ZtTaskService.java | 54 +- .../spring/service/ZtTaskServiceImpl.java | 230 +- .../java/luckyweb/seagull/util/DateLib.java | 398 +- .../java/luckyweb/seagull/util/DateUtil.java | 466 +- .../java/luckyweb/seagull/util/Endecrypt.java | 562 +- .../util/HibernateSessionFactoryUtil.java | 116 +- .../java/luckyweb/seagull/util/MysqlLib.java | 180 +- .../java/luckyweb/seagull/util/StrLib.java | 570 +- .../luckyweb/seagull/util/StringUtility.java | 1952 +- .../seagull/util/TestJobsException.java | 64 +- .../java/rmi/model/RunBatchCaseEntity.java | 68 +- src/main/java/rmi/model/RunCaseEntity.java | 82 +- src/main/java/rmi/model/RunTaskEntity.java | 54 +- src/main/java/rmi/service/RunService.java | 40 +- src/main/resources/Accident.hbm.xml | 144 +- src/main/resources/FlowCheck.hbm.xml | 96 +- src/main/resources/FlowInfo.hbm.xml | 64 +- src/main/resources/OperationLog.hbm.xml | 58 +- src/main/resources/PlanFlowCheck.hbm.xml | 54 +- src/main/resources/ProjectCase.hbm.xml | 78 +- src/main/resources/ProjectCasesteps.hbm.xml | 96 +- src/main/resources/ProjectModule.hbm.xml | 42 +- src/main/resources/ProjectPlan.hbm.xml | 60 +- src/main/resources/ProjectPlanCase.hbm.xml | 42 +- .../resources/ProjectProtocolTemplate.hbm.xml | 70 +- .../resources/ProjectTemplateParams.hbm.xml | 40 +- src/main/resources/ProjectVersion.hbm.xml | 288 +- src/main/resources/Review.hbm.xml | 90 +- src/main/resources/ReviewInfo.hbm.xml | 60 +- src/main/resources/SecondarySector.hbm.xml | 36 +- src/main/resources/SectorProjects.hbm.xml | 54 +- src/main/resources/TempCasestepDebug.hbm.xml | 46 +- src/main/resources/TestCasedetail.hbm.xml | 60 +- src/main/resources/TestClient.hbm.xml | 64 +- src/main/resources/TestJobs.hbm.xml | 216 +- src/main/resources/TestLogdetail.hbm.xml | 76 +- src/main/resources/TestTaskexcute.hbm.xml | 90 +- src/main/resources/UserAuthority.hbm.xml | 40 +- src/main/resources/UserInfo.hbm.xml | 58 +- src/main/resources/UserRole.hbm.xml | 40 +- src/main/resources/ZtTask.hbm.xml | 80 +- src/main/resources/applicationContext.xml | 116 +- src/main/resources/hibernate.cfg.xml | 74 - src/main/resources/log4j.xml | 114 +- src/main/webapp/META-INF/MANIFEST.MF | 6 +- src/main/webapp/WEB-INF/web.xml | 142 +- src/main/webapp/css/login.css | 876 +- src/main/webapp/css/style.css | 366 +- src/main/webapp/down.jsp | 6 +- src/main/webapp/error.jsp | 102 +- src/main/webapp/error/404.jsp | 22 +- src/main/webapp/error/500.jsp | 24 +- src/main/webapp/error/error.jsp | 26 +- src/main/webapp/footer.jsp | 98 +- src/main/webapp/head.jsp | 322 +- src/main/webapp/index.jsp | 246 +- .../webapp/js/My97DatePicker/WdatePicker.js | 974 +- src/main/webapp/js/My97DatePicker/calendar.js | 8 +- src/main/webapp/js/My97DatePicker/lang/en.js | 26 +- .../webapp/js/My97DatePicker/lang/zh-cn.js | 26 +- .../webapp/js/My97DatePicker/lang/zh-tw.js | 26 +- .../js/My97DatePicker/skin/WdatePicker.css | 18 +- .../skin/default/datepicker.css | 490 +- .../skin/whyGreen/datepicker.css | 510 +- .../js/My97DatePicker/开发包/lang/en.js | 26 +- .../js/My97DatePicker/开发包/lang/zh-cn.js | 26 +- .../js/My97DatePicker/开发包/lang/zh-tw.js | 26 +- .../js/My97DatePicker/开发包/readme.txt | 6 +- .../开发包/skin/WdatePicker.css | 18 +- .../开发包/skin/default/datepicker.css | 532 +- .../开发包/skin/whyGreen/datepicker.css | 552 +- src/main/webapp/js/easyui/changelog.txt | 912 +- .../demo-mobile/accordion/_content.html | 34 +- .../demo-mobile/datagrid/rowediting.html | 206 +- .../js/easyui/demo-mobile/dialog/basic.html | 90 +- .../js/easyui/demo-mobile/dialog/message.html | 80 +- .../js/easyui/demo-mobile/form/basic.html | 106 +- .../js/easyui/demo-mobile/layout/basic.html | 62 +- .../js/easyui/demo-mobile/menu/basic.html | 76 +- .../js/easyui/demo-mobile/menu/menubar.html | 88 +- .../js/easyui/demo-mobile/panel/_content.html | 34 +- .../js/easyui/demo-mobile/panel/nav.html | 76 +- .../js/easyui/demo-mobile/toolbar/basic.html | 124 +- .../js/easyui/demo-mobile/toolbar/button.html | 88 +- .../js/easyui/demo-mobile/toolbar/menu.html | 150 +- .../js/easyui/demo-mobile/tree/basic.html | 110 +- .../js/easyui/demo-mobile/tree/dnd.html | 110 +- .../js/easyui/demo/accordion/_content.html | 34 +- .../js/easyui/demo/accordion/actions.html | 100 +- .../webapp/js/easyui/demo/accordion/ajax.html | 54 +- .../js/easyui/demo/accordion/basic.html | 102 +- .../easyui/demo/accordion/datagrid_data1.json | 24 +- .../js/easyui/demo/accordion/expandable.html | 64 +- .../js/easyui/demo/accordion/fluid.html | 64 +- .../js/easyui/demo/accordion/multiple.html | 66 +- .../js/easyui/demo/accordion/tools.html | 94 +- .../webapp/js/easyui/demo/calendar/basic.html | 36 +- .../js/easyui/demo/calendar/custom.html | 90 +- .../js/easyui/demo/calendar/disabledate.html | 54 +- .../js/easyui/demo/calendar/firstday.html | 58 +- .../webapp/js/easyui/demo/calendar/fluid.html | 44 +- .../js/easyui/demo/combo/animation.html | 72 +- .../webapp/js/easyui/demo/combo/basic.html | 82 +- .../js/easyui/demo/combobox/actions.html | 170 +- .../webapp/js/easyui/demo/combobox/basic.html | 140 +- .../easyui/demo/combobox/combobox_data1.json | 42 +- .../easyui/demo/combobox/combobox_data2.json | 92 +- .../js/easyui/demo/combobox/customformat.html | 64 +- .../js/easyui/demo/combobox/dynamicdata.html | 44 +- .../webapp/js/easyui/demo/combobox/fluid.html | 70 +- .../webapp/js/easyui/demo/combobox/group.html | 50 +- .../webapp/js/easyui/demo/combobox/icons.html | 62 +- .../js/easyui/demo/combobox/multiline.html | 140 +- .../js/easyui/demo/combobox/multiple.html | 56 +- .../js/easyui/demo/combobox/navigation.html | 144 +- .../js/easyui/demo/combobox/remotedata.html | 52 +- .../js/easyui/demo/combobox/remotejsonp.html | 94 +- .../js/easyui/demo/combogrid/actions.html | 104 +- .../js/easyui/demo/combogrid/basic.html | 66 +- .../easyui/demo/combogrid/datagrid_data1.json | 24 +- .../js/easyui/demo/combogrid/fluid.html | 106 +- .../js/easyui/demo/combogrid/initvalue.html | 64 +- .../js/easyui/demo/combogrid/multiple.html | 72 +- .../js/easyui/demo/combogrid/navigation.html | 74 +- .../js/easyui/demo/combotree/actions.html | 76 +- .../js/easyui/demo/combotree/basic.html | 36 +- .../js/easyui/demo/combotree/fluid.html | 42 +- .../js/easyui/demo/combotree/initvalue.html | 36 +- .../js/easyui/demo/combotree/multiple.html | 42 +- .../js/easyui/demo/combotree/tree_data1.json | 98 +- .../js/easyui/demo/datagrid/aligncolumns.html | 62 +- .../webapp/js/easyui/demo/datagrid/basic.html | 62 +- .../js/easyui/demo/datagrid/cacheeditor.html | 296 +- .../js/easyui/demo/datagrid/cellediting.html | 186 +- .../js/easyui/demo/datagrid/cellstyle.html | 82 +- .../js/easyui/demo/datagrid/checkbox.html | 82 +- .../demo/datagrid/clientpagination.html | 240 +- .../js/easyui/demo/datagrid/columngroup.html | 66 +- .../easyui/demo/datagrid/complextoolbar.html | 98 +- .../js/easyui/demo/datagrid/contextmenu.html | 160 +- .../js/easyui/demo/datagrid/custompager.html | 104 +- .../easyui/demo/datagrid/datagrid_data1.json | 24 +- .../easyui/demo/datagrid/datagrid_data2.json | 30 +- .../webapp/js/easyui/demo/datagrid/fluid.html | 62 +- .../js/easyui/demo/datagrid/footer.html | 74 +- .../easyui/demo/datagrid/formatcolumns.html | 76 +- .../easyui/demo/datagrid/frozencolumns.html | 68 +- .../js/easyui/demo/datagrid/frozenrows.html | 86 +- .../js/easyui/demo/datagrid/mergecells.html | 114 +- .../js/easyui/demo/datagrid/multisorting.html | 72 +- .../js/easyui/demo/datagrid/products.json | 18 +- .../js/easyui/demo/datagrid/rowborder.html | 118 +- .../js/easyui/demo/datagrid/rowediting.html | 226 +- .../js/easyui/demo/datagrid/rowstyle.html | 80 +- .../js/easyui/demo/datagrid/selection.html | 112 +- .../easyui/demo/datagrid/simpletoolbar.html | 88 +- .../js/easyui/demo/datagrid/transform.html | 90 +- .../webapp/js/easyui/demo/datebox/basic.html | 34 +- .../js/easyui/demo/datebox/buttons.html | 54 +- .../webapp/js/easyui/demo/datebox/clone.html | 52 +- .../js/easyui/demo/datebox/dateformat.html | 76 +- .../webapp/js/easyui/demo/datebox/events.html | 52 +- .../webapp/js/easyui/demo/datebox/fluid.html | 40 +- .../js/easyui/demo/datebox/restrict.html | 58 +- .../js/easyui/demo/datebox/validate.html | 58 +- .../js/easyui/demo/datetimebox/basic.html | 34 +- .../js/easyui/demo/datetimebox/fluid.html | 40 +- .../js/easyui/demo/datetimebox/initvalue.html | 36 +- .../easyui/demo/datetimebox/showseconds.html | 42 +- src/main/webapp/js/easyui/demo/demo.css | 42 +- .../webapp/js/easyui/demo/dialog/basic.html | 44 +- .../js/easyui/demo/dialog/complextoolbar.html | 90 +- .../webapp/js/easyui/demo/dialog/fluid.html | 46 +- .../js/easyui/demo/dialog/toolbarbuttons.html | 102 +- .../js/easyui/demo/draggable/basic.html | 40 +- .../js/easyui/demo/draggable/constrain.html | 68 +- .../webapp/js/easyui/demo/draggable/snap.html | 72 +- .../js/easyui/demo/droppable/accept.html | 154 +- .../js/easyui/demo/droppable/basic.html | 152 +- .../webapp/js/easyui/demo/droppable/sort.html | 140 +- .../js/easyui/demo/easyloader/basic.html | 148 +- .../webapp/js/easyui/demo/form/basic.html | 116 +- .../js/easyui/demo/form/form_data1.json | 12 +- src/main/webapp/js/easyui/demo/form/load.html | 134 +- .../js/easyui/demo/form/validateonsubmit.html | 124 +- .../js/easyui/demo/layout/_content.html | 34 +- .../js/easyui/demo/layout/addremove.html | 104 +- .../js/easyui/demo/layout/autoheight.html | 116 +- .../webapp/js/easyui/demo/layout/basic.html | 76 +- .../webapp/js/easyui/demo/layout/complex.html | 112 +- .../js/easyui/demo/layout/datagrid_data1.json | 24 +- .../webapp/js/easyui/demo/layout/fluid.html | 46 +- .../webapp/js/easyui/demo/layout/full.html | 36 +- .../js/easyui/demo/layout/nestedlayout.html | 60 +- .../js/easyui/demo/layout/nocollapsible.html | 66 +- .../demo/layout/propertygrid_data1.json | 38 +- .../js/easyui/demo/layout/tree_data1.json | 98 +- .../js/easyui/demo/linkbutton/basic.html | 64 +- .../js/easyui/demo/linkbutton/fluid.html | 64 +- .../js/easyui/demo/linkbutton/group.html | 64 +- .../js/easyui/demo/linkbutton/iconalign.html | 62 +- .../js/easyui/demo/linkbutton/plain.html | 54 +- .../js/easyui/demo/linkbutton/size.html | 66 +- .../js/easyui/demo/linkbutton/style.html | 60 +- .../js/easyui/demo/linkbutton/toggle.html | 48 +- .../webapp/js/easyui/demo/menu/basic.html | 134 +- .../js/easyui/demo/menu/customitem.html | 108 +- .../webapp/js/easyui/demo/menu/events.html | 78 +- .../webapp/js/easyui/demo/menu/inline.html | 116 +- .../js/easyui/demo/menubutton/actions.html | 114 +- .../js/easyui/demo/menubutton/alignment.html | 136 +- .../js/easyui/demo/menubutton/basic.html | 106 +- .../webapp/js/easyui/demo/messager/alert.html | 78 +- .../webapp/js/easyui/demo/messager/basic.html | 110 +- .../js/easyui/demo/messager/interactive.html | 70 +- .../js/easyui/demo/messager/position.html | 278 +- .../js/easyui/demo/numberbox/basic.html | 46 +- .../js/easyui/demo/numberbox/fluid.html | 46 +- .../js/easyui/demo/numberbox/format.html | 78 +- .../js/easyui/demo/numberbox/range.html | 48 +- .../js/easyui/demo/numberspinner/basic.html | 48 +- .../js/easyui/demo/numberspinner/fluid.html | 40 +- .../easyui/demo/numberspinner/increment.html | 34 +- .../js/easyui/demo/numberspinner/range.html | 34 +- .../js/easyui/demo/pagination/attaching.html | 62 +- .../js/easyui/demo/pagination/basic.html | 38 +- .../easyui/demo/pagination/custombuttons.html | 74 +- .../js/easyui/demo/pagination/layout.html | 122 +- .../js/easyui/demo/pagination/links.html | 44 +- .../js/easyui/demo/pagination/simple.html | 48 +- .../webapp/js/easyui/demo/panel/_content.html | 34 +- .../webapp/js/easyui/demo/panel/basic.html | 60 +- .../js/easyui/demo/panel/customtools.html | 68 +- .../webapp/js/easyui/demo/panel/fluid.html | 40 +- .../webapp/js/easyui/demo/panel/footer.html | 42 +- .../js/easyui/demo/panel/loadcontent.html | 52 +- .../js/easyui/demo/panel/nestedpanel.html | 58 +- .../js/easyui/demo/panel/paneltools.html | 72 +- .../js/easyui/demo/progressbar/basic.html | 58 +- .../js/easyui/demo/progressbar/fluid.html | 40 +- .../js/easyui/demo/propertygrid/basic.html | 120 +- .../demo/propertygrid/customcolumns.html | 60 +- .../easyui/demo/propertygrid/groupformat.html | 58 +- .../demo/propertygrid/propertygrid_data1.json | 38 +- .../js/easyui/demo/resizable/basic.html | 46 +- .../js/easyui/demo/searchbox/basic.html | 44 +- .../js/easyui/demo/searchbox/category.html | 54 +- .../js/easyui/demo/searchbox/fluid.html | 48 +- .../webapp/js/easyui/demo/slider/basic.html | 34 +- .../webapp/js/easyui/demo/slider/fluid.html | 40 +- .../js/easyui/demo/slider/formattip.html | 54 +- .../js/easyui/demo/slider/nonlinear.html | 114 +- .../webapp/js/easyui/demo/slider/range.html | 44 +- .../webapp/js/easyui/demo/slider/rule.html | 40 +- .../js/easyui/demo/slider/vertical.html | 48 +- .../js/easyui/demo/splitbutton/actions.html | 126 +- .../js/easyui/demo/splitbutton/basic.html | 120 +- .../webapp/js/easyui/demo/tabs/_content.html | 34 +- .../js/easyui/demo/tabs/autoheight.html | 70 +- .../webapp/js/easyui/demo/tabs/basic.html | 70 +- .../webapp/js/easyui/demo/tabs/dropdown.html | 108 +- .../js/easyui/demo/tabs/fixedwidth.html | 72 +- .../webapp/js/easyui/demo/tabs/fluid.html | 46 +- .../webapp/js/easyui/demo/tabs/hover.html | 90 +- .../js/easyui/demo/tabs/nestedtabs.html | 106 +- .../js/easyui/demo/tabs/striptools.html | 76 +- .../webapp/js/easyui/demo/tabs/style.html | 100 +- .../webapp/js/easyui/demo/tabs/tabimage.html | 80 +- .../js/easyui/demo/tabs/tabposition.html | 88 +- .../webapp/js/easyui/demo/tabs/tabstools.html | 80 +- .../js/easyui/demo/tabs/tree_data1.json | 98 +- .../js/easyui/demo/timespinner/actions.html | 74 +- .../js/easyui/demo/timespinner/basic.html | 34 +- .../js/easyui/demo/timespinner/fluid.html | 40 +- .../js/easyui/demo/timespinner/range.html | 38 +- .../js/easyui/demo/tooltip/_content.html | 34 +- .../js/easyui/demo/tooltip/_dialog.html | 44 +- .../webapp/js/easyui/demo/tooltip/ajax.html | 62 +- .../webapp/js/easyui/demo/tooltip/basic.html | 38 +- .../js/easyui/demo/tooltip/customcontent.html | 62 +- .../js/easyui/demo/tooltip/customstyle.html | 102 +- .../js/easyui/demo/tooltip/position.html | 66 +- .../js/easyui/demo/tooltip/toolbar.html | 78 +- .../js/easyui/demo/tooltip/tooltipdialog.html | 86 +- .../webapp/js/easyui/demo/tree/actions.html | 92 +- .../webapp/js/easyui/demo/tree/animation.html | 38 +- .../webapp/js/easyui/demo/tree/basic.html | 104 +- .../webapp/js/easyui/demo/tree/checkbox.html | 72 +- .../js/easyui/demo/tree/contextmenu.html | 128 +- src/main/webapp/js/easyui/demo/tree/dnd.html | 38 +- .../webapp/js/easyui/demo/tree/editable.html | 52 +- .../js/easyui/demo/tree/formatting.html | 62 +- .../webapp/js/easyui/demo/tree/icons.html | 38 +- .../webapp/js/easyui/demo/tree/lazyload.html | 162 +- .../webapp/js/easyui/demo/tree/lines.html | 38 +- .../js/easyui/demo/tree/tree_data1.json | 98 +- .../js/easyui/demo/tree/tree_data2.json | 122 +- .../js/easyui/demo/treegrid/actions.html | 126 +- .../webapp/js/easyui/demo/treegrid/basic.html | 66 +- .../demo/treegrid/clientpagination.html | 320 +- .../js/easyui/demo/treegrid/contextmenu.html | 206 +- .../js/easyui/demo/treegrid/editable.html | 184 +- .../webapp/js/easyui/demo/treegrid/fluid.html | 64 +- .../js/easyui/demo/treegrid/footer.html | 108 +- .../webapp/js/easyui/demo/treegrid/lines.html | 68 +- .../js/easyui/demo/treegrid/reports.html | 96 +- .../easyui/demo/treegrid/treegrid_data1.json | 144 +- .../easyui/demo/treegrid/treegrid_data2.json | 22 +- .../easyui/demo/treegrid/treegrid_data3.json | 24 +- .../js/easyui/demo/validatebox/basic.html | 98 +- .../demo/validatebox/customtooltip.html | 188 +- .../demo/validatebox/validateonblur.html | 112 +- .../webapp/js/easyui/demo/window/basic.html | 44 +- .../js/easyui/demo/window/customtools.html | 58 +- .../webapp/js/easyui/demo/window/fluid.html | 46 +- .../webapp/js/easyui/demo/window/footer.html | 46 +- .../js/easyui/demo/window/inlinewindow.html | 50 +- .../js/easyui/demo/window/modalwindow.html | 46 +- .../js/easyui/demo/window/windowlayout.html | 64 +- src/main/webapp/js/easyui/easyloader.js | 18 +- .../webapp/js/easyui/jquery.easyui.min.js | 18 +- .../webapp/js/easyui/jquery.easyui.mobile.js | 18 +- .../webapp/js/easyui/locale/easyui-lang-af.js | 88 +- .../webapp/js/easyui/locale/easyui-lang-am.js | 92 +- .../webapp/js/easyui/locale/easyui-lang-ar.js | 90 +- .../webapp/js/easyui/locale/easyui-lang-bg.js | 88 +- .../webapp/js/easyui/locale/easyui-lang-ca.js | 88 +- .../webapp/js/easyui/locale/easyui-lang-cs.js | 88 +- .../webapp/js/easyui/locale/easyui-lang-cz.js | 88 +- .../webapp/js/easyui/locale/easyui-lang-da.js | 88 +- .../webapp/js/easyui/locale/easyui-lang-de.js | 126 +- .../webapp/js/easyui/locale/easyui-lang-el.js | 90 +- .../webapp/js/easyui/locale/easyui-lang-en.js | 90 +- .../webapp/js/easyui/locale/easyui-lang-es.js | 90 +- .../webapp/js/easyui/locale/easyui-lang-fr.js | 88 +- .../webapp/js/easyui/locale/easyui-lang-jp.js | 90 +- .../webapp/js/easyui/locale/easyui-lang-nl.js | 88 +- .../webapp/js/easyui/locale/easyui-lang-pl.js | 90 +- .../js/easyui/locale/easyui-lang-pt_BR.js | 90 +- .../webapp/js/easyui/locale/easyui-lang-ru.js | 92 +- .../js/easyui/locale/easyui-lang-sv_SE.js | 90 +- .../js/easyui/locale/easyui-lang-zh_CN.js | 132 +- .../js/easyui/locale/easyui-lang-zh_TW.js | 96 +- .../js/easyui/plugins/jquery.accordion.js | 18 +- .../js/easyui/plugins/jquery.calendar.js | 18 +- .../webapp/js/easyui/plugins/jquery.combo.js | 18 +- .../js/easyui/plugins/jquery.combobox.js | 18 +- .../js/easyui/plugins/jquery.combogrid.js | 18 +- .../js/easyui/plugins/jquery.combotree.js | 18 +- .../js/easyui/plugins/jquery.datagrid.js | 18 +- .../js/easyui/plugins/jquery.datalist.js | 18 +- .../js/easyui/plugins/jquery.datebox.js | 18 +- .../js/easyui/plugins/jquery.datetimebox.js | 18 +- .../easyui/plugins/jquery.datetimespinner.js | 18 +- .../webapp/js/easyui/plugins/jquery.dialog.js | 18 +- .../js/easyui/plugins/jquery.draggable.js | 18 +- .../js/easyui/plugins/jquery.droppable.js | 18 +- .../js/easyui/plugins/jquery.filebox.js | 18 +- .../webapp/js/easyui/plugins/jquery.form.js | 18 +- .../webapp/js/easyui/plugins/jquery.layout.js | 18 +- .../js/easyui/plugins/jquery.linkbutton.js | 18 +- .../webapp/js/easyui/plugins/jquery.menu.js | 18 +- .../js/easyui/plugins/jquery.menubutton.js | 18 +- .../js/easyui/plugins/jquery.messager.js | 18 +- .../webapp/js/easyui/plugins/jquery.mobile.js | 18 +- .../js/easyui/plugins/jquery.numberbox.js | 18 +- .../js/easyui/plugins/jquery.numberspinner.js | 18 +- .../js/easyui/plugins/jquery.pagination.js | 18 +- .../webapp/js/easyui/plugins/jquery.panel.js | 18 +- .../webapp/js/easyui/plugins/jquery.parser.js | 18 +- .../js/easyui/plugins/jquery.progressbar.js | 18 +- .../js/easyui/plugins/jquery.propertygrid.js | 18 +- .../js/easyui/plugins/jquery.resizable.js | 18 +- .../js/easyui/plugins/jquery.searchbox.js | 18 +- .../webapp/js/easyui/plugins/jquery.slider.js | 18 +- .../js/easyui/plugins/jquery.spinner.js | 18 +- .../js/easyui/plugins/jquery.splitbutton.js | 18 +- .../webapp/js/easyui/plugins/jquery.tabs.js | 18 +- .../js/easyui/plugins/jquery.textbox.js | 18 +- .../js/easyui/plugins/jquery.timespinner.js | 18 +- .../js/easyui/plugins/jquery.tooltip.js | 18 +- .../webapp/js/easyui/plugins/jquery.tree.js | 18 +- .../js/easyui/plugins/jquery.treegrid.js | 18 +- .../js/easyui/plugins/jquery.validatebox.js | 18 +- .../webapp/js/easyui/plugins/jquery.window.js | 18 +- src/main/webapp/js/easyui/readme.txt | 8 +- src/main/webapp/js/easyui/src/easyloader.js | 850 +- .../webapp/js/easyui/src/jquery.accordion.js | 826 +- .../webapp/js/easyui/src/jquery.calendar.js | 876 +- .../webapp/js/easyui/src/jquery.combobox.js | 1130 +- .../webapp/js/easyui/src/jquery.datebox.js | 570 +- .../webapp/js/easyui/src/jquery.draggable.js | 790 +- .../webapp/js/easyui/src/jquery.droppable.js | 162 +- src/main/webapp/js/easyui/src/jquery.form.js | 742 +- .../webapp/js/easyui/src/jquery.linkbutton.js | 484 +- src/main/webapp/js/easyui/src/jquery.menu.js | 1274 +- .../webapp/js/easyui/src/jquery.parser.js | 712 +- .../js/easyui/src/jquery.progressbar.js | 214 +- .../js/easyui/src/jquery.propertygrid.js | 820 +- .../webapp/js/easyui/src/jquery.resizable.js | 494 +- .../webapp/js/easyui/src/jquery.slider.js | 870 +- src/main/webapp/js/easyui/src/jquery.tabs.js | 1706 +- .../webapp/js/easyui/src/jquery.window.js | 758 +- src/main/webapp/js/easyui/themes/color.css | 224 +- src/main/webapp/js/easyui/themes/icon.css | 192 +- src/main/webapp/js/ichart.1.2.js | 15630 ++++++++-------- src/main/webapp/js/jslib.js | 1234 +- src/main/webapp/jsp/accident/acc_upload.jsp | 148 +- src/main/webapp/jsp/accident/accident.jsp | 1022 +- src/main/webapp/jsp/accident/accident_add.jsp | 656 +- .../webapp/jsp/accident/accident_show.jsp | 460 +- .../webapp/jsp/accident/accident_update.jsp | 634 +- src/main/webapp/jsp/base/operationlog.jsp | 426 +- src/main/webapp/jsp/base/secondarysector.jsp | 776 +- src/main/webapp/jsp/base/sectorprojects.jsp | 976 +- src/main/webapp/jsp/base/testclient.jsp | 944 +- src/main/webapp/jsp/echart/echarts_bar1.jsp | 214 +- src/main/webapp/jsp/echart/echarts_bar3.jsp | 206 +- src/main/webapp/jsp/echart/echarts_bar4.jsp | 220 +- .../webapp/jsp/echart/echarts_lasagna.jsp | 308 +- src/main/webapp/jsp/echart/echarts_line1.jsp | 218 +- src/main/webapp/jsp/echart/echarts_pie5.jsp | 1302 +- src/main/webapp/jsp/flowcheck/flowcheck.jsp | 832 +- .../webapp/jsp/flowcheck/flowcheck_add.jsp | 716 +- .../webapp/jsp/flowcheck/flowcheck_report.jsp | 270 +- .../webapp/jsp/flowcheck/flowcheck_update.jsp | 734 +- .../webapp/jsp/flowcheck/flowcheckinfo.jsp | 1142 +- .../webapp/jsp/flowcheck/planflowcheck.jsp | 610 +- .../jsp/flowcheck/planflowcheck_add.jsp | 558 +- .../jsp/flowcheck/planflowcheck_tocheck.jsp | 730 +- .../jsp/flowcheck/planflowcheck_update.jsp | 458 +- src/main/webapp/jsp/plancase/projectcase.jsp | 2110 +-- src/main/webapp/jsp/plancase/projectplan.jsp | 936 +- .../webapp/jsp/plancase/projectplancase.jsp | 746 +- src/main/webapp/jsp/plancase/ptctemplate.jsp | 1078 +- src/main/webapp/jsp/plancase/step_add.jsp | 1328 +- .../webapp/jsp/plancase/templateparam.jsp | 510 +- .../jsp/projectversion/projectversion.jsp | 1098 +- .../jsp/projectversion/projectversion_add.jsp | 752 +- .../projectversion/projectversion_addplan.jsp | 596 +- .../projectversion/projectversion_show.jsp | 406 +- .../projectversion/projectversion_update.jsp | 792 +- .../projectversion/projectversionreport.jsp | 310 +- .../webapp/jsp/projectversion/zentaolist.jsp | 396 +- .../jsp/projectversion/zentaolistfortast.jsp | 322 +- .../jsp/projectversion/zentaoreport.jsp | 298 +- src/main/webapp/jsp/review/review.jsp | 704 +- src/main/webapp/jsp/review/review_update.jsp | 490 +- src/main/webapp/jsp/review/reviewinfo.jsp | 464 +- src/main/webapp/jsp/review/reviewinfo_add.jsp | 546 +- .../webapp/jsp/review/reviewinfo_update.jsp | 462 +- src/main/webapp/jsp/task/casedetail_list.jsp | 1040 +- src/main/webapp/jsp/task/file_upload.jsp | 258 +- src/main/webapp/jsp/task/job_list.jsp | 1036 +- src/main/webapp/jsp/task/task_add.jsp | 1208 +- src/main/webapp/jsp/task/task_show.jsp | 322 +- src/main/webapp/jsp/task/task_update.jsp | 1196 +- src/main/webapp/jsp/task/taskexcute_list.jsp | 808 +- src/main/webapp/jsp/user/role.jsp | 336 +- src/main/webapp/jsp/user/role_add.jsp | 232 +- src/main/webapp/jsp/user/user.jsp | 670 +- src/main/webapp/jsp/user/user_add.jsp | 286 +- src/main/webapp/jsp/user/user_info.jsp | 202 +- src/main/webapp/jsp/user/user_proupdate.jsp | 208 +- src/main/webapp/jsp/user/user_pswupdate.jsp | 216 +- src/main/webapp/jsp/user/user_update.jsp | 486 +- .../assets/css/bootstrap-modal-loading.css | 34 +- .../webapp/progressus/assets/css/main.css | 162 +- .../assets/js/bootstrap-suggest.min.js | 14 +- .../js/bootstrapValidator/language/bg_BG.js | 740 +- .../webapp/progressus/assets/js/template.js | 24 +- src/main/webapp/progressus/contact.jsp | 138 +- src/main/webapp/progressus/signin.jsp | 412 +- src/main/webapp/show.jsp | 112 +- src/main/webapp/success.jsp | 104 +- 668 files changed, 82151 insertions(+), 81512 deletions(-) create mode 100644 mysqldb/initialization(create table)/V2.4 初始化 .sql create mode 100644 mysqldb/update(alter table)/V2.3 upgrade V2.4/V2.4.sql delete mode 100644 src/main/resources/hibernate.cfg.xml diff --git a/.classpath b/.classpath index e1a7098..da0bdd0 100644 --- a/.classpath +++ b/.classpath @@ -1,33 +1,33 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/.gitignore b/.gitignore index b83d222..db93136 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ /target/ +/src/main/resources/hibernate.cfg.xml diff --git a/.project b/.project index dd3db30..b96a8a7 100644 --- a/.project +++ b/.project @@ -1,35 +1,35 @@ - - - LuckyFrameWeb - - - - - - org.eclipse.wst.common.project.facet.core.builder - - - - - org.eclipse.jdt.core.javabuilder - - - - - org.eclipse.m2e.core.maven2Builder - - - - - org.eclipse.wst.validation.validationbuilder - - - - - - org.eclipse.jdt.core.javanature - org.eclipse.m2e.core.maven2Nature - org.eclipse.wst.common.project.facet.core.nature - org.eclipse.wst.common.modulecore.ModuleCoreNature - - + + + LuckyFrameWeb + + + + + + org.eclipse.wst.common.project.facet.core.builder + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.m2e.core.maven2Builder + + + + + org.eclipse.wst.validation.validationbuilder + + + + + + org.eclipse.jdt.core.javanature + org.eclipse.m2e.core.maven2Nature + org.eclipse.wst.common.project.facet.core.nature + org.eclipse.wst.common.modulecore.ModuleCoreNature + + diff --git a/.settings/.jsdtscope b/.settings/.jsdtscope index 1e92f03..04d5b64 100644 --- a/.settings/.jsdtscope +++ b/.settings/.jsdtscope @@ -1,13 +1,13 @@ - - - - - - - - - - - - - + + + + + + + + + + + + + diff --git a/.settings/org.eclipse.core.resources.prefs b/.settings/org.eclipse.core.resources.prefs index bfd3315..1b08dad 100644 --- a/.settings/org.eclipse.core.resources.prefs +++ b/.settings/org.eclipse.core.resources.prefs @@ -1,9 +1,9 @@ -eclipse.preferences.version=1 -encoding//src/main/java=UTF-8 -encoding//src/main/resources=UTF-8 -encoding//src/main/webapp/down.jsp=UTF-8 -encoding//src/main/webapp/footer.jsp=UTF-8 -encoding//src/main/webapp/head.jsp=UTF-8 -encoding//src/main/webapp/index.jsp=UTF-8 -encoding//src/test/java=UTF-8 -encoding/=UTF-8 +eclipse.preferences.version=1 +encoding//src/main/java=UTF-8 +encoding//src/main/resources=UTF-8 +encoding//src/main/webapp/down.jsp=UTF-8 +encoding//src/main/webapp/footer.jsp=UTF-8 +encoding//src/main/webapp/head.jsp=UTF-8 +encoding//src/main/webapp/index.jsp=UTF-8 +encoding//src/test/java=UTF-8 +encoding/=UTF-8 diff --git a/.settings/org.eclipse.jdt.core.prefs b/.settings/org.eclipse.jdt.core.prefs index 9c4403f..6b5aebc 100644 --- a/.settings/org.eclipse.jdt.core.prefs +++ b/.settings/org.eclipse.jdt.core.prefs @@ -1,13 +1,13 @@ -eclipse.preferences.version=1 -org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled -org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7 -org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve -org.eclipse.jdt.core.compiler.compliance=1.7 -org.eclipse.jdt.core.compiler.debug.lineNumber=generate -org.eclipse.jdt.core.compiler.debug.localVariable=generate -org.eclipse.jdt.core.compiler.debug.sourceFile=generate -org.eclipse.jdt.core.compiler.problem.assertIdentifier=error -org.eclipse.jdt.core.compiler.problem.enumIdentifier=error -org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning -org.eclipse.jdt.core.compiler.source=1.7 +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7 +org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve +org.eclipse.jdt.core.compiler.compliance=1.7 +org.eclipse.jdt.core.compiler.debug.lineNumber=generate +org.eclipse.jdt.core.compiler.debug.localVariable=generate +org.eclipse.jdt.core.compiler.debug.sourceFile=generate +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning +org.eclipse.jdt.core.compiler.source=1.7 diff --git a/.settings/org.eclipse.m2e.core.prefs b/.settings/org.eclipse.m2e.core.prefs index 14b697b..f897a7f 100644 --- a/.settings/org.eclipse.m2e.core.prefs +++ b/.settings/org.eclipse.m2e.core.prefs @@ -1,4 +1,4 @@ -activeProfiles= -eclipse.preferences.version=1 -resolveWorkspaceProjects=true -version=1 +activeProfiles= +eclipse.preferences.version=1 +resolveWorkspaceProjects=true +version=1 diff --git a/.settings/org.eclipse.m2e.wtp.prefs b/.settings/org.eclipse.m2e.wtp.prefs index 0492759..ef86089 100644 --- a/.settings/org.eclipse.m2e.wtp.prefs +++ b/.settings/org.eclipse.m2e.wtp.prefs @@ -1,2 +1,2 @@ -eclipse.preferences.version=1 -org.eclipse.m2e.wtp.enabledProjectSpecificPrefs=false +eclipse.preferences.version=1 +org.eclipse.m2e.wtp.enabledProjectSpecificPrefs=false diff --git a/.settings/org.eclipse.wst.common.component b/.settings/org.eclipse.wst.common.component index 3e7c761..2f0cb67 100644 --- a/.settings/org.eclipse.wst.common.component +++ b/.settings/org.eclipse.wst.common.component @@ -1,10 +1,10 @@ - - - - - - - - - - + + + + + + + + + + diff --git a/.settings/org.eclipse.wst.common.project.facet.core.xml b/.settings/org.eclipse.wst.common.project.facet.core.xml index 3084b6c..5ba2419 100644 --- a/.settings/org.eclipse.wst.common.project.facet.core.xml +++ b/.settings/org.eclipse.wst.common.project.facet.core.xml @@ -1,8 +1,8 @@ - - - - - - - - + + + + + + + + diff --git a/.settings/org.eclipse.wst.validation.prefs b/.settings/org.eclipse.wst.validation.prefs index 6f1cba6..04cad8c 100644 --- a/.settings/org.eclipse.wst.validation.prefs +++ b/.settings/org.eclipse.wst.validation.prefs @@ -1,2 +1,2 @@ -disabled=06target -eclipse.preferences.version=1 +disabled=06target +eclipse.preferences.version=1 diff --git a/README.md b/README.md index 7e499b4..d113eec 100644 --- a/README.md +++ b/README.md @@ -1,74 +1,74 @@ -

- - luckyframe_Logo - -

- -

- 让你的自动化体系建设更简单 - - LuckyFrame官网 - -

- -

- - maven - - - code style - - - code style - - - - -

- -# 捐赠 | 感谢 -> [【捐赠支持(微信)】](https://git.oschina.net/uploads/images/2017/0913/175706_f58b543b_1215415.jpeg) [【捐赠支持(支付宝)】](https://git.oschina.net/uploads/images/2017/0913/175750_e96add72_1215415.jpeg) - -> 感谢你们的认可与支持 [【捐赠记录】](https://git.oschina.net/seagull1985/LuckyFrameWeb/wikis/pages?title=捐赠列表&parent=捐赠) - - -# 介绍 - -LuckyFrame 开源自动化测试平台 - 自动化测试 X 时代来了 -> LuckyFrame QQ官方交流群 487954492 -LuckyFrame自动化测试 -# 我能做什么? - -- **分布式测试**:使用Web-Client的方式,Web端负责基本信息管理展示,Client负责用例执行,任意无限扩展客户端。 -- **多途径用例管理**:您即可以使用Web端自带的用例管理模块,也可以使用testlink来管理自动化用例。 -- **质量管理**:Web端不仅仅有用来管理自动化相关的模块,更可以做一些简单的质量数据收集分析以及数据的多图表展示。 -- **多线程执行用例**:客户端执行用例可以指定线程数量,用例运行更快速。 -- **在线编辑用例**:专属自动化用例设计结构,使用bootstrap table x_edit插件,更快捷、方便的编辑、调试自动化用例。 -- **定时任务调度**:支持自定义配置调度任务,包括指定线程数,指定执行客户端,远程执行shell重启tomcat,对jenkins中的项目进行构建等。 -- **测试过程监控**:客户端运行用例采用命令行的方式,在客户端可以实时查看过程。Web端可以通过任务查询查看测试进度。 -- **日志定位**:客户端LOG4J+数据库记录测试过程日志,2种方式都可以通过Web端实时查看定位问题。 -- **接口+Web UI双纬度自动化**:支持接口+Web UI自动化,客户端OS必须为Windows系统,UI自动化采用WebDriver3.0封装,纯关键字驱动,0编码。 -- **HTTP+Socket接口免编码**:完全封装HTTP以及Socket接口,协议模板+纯关键字驱动,免编码,初级测试人员的福音,与其他类似开源工具相比优势明显 -- **在线调试用例**:直接通过页面的步骤编辑界面调试用例,省心、省力、省脑子,但是不能不要脑子。 -- **Bootstrap 小清新风格界面**:整套Web系统基于Bootstrap风格,以及多种其下的插件,构建清爽界面。 -- **更多...**:还有更多自动化的创意,期待你的体验发现... 更多详细介绍 - -# 瞅一眼吧 - -![首页](https://git.oschina.net/uploads/images/2017/0913/193800_d0189b51_1215415.jpeg "首页") -![用例管理](https://git.oschina.net/uploads/images/2017/0913/193821_2e58d1cc_1215415.jpeg "用例管理") -![步骤管理自动联想](https://gitee.com/uploads/images/2017/1110/150236_b5e0d674_1215415.png "步骤管理自动联想") -![测试计划管理](https://git.oschina.net/uploads/images/2017/0913/193847_c32f96ff_1215415.jpeg "测试计划管理") -![测试任务调度](https://git.oschina.net/uploads/images/2017/0913/193913_fdccc46f_1215415.png "测试任务调度") -![测试任务执行](https://git.oschina.net/uploads/images/2017/0913/193935_3b381747_1215415.png "测试任务执行") -![用例日志查询](https://git.oschina.net/uploads/images/2017/0913/194004_6414aa59_1215415.png "用例日志查询") - -# 更新日志 -> [【查看版本Releases日志】](https://git.oschina.net/seagull1985/LuckyFrameWeb/wikis/pages?title=更新日志&parent=项目信息) - -# 大家安静下,我再说一句 -此项目是LuckyFrame的Web端项目,此外还有一个LuckyFrame的项目做为客户端,如果您只需要先看看界面,那么单独下载这个项目就够了,如果您需要搭建整套环境,那还要把LuckyFrame项目下载下来。 - -# 期待您更多的意见 - +

+ + luckyframe_Logo + +

+ +

+ 让你的自动化体系建设更简单 + + LuckyFrame官网 + +

+ +

+ + maven + + + code style + + + code style + + + + +

+ +# 捐赠 | 感谢 +> [【捐赠支持(微信)】](https://git.oschina.net/uploads/images/2017/0913/175706_f58b543b_1215415.jpeg) [【捐赠支持(支付宝)】](https://git.oschina.net/uploads/images/2017/0913/175750_e96add72_1215415.jpeg) + +> 感谢你们的认可与支持 [【捐赠记录】](https://git.oschina.net/seagull1985/LuckyFrameWeb/wikis/pages?title=捐赠列表&parent=捐赠) + + +# 介绍 + +LuckyFrame 开源自动化测试平台 - 自动化测试 X 时代来了 +> LuckyFrame QQ官方交流群 487954492 +LuckyFrame自动化测试 +# 我能做什么? + +- **分布式测试**:使用Web-Client的方式,Web端负责基本信息管理展示,Client负责用例执行,任意无限扩展客户端。 +- **多途径用例管理**:您即可以使用Web端自带的用例管理模块,也可以使用testlink来管理自动化用例。 +- **质量管理**:Web端不仅仅有用来管理自动化相关的模块,更可以做一些简单的质量数据收集分析以及数据的多图表展示。 +- **多线程执行用例**:客户端执行用例可以指定线程数量,用例运行更快速。 +- **在线编辑用例**:专属自动化用例设计结构,使用bootstrap table x_edit插件,更快捷、方便的编辑、调试自动化用例。 +- **定时任务调度**:支持自定义配置调度任务,包括指定线程数,指定执行客户端,远程执行shell重启tomcat,对jenkins中的项目进行构建等。 +- **测试过程监控**:客户端运行用例采用命令行的方式,在客户端可以实时查看过程。Web端可以通过任务查询查看测试进度。 +- **日志定位**:客户端LOG4J+数据库记录测试过程日志,2种方式都可以通过Web端实时查看定位问题。 +- **接口+Web UI双纬度自动化**:支持接口+Web UI自动化,客户端OS必须为Windows系统,UI自动化采用WebDriver3.0封装,纯关键字驱动,0编码。 +- **HTTP+Socket接口免编码**:完全封装HTTP以及Socket接口,协议模板+纯关键字驱动,免编码,初级测试人员的福音,与其他类似开源工具相比优势明显 +- **在线调试用例**:直接通过页面的步骤编辑界面调试用例,省心、省力、省脑子,但是不能不要脑子。 +- **Bootstrap 小清新风格界面**:整套Web系统基于Bootstrap风格,以及多种其下的插件,构建清爽界面。 +- **更多...**:还有更多自动化的创意,期待你的体验发现... 更多详细介绍 + +# 瞅一眼吧 + +![首页](https://git.oschina.net/uploads/images/2017/0913/193800_d0189b51_1215415.jpeg "首页") +![用例管理](https://git.oschina.net/uploads/images/2017/0913/193821_2e58d1cc_1215415.jpeg "用例管理") +![步骤管理自动联想](https://gitee.com/uploads/images/2017/1110/150236_b5e0d674_1215415.png "步骤管理自动联想") +![测试计划管理](https://git.oschina.net/uploads/images/2017/0913/193847_c32f96ff_1215415.jpeg "测试计划管理") +![测试任务调度](https://git.oschina.net/uploads/images/2017/0913/193913_fdccc46f_1215415.png "测试任务调度") +![测试任务执行](https://git.oschina.net/uploads/images/2017/0913/193935_3b381747_1215415.png "测试任务执行") +![用例日志查询](https://git.oschina.net/uploads/images/2017/0913/194004_6414aa59_1215415.png "用例日志查询") + +# 更新日志 +> [【查看版本Releases日志】](https://git.oschina.net/seagull1985/LuckyFrameWeb/wikis/pages?title=更新日志&parent=项目信息) + +# 大家安静下,我再说一句 +此项目是LuckyFrame的Web端项目,此外还有一个LuckyFrame的项目做为客户端,如果您只需要先看看界面,那么单独下载这个项目就够了,如果您需要搭建整套环境,那还要把LuckyFrame项目下载下来。 + +# 期待您更多的意见 + > 如果你有任何的想法或是建议那就给我留个言吧 \ No newline at end of file diff --git a/mysqldb/initialization(create table)/V1.0初始化.sql b/mysqldb/initialization(create table)/V1.0初始化.sql index bece540..3ce22e4 100644 --- a/mysqldb/initialization(create table)/V1.0初始化.sql +++ b/mysqldb/initialization(create table)/V1.0初始化.sql @@ -1,451 +1,451 @@ -create table OPERATION_LOG -( - id int(9) not null AUTO_INCREMENT, - tablename VARCHAR(30) not null COMMENT '被记录日志表名', - tableid int(8) not null COMMENT '被记录日志ID', - operation_time VARCHAR(30) not null COMMENT '操作时间', - operationer VARCHAR(20) not null COMMENT '操作人员', - operation_description VARCHAR(200) not null COMMENT '描述', - projectid int(8) COMMENT '项目ID', - primary key (ID) -)default character set utf8; -create table QA_ACCIDENT -( - id int(8) not null AUTO_INCREMENT, - projectid int(8) not null COMMENT '项目ID', - accstatus VARCHAR(80) not null COMMENT '事故状态', - eventtime VARCHAR(30) COMMENT '事故发生时间', - reporter VARCHAR(20) not null COMMENT '报告人', - reporttime VARCHAR(30) not null COMMENT '事故报告时间', - accdescription VARCHAR(500) not null COMMENT '事故描述', - acclevel VARCHAR(60) not null COMMENT '事故等级', - causalanalysis VARCHAR(500) COMMENT '原因分析', - causaltype VARCHAR(100) COMMENT '原因类型', - consequenceanalysis VARCHAR(300) COMMENT '后果分析', - correctiveaction VARCHAR(300) COMMENT '纠正措施', - resolutiontime VARCHAR(30) COMMENT '解决时间', - resolutioner VARCHAR(20) COMMENT '解决处理人', - preventiveaction VARCHAR(300) COMMENT '预防措施', - preventiver VARCHAR(20) COMMENT '预防措施责任人', - preventiveplandate VARCHAR(30) COMMENT '预防措施计划完成时间', - preventiveaccdate VARCHAR(30) COMMENT '预防措施实际完成时间', - trouble_duration int(8) COMMENT '事故持续时间', - impact_time int(8), - filename VARCHAR(100) COMMENT '附件路径', - primary key (ID) -)default character set utf8; -create table QA_FLOWCHECK -( - id int(10) not null AUTO_INCREMENT, - checkid int(10) not null COMMENT '检查id', - projectid int(10) not null COMMENT '项目id', - projectphase VARCHAR(20) not null COMMENT '项目阶段', - phasenode VARCHAR(50) not null COMMENT '阶段节点', - checkentry VARCHAR(100) not null COMMENT '检查内容', - checkresult VARCHAR(20) COMMENT '检查结果', - checkdate VARCHAR(20) COMMENT '检查日期', - checkdescriptions VARCHAR(400) COMMENT '不符合项描述', - stateupdate VARCHAR(20) COMMENT '状态更新', - updatedate VARCHAR(20) COMMENT '更新日期', - remark VARCHAR(200) COMMENT '备注', - versionnum VARCHAR(30) COMMENT '版本号', - primary key (ID) -)default character set utf8; -create table QA_FLOWINFO -( - id int(10) not null AUTO_INCREMENT, - phaseid int(10) not null, - phasename VARCHAR(20) not null, - phasenodeid int(10) not null, - phasenodename VARCHAR(20) not null, - checkentryid int(10) not null, - checkentry VARCHAR(200) not null, - remark VARCHAR(100), - primary key (ID) -)default character set utf8; -create table QA_PLANFLOWCHECK -( - id int(8) not null AUTO_INCREMENT, - projectid int(8) not null COMMENT '项目ID', - versionnum VARCHAR(30) COMMENT '版本号', - checkentryid VARCHAR(20) not null COMMENT '检查ID', - plandate VARCHAR(20) not null COMMENT '计划检查日期', - status int(4) not null COMMENT '计划状态:1 检查计划 2 已检查', - primary key (ID) -)default character set utf8; -create table QA_PROJECTVERSION -( - versionid int(10) not null AUTO_INCREMENT, - versionnumber VARCHAR(20) COMMENT '版本号', - plan_launchdate VARCHAR(20) COMMENT '计划上线日期', - actually_launchdate VARCHAR(20) COMMENT '实际上线日期', - plan_devstart VARCHAR(20) COMMENT '计划开发开始时间', - plan_devend VARCHAR(20) COMMENT '计划开发结束时间', - actually_devstart VARCHAR(20) COMMENT '实际开发开始时间', - actually_devend VARCHAR(20) COMMENT '实际开发结束时间', - plan_teststart VARCHAR(20) COMMENT '计划测试开始时间', - plan_testend VARCHAR(20) COMMENT '计划测试结束时间', - actually_teststart VARCHAR(20) COMMENT '实际测试开始时间', - actually_testend VARCHAR(20) COMMENT '实际测试结束时间', - plan_demand int(10) COMMENT '计划上线需求数', - actually_demand int(10) COMMENT '实际上线需求数', - codeline FLOAT(10) COMMENT '代码变动行数', - testcasenum int(10) COMMENT '测试用例数', - changetestingreturn int(10) COMMENT '版本转测试打回次数', - dev_member VARCHAR(50) COMMENT '开发投入人力', - test_member VARCHAR(50) COMMENT '测试投入人力', - human_cost VARCHAR(20) COMMENT '耗费人力 人/天', - per_dev VARCHAR(20) COMMENT '开发平均生产率 人/天/行', - per_test VARCHAR(20) COMMENT '用例编写/用例执行', - code_di VARCHAR(20) COMMENT '代码DI值', - qualityreview VARCHAR(500) COMMENT '质量回溯', - imprint VARCHAR(500) COMMENT '版本说明', - remark VARCHAR(500) COMMENT '备注', - projectid int(10) COMMENT '项目ID', - devtime_deviation VARCHAR(20) COMMENT '开发偏移率', - devdelay_days VARCHAR(20) COMMENT '开发延迟时间', - testtime_deviation VARCHAR(20) COMMENT '测试偏移率', - testdelay_days VARCHAR(20) COMMENT '测试延迟时间', - protime_deviation VARCHAR(20), - prodelay_days VARCHAR(20), - bug_zm int(10), - bug_yz int(10), - bug_yb int(10), - bug_ts int(10), - versiontype int(8) default 1 not null COMMENT '版本类型', - perdemand FLOAT(8) default 0.00, - codestandard_zd int(10) default 0 not null, - codestandard_yz int(10) default 0 not null, - codestandard_zy int(10) default 0 not null, - zt_versionlink VARCHAR(100) COMMENT '禅道链接', - human_costdev VARCHAR(20) default '0' COMMENT '开发人力成本', - human_costtest VARCHAR(20) default '0' COMMENT '测试人力成本', - primary key (versionid) -)default character set utf8; -create table QA_REVIEW -( - id int(8) not null AUTO_INCREMENT, - projectid int(8) not null COMMENT '项目ID', - version VARCHAR(20) not null COMMENT '版本号', - review_type VARCHAR(20) COMMENT '评审类型', - review_date VARCHAR(20) COMMENT '评审日期', - bug_num int(8) COMMENT '问题数', - repair_num int(8) COMMENT '已修复问题数', - confirm_date VARCHAR(20) COMMENT '最后确认日期', - review_object VARCHAR(100) COMMENT '评审对象', - review_result VARCHAR(50) COMMENT '评审结果', - result_confirmor VARCHAR(50) COMMENT '结果确认人', - remark VARCHAR(500) COMMENT '备注', - primary key (id) -)default character set utf8; -create table QA_REVIEWINFO -( - id int(8) not null AUTO_INCREMENT, - review_id int(8) not null COMMENT '评审ID', - bug_description VARCHAR(500) COMMENT '问题描述', - status VARCHAR(20) COMMENT '状态', - duty_officer VARCHAR(100) COMMENT '责任人', - confirm_date VARCHAR(20) COMMENT '最后确认日期', - corrective VARCHAR(500) COMMENT '纠正措施', - primary key (id) -)default character set utf8; -create table QA_SECONDARYSECTOR -( - sectorid int(10) not null AUTO_INCREMENT, - departmenthead VARCHAR(20), - departmentname VARCHAR(20), - primary key (sectorid) -)default character set utf8; -create table QA_SECTORPROJECTS -( - projectid int(10) not null AUTO_INCREMENT, - projectname VARCHAR(100) not null, - projectmanager VARCHAR(100) not null, - sectorid int(10) not null, - projecttype int(4) default 0 not null, - primary key (projectid) -)default character set utf8; -create table QA_ZTTASK -( - id int(8) not null AUTO_INCREMENT, - versionid int(8) COMMENT '版本ID', - versionname VARCHAR(100) COMMENT '版本名称', - taskname VARCHAR(300) COMMENT '任务名称', - assigneddate VARCHAR(50) COMMENT '完成时间', - estimate int(8) COMMENT '预期工时', - consumed int(8) COMMENT '实际工时', - finishedby VARCHAR(40) COMMENT '完成人账号', - finishedname VARCHAR(40) COMMENT '完成人姓名', - deadline VARCHAR(40) COMMENT '计划截止日期', - delaystatus int(4) COMMENT '延期状态', - primary key (id) -)default character set utf8; -create table TEST_JOBS -( - id int(10) not null AUTO_INCREMENT, - name VARCHAR(100) not null COMMENT '调度名称', - startdate VARCHAR(100) COMMENT '开始日期', - starttime VARCHAR(100) COMMENT '开始时间', - enddate VARCHAR(100) COMMENT '结束日期', - endtime VARCHAR(100) COMMENT '结束时间', - runtime datetime COMMENT '执行时间', - remark VARCHAR(800) COMMENT '备注', - planproj VARCHAR(100) COMMENT '项目名(testlink)中', - state VARCHAR(4) not null COMMENT '状态', - tasktype VARCHAR(4) not null COMMENT '执行类型 O执行一次 D每天执行', - starttimestr VARCHAR(100) COMMENT '执行时间表达式', - endtimestr VARCHAR(100) COMMENT '结束时间', - createtime datetime not null, - noenddate VARCHAR(10) COMMENT '是否有结束日期', - time int default 0, - timetype VARCHAR(4), - issendmail VARCHAR(4) default "0" COMMENT '是否发送邮件通知', - emailer VARCHAR(250) COMMENT '邮件地址', - threadcount int default 1 COMMENT '客户端线程数(接口)', - testlinkname VARCHAR(200) COMMENT 'TESTLINK中的计划名称', - isbuilding VARCHAR(4) default '0' not null COMMENT '是否自动构建', - buildname VARCHAR(100) COMMENT '构建链接', - isrestart VARCHAR(4) default '0' not null COMMENT '是否自动重启', - restartcomm VARCHAR(200) COMMENT '重启脚本', - extype int(4) default 0 not null COMMENT '执行类型', - browsertype int(4) COMMENT 'UI自动化浏览器类型', - timeout int(8) default 60 not null COMMENT '任务超时中断时间(分钟)', - clientip VARCHAR(30) default '127.0.0.1' not null COMMENT '版本ID', - primary key (id) -)default character set utf8; -create table TEST_CASEDETAIL -( - id int(10) not null AUTO_INCREMENT, - taskid int(10) not null, - caseno VARCHAR(20) not null COMMENT '用例编号', - caseversion VARCHAR(20) not null COMMENT '用例版本', - casetime datetime not null COMMENT '执行时间', - casename VARCHAR(200) not null COMMENT '用例名称', - casestatus VARCHAR(2) default '4' not null COMMENT ' pass:0 fail:1 lock:2 unexcute:4', - primary key (id) -)default character set utf8; -create table TEST_LOGDETAIL -( - logid int(10) not null AUTO_INCREMENT, - logtime datetime not null COMMENT '日志时间', - detail VARCHAR(1000) not null COMMENT '日志', - loggrade VARCHAR(20) COMMENT '日志级别', - caseid int(10) not null COMMENT '用例编号', - taskid int(10), - step VARCHAR(20) COMMENT '用例步骤', - imgname VARCHAR(30) COMMENT 'UI自动化自动截图地址', - primary key (logid) -)default character set utf8; -create table TEST_TASKEXCUTE -( - id int(10) not null AUTO_INCREMENT, - taskid VARCHAR(150) not null, - casetotal_count int(10) COMMENT '总用例数', - casesucc_count int(10) COMMENT '成功数', - casefail_count int(10) COMMENT '失败数', - caselock_count int(10) COMMENT '锁定数', - createtime datetime COMMENT '时间', - jobid int(10) not null, - finishtime datetime COMMENT '完成时间', - taskstatus VARCHAR(2) default '' COMMENT '状态 0未执行 1执行中 2 成功 4失败 ', - casenoexec_count int default 0 COMMENT '未执行用例', - caseisexec VARCHAR(2) COMMENT '任务是否被成功吊起 0 成功吊起 3 吊起失败', - primary key (id) -)default character set utf8; -create table USERINFO -( - id int(8) not null AUTO_INCREMENT, - usercode VARCHAR(20) not null, - password VARCHAR(200) not null, - username VARCHAR(20), - role VARCHAR(100) COMMENT '角色', - sectorid int(8) default 0 not null COMMENT '所属部门', - primary key (id) -)default character set utf8; - -create table USER_AUTHORITY -( - id int(9) not null AUTO_INCREMENT, - module VARCHAR(50) not null COMMENT '模块', - auth_type VARCHAR(50) not null COMMENT '权限类型', - alias VARCHAR(50) not null COMMENT '别名', - primary key (id) -)default character set utf8; -create table USER_ROLE -( - id int(9) not null AUTO_INCREMENT, - role VARCHAR(50) not null COMMENT '角色', - permission VARCHAR(1000) COMMENT '权限', - primary key (id) -)default character set utf8; - -/*插入索引 -CREATE INDEX index_caseid ON TEST_LOGDETAIL (caseid); -CREATE INDEX index_taskid ON TEST_CASEDETAIL (taskid);*/ - -/*插入权限默认定义*/ -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (1, '质量-版本信息', '增加', 'pv_1'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (2, '质量-版本信息', '删除', 'pv_2'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (3, '质量-版本信息', '修改', 'pv_3'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (4, '质量-版本计划信息', '增加', 'pvp_1'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (5, '质量-流程检查信息', '增加', 'fc_1'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (6, '质量-流程检查信息', '删除', 'fc_2'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (7, '质量-流程检查信息', '修改', 'fc_3'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (8, '质量-生产故障信息', '增加', 'acc_1'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (9, '质量-生产故障信息', '删除', 'acc_2'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (10, '质量-生产故障信息', '修改', 'acc_3'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (21, '自动化-任务调度', '启动', 'tast_run'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (22, '自动化-任务调度', '移除', 'tast_remove'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (23, '自动化-任务调度', '执行', 'tast_ex'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (24, '自动化-任务调度', '增加', 'tast_1'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (25, '自动化-任务调度', '删除', 'tast_2'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (26, '自动化-任务调度', '修改', 'tast_3'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (27, '自动化-任务调度', '上传', 'tast_upload'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (11, '质量-流程检查计划', '增加', 'pfc_1'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (12, '质量-流程检查计划', '删除', 'pfc_2'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (13, '质量-流程检查计划', '修改', 'pfc_3'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (14, '质量-流程检查计划', '转计划', 'fc_tocheck'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (15, '质量-评审信息详情', '增加', 'revinfo_1'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (16, '质量-评审信息详情', '删除', 'revinfo_2'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (17, '质量-评审信息详情', '修改', 'revinfo_3'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (18, '质量-评审信息', '删除', 'rev_2'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (19, '质量-评审信息', '修改', 'rev_3'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (20, '质量-生产故障信息', '上传', 'acc_upload'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (41, '用户管理', '增加', 'ui_1'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (42, '用户管理', '删除', 'ui_2'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (43, '用户管理', '修改', 'ui_3'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (44, '用户管理', '查看', 'ui_4'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (45, '用户管理-权限角色', '查看修改', 'role_3'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (28, '自动化-任务列表', '删除', 'tastex_2'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (29, '自动化-用例列表', '执行', 'case_ex'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (46, '用户管理-权限角色', '增加', 'role_1'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (47, '用户管理-权限角色', '删除', 'role_2'); - -/*插入角色默认定义*/ -insert into USER_ROLE (id, role, permission) -values (2, '测试工程师', 'acc_1,acc_2,acc_3,'); -insert into USER_ROLE (id, role, permission) -values (3, '自动化工程师', 'acc_1,acc_2,acc_3,tast_run,tast_remove,tast_ex,tast_1,tast_3,tast_2,tast_upload,tastex_2,case_ex,'); -insert into USER_ROLE (id, role, permission) -values (4, '质量工程师', 'pv_1,pv_2,pv_3,pvp_1,fc_1,fc_2,fc_3,acc_1,acc_2,acc_3,pfc_1,pfc_2,pfc_3,fc_tocheck,revinfo_1,revinfo_2,revinfo_3,rev_2,rev_3,acc_upload,'); -insert into USER_ROLE (id, role, permission) -values (1, '管理员', 'pv_1,pv_2,pv_3,pvp_1,fc_1,fc_2,fc_3,acc_1,acc_2,acc_3,tast_run,tast_remove,tast_ex,tast_1,tast_3,tast_2,tast_upload,tastex_2,case_ex,pfc_1,pfc_2,pfc_3,fc_tocheck,revinfo_1,revinfo_2,revinfo_3,rev_2,rev_3,acc_upload,ui_1,ui_2,ui_3,ui_4,role_3,role_1,role_2,'); - -/*插入默认部门分级*/ -insert into QA_SECONDARYSECTOR (sectorid, departmenthead, departmentname) -values (99, '系统管理员', '总部'); -/*插入默认项目*/ -insert into QA_SECTORPROJECTS (projectid, projectname, projectmanager, sectorid, projecttype) -values (99, '全部项目/未知项目', '系统管理员', 99, 0); -/*插入默认管理员*/ -insert into USERINFO (id, usercode, password, username, role, sectorid) -values (1, 'admin', 'uJ45aIeS9N80kaSFDjvk%2FA%3D%3D', '系统管理员', '1', 99); -/*插入流程检查定义数据*/ -insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) -values (36, 5, '总结阶段', 2, '计划变更', 1, '如与计划不合,是否提交计划变更邮件', null); -insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) -values (37, 5, '总结阶段', 3, '代码质量', 1, 'sonar代码检查是否刷新构建', null); -insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) -values (38, 5, '总结阶段', 3, '代码质量', 2, 'sonar代码问题数是否符合要求', null); -insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) -values (35, 2, '开发阶段', 3, '开发与编码', 6, '是否每一条禅道开发任务都提交转测申请', null); -insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) -values (34, 4, '验收与上线', 2, '上线部署', 3, 'SVN代码是否提交并标注', null); -insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) -values (1, 1, '需求阶段', 1, '需求编制', 1, '《产品需求说明书》是否组织评审会', null); -insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) -values (2, 1, '需求阶段', 1, '需求编制', 2, '《产品需求说明书》评审是否通过', null); -insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) -values (3, 1, '需求阶段', 1, '需求编制', 3, '《产品需求说明书》是否归档到SVN', null); -insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) -values (4, 1, '需求阶段', 1, '需求编制', 4, '《产品需求说明书》评审记录表是否签字通过', null); -insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) -values (5, 2, '开发阶段', 1, '需求分解', 1, '是否有需求分解/任务讨论会', null); -insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) -values (6, 2, '开发阶段', 1, '需求分解', 2, '《项目计划》邮件是否及时发出', null); -insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) -values (7, 2, '开发阶段', 1, '需求分解', 3, '《项目计划》邮件内容是否完整', null); -insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) -values (10, 2, '开发阶段', 2, '软件设计', 1, '《产品开发概要设计》是否组织评审会', null); -insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) -values (11, 2, '开发阶段', 2, '软件设计', 2, '《产品开发概要设计》评审是否通过', null); -insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) -values (12, 2, '开发阶段', 2, '软件设计', 3, '《产品开发概要设计》是否归档到SVN', null); -insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) -values (13, 2, '开发阶段', 2, '软件设计', 4, '《产品开发概要设计》评审记录表是否签字通过', null); -insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) -values (14, 2, '开发阶段', 3, '开发与编码', 1, '是否进行每日晨会', null); -insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) -values (15, 2, '开发阶段', 3, '开发与编码', 2, '是否进行代码走读', null); -insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) -values (16, 2, '开发阶段', 3, '开发与编码', 3, '是否每一条禅道开发任务都提交转测申请', null); -insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) -values (17, 2, '开发阶段', 3, '开发与编码', 4, '转测邮件是否合格', null); -insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) -values (18, 2, '开发阶段', 3, '开发与编码', 5, '转测邮件打回次数为0', null); -insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) -values (19, 3, '测试阶段', 1, '软件测试', 1, '是否回复测试计划', null); -insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) -values (20, 3, '测试阶段', 1, '软件测试', 2, '是否回复测试用例', null); -insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) -values (21, 3, '测试阶段', 1, '软件测试', 3, '测试用例是否通过评审/确认', null); -insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) -values (22, 3, '测试阶段', 1, '软件测试', 4, '《软件测试报告》是否组织评审会', null); -insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) -values (23, 3, '测试阶段', 1, '软件测试', 5, '《软件测试报告》是否评审通过', null); -insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) -values (24, 3, '测试阶段', 1, '软件测试', 6, '《软件测试报告》/测试结果是否发出邮件', null); -insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) -values (25, 3, '测试阶段', 1, '软件测试', 7, '《软件测试报告》评审记录表是否签字通过', null); -insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) -values (26, 4, '验收与上线', 1, '产品验收', 1, '《产品验收报告》是否组织评审会', null); -insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) -values (27, 4, '验收与上线', 1, '产品验收', 2, '《产品验收报告》是否评审通过', null); -insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) -values (28, 4, '验收与上线', 1, '产品验收', 3, '《产品验收报告》是否归档到SVN', null); -insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) -values (29, 4, '验收与上线', 1, '产品验收', 4, '《产品验收报告》评审记录表是否签字通过', null); -insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) -values (30, 4, '验收与上线', 2, '上线部署', 1, '产品/开发是否提交上线流程(OA)', null); -insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) -values (31, 4, '验收与上线', 2, '上线部署', 2, '开发是否提交上线相关资料', null); -insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) -values (32, 5, '总结阶段', 1, '项目总结', 1, '《项目总结》邮件是否及时发出', null); -insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +create table OPERATION_LOG +( + id int(9) not null AUTO_INCREMENT, + tablename VARCHAR(30) not null COMMENT '被记录日志表名', + tableid int(8) not null COMMENT '被记录日志ID', + operation_time VARCHAR(30) not null COMMENT '操作时间', + operationer VARCHAR(20) not null COMMENT '操作人员', + operation_description VARCHAR(200) not null COMMENT '描述', + projectid int(8) COMMENT '项目ID', + primary key (ID) +)default character set utf8; +create table QA_ACCIDENT +( + id int(8) not null AUTO_INCREMENT, + projectid int(8) not null COMMENT '项目ID', + accstatus VARCHAR(80) not null COMMENT '事故状态', + eventtime VARCHAR(30) COMMENT '事故发生时间', + reporter VARCHAR(20) not null COMMENT '报告人', + reporttime VARCHAR(30) not null COMMENT '事故报告时间', + accdescription VARCHAR(500) not null COMMENT '事故描述', + acclevel VARCHAR(60) not null COMMENT '事故等级', + causalanalysis VARCHAR(500) COMMENT '原因分析', + causaltype VARCHAR(100) COMMENT '原因类型', + consequenceanalysis VARCHAR(300) COMMENT '后果分析', + correctiveaction VARCHAR(300) COMMENT '纠正措施', + resolutiontime VARCHAR(30) COMMENT '解决时间', + resolutioner VARCHAR(20) COMMENT '解决处理人', + preventiveaction VARCHAR(300) COMMENT '预防措施', + preventiver VARCHAR(20) COMMENT '预防措施责任人', + preventiveplandate VARCHAR(30) COMMENT '预防措施计划完成时间', + preventiveaccdate VARCHAR(30) COMMENT '预防措施实际完成时间', + trouble_duration int(8) COMMENT '事故持续时间', + impact_time int(8), + filename VARCHAR(100) COMMENT '附件路径', + primary key (ID) +)default character set utf8; +create table QA_FLOWCHECK +( + id int(10) not null AUTO_INCREMENT, + checkid int(10) not null COMMENT '检查id', + projectid int(10) not null COMMENT '项目id', + projectphase VARCHAR(20) not null COMMENT '项目阶段', + phasenode VARCHAR(50) not null COMMENT '阶段节点', + checkentry VARCHAR(100) not null COMMENT '检查内容', + checkresult VARCHAR(20) COMMENT '检查结果', + checkdate VARCHAR(20) COMMENT '检查日期', + checkdescriptions VARCHAR(400) COMMENT '不符合项描述', + stateupdate VARCHAR(20) COMMENT '状态更新', + updatedate VARCHAR(20) COMMENT '更新日期', + remark VARCHAR(200) COMMENT '备注', + versionnum VARCHAR(30) COMMENT '版本号', + primary key (ID) +)default character set utf8; +create table QA_FLOWINFO +( + id int(10) not null AUTO_INCREMENT, + phaseid int(10) not null, + phasename VARCHAR(20) not null, + phasenodeid int(10) not null, + phasenodename VARCHAR(20) not null, + checkentryid int(10) not null, + checkentry VARCHAR(200) not null, + remark VARCHAR(100), + primary key (ID) +)default character set utf8; +create table QA_PLANFLOWCHECK +( + id int(8) not null AUTO_INCREMENT, + projectid int(8) not null COMMENT '项目ID', + versionnum VARCHAR(30) COMMENT '版本号', + checkentryid VARCHAR(20) not null COMMENT '检查ID', + plandate VARCHAR(20) not null COMMENT '计划检查日期', + status int(4) not null COMMENT '计划状态:1 检查计划 2 已检查', + primary key (ID) +)default character set utf8; +create table QA_PROJECTVERSION +( + versionid int(10) not null AUTO_INCREMENT, + versionnumber VARCHAR(20) COMMENT '版本号', + plan_launchdate VARCHAR(20) COMMENT '计划上线日期', + actually_launchdate VARCHAR(20) COMMENT '实际上线日期', + plan_devstart VARCHAR(20) COMMENT '计划开发开始时间', + plan_devend VARCHAR(20) COMMENT '计划开发结束时间', + actually_devstart VARCHAR(20) COMMENT '实际开发开始时间', + actually_devend VARCHAR(20) COMMENT '实际开发结束时间', + plan_teststart VARCHAR(20) COMMENT '计划测试开始时间', + plan_testend VARCHAR(20) COMMENT '计划测试结束时间', + actually_teststart VARCHAR(20) COMMENT '实际测试开始时间', + actually_testend VARCHAR(20) COMMENT '实际测试结束时间', + plan_demand int(10) COMMENT '计划上线需求数', + actually_demand int(10) COMMENT '实际上线需求数', + codeline FLOAT(10) COMMENT '代码变动行数', + testcasenum int(10) COMMENT '测试用例数', + changetestingreturn int(10) COMMENT '版本转测试打回次数', + dev_member VARCHAR(50) COMMENT '开发投入人力', + test_member VARCHAR(50) COMMENT '测试投入人力', + human_cost VARCHAR(20) COMMENT '耗费人力 人/天', + per_dev VARCHAR(20) COMMENT '开发平均生产率 人/天/行', + per_test VARCHAR(20) COMMENT '用例编写/用例执行', + code_di VARCHAR(20) COMMENT '代码DI值', + qualityreview VARCHAR(500) COMMENT '质量回溯', + imprint VARCHAR(500) COMMENT '版本说明', + remark VARCHAR(500) COMMENT '备注', + projectid int(10) COMMENT '项目ID', + devtime_deviation VARCHAR(20) COMMENT '开发偏移率', + devdelay_days VARCHAR(20) COMMENT '开发延迟时间', + testtime_deviation VARCHAR(20) COMMENT '测试偏移率', + testdelay_days VARCHAR(20) COMMENT '测试延迟时间', + protime_deviation VARCHAR(20), + prodelay_days VARCHAR(20), + bug_zm int(10), + bug_yz int(10), + bug_yb int(10), + bug_ts int(10), + versiontype int(8) default 1 not null COMMENT '版本类型', + perdemand FLOAT(8) default 0.00, + codestandard_zd int(10) default 0 not null, + codestandard_yz int(10) default 0 not null, + codestandard_zy int(10) default 0 not null, + zt_versionlink VARCHAR(100) COMMENT '禅道链接', + human_costdev VARCHAR(20) default '0' COMMENT '开发人力成本', + human_costtest VARCHAR(20) default '0' COMMENT '测试人力成本', + primary key (versionid) +)default character set utf8; +create table QA_REVIEW +( + id int(8) not null AUTO_INCREMENT, + projectid int(8) not null COMMENT '项目ID', + version VARCHAR(20) not null COMMENT '版本号', + review_type VARCHAR(20) COMMENT '评审类型', + review_date VARCHAR(20) COMMENT '评审日期', + bug_num int(8) COMMENT '问题数', + repair_num int(8) COMMENT '已修复问题数', + confirm_date VARCHAR(20) COMMENT '最后确认日期', + review_object VARCHAR(100) COMMENT '评审对象', + review_result VARCHAR(50) COMMENT '评审结果', + result_confirmor VARCHAR(50) COMMENT '结果确认人', + remark VARCHAR(500) COMMENT '备注', + primary key (id) +)default character set utf8; +create table QA_REVIEWINFO +( + id int(8) not null AUTO_INCREMENT, + review_id int(8) not null COMMENT '评审ID', + bug_description VARCHAR(500) COMMENT '问题描述', + status VARCHAR(20) COMMENT '状态', + duty_officer VARCHAR(100) COMMENT '责任人', + confirm_date VARCHAR(20) COMMENT '最后确认日期', + corrective VARCHAR(500) COMMENT '纠正措施', + primary key (id) +)default character set utf8; +create table QA_SECONDARYSECTOR +( + sectorid int(10) not null AUTO_INCREMENT, + departmenthead VARCHAR(20), + departmentname VARCHAR(20), + primary key (sectorid) +)default character set utf8; +create table QA_SECTORPROJECTS +( + projectid int(10) not null AUTO_INCREMENT, + projectname VARCHAR(100) not null, + projectmanager VARCHAR(100) not null, + sectorid int(10) not null, + projecttype int(4) default 0 not null, + primary key (projectid) +)default character set utf8; +create table QA_ZTTASK +( + id int(8) not null AUTO_INCREMENT, + versionid int(8) COMMENT '版本ID', + versionname VARCHAR(100) COMMENT '版本名称', + taskname VARCHAR(300) COMMENT '任务名称', + assigneddate VARCHAR(50) COMMENT '完成时间', + estimate int(8) COMMENT '预期工时', + consumed int(8) COMMENT '实际工时', + finishedby VARCHAR(40) COMMENT '完成人账号', + finishedname VARCHAR(40) COMMENT '完成人姓名', + deadline VARCHAR(40) COMMENT '计划截止日期', + delaystatus int(4) COMMENT '延期状态', + primary key (id) +)default character set utf8; +create table TEST_JOBS +( + id int(10) not null AUTO_INCREMENT, + name VARCHAR(100) not null COMMENT '调度名称', + startdate VARCHAR(100) COMMENT '开始日期', + starttime VARCHAR(100) COMMENT '开始时间', + enddate VARCHAR(100) COMMENT '结束日期', + endtime VARCHAR(100) COMMENT '结束时间', + runtime datetime COMMENT '执行时间', + remark VARCHAR(800) COMMENT '备注', + planproj VARCHAR(100) COMMENT '项目名(testlink)中', + state VARCHAR(4) not null COMMENT '状态', + tasktype VARCHAR(4) not null COMMENT '执行类型 O执行一次 D每天执行', + starttimestr VARCHAR(100) COMMENT '执行时间表达式', + endtimestr VARCHAR(100) COMMENT '结束时间', + createtime datetime not null, + noenddate VARCHAR(10) COMMENT '是否有结束日期', + time int default 0, + timetype VARCHAR(4), + issendmail VARCHAR(4) default "0" COMMENT '是否发送邮件通知', + emailer VARCHAR(250) COMMENT '邮件地址', + threadcount int default 1 COMMENT '客户端线程数(接口)', + testlinkname VARCHAR(200) COMMENT 'TESTLINK中的计划名称', + isbuilding VARCHAR(4) default '0' not null COMMENT '是否自动构建', + buildname VARCHAR(100) COMMENT '构建链接', + isrestart VARCHAR(4) default '0' not null COMMENT '是否自动重启', + restartcomm VARCHAR(200) COMMENT '重启脚本', + extype int(4) default 0 not null COMMENT '执行类型', + browsertype int(4) COMMENT 'UI自动化浏览器类型', + timeout int(8) default 60 not null COMMENT '任务超时中断时间(分钟)', + clientip VARCHAR(30) default '127.0.0.1' not null COMMENT '版本ID', + primary key (id) +)default character set utf8; +create table TEST_CASEDETAIL +( + id int(10) not null AUTO_INCREMENT, + taskid int(10) not null, + caseno VARCHAR(20) not null COMMENT '用例编号', + caseversion VARCHAR(20) not null COMMENT '用例版本', + casetime datetime not null COMMENT '执行时间', + casename VARCHAR(200) not null COMMENT '用例名称', + casestatus VARCHAR(2) default '4' not null COMMENT ' pass:0 fail:1 lock:2 unexcute:4', + primary key (id) +)default character set utf8; +create table TEST_LOGDETAIL +( + logid int(10) not null AUTO_INCREMENT, + logtime datetime not null COMMENT '日志时间', + detail VARCHAR(1000) not null COMMENT '日志', + loggrade VARCHAR(20) COMMENT '日志级别', + caseid int(10) not null COMMENT '用例编号', + taskid int(10), + step VARCHAR(20) COMMENT '用例步骤', + imgname VARCHAR(30) COMMENT 'UI自动化自动截图地址', + primary key (logid) +)default character set utf8; +create table TEST_TASKEXCUTE +( + id int(10) not null AUTO_INCREMENT, + taskid VARCHAR(150) not null, + casetotal_count int(10) COMMENT '总用例数', + casesucc_count int(10) COMMENT '成功数', + casefail_count int(10) COMMENT '失败数', + caselock_count int(10) COMMENT '锁定数', + createtime datetime COMMENT '时间', + jobid int(10) not null, + finishtime datetime COMMENT '完成时间', + taskstatus VARCHAR(2) default '' COMMENT '状态 0未执行 1执行中 2 成功 4失败 ', + casenoexec_count int default 0 COMMENT '未执行用例', + caseisexec VARCHAR(2) COMMENT '任务是否被成功吊起 0 成功吊起 3 吊起失败', + primary key (id) +)default character set utf8; +create table USERINFO +( + id int(8) not null AUTO_INCREMENT, + usercode VARCHAR(20) not null, + password VARCHAR(200) not null, + username VARCHAR(20), + role VARCHAR(100) COMMENT '角色', + sectorid int(8) default 0 not null COMMENT '所属部门', + primary key (id) +)default character set utf8; + +create table USER_AUTHORITY +( + id int(9) not null AUTO_INCREMENT, + module VARCHAR(50) not null COMMENT '模块', + auth_type VARCHAR(50) not null COMMENT '权限类型', + alias VARCHAR(50) not null COMMENT '别名', + primary key (id) +)default character set utf8; +create table USER_ROLE +( + id int(9) not null AUTO_INCREMENT, + role VARCHAR(50) not null COMMENT '角色', + permission VARCHAR(1000) COMMENT '权限', + primary key (id) +)default character set utf8; + +/*插入索引 +CREATE INDEX index_caseid ON TEST_LOGDETAIL (caseid); +CREATE INDEX index_taskid ON TEST_CASEDETAIL (taskid);*/ + +/*插入权限默认定义*/ +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (1, '质量-版本信息', '增加', 'pv_1'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (2, '质量-版本信息', '删除', 'pv_2'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (3, '质量-版本信息', '修改', 'pv_3'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (4, '质量-版本计划信息', '增加', 'pvp_1'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (5, '质量-流程检查信息', '增加', 'fc_1'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (6, '质量-流程检查信息', '删除', 'fc_2'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (7, '质量-流程检查信息', '修改', 'fc_3'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (8, '质量-生产故障信息', '增加', 'acc_1'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (9, '质量-生产故障信息', '删除', 'acc_2'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (10, '质量-生产故障信息', '修改', 'acc_3'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (21, '自动化-任务调度', '启动', 'tast_run'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (22, '自动化-任务调度', '移除', 'tast_remove'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (23, '自动化-任务调度', '执行', 'tast_ex'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (24, '自动化-任务调度', '增加', 'tast_1'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (25, '自动化-任务调度', '删除', 'tast_2'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (26, '自动化-任务调度', '修改', 'tast_3'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (27, '自动化-任务调度', '上传', 'tast_upload'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (11, '质量-流程检查计划', '增加', 'pfc_1'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (12, '质量-流程检查计划', '删除', 'pfc_2'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (13, '质量-流程检查计划', '修改', 'pfc_3'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (14, '质量-流程检查计划', '转计划', 'fc_tocheck'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (15, '质量-评审信息详情', '增加', 'revinfo_1'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (16, '质量-评审信息详情', '删除', 'revinfo_2'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (17, '质量-评审信息详情', '修改', 'revinfo_3'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (18, '质量-评审信息', '删除', 'rev_2'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (19, '质量-评审信息', '修改', 'rev_3'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (20, '质量-生产故障信息', '上传', 'acc_upload'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (41, '用户管理', '增加', 'ui_1'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (42, '用户管理', '删除', 'ui_2'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (43, '用户管理', '修改', 'ui_3'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (44, '用户管理', '查看', 'ui_4'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (45, '用户管理-权限角色', '查看修改', 'role_3'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (28, '自动化-任务列表', '删除', 'tastex_2'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (29, '自动化-用例列表', '执行', 'case_ex'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (46, '用户管理-权限角色', '增加', 'role_1'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (47, '用户管理-权限角色', '删除', 'role_2'); + +/*插入角色默认定义*/ +insert into USER_ROLE (id, role, permission) +values (2, '测试工程师', 'acc_1,acc_2,acc_3,'); +insert into USER_ROLE (id, role, permission) +values (3, '自动化工程师', 'acc_1,acc_2,acc_3,tast_run,tast_remove,tast_ex,tast_1,tast_3,tast_2,tast_upload,tastex_2,case_ex,'); +insert into USER_ROLE (id, role, permission) +values (4, '质量工程师', 'pv_1,pv_2,pv_3,pvp_1,fc_1,fc_2,fc_3,acc_1,acc_2,acc_3,pfc_1,pfc_2,pfc_3,fc_tocheck,revinfo_1,revinfo_2,revinfo_3,rev_2,rev_3,acc_upload,'); +insert into USER_ROLE (id, role, permission) +values (1, '管理员', 'pv_1,pv_2,pv_3,pvp_1,fc_1,fc_2,fc_3,acc_1,acc_2,acc_3,tast_run,tast_remove,tast_ex,tast_1,tast_3,tast_2,tast_upload,tastex_2,case_ex,pfc_1,pfc_2,pfc_3,fc_tocheck,revinfo_1,revinfo_2,revinfo_3,rev_2,rev_3,acc_upload,ui_1,ui_2,ui_3,ui_4,role_3,role_1,role_2,'); + +/*插入默认部门分级*/ +insert into QA_SECONDARYSECTOR (sectorid, departmenthead, departmentname) +values (99, '系统管理员', '总部'); +/*插入默认项目*/ +insert into QA_SECTORPROJECTS (projectid, projectname, projectmanager, sectorid, projecttype) +values (99, '全部项目/未知项目', '系统管理员', 99, 0); +/*插入默认管理员*/ +insert into USERINFO (id, usercode, password, username, role, sectorid) +values (1, 'admin', 'uJ45aIeS9N80kaSFDjvk%2FA%3D%3D', '系统管理员', '1', 99); +/*插入流程检查定义数据*/ +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (36, 5, '总结阶段', 2, '计划变更', 1, '如与计划不合,是否提交计划变更邮件', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (37, 5, '总结阶段', 3, '代码质量', 1, 'sonar代码检查是否刷新构建', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (38, 5, '总结阶段', 3, '代码质量', 2, 'sonar代码问题数是否符合要求', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (35, 2, '开发阶段', 3, '开发与编码', 6, '是否每一条禅道开发任务都提交转测申请', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (34, 4, '验收与上线', 2, '上线部署', 3, 'SVN代码是否提交并标注', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (1, 1, '需求阶段', 1, '需求编制', 1, '《产品需求说明书》是否组织评审会', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (2, 1, '需求阶段', 1, '需求编制', 2, '《产品需求说明书》评审是否通过', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (3, 1, '需求阶段', 1, '需求编制', 3, '《产品需求说明书》是否归档到SVN', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (4, 1, '需求阶段', 1, '需求编制', 4, '《产品需求说明书》评审记录表是否签字通过', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (5, 2, '开发阶段', 1, '需求分解', 1, '是否有需求分解/任务讨论会', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (6, 2, '开发阶段', 1, '需求分解', 2, '《项目计划》邮件是否及时发出', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (7, 2, '开发阶段', 1, '需求分解', 3, '《项目计划》邮件内容是否完整', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (10, 2, '开发阶段', 2, '软件设计', 1, '《产品开发概要设计》是否组织评审会', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (11, 2, '开发阶段', 2, '软件设计', 2, '《产品开发概要设计》评审是否通过', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (12, 2, '开发阶段', 2, '软件设计', 3, '《产品开发概要设计》是否归档到SVN', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (13, 2, '开发阶段', 2, '软件设计', 4, '《产品开发概要设计》评审记录表是否签字通过', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (14, 2, '开发阶段', 3, '开发与编码', 1, '是否进行每日晨会', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (15, 2, '开发阶段', 3, '开发与编码', 2, '是否进行代码走读', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (16, 2, '开发阶段', 3, '开发与编码', 3, '是否每一条禅道开发任务都提交转测申请', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (17, 2, '开发阶段', 3, '开发与编码', 4, '转测邮件是否合格', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (18, 2, '开发阶段', 3, '开发与编码', 5, '转测邮件打回次数为0', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (19, 3, '测试阶段', 1, '软件测试', 1, '是否回复测试计划', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (20, 3, '测试阶段', 1, '软件测试', 2, '是否回复测试用例', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (21, 3, '测试阶段', 1, '软件测试', 3, '测试用例是否通过评审/确认', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (22, 3, '测试阶段', 1, '软件测试', 4, '《软件测试报告》是否组织评审会', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (23, 3, '测试阶段', 1, '软件测试', 5, '《软件测试报告》是否评审通过', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (24, 3, '测试阶段', 1, '软件测试', 6, '《软件测试报告》/测试结果是否发出邮件', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (25, 3, '测试阶段', 1, '软件测试', 7, '《软件测试报告》评审记录表是否签字通过', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (26, 4, '验收与上线', 1, '产品验收', 1, '《产品验收报告》是否组织评审会', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (27, 4, '验收与上线', 1, '产品验收', 2, '《产品验收报告》是否评审通过', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (28, 4, '验收与上线', 1, '产品验收', 3, '《产品验收报告》是否归档到SVN', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (29, 4, '验收与上线', 1, '产品验收', 4, '《产品验收报告》评审记录表是否签字通过', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (30, 4, '验收与上线', 2, '上线部署', 1, '产品/开发是否提交上线流程(OA)', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (31, 4, '验收与上线', 2, '上线部署', 2, '开发是否提交上线相关资料', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (32, 5, '总结阶段', 1, '项目总结', 1, '《项目总结》邮件是否及时发出', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) values (33, 5, '总结阶段', 1, '项目总结', 2, '《项目总结》邮件内容是否完整', null); \ No newline at end of file diff --git a/mysqldb/initialization(create table)/V1.1初始化.sql b/mysqldb/initialization(create table)/V1.1初始化.sql index d67f514..8ed8cb2 100644 --- a/mysqldb/initialization(create table)/V1.1初始化.sql +++ b/mysqldb/initialization(create table)/V1.1初始化.sql @@ -1,457 +1,457 @@ -create table OPERATION_LOG -( - id int(9) not null AUTO_INCREMENT, - tablename VARCHAR(30) not null COMMENT '被记录日志表名', - tableid int(8) not null COMMENT '被记录日志ID', - operation_time VARCHAR(30) not null COMMENT '操作时间', - operationer VARCHAR(20) not null COMMENT '操作人员', - operation_description VARCHAR(200) not null COMMENT '描述', - projectid int(8) COMMENT '项目ID', - primary key (ID) -)default character set utf8; -create table QA_ACCIDENT -( - id int(8) not null AUTO_INCREMENT, - projectid int(8) not null COMMENT '项目ID', - accstatus VARCHAR(80) not null COMMENT '事故状态', - eventtime VARCHAR(30) COMMENT '事故发生时间', - reporter VARCHAR(20) not null COMMENT '报告人', - reporttime VARCHAR(30) not null COMMENT '事故报告时间', - accdescription VARCHAR(500) not null COMMENT '事故描述', - acclevel VARCHAR(60) not null COMMENT '事故等级', - causalanalysis VARCHAR(500) COMMENT '原因分析', - causaltype VARCHAR(100) COMMENT '原因类型', - consequenceanalysis VARCHAR(300) COMMENT '后果分析', - correctiveaction VARCHAR(300) COMMENT '纠正措施', - resolutiontime VARCHAR(30) COMMENT '解决时间', - resolutioner VARCHAR(20) COMMENT '解决处理人', - preventiveaction VARCHAR(300) COMMENT '预防措施', - preventiver VARCHAR(20) COMMENT '预防措施责任人', - preventiveplandate VARCHAR(30) COMMENT '预防措施计划完成时间', - preventiveaccdate VARCHAR(30) COMMENT '预防措施实际完成时间', - trouble_duration int(8) COMMENT '事故持续时间', - impact_time int(8), - filename VARCHAR(100) COMMENT '附件路径', - primary key (ID) -)default character set utf8; -create table QA_FLOWCHECK -( - id int(10) not null AUTO_INCREMENT, - checkid int(10) not null COMMENT '检查id', - projectid int(10) not null COMMENT '项目id', - projectphase VARCHAR(20) not null COMMENT '项目阶段', - phasenode VARCHAR(50) not null COMMENT '阶段节点', - checkentry VARCHAR(100) not null COMMENT '检查内容', - checkresult VARCHAR(20) COMMENT '检查结果', - checkdate VARCHAR(20) COMMENT '检查日期', - checkdescriptions VARCHAR(400) COMMENT '不符合项描述', - stateupdate VARCHAR(20) COMMENT '状态更新', - updatedate VARCHAR(20) COMMENT '更新日期', - remark VARCHAR(200) COMMENT '备注', - versionnum VARCHAR(30) COMMENT '版本号', - primary key (ID) -)default character set utf8; -create table QA_FLOWINFO -( - id int(10) not null AUTO_INCREMENT, - phaseid int(10) not null, - phasename VARCHAR(20) not null, - phasenodeid int(10) not null, - phasenodename VARCHAR(20) not null, - checkentryid int(10) not null, - checkentry VARCHAR(200) not null, - remark VARCHAR(100), - primary key (ID) -)default character set utf8; -create table QA_PLANFLOWCHECK -( - id int(8) not null AUTO_INCREMENT, - projectid int(8) not null COMMENT '项目ID', - versionnum VARCHAR(30) COMMENT '版本号', - checkentryid VARCHAR(20) not null COMMENT '检查ID', - plandate VARCHAR(20) not null COMMENT '计划检查日期', - status int(4) not null COMMENT '计划状态:1 检查计划 2 已检查', - primary key (ID) -)default character set utf8; -create table QA_PROJECTVERSION -( - versionid int(10) not null AUTO_INCREMENT, - versionnumber VARCHAR(20) COMMENT '版本号', - plan_launchdate VARCHAR(20) COMMENT '计划上线日期', - actually_launchdate VARCHAR(20) COMMENT '实际上线日期', - plan_devstart VARCHAR(20) COMMENT '计划开发开始时间', - plan_devend VARCHAR(20) COMMENT '计划开发结束时间', - actually_devstart VARCHAR(20) COMMENT '实际开发开始时间', - actually_devend VARCHAR(20) COMMENT '实际开发结束时间', - plan_teststart VARCHAR(20) COMMENT '计划测试开始时间', - plan_testend VARCHAR(20) COMMENT '计划测试结束时间', - actually_teststart VARCHAR(20) COMMENT '实际测试开始时间', - actually_testend VARCHAR(20) COMMENT '实际测试结束时间', - plan_demand int(10) COMMENT '计划上线需求数', - actually_demand int(10) COMMENT '实际上线需求数', - codeline FLOAT(10) COMMENT '代码变动行数', - testcasenum int(10) COMMENT '测试用例数', - changetestingreturn int(10) COMMENT '版本转测试打回次数', - dev_member VARCHAR(50) COMMENT '开发投入人力', - test_member VARCHAR(50) COMMENT '测试投入人力', - human_cost VARCHAR(20) COMMENT '耗费人力 人/天', - per_dev VARCHAR(20) COMMENT '开发平均生产率 人/天/行', - per_test VARCHAR(20) COMMENT '用例编写/用例执行', - code_di VARCHAR(20) COMMENT '代码DI值', - qualityreview VARCHAR(500) COMMENT '质量回溯', - imprint VARCHAR(500) COMMENT '版本说明', - remark VARCHAR(500) COMMENT '备注', - projectid int(10) COMMENT '项目ID', - devtime_deviation VARCHAR(20) COMMENT '开发偏移率', - devdelay_days VARCHAR(20) COMMENT '开发延迟时间', - testtime_deviation VARCHAR(20) COMMENT '测试偏移率', - testdelay_days VARCHAR(20) COMMENT '测试延迟时间', - protime_deviation VARCHAR(20), - prodelay_days VARCHAR(20), - bug_zm int(10), - bug_yz int(10), - bug_yb int(10), - bug_ts int(10), - versiontype int(8) default 1 not null COMMENT '版本类型', - perdemand FLOAT(8) default 0.00, - codestandard_zd int(10) default 0 not null, - codestandard_yz int(10) default 0 not null, - codestandard_zy int(10) default 0 not null, - zt_versionlink VARCHAR(100) COMMENT '禅道链接', - human_costdev VARCHAR(20) default '0' COMMENT '开发人力成本', - human_costtest VARCHAR(20) default '0' COMMENT '测试人力成本', - primary key (versionid) -)default character set utf8; -create table QA_REVIEW -( - id int(8) not null AUTO_INCREMENT, - projectid int(8) not null COMMENT '项目ID', - version VARCHAR(20) not null COMMENT '版本号', - review_type VARCHAR(20) COMMENT '评审类型', - review_date VARCHAR(20) COMMENT '评审日期', - bug_num int(8) COMMENT '问题数', - repair_num int(8) COMMENT '已修复问题数', - confirm_date VARCHAR(20) COMMENT '最后确认日期', - review_object VARCHAR(100) COMMENT '评审对象', - review_result VARCHAR(50) COMMENT '评审结果', - result_confirmor VARCHAR(50) COMMENT '结果确认人', - remark VARCHAR(500) COMMENT '备注', - primary key (id) -)default character set utf8; -create table QA_REVIEWINFO -( - id int(8) not null AUTO_INCREMENT, - review_id int(8) not null COMMENT '评审ID', - bug_description VARCHAR(500) COMMENT '问题描述', - status VARCHAR(20) COMMENT '状态', - duty_officer VARCHAR(100) COMMENT '责任人', - confirm_date VARCHAR(20) COMMENT '最后确认日期', - corrective VARCHAR(500) COMMENT '纠正措施', - primary key (id) -)default character set utf8; -create table QA_SECONDARYSECTOR -( - sectorid int(10) not null AUTO_INCREMENT, - departmenthead VARCHAR(20), - departmentname VARCHAR(20), - primary key (sectorid) -)default character set utf8; -create table QA_SECTORPROJECTS -( - projectid int(10) not null AUTO_INCREMENT, - projectname VARCHAR(100) not null, - projectmanager VARCHAR(100) not null, - sectorid int(10) not null, - projecttype int(4) default 0 not null, - primary key (projectid) -)default character set utf8; -create table QA_ZTTASK -( - id int(8) not null AUTO_INCREMENT, - versionid int(8) COMMENT '版本ID', - versionname VARCHAR(100) COMMENT '版本名称', - taskname VARCHAR(300) COMMENT '任务名称', - assigneddate VARCHAR(50) COMMENT '完成时间', - estimate int(8) COMMENT '预期工时', - consumed int(8) COMMENT '实际工时', - finishedby VARCHAR(40) COMMENT '完成人账号', - finishedname VARCHAR(40) COMMENT '完成人姓名', - deadline VARCHAR(40) COMMENT '计划截止日期', - delaystatus int(4) COMMENT '延期状态', - primary key (id) -)default character set utf8; -create table TEST_JOBS -( - id int(10) not null AUTO_INCREMENT, - name VARCHAR(100) not null COMMENT '调度名称', - startdate VARCHAR(100) COMMENT '开始日期', - starttime VARCHAR(100) COMMENT '开始时间', - enddate VARCHAR(100) COMMENT '结束日期', - endtime VARCHAR(100) COMMENT '结束时间', - runtime datetime COMMENT '执行时间', - remark VARCHAR(800) COMMENT '备注', - planproj VARCHAR(100) COMMENT '项目名(testlink)中', - state VARCHAR(4) not null COMMENT '状态', - tasktype VARCHAR(4) not null COMMENT '执行类型 O执行一次 D每天执行', - starttimestr VARCHAR(100) COMMENT '执行时间表达式', - endtimestr VARCHAR(100) COMMENT '结束时间', - createtime datetime not null, - noenddate VARCHAR(10) COMMENT '是否有结束日期', - time int default 0, - timetype VARCHAR(4), - issendmail VARCHAR(4) default "0" COMMENT '是否发送邮件通知', - emailer VARCHAR(250) COMMENT '邮件地址', - threadcount int default 1 COMMENT '客户端线程数(接口)', - testlinkname VARCHAR(200) COMMENT 'TESTLINK中的计划名称', - isbuilding VARCHAR(4) default '0' not null COMMENT '是否自动构建', - buildname VARCHAR(100) COMMENT '构建链接', - isrestart VARCHAR(4) default '0' not null COMMENT '是否自动重启', - restartcomm VARCHAR(200) COMMENT '重启脚本', - extype int(4) default 0 not null COMMENT '执行类型', - browsertype int(4) COMMENT 'UI自动化浏览器类型', - timeout int(8) default 60 not null COMMENT '任务超时中断时间(分钟)', - clientip VARCHAR(30) default '127.0.0.1' not null COMMENT '版本ID', - primary key (id) -)default character set utf8; -create table TEST_CASEDETAIL -( - id int(10) not null AUTO_INCREMENT, - taskid int(10) not null, - caseno VARCHAR(20) not null COMMENT '用例编号', - caseversion VARCHAR(20) not null COMMENT '用例版本', - casetime datetime not null COMMENT '执行时间', - casename VARCHAR(200) not null COMMENT '用例名称', - casestatus VARCHAR(2) default '4' not null COMMENT ' pass:0 fail:1 lock:2 unexcute:4', - primary key (id) -)default character set utf8; -create table TEST_LOGDETAIL -( - logid int(10) not null AUTO_INCREMENT, - logtime datetime not null COMMENT '日志时间', - detail VARCHAR(5000) not null COMMENT '日志', /*V1.1 扩展日志明细字段到2000*/ - loggrade VARCHAR(20) COMMENT '日志级别', - caseid int(10) not null COMMENT '用例编号', - taskid int(10), - step VARCHAR(20) COMMENT '用例步骤', - imgname VARCHAR(30) COMMENT 'UI自动化自动截图地址', - primary key (logid) -)default character set utf8; -create table TEST_TASKEXCUTE -( - id int(10) not null AUTO_INCREMENT, - taskid VARCHAR(150) not null, - casetotal_count int(10) COMMENT '总用例数', - casesucc_count int(10) COMMENT '成功数', - casefail_count int(10) COMMENT '失败数', - caselock_count int(10) COMMENT '锁定数', - createtime datetime COMMENT '时间', - jobid int(10) not null, - finishtime datetime COMMENT '完成时间', - taskstatus VARCHAR(2) default '' COMMENT '状态 0未执行 1执行中 2 成功 4失败 ', - casenoexec_count int default 0 COMMENT '未执行用例', - caseisexec VARCHAR(2) COMMENT '任务是否被成功吊起 0 成功吊起 3 吊起失败', - primary key (id) -)default character set utf8; -create table USERINFO -( - id int(8) not null AUTO_INCREMENT, - usercode VARCHAR(20) not null, - password VARCHAR(200) not null, - username VARCHAR(20), - role VARCHAR(100) COMMENT '角色', - sectorid int(8) default 0 not null COMMENT '所属部门', - primary key (id) -)default character set utf8; - -create table USER_AUTHORITY -( - id int(9) not null AUTO_INCREMENT, - module VARCHAR(50) not null COMMENT '模块', - auth_type VARCHAR(50) not null COMMENT '权限类型', - alias VARCHAR(50) not null COMMENT '别名', - primary key (id) -)default character set utf8; -create table USER_ROLE -( - id int(9) not null AUTO_INCREMENT, - role VARCHAR(50) not null COMMENT '角色', - permission VARCHAR(1000) COMMENT '权限', - primary key (id) -)default character set utf8; - -/*插入索引 -CREATE INDEX index_caseid ON TEST_LOGDETAIL (caseid); -CREATE INDEX index_taskid ON TEST_CASEDETAIL (taskid);*/ - -/*插入权限默认定义*/ -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (1, '质量-版本信息', '增加', 'pv_1'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (2, '质量-版本信息', '删除', 'pv_2'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (3, '质量-版本信息', '修改', 'pv_3'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (4, '质量-版本计划信息', '增加', 'pvp_1'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (5, '质量-流程检查信息', '增加', 'fc_1'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (6, '质量-流程检查信息', '删除', 'fc_2'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (7, '质量-流程检查信息', '修改', 'fc_3'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (8, '质量-生产故障信息', '增加', 'acc_1'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (9, '质量-生产故障信息', '删除', 'acc_2'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (10, '质量-生产故障信息', '修改', 'acc_3'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (21, '自动化-任务调度', '启动', 'tast_run'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (22, '自动化-任务调度', '移除', 'tast_remove'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (23, '自动化-任务调度', '执行', 'tast_ex'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (24, '自动化-任务调度', '增加', 'tast_1'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (25, '自动化-任务调度', '删除', 'tast_2'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (26, '自动化-任务调度', '修改', 'tast_3'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (27, '自动化-任务调度', '上传', 'tast_upload'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (11, '质量-流程检查计划', '增加', 'pfc_1'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (12, '质量-流程检查计划', '删除', 'pfc_2'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (13, '质量-流程检查计划', '修改', 'pfc_3'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (14, '质量-流程检查计划', '转计划', 'fc_tocheck'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (15, '质量-评审信息详情', '增加', 'revinfo_1'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (16, '质量-评审信息详情', '删除', 'revinfo_2'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (17, '质量-评审信息详情', '修改', 'revinfo_3'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (18, '质量-评审信息', '删除', 'rev_2'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (19, '质量-评审信息', '修改', 'rev_3'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (20, '质量-生产故障信息', '上传', 'acc_upload'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (41, '用户管理', '增加', 'ui_1'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (42, '用户管理', '删除', 'ui_2'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (43, '用户管理', '修改', 'ui_3'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (44, '用户管理', '查看', 'ui_4'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (45, '用户管理-权限角色', '查看修改', 'role_3'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (28, '自动化-任务列表', '删除', 'tastex_2'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (29, '自动化-用例列表', '执行', 'case_ex'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (46, '用户管理-权限角色', '增加', 'role_1'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (47, '用户管理-权限角色', '删除', 'role_2'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (48, '项目管理', '增加', 'pro_1'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (49, '项目管理', '删除', 'pro_2'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (50, '项目管理', '修改', 'pro_3'); - -/*插入角色默认定义*/ -insert into USER_ROLE (id, role, permission) -values (2, '测试工程师', 'acc_1,acc_2,acc_3,'); -insert into USER_ROLE (id, role, permission) -values (3, '自动化工程师', 'acc_1,acc_2,acc_3,tast_run,tast_remove,tast_ex,tast_1,tast_3,tast_2,tast_upload,tastex_2,case_ex,'); -insert into USER_ROLE (id, role, permission) -values (4, '质量工程师', 'pv_1,pv_2,pv_3,pvp_1,fc_1,fc_2,fc_3,acc_1,acc_2,acc_3,pfc_1,pfc_2,pfc_3,fc_tocheck,revinfo_1,revinfo_2,revinfo_3,rev_2,rev_3,acc_upload,'); -insert into USER_ROLE (id, role, permission) -values (1, '管理员', 'pv_1,pv_2,pv_3,pvp_1,fc_1,fc_2,fc_3,acc_1,acc_2,acc_3,tast_run,tast_remove,tast_ex,tast_1,tast_3,tast_2,tast_upload,tastex_2,case_ex,pfc_1,pfc_2,pfc_3,fc_tocheck,revinfo_1,revinfo_2,revinfo_3,rev_2,rev_3,acc_upload,ui_1,ui_2,ui_3,ui_4,role_3,role_1,role_2,'); - -/*插入默认部门分级*/ -insert into QA_SECONDARYSECTOR (sectorid, departmenthead, departmentname) -values (99, '系统管理员', '总部'); -/*插入默认项目*/ -insert into QA_SECTORPROJECTS (projectid, projectname, projectmanager, sectorid, projecttype) -values (99, '全部项目/未知项目', '系统管理员', 99, 0); -/*插入默认管理员*/ -insert into USERINFO (id, usercode, password, username, role, sectorid) -values (1, 'admin', 'uJ45aIeS9N80kaSFDjvk%2FA%3D%3D', '系统管理员', '1', 99); -/*插入流程检查定义数据*/ -insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) -values (36, 5, '总结阶段', 2, '计划变更', 1, '如与计划不合,是否提交计划变更邮件', null); -insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) -values (37, 5, '总结阶段', 3, '代码质量', 1, 'sonar代码检查是否刷新构建', null); -insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) -values (38, 5, '总结阶段', 3, '代码质量', 2, 'sonar代码问题数是否符合要求', null); -insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) -values (35, 2, '开发阶段', 3, '开发与编码', 6, '是否每一条禅道开发任务都提交转测申请', null); -insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) -values (34, 4, '验收与上线', 2, '上线部署', 3, 'SVN代码是否提交并标注', null); -insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) -values (1, 1, '需求阶段', 1, '需求编制', 1, '《产品需求说明书》是否组织评审会', null); -insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) -values (2, 1, '需求阶段', 1, '需求编制', 2, '《产品需求说明书》评审是否通过', null); -insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) -values (3, 1, '需求阶段', 1, '需求编制', 3, '《产品需求说明书》是否归档到SVN', null); -insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) -values (4, 1, '需求阶段', 1, '需求编制', 4, '《产品需求说明书》评审记录表是否签字通过', null); -insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) -values (5, 2, '开发阶段', 1, '需求分解', 1, '是否有需求分解/任务讨论会', null); -insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) -values (6, 2, '开发阶段', 1, '需求分解', 2, '《项目计划》邮件是否及时发出', null); -insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) -values (7, 2, '开发阶段', 1, '需求分解', 3, '《项目计划》邮件内容是否完整', null); -insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) -values (10, 2, '开发阶段', 2, '软件设计', 1, '《产品开发概要设计》是否组织评审会', null); -insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) -values (11, 2, '开发阶段', 2, '软件设计', 2, '《产品开发概要设计》评审是否通过', null); -insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) -values (12, 2, '开发阶段', 2, '软件设计', 3, '《产品开发概要设计》是否归档到SVN', null); -insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) -values (13, 2, '开发阶段', 2, '软件设计', 4, '《产品开发概要设计》评审记录表是否签字通过', null); -insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) -values (14, 2, '开发阶段', 3, '开发与编码', 1, '是否进行每日晨会', null); -insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) -values (15, 2, '开发阶段', 3, '开发与编码', 2, '是否进行代码走读', null); -insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) -values (16, 2, '开发阶段', 3, '开发与编码', 3, '是否每一条禅道开发任务都提交转测申请', null); -insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) -values (17, 2, '开发阶段', 3, '开发与编码', 4, '转测邮件是否合格', null); -insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) -values (18, 2, '开发阶段', 3, '开发与编码', 5, '转测邮件打回次数为0', null); -insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) -values (19, 3, '测试阶段', 1, '软件测试', 1, '是否回复测试计划', null); -insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) -values (20, 3, '测试阶段', 1, '软件测试', 2, '是否回复测试用例', null); -insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) -values (21, 3, '测试阶段', 1, '软件测试', 3, '测试用例是否通过评审/确认', null); -insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) -values (22, 3, '测试阶段', 1, '软件测试', 4, '《软件测试报告》是否组织评审会', null); -insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) -values (23, 3, '测试阶段', 1, '软件测试', 5, '《软件测试报告》是否评审通过', null); -insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) -values (24, 3, '测试阶段', 1, '软件测试', 6, '《软件测试报告》/测试结果是否发出邮件', null); -insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) -values (25, 3, '测试阶段', 1, '软件测试', 7, '《软件测试报告》评审记录表是否签字通过', null); -insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) -values (26, 4, '验收与上线', 1, '产品验收', 1, '《产品验收报告》是否组织评审会', null); -insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) -values (27, 4, '验收与上线', 1, '产品验收', 2, '《产品验收报告》是否评审通过', null); -insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) -values (28, 4, '验收与上线', 1, '产品验收', 3, '《产品验收报告》是否归档到SVN', null); -insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) -values (29, 4, '验收与上线', 1, '产品验收', 4, '《产品验收报告》评审记录表是否签字通过', null); -insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) -values (30, 4, '验收与上线', 2, '上线部署', 1, '产品/开发是否提交上线流程(OA)', null); -insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) -values (31, 4, '验收与上线', 2, '上线部署', 2, '开发是否提交上线相关资料', null); -insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) -values (32, 5, '总结阶段', 1, '项目总结', 1, '《项目总结》邮件是否及时发出', null); -insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +create table OPERATION_LOG +( + id int(9) not null AUTO_INCREMENT, + tablename VARCHAR(30) not null COMMENT '被记录日志表名', + tableid int(8) not null COMMENT '被记录日志ID', + operation_time VARCHAR(30) not null COMMENT '操作时间', + operationer VARCHAR(20) not null COMMENT '操作人员', + operation_description VARCHAR(200) not null COMMENT '描述', + projectid int(8) COMMENT '项目ID', + primary key (ID) +)default character set utf8; +create table QA_ACCIDENT +( + id int(8) not null AUTO_INCREMENT, + projectid int(8) not null COMMENT '项目ID', + accstatus VARCHAR(80) not null COMMENT '事故状态', + eventtime VARCHAR(30) COMMENT '事故发生时间', + reporter VARCHAR(20) not null COMMENT '报告人', + reporttime VARCHAR(30) not null COMMENT '事故报告时间', + accdescription VARCHAR(500) not null COMMENT '事故描述', + acclevel VARCHAR(60) not null COMMENT '事故等级', + causalanalysis VARCHAR(500) COMMENT '原因分析', + causaltype VARCHAR(100) COMMENT '原因类型', + consequenceanalysis VARCHAR(300) COMMENT '后果分析', + correctiveaction VARCHAR(300) COMMENT '纠正措施', + resolutiontime VARCHAR(30) COMMENT '解决时间', + resolutioner VARCHAR(20) COMMENT '解决处理人', + preventiveaction VARCHAR(300) COMMENT '预防措施', + preventiver VARCHAR(20) COMMENT '预防措施责任人', + preventiveplandate VARCHAR(30) COMMENT '预防措施计划完成时间', + preventiveaccdate VARCHAR(30) COMMENT '预防措施实际完成时间', + trouble_duration int(8) COMMENT '事故持续时间', + impact_time int(8), + filename VARCHAR(100) COMMENT '附件路径', + primary key (ID) +)default character set utf8; +create table QA_FLOWCHECK +( + id int(10) not null AUTO_INCREMENT, + checkid int(10) not null COMMENT '检查id', + projectid int(10) not null COMMENT '项目id', + projectphase VARCHAR(20) not null COMMENT '项目阶段', + phasenode VARCHAR(50) not null COMMENT '阶段节点', + checkentry VARCHAR(100) not null COMMENT '检查内容', + checkresult VARCHAR(20) COMMENT '检查结果', + checkdate VARCHAR(20) COMMENT '检查日期', + checkdescriptions VARCHAR(400) COMMENT '不符合项描述', + stateupdate VARCHAR(20) COMMENT '状态更新', + updatedate VARCHAR(20) COMMENT '更新日期', + remark VARCHAR(200) COMMENT '备注', + versionnum VARCHAR(30) COMMENT '版本号', + primary key (ID) +)default character set utf8; +create table QA_FLOWINFO +( + id int(10) not null AUTO_INCREMENT, + phaseid int(10) not null, + phasename VARCHAR(20) not null, + phasenodeid int(10) not null, + phasenodename VARCHAR(20) not null, + checkentryid int(10) not null, + checkentry VARCHAR(200) not null, + remark VARCHAR(100), + primary key (ID) +)default character set utf8; +create table QA_PLANFLOWCHECK +( + id int(8) not null AUTO_INCREMENT, + projectid int(8) not null COMMENT '项目ID', + versionnum VARCHAR(30) COMMENT '版本号', + checkentryid VARCHAR(20) not null COMMENT '检查ID', + plandate VARCHAR(20) not null COMMENT '计划检查日期', + status int(4) not null COMMENT '计划状态:1 检查计划 2 已检查', + primary key (ID) +)default character set utf8; +create table QA_PROJECTVERSION +( + versionid int(10) not null AUTO_INCREMENT, + versionnumber VARCHAR(20) COMMENT '版本号', + plan_launchdate VARCHAR(20) COMMENT '计划上线日期', + actually_launchdate VARCHAR(20) COMMENT '实际上线日期', + plan_devstart VARCHAR(20) COMMENT '计划开发开始时间', + plan_devend VARCHAR(20) COMMENT '计划开发结束时间', + actually_devstart VARCHAR(20) COMMENT '实际开发开始时间', + actually_devend VARCHAR(20) COMMENT '实际开发结束时间', + plan_teststart VARCHAR(20) COMMENT '计划测试开始时间', + plan_testend VARCHAR(20) COMMENT '计划测试结束时间', + actually_teststart VARCHAR(20) COMMENT '实际测试开始时间', + actually_testend VARCHAR(20) COMMENT '实际测试结束时间', + plan_demand int(10) COMMENT '计划上线需求数', + actually_demand int(10) COMMENT '实际上线需求数', + codeline FLOAT(10) COMMENT '代码变动行数', + testcasenum int(10) COMMENT '测试用例数', + changetestingreturn int(10) COMMENT '版本转测试打回次数', + dev_member VARCHAR(50) COMMENT '开发投入人力', + test_member VARCHAR(50) COMMENT '测试投入人力', + human_cost VARCHAR(20) COMMENT '耗费人力 人/天', + per_dev VARCHAR(20) COMMENT '开发平均生产率 人/天/行', + per_test VARCHAR(20) COMMENT '用例编写/用例执行', + code_di VARCHAR(20) COMMENT '代码DI值', + qualityreview VARCHAR(500) COMMENT '质量回溯', + imprint VARCHAR(500) COMMENT '版本说明', + remark VARCHAR(500) COMMENT '备注', + projectid int(10) COMMENT '项目ID', + devtime_deviation VARCHAR(20) COMMENT '开发偏移率', + devdelay_days VARCHAR(20) COMMENT '开发延迟时间', + testtime_deviation VARCHAR(20) COMMENT '测试偏移率', + testdelay_days VARCHAR(20) COMMENT '测试延迟时间', + protime_deviation VARCHAR(20), + prodelay_days VARCHAR(20), + bug_zm int(10), + bug_yz int(10), + bug_yb int(10), + bug_ts int(10), + versiontype int(8) default 1 not null COMMENT '版本类型', + perdemand FLOAT(8) default 0.00, + codestandard_zd int(10) default 0 not null, + codestandard_yz int(10) default 0 not null, + codestandard_zy int(10) default 0 not null, + zt_versionlink VARCHAR(100) COMMENT '禅道链接', + human_costdev VARCHAR(20) default '0' COMMENT '开发人力成本', + human_costtest VARCHAR(20) default '0' COMMENT '测试人力成本', + primary key (versionid) +)default character set utf8; +create table QA_REVIEW +( + id int(8) not null AUTO_INCREMENT, + projectid int(8) not null COMMENT '项目ID', + version VARCHAR(20) not null COMMENT '版本号', + review_type VARCHAR(20) COMMENT '评审类型', + review_date VARCHAR(20) COMMENT '评审日期', + bug_num int(8) COMMENT '问题数', + repair_num int(8) COMMENT '已修复问题数', + confirm_date VARCHAR(20) COMMENT '最后确认日期', + review_object VARCHAR(100) COMMENT '评审对象', + review_result VARCHAR(50) COMMENT '评审结果', + result_confirmor VARCHAR(50) COMMENT '结果确认人', + remark VARCHAR(500) COMMENT '备注', + primary key (id) +)default character set utf8; +create table QA_REVIEWINFO +( + id int(8) not null AUTO_INCREMENT, + review_id int(8) not null COMMENT '评审ID', + bug_description VARCHAR(500) COMMENT '问题描述', + status VARCHAR(20) COMMENT '状态', + duty_officer VARCHAR(100) COMMENT '责任人', + confirm_date VARCHAR(20) COMMENT '最后确认日期', + corrective VARCHAR(500) COMMENT '纠正措施', + primary key (id) +)default character set utf8; +create table QA_SECONDARYSECTOR +( + sectorid int(10) not null AUTO_INCREMENT, + departmenthead VARCHAR(20), + departmentname VARCHAR(20), + primary key (sectorid) +)default character set utf8; +create table QA_SECTORPROJECTS +( + projectid int(10) not null AUTO_INCREMENT, + projectname VARCHAR(100) not null, + projectmanager VARCHAR(100) not null, + sectorid int(10) not null, + projecttype int(4) default 0 not null, + primary key (projectid) +)default character set utf8; +create table QA_ZTTASK +( + id int(8) not null AUTO_INCREMENT, + versionid int(8) COMMENT '版本ID', + versionname VARCHAR(100) COMMENT '版本名称', + taskname VARCHAR(300) COMMENT '任务名称', + assigneddate VARCHAR(50) COMMENT '完成时间', + estimate int(8) COMMENT '预期工时', + consumed int(8) COMMENT '实际工时', + finishedby VARCHAR(40) COMMENT '完成人账号', + finishedname VARCHAR(40) COMMENT '完成人姓名', + deadline VARCHAR(40) COMMENT '计划截止日期', + delaystatus int(4) COMMENT '延期状态', + primary key (id) +)default character set utf8; +create table TEST_JOBS +( + id int(10) not null AUTO_INCREMENT, + name VARCHAR(100) not null COMMENT '调度名称', + startdate VARCHAR(100) COMMENT '开始日期', + starttime VARCHAR(100) COMMENT '开始时间', + enddate VARCHAR(100) COMMENT '结束日期', + endtime VARCHAR(100) COMMENT '结束时间', + runtime datetime COMMENT '执行时间', + remark VARCHAR(800) COMMENT '备注', + planproj VARCHAR(100) COMMENT '项目名(testlink)中', + state VARCHAR(4) not null COMMENT '状态', + tasktype VARCHAR(4) not null COMMENT '执行类型 O执行一次 D每天执行', + starttimestr VARCHAR(100) COMMENT '执行时间表达式', + endtimestr VARCHAR(100) COMMENT '结束时间', + createtime datetime not null, + noenddate VARCHAR(10) COMMENT '是否有结束日期', + time int default 0, + timetype VARCHAR(4), + issendmail VARCHAR(4) default "0" COMMENT '是否发送邮件通知', + emailer VARCHAR(250) COMMENT '邮件地址', + threadcount int default 1 COMMENT '客户端线程数(接口)', + testlinkname VARCHAR(200) COMMENT 'TESTLINK中的计划名称', + isbuilding VARCHAR(4) default '0' not null COMMENT '是否自动构建', + buildname VARCHAR(100) COMMENT '构建链接', + isrestart VARCHAR(4) default '0' not null COMMENT '是否自动重启', + restartcomm VARCHAR(200) COMMENT '重启脚本', + extype int(4) default 0 not null COMMENT '执行类型', + browsertype int(4) COMMENT 'UI自动化浏览器类型', + timeout int(8) default 60 not null COMMENT '任务超时中断时间(分钟)', + clientip VARCHAR(30) default '127.0.0.1' not null COMMENT '版本ID', + primary key (id) +)default character set utf8; +create table TEST_CASEDETAIL +( + id int(10) not null AUTO_INCREMENT, + taskid int(10) not null, + caseno VARCHAR(20) not null COMMENT '用例编号', + caseversion VARCHAR(20) not null COMMENT '用例版本', + casetime datetime not null COMMENT '执行时间', + casename VARCHAR(200) not null COMMENT '用例名称', + casestatus VARCHAR(2) default '4' not null COMMENT ' pass:0 fail:1 lock:2 unexcute:4', + primary key (id) +)default character set utf8; +create table TEST_LOGDETAIL +( + logid int(10) not null AUTO_INCREMENT, + logtime datetime not null COMMENT '日志时间', + detail VARCHAR(5000) not null COMMENT '日志', /*V1.1 扩展日志明细字段到2000*/ + loggrade VARCHAR(20) COMMENT '日志级别', + caseid int(10) not null COMMENT '用例编号', + taskid int(10), + step VARCHAR(20) COMMENT '用例步骤', + imgname VARCHAR(30) COMMENT 'UI自动化自动截图地址', + primary key (logid) +)default character set utf8; +create table TEST_TASKEXCUTE +( + id int(10) not null AUTO_INCREMENT, + taskid VARCHAR(150) not null, + casetotal_count int(10) COMMENT '总用例数', + casesucc_count int(10) COMMENT '成功数', + casefail_count int(10) COMMENT '失败数', + caselock_count int(10) COMMENT '锁定数', + createtime datetime COMMENT '时间', + jobid int(10) not null, + finishtime datetime COMMENT '完成时间', + taskstatus VARCHAR(2) default '' COMMENT '状态 0未执行 1执行中 2 成功 4失败 ', + casenoexec_count int default 0 COMMENT '未执行用例', + caseisexec VARCHAR(2) COMMENT '任务是否被成功吊起 0 成功吊起 3 吊起失败', + primary key (id) +)default character set utf8; +create table USERINFO +( + id int(8) not null AUTO_INCREMENT, + usercode VARCHAR(20) not null, + password VARCHAR(200) not null, + username VARCHAR(20), + role VARCHAR(100) COMMENT '角色', + sectorid int(8) default 0 not null COMMENT '所属部门', + primary key (id) +)default character set utf8; + +create table USER_AUTHORITY +( + id int(9) not null AUTO_INCREMENT, + module VARCHAR(50) not null COMMENT '模块', + auth_type VARCHAR(50) not null COMMENT '权限类型', + alias VARCHAR(50) not null COMMENT '别名', + primary key (id) +)default character set utf8; +create table USER_ROLE +( + id int(9) not null AUTO_INCREMENT, + role VARCHAR(50) not null COMMENT '角色', + permission VARCHAR(1000) COMMENT '权限', + primary key (id) +)default character set utf8; + +/*插入索引 +CREATE INDEX index_caseid ON TEST_LOGDETAIL (caseid); +CREATE INDEX index_taskid ON TEST_CASEDETAIL (taskid);*/ + +/*插入权限默认定义*/ +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (1, '质量-版本信息', '增加', 'pv_1'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (2, '质量-版本信息', '删除', 'pv_2'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (3, '质量-版本信息', '修改', 'pv_3'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (4, '质量-版本计划信息', '增加', 'pvp_1'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (5, '质量-流程检查信息', '增加', 'fc_1'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (6, '质量-流程检查信息', '删除', 'fc_2'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (7, '质量-流程检查信息', '修改', 'fc_3'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (8, '质量-生产故障信息', '增加', 'acc_1'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (9, '质量-生产故障信息', '删除', 'acc_2'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (10, '质量-生产故障信息', '修改', 'acc_3'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (21, '自动化-任务调度', '启动', 'tast_run'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (22, '自动化-任务调度', '移除', 'tast_remove'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (23, '自动化-任务调度', '执行', 'tast_ex'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (24, '自动化-任务调度', '增加', 'tast_1'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (25, '自动化-任务调度', '删除', 'tast_2'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (26, '自动化-任务调度', '修改', 'tast_3'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (27, '自动化-任务调度', '上传', 'tast_upload'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (11, '质量-流程检查计划', '增加', 'pfc_1'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (12, '质量-流程检查计划', '删除', 'pfc_2'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (13, '质量-流程检查计划', '修改', 'pfc_3'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (14, '质量-流程检查计划', '转计划', 'fc_tocheck'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (15, '质量-评审信息详情', '增加', 'revinfo_1'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (16, '质量-评审信息详情', '删除', 'revinfo_2'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (17, '质量-评审信息详情', '修改', 'revinfo_3'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (18, '质量-评审信息', '删除', 'rev_2'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (19, '质量-评审信息', '修改', 'rev_3'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (20, '质量-生产故障信息', '上传', 'acc_upload'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (41, '用户管理', '增加', 'ui_1'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (42, '用户管理', '删除', 'ui_2'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (43, '用户管理', '修改', 'ui_3'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (44, '用户管理', '查看', 'ui_4'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (45, '用户管理-权限角色', '查看修改', 'role_3'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (28, '自动化-任务列表', '删除', 'tastex_2'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (29, '自动化-用例列表', '执行', 'case_ex'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (46, '用户管理-权限角色', '增加', 'role_1'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (47, '用户管理-权限角色', '删除', 'role_2'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (48, '项目管理', '增加', 'pro_1'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (49, '项目管理', '删除', 'pro_2'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (50, '项目管理', '修改', 'pro_3'); + +/*插入角色默认定义*/ +insert into USER_ROLE (id, role, permission) +values (2, '测试工程师', 'acc_1,acc_2,acc_3,'); +insert into USER_ROLE (id, role, permission) +values (3, '自动化工程师', 'acc_1,acc_2,acc_3,tast_run,tast_remove,tast_ex,tast_1,tast_3,tast_2,tast_upload,tastex_2,case_ex,'); +insert into USER_ROLE (id, role, permission) +values (4, '质量工程师', 'pv_1,pv_2,pv_3,pvp_1,fc_1,fc_2,fc_3,acc_1,acc_2,acc_3,pfc_1,pfc_2,pfc_3,fc_tocheck,revinfo_1,revinfo_2,revinfo_3,rev_2,rev_3,acc_upload,'); +insert into USER_ROLE (id, role, permission) +values (1, '管理员', 'pv_1,pv_2,pv_3,pvp_1,fc_1,fc_2,fc_3,acc_1,acc_2,acc_3,tast_run,tast_remove,tast_ex,tast_1,tast_3,tast_2,tast_upload,tastex_2,case_ex,pfc_1,pfc_2,pfc_3,fc_tocheck,revinfo_1,revinfo_2,revinfo_3,rev_2,rev_3,acc_upload,ui_1,ui_2,ui_3,ui_4,role_3,role_1,role_2,'); + +/*插入默认部门分级*/ +insert into QA_SECONDARYSECTOR (sectorid, departmenthead, departmentname) +values (99, '系统管理员', '总部'); +/*插入默认项目*/ +insert into QA_SECTORPROJECTS (projectid, projectname, projectmanager, sectorid, projecttype) +values (99, '全部项目/未知项目', '系统管理员', 99, 0); +/*插入默认管理员*/ +insert into USERINFO (id, usercode, password, username, role, sectorid) +values (1, 'admin', 'uJ45aIeS9N80kaSFDjvk%2FA%3D%3D', '系统管理员', '1', 99); +/*插入流程检查定义数据*/ +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (36, 5, '总结阶段', 2, '计划变更', 1, '如与计划不合,是否提交计划变更邮件', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (37, 5, '总结阶段', 3, '代码质量', 1, 'sonar代码检查是否刷新构建', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (38, 5, '总结阶段', 3, '代码质量', 2, 'sonar代码问题数是否符合要求', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (35, 2, '开发阶段', 3, '开发与编码', 6, '是否每一条禅道开发任务都提交转测申请', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (34, 4, '验收与上线', 2, '上线部署', 3, 'SVN代码是否提交并标注', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (1, 1, '需求阶段', 1, '需求编制', 1, '《产品需求说明书》是否组织评审会', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (2, 1, '需求阶段', 1, '需求编制', 2, '《产品需求说明书》评审是否通过', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (3, 1, '需求阶段', 1, '需求编制', 3, '《产品需求说明书》是否归档到SVN', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (4, 1, '需求阶段', 1, '需求编制', 4, '《产品需求说明书》评审记录表是否签字通过', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (5, 2, '开发阶段', 1, '需求分解', 1, '是否有需求分解/任务讨论会', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (6, 2, '开发阶段', 1, '需求分解', 2, '《项目计划》邮件是否及时发出', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (7, 2, '开发阶段', 1, '需求分解', 3, '《项目计划》邮件内容是否完整', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (10, 2, '开发阶段', 2, '软件设计', 1, '《产品开发概要设计》是否组织评审会', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (11, 2, '开发阶段', 2, '软件设计', 2, '《产品开发概要设计》评审是否通过', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (12, 2, '开发阶段', 2, '软件设计', 3, '《产品开发概要设计》是否归档到SVN', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (13, 2, '开发阶段', 2, '软件设计', 4, '《产品开发概要设计》评审记录表是否签字通过', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (14, 2, '开发阶段', 3, '开发与编码', 1, '是否进行每日晨会', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (15, 2, '开发阶段', 3, '开发与编码', 2, '是否进行代码走读', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (16, 2, '开发阶段', 3, '开发与编码', 3, '是否每一条禅道开发任务都提交转测申请', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (17, 2, '开发阶段', 3, '开发与编码', 4, '转测邮件是否合格', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (18, 2, '开发阶段', 3, '开发与编码', 5, '转测邮件打回次数为0', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (19, 3, '测试阶段', 1, '软件测试', 1, '是否回复测试计划', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (20, 3, '测试阶段', 1, '软件测试', 2, '是否回复测试用例', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (21, 3, '测试阶段', 1, '软件测试', 3, '测试用例是否通过评审/确认', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (22, 3, '测试阶段', 1, '软件测试', 4, '《软件测试报告》是否组织评审会', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (23, 3, '测试阶段', 1, '软件测试', 5, '《软件测试报告》是否评审通过', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (24, 3, '测试阶段', 1, '软件测试', 6, '《软件测试报告》/测试结果是否发出邮件', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (25, 3, '测试阶段', 1, '软件测试', 7, '《软件测试报告》评审记录表是否签字通过', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (26, 4, '验收与上线', 1, '产品验收', 1, '《产品验收报告》是否组织评审会', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (27, 4, '验收与上线', 1, '产品验收', 2, '《产品验收报告》是否评审通过', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (28, 4, '验收与上线', 1, '产品验收', 3, '《产品验收报告》是否归档到SVN', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (29, 4, '验收与上线', 1, '产品验收', 4, '《产品验收报告》评审记录表是否签字通过', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (30, 4, '验收与上线', 2, '上线部署', 1, '产品/开发是否提交上线流程(OA)', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (31, 4, '验收与上线', 2, '上线部署', 2, '开发是否提交上线相关资料', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (32, 5, '总结阶段', 1, '项目总结', 1, '《项目总结》邮件是否及时发出', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) values (33, 5, '总结阶段', 1, '项目总结', 2, '《项目总结》邮件内容是否完整', null); \ No newline at end of file diff --git a/mysqldb/initialization(create table)/V2.0 初始化 .sql b/mysqldb/initialization(create table)/V2.0 初始化 .sql index 4c4ef44..c0bb583 100644 --- a/mysqldb/initialization(create table)/V2.0 初始化 .sql +++ b/mysqldb/initialization(create table)/V2.0 初始化 .sql @@ -1,541 +1,541 @@ -create table OPERATION_LOG -( - id int(9) not null AUTO_INCREMENT, - tablename VARCHAR(30) not null COMMENT '被记录日志表名', - tableid int(8) not null COMMENT '被记录日志ID', - operation_time VARCHAR(30) not null COMMENT '操作时间', - operationer VARCHAR(20) not null COMMENT '操作人员', - operation_description VARCHAR(200) not null COMMENT '描述', - projectid int(8) COMMENT '项目ID', - primary key (ID) -)default character set utf8; -create table QA_ACCIDENT -( - id int(8) not null AUTO_INCREMENT, - projectid int(8) not null COMMENT '项目ID', - accstatus VARCHAR(80) not null COMMENT '事故状态', - eventtime VARCHAR(30) COMMENT '事故发生时间', - reporter VARCHAR(20) not null COMMENT '报告人', - reporttime VARCHAR(30) not null COMMENT '事故报告时间', - accdescription VARCHAR(500) not null COMMENT '事故描述', - acclevel VARCHAR(60) not null COMMENT '事故等级', - causalanalysis VARCHAR(500) COMMENT '原因分析', - causaltype VARCHAR(100) COMMENT '原因类型', - consequenceanalysis VARCHAR(300) COMMENT '后果分析', - correctiveaction VARCHAR(300) COMMENT '纠正措施', - resolutiontime VARCHAR(30) COMMENT '解决时间', - resolutioner VARCHAR(20) COMMENT '解决处理人', - preventiveaction VARCHAR(300) COMMENT '预防措施', - preventiver VARCHAR(20) COMMENT '预防措施责任人', - preventiveplandate VARCHAR(30) COMMENT '预防措施计划完成时间', - preventiveaccdate VARCHAR(30) COMMENT '预防措施实际完成时间', - trouble_duration int(8) COMMENT '事故持续时间', - impact_time int(8), - filename VARCHAR(100) COMMENT '附件路径', - primary key (ID) -)default character set utf8; -create table QA_FLOWCHECK -( - id int(10) not null AUTO_INCREMENT, - checkid int(10) not null COMMENT '检查id', - projectid int(10) not null COMMENT '项目id', - projectphase VARCHAR(20) not null COMMENT '项目阶段', - phasenode VARCHAR(50) not null COMMENT '阶段节点', - checkentry VARCHAR(100) not null COMMENT '检查内容', - checkresult VARCHAR(20) COMMENT '检查结果', - checkdate VARCHAR(20) COMMENT '检查日期', - checkdescriptions VARCHAR(400) COMMENT '不符合项描述', - stateupdate VARCHAR(20) COMMENT '状态更新', - updatedate VARCHAR(20) COMMENT '更新日期', - remark VARCHAR(200) COMMENT '备注', - versionnum VARCHAR(30) COMMENT '版本号', - primary key (ID) -)default character set utf8; -create table QA_FLOWINFO -( - id int(10) not null AUTO_INCREMENT, - phaseid int(10) not null, - phasename VARCHAR(20) not null, - phasenodeid int(10) not null, - phasenodename VARCHAR(20) not null, - checkentryid int(10) not null, - checkentry VARCHAR(200) not null, - remark VARCHAR(100), - primary key (ID) -)default character set utf8; -create table QA_PLANFLOWCHECK -( - id int(8) not null AUTO_INCREMENT, - projectid int(8) not null COMMENT '项目ID', - versionnum VARCHAR(30) COMMENT '版本号', - checkentryid VARCHAR(20) not null COMMENT '检查ID', - plandate VARCHAR(20) not null COMMENT '计划检查日期', - status int(4) not null COMMENT '计划状态:1 检查计划 2 已检查', - primary key (ID) -)default character set utf8; -create table QA_PROJECTVERSION -( - versionid int(10) not null AUTO_INCREMENT, - versionnumber VARCHAR(20) COMMENT '版本号', - plan_launchdate VARCHAR(20) COMMENT '计划上线日期', - actually_launchdate VARCHAR(20) COMMENT '实际上线日期', - plan_devstart VARCHAR(20) COMMENT '计划开发开始时间', - plan_devend VARCHAR(20) COMMENT '计划开发结束时间', - actually_devstart VARCHAR(20) COMMENT '实际开发开始时间', - actually_devend VARCHAR(20) COMMENT '实际开发结束时间', - plan_teststart VARCHAR(20) COMMENT '计划测试开始时间', - plan_testend VARCHAR(20) COMMENT '计划测试结束时间', - actually_teststart VARCHAR(20) COMMENT '实际测试开始时间', - actually_testend VARCHAR(20) COMMENT '实际测试结束时间', - plan_demand int(10) COMMENT '计划上线需求数', - actually_demand int(10) COMMENT '实际上线需求数', - codeline FLOAT(10) COMMENT '代码变动行数', - testcasenum int(10) COMMENT '测试用例数', - changetestingreturn int(10) COMMENT '版本转测试打回次数', - dev_member VARCHAR(50) COMMENT '开发投入人力', - test_member VARCHAR(50) COMMENT '测试投入人力', - human_cost VARCHAR(20) COMMENT '耗费人力 人/天', - per_dev VARCHAR(20) COMMENT '开发平均生产率 人/天/行', - per_test VARCHAR(20) COMMENT '用例编写/用例执行', - code_di VARCHAR(20) COMMENT '代码DI值', - qualityreview VARCHAR(500) COMMENT '质量回溯', - imprint VARCHAR(500) COMMENT '版本说明', - remark VARCHAR(500) COMMENT '备注', - projectid int(10) COMMENT '项目ID', - devtime_deviation VARCHAR(20) COMMENT '开发偏移率', - devdelay_days VARCHAR(20) COMMENT '开发延迟时间', - testtime_deviation VARCHAR(20) COMMENT '测试偏移率', - testdelay_days VARCHAR(20) COMMENT '测试延迟时间', - protime_deviation VARCHAR(20), - prodelay_days VARCHAR(20), - bug_zm int(10), - bug_yz int(10), - bug_yb int(10), - bug_ts int(10), - versiontype int(8) default 1 not null COMMENT '版本类型', - perdemand FLOAT(8) default 0.00, - codestandard_zd int(10) default 0 not null, - codestandard_yz int(10) default 0 not null, - codestandard_zy int(10) default 0 not null, - zt_versionlink VARCHAR(100) COMMENT '禅道链接', - human_costdev VARCHAR(20) default '0' COMMENT '开发人力成本', - human_costtest VARCHAR(20) default '0' COMMENT '测试人力成本', - primary key (versionid) -)default character set utf8; -create table QA_REVIEW -( - id int(8) not null AUTO_INCREMENT, - projectid int(8) not null COMMENT '项目ID', - version VARCHAR(20) not null COMMENT '版本号', - review_type VARCHAR(20) COMMENT '评审类型', - review_date VARCHAR(20) COMMENT '评审日期', - bug_num int(8) COMMENT '问题数', - repair_num int(8) COMMENT '已修复问题数', - confirm_date VARCHAR(20) COMMENT '最后确认日期', - review_object VARCHAR(100) COMMENT '评审对象', - review_result VARCHAR(50) COMMENT '评审结果', - result_confirmor VARCHAR(50) COMMENT '结果确认人', - remark VARCHAR(500) COMMENT '备注', - primary key (id) -)default character set utf8; -create table QA_REVIEWINFO -( - id int(8) not null AUTO_INCREMENT, - review_id int(8) not null COMMENT '评审ID', - bug_description VARCHAR(500) COMMENT '问题描述', - status VARCHAR(20) COMMENT '状态', - duty_officer VARCHAR(100) COMMENT '责任人', - confirm_date VARCHAR(20) COMMENT '最后确认日期', - corrective VARCHAR(500) COMMENT '纠正措施', - primary key (id) -)default character set utf8; -create table QA_SECONDARYSECTOR -( - sectorid int(10) not null AUTO_INCREMENT, - departmenthead VARCHAR(20), - departmentname VARCHAR(20), - primary key (sectorid) -)default character set utf8; -create table QA_SECTORPROJECTS -( - projectid int(10) not null AUTO_INCREMENT, - projectname VARCHAR(100) not null, - projectmanager VARCHAR(100) not null, - sectorid int(10) not null, - projecttype int(4) default 0 not null, - projectsign VARCHAR(20) default 'sign' not null, - primary key (projectid) -)default character set utf8; -create table QA_ZTTASK -( - id int(8) not null AUTO_INCREMENT, - versionid int(8) COMMENT '版本ID', - versionname VARCHAR(100) COMMENT '版本名称', - taskname VARCHAR(300) COMMENT '任务名称', - assigneddate VARCHAR(50) COMMENT '完成时间', - estimate int(8) COMMENT '预期工时', - consumed int(8) COMMENT '实际工时', - finishedby VARCHAR(40) COMMENT '完成人账号', - finishedname VARCHAR(40) COMMENT '完成人姓名', - deadline VARCHAR(40) COMMENT '计划截止日期', - delaystatus int(4) COMMENT '延期状态', - primary key (id) -)default character set utf8; -create table TEST_JOBS -( - id int(10) not null AUTO_INCREMENT, - name VARCHAR(100) not null COMMENT '调度名称', - startdate VARCHAR(100) COMMENT '开始日期', - starttime VARCHAR(100) COMMENT '开始时间', - enddate VARCHAR(100) COMMENT '结束日期', - endtime VARCHAR(100) COMMENT '结束时间', - runtime datetime COMMENT '执行时间', - remark VARCHAR(800) COMMENT '备注', - planproj VARCHAR(100) COMMENT '项目名(testlink)中', - state VARCHAR(4) not null COMMENT '状态', - tasktype VARCHAR(4) not null COMMENT '执行类型 O执行一次 D每天执行', - starttimestr VARCHAR(100) COMMENT '执行时间表达式', - endtimestr VARCHAR(100) COMMENT '结束时间', - createtime datetime not null, - noenddate VARCHAR(10) COMMENT '是否有结束日期', - time int default 0, - timetype VARCHAR(4), - issendmail VARCHAR(4) default "0" COMMENT '是否发送邮件通知', - emailer VARCHAR(250) COMMENT '邮件地址', - threadcount int default 1 COMMENT '客户端线程数(接口)', - testlinkname VARCHAR(200) COMMENT 'TESTLINK中的计划名称', - isbuilding VARCHAR(4) default '0' not null COMMENT '是否自动构建', - buildname VARCHAR(100) COMMENT '构建链接', - isrestart VARCHAR(4) default '0' not null COMMENT '是否自动重启', - restartcomm VARCHAR(200) COMMENT '重启脚本', - extype int(4) default 0 not null COMMENT '执行类型', - browsertype int(4) COMMENT 'UI自动化浏览器类型', - timeout int(8) default 60 not null COMMENT '任务超时中断时间(分钟)', - clientip VARCHAR(30) default '127.0.0.1' not null COMMENT '版本ID', - projecttype int(4) default "0" COMMENT '项目类型 0 testlink 1 系统内项目', - projectid int(8) COMMENT '系统内项目ID', - planid int(8) COMMENT '系统内项目关联测试计划ID', - primary key (id) -)default character set utf8; -create table TEST_CASEDETAIL -( - id int(10) not null AUTO_INCREMENT, - taskid int(10) not null, - caseno VARCHAR(20) not null COMMENT '用例编号', - caseversion VARCHAR(20) not null COMMENT '用例版本', - casetime datetime not null COMMENT '执行时间', - casename VARCHAR(200) not null COMMENT '用例名称', - casestatus VARCHAR(2) default '4' not null COMMENT ' pass:0 fail:1 lock:2 unexcute:4', - primary key (id) -)default character set utf8; -create table TEST_LOGDETAIL -( - logid int(10) not null AUTO_INCREMENT, - logtime datetime not null COMMENT '日志时间', - detail VARCHAR(5000) not null COMMENT '日志', /*V1.1 扩展日志明细字段到2000*/ - loggrade VARCHAR(20) COMMENT '日志级别', - caseid int(10) not null COMMENT '用例编号', - taskid int(10), - step VARCHAR(20) COMMENT '用例步骤', - imgname VARCHAR(30) COMMENT 'UI自动化自动截图地址', - primary key (logid) -)default character set utf8; -create table TEST_TASKEXCUTE -( - id int(10) not null AUTO_INCREMENT, - taskid VARCHAR(150) not null, - casetotal_count int(10) COMMENT '总用例数', - casesucc_count int(10) COMMENT '成功数', - casefail_count int(10) COMMENT '失败数', - caselock_count int(10) COMMENT '锁定数', - createtime datetime COMMENT '时间', - jobid int(10) not null, - finishtime datetime COMMENT '完成时间', - taskstatus VARCHAR(2) default '' COMMENT '状态 0未执行 1执行中 2 成功 4失败 ', - casenoexec_count int default 0 COMMENT '未执行用例', - caseisexec VARCHAR(2) COMMENT '任务是否被成功吊起 0 成功吊起 3 吊起失败', - primary key (id) -)default character set utf8; -create table USERINFO -( - id int(8) not null AUTO_INCREMENT, - usercode VARCHAR(20) not null, - password VARCHAR(200) not null, - username VARCHAR(20), - role VARCHAR(100) COMMENT '角色', - sectorid int(8) default 0 not null COMMENT '所属部门', - projectid int(4) default 0 not null COMMENT '默认选择项目', - primary key (id) -)default character set utf8; - -create table USER_AUTHORITY -( - id int(9) not null AUTO_INCREMENT, - module VARCHAR(50) not null COMMENT '模块', - auth_type VARCHAR(50) not null COMMENT '权限类型', - alias VARCHAR(50) not null COMMENT '别名', - primary key (id) -)default character set utf8; -create table USER_ROLE -( - id int(9) not null AUTO_INCREMENT, - role VARCHAR(50) not null COMMENT '角色', - permission VARCHAR(1000) COMMENT '权限', - primary key (id) -)default character set utf8; - -/*用例管理模块*/ -create table PROJECT_CASE -( - id int(8) not null AUTO_INCREMENT, - sign VARCHAR(20) not null COMMENT '用例标识', - name VARCHAR(200) not null COMMENT '用例名称', - projectid int(8) not null COMMENT '关联项目ID', - moduleid int(8) not null COMMENT '关联项目模块ID', - projectindex int(8) not null COMMENT '项目用例编号', - time VARCHAR(30) COMMENT '最后更新时间', - operationer VARCHAR(20) COMMENT '最后更新人员', - casetype int(2) not null COMMENT '0 接口 1 UI', - remark VARCHAR(200) COMMENT '备注', - primary key (ID) -)default character set utf8; - -create table PROJECT_CASESTEPS -( - id int(8) not null AUTO_INCREMENT, - path VARCHAR(100) COMMENT '包路径|定位路径', - operation VARCHAR(100) COMMENT '方法名|操作', - parameters VARCHAR(500) COMMENT '参数', - action VARCHAR(50) COMMENT '步骤动作', - caseid int(8) not null COMMENT '用例ID', - stepnum int(2) not null COMMENT '步骤编号', - expectedresult VARCHAR(2000) COMMENT '预期结果', - projectid int(8) not null COMMENT '项目ID', - steptype int(2) not null COMMENT '0 接口 1 UI', - time VARCHAR(30) COMMENT '最后更新时间', - operationer VARCHAR(20) COMMENT '最后更新人员', - remark VARCHAR(200) COMMENT '备注', - primary key (ID) -)default character set utf8; - -create table PROJECT_PLAN -( - id int(9) not null AUTO_INCREMENT, - name VARCHAR(50) not null COMMENT '测试计划名称', - casecount int(8) COMMENT '计划中用例总数', - remark VARCHAR(200) COMMENT '备注', - projectid int(8) not null COMMENT '项目ID', - time VARCHAR(30) COMMENT '最后更新时间', - operationer VARCHAR(20) COMMENT '最后更新人员', - primary key (ID) -)default character set utf8; - -create table PROJECT_PLANCASE -( - id int(9) not null AUTO_INCREMENT, - caseid int(8) not null COMMENT '用例ID', - planid int(8) not null COMMENT '项目计划ID', - priority int(8) not null COMMENT '用例优先级', - primary key (ID), - index (caseid), - index (planid) -)default character set utf8; - -create table PROJECT_MODULE -( - id int(9) not null AUTO_INCREMENT, - projectid int(8) not null COMMENT '项目ID', - modulename VARCHAR(50) COMMENT '模块名字', - pid int(4) COMMENT '层级关系', - primary key (ID) -)default character set utf8; -/*插入索引 -CREATE INDEX index_caseid ON TEST_LOGDETAIL (caseid); -CREATE INDEX index_taskid ON TEST_CASEDETAIL (taskid);*/ - -/*插入权限默认定义*/ -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (1, '质量-版本信息', '增加', 'pv_1'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (2, '质量-版本信息', '删除', 'pv_2'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (3, '质量-版本信息', '修改', 'pv_3'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (4, '质量-版本计划信息', '增加', 'pvp_1'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (5, '质量-流程检查信息', '增加', 'fc_1'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (6, '质量-流程检查信息', '删除', 'fc_2'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (7, '质量-流程检查信息', '修改', 'fc_3'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (8, '质量-生产故障信息', '增加', 'acc_1'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (9, '质量-生产故障信息', '删除', 'acc_2'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (10, '质量-生产故障信息', '修改', 'acc_3'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (21, '自动化-任务调度', '启动', 'tast_run'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (22, '自动化-任务调度', '移除', 'tast_remove'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (23, '自动化-任务调度', '执行', 'tast_ex'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (24, '自动化-任务调度', '增加', 'tast_1'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (25, '自动化-任务调度', '删除', 'tast_2'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (26, '自动化-任务调度', '修改', 'tast_3'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (27, '自动化-任务调度', '上传', 'tast_upload'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (11, '质量-流程检查计划', '增加', 'pfc_1'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (12, '质量-流程检查计划', '删除', 'pfc_2'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (13, '质量-流程检查计划', '修改', 'pfc_3'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (14, '质量-流程检查计划', '转计划', 'fc_tocheck'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (15, '质量-评审信息详情', '增加', 'revinfo_1'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (16, '质量-评审信息详情', '删除', 'revinfo_2'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (17, '质量-评审信息详情', '修改', 'revinfo_3'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (18, '质量-评审信息', '删除', 'rev_2'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (19, '质量-评审信息', '修改', 'rev_3'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (20, '质量-生产故障信息', '上传', 'acc_upload'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (41, '用户管理', '增加', 'ui_1'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (42, '用户管理', '删除', 'ui_2'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (43, '用户管理', '修改', 'ui_3'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (44, '用户管理', '查看', 'ui_4'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (45, '用户管理-权限角色', '查看修改', 'role_3'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (28, '自动化-任务列表', '删除', 'tastex_2'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (29, '自动化-用例列表', '执行', 'case_ex'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (46, '用户管理-权限角色', '增加', 'role_1'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (47, '用户管理-权限角色', '删除', 'role_2'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (48, '项目管理', '增加', 'pro_1'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (49, '项目管理', '删除', 'pro_2'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (50, '项目管理', '修改', 'pro_3'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (51, '用例管理', '增加', 'case_1'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (52, '用例管理', '删除', 'case_2'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (53, '用例管理', '修改', 'case_3'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (54, '步骤管理', '增删改查', 'case_step'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (55, '测试计划管理', '增加', 'proplan_1'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (56, '测试计划管理', '删除', 'proplan_2'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (57, '测试计划管理', '修改', 'proplan_3'); - -/*插入角色默认定义*/ -insert into USER_ROLE (id, role, permission) -values (2, '测试工程师', 'acc_1,acc_2,acc_3,'); -insert into USER_ROLE (id, role, permission) -values (3, '自动化工程师', 'acc_1,acc_2,acc_3,tast_run,tast_remove,tast_ex,tast_1,tast_3,tast_2,tast_upload,tastex_2,case_ex,'); -insert into USER_ROLE (id, role, permission) -values (4, '质量工程师', 'pv_1,pv_2,pv_3,pvp_1,fc_1,fc_2,fc_3,acc_1,acc_2,acc_3,pfc_1,pfc_2,pfc_3,fc_tocheck,revinfo_1,revinfo_2,revinfo_3,rev_2,rev_3,acc_upload,'); -insert into USER_ROLE (id, role, permission) -values (1, '管理员', 'pv_1,pv_2,pv_3,pvp_1,fc_1,fc_2,fc_3,acc_1,acc_2,acc_3,tast_run,tast_remove,tast_ex,tast_1,tast_3,tast_2,tast_upload,tastex_2,case_ex,pfc_1,pfc_2,pfc_3,fc_tocheck,revinfo_1,revinfo_2,revinfo_3,rev_2,rev_3,acc_upload,ui_1,ui_2,ui_3,ui_4,role_3,role_1,role_2,pro_1,pro_2,pro_3,'); - -/*插入默认部门分级*/ -insert into QA_SECONDARYSECTOR (sectorid, departmenthead, departmentname) -values (99, '系统管理员', '总部'); -/*插入默认项目*/ -insert into QA_SECTORPROJECTS (projectid, projectname, projectmanager, sectorid, projecttype) -values (99, '全部项目/未知项目', '系统管理员', 99, 0); -/*插入默认管理员*/ -insert into USERINFO (id, usercode, password, username, role, sectorid) -values (1, 'admin', 'uJ45aIeS9N80kaSFDjvk%2FA%3D%3D', '系统管理员', '1', 99); -/*插入流程检查定义数据*/ -insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) -values (36, 5, '总结阶段', 2, '计划变更', 1, '如与计划不合,是否提交计划变更邮件', null); -insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) -values (37, 5, '总结阶段', 3, '代码质量', 1, 'sonar代码检查是否刷新构建', null); -insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) -values (38, 5, '总结阶段', 3, '代码质量', 2, 'sonar代码问题数是否符合要求', null); -insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) -values (35, 2, '开发阶段', 3, '开发与编码', 6, '是否每一条禅道开发任务都提交转测申请', null); -insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) -values (34, 4, '验收与上线', 2, '上线部署', 3, 'SVN代码是否提交并标注', null); -insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) -values (1, 1, '需求阶段', 1, '需求编制', 1, '《产品需求说明书》是否组织评审会', null); -insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) -values (2, 1, '需求阶段', 1, '需求编制', 2, '《产品需求说明书》评审是否通过', null); -insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) -values (3, 1, '需求阶段', 1, '需求编制', 3, '《产品需求说明书》是否归档到SVN', null); -insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) -values (4, 1, '需求阶段', 1, '需求编制', 4, '《产品需求说明书》评审记录表是否签字通过', null); -insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) -values (5, 2, '开发阶段', 1, '需求分解', 1, '是否有需求分解/任务讨论会', null); -insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) -values (6, 2, '开发阶段', 1, '需求分解', 2, '《项目计划》邮件是否及时发出', null); -insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) -values (7, 2, '开发阶段', 1, '需求分解', 3, '《项目计划》邮件内容是否完整', null); -insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) -values (10, 2, '开发阶段', 2, '软件设计', 1, '《产品开发概要设计》是否组织评审会', null); -insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) -values (11, 2, '开发阶段', 2, '软件设计', 2, '《产品开发概要设计》评审是否通过', null); -insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) -values (12, 2, '开发阶段', 2, '软件设计', 3, '《产品开发概要设计》是否归档到SVN', null); -insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) -values (13, 2, '开发阶段', 2, '软件设计', 4, '《产品开发概要设计》评审记录表是否签字通过', null); -insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) -values (14, 2, '开发阶段', 3, '开发与编码', 1, '是否进行每日晨会', null); -insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) -values (15, 2, '开发阶段', 3, '开发与编码', 2, '是否进行代码走读', null); -insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) -values (16, 2, '开发阶段', 3, '开发与编码', 3, '是否每一条禅道开发任务都提交转测申请', null); -insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) -values (17, 2, '开发阶段', 3, '开发与编码', 4, '转测邮件是否合格', null); -insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) -values (18, 2, '开发阶段', 3, '开发与编码', 5, '转测邮件打回次数为0', null); -insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) -values (19, 3, '测试阶段', 1, '软件测试', 1, '是否回复测试计划', null); -insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) -values (20, 3, '测试阶段', 1, '软件测试', 2, '是否回复测试用例', null); -insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) -values (21, 3, '测试阶段', 1, '软件测试', 3, '测试用例是否通过评审/确认', null); -insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) -values (22, 3, '测试阶段', 1, '软件测试', 4, '《软件测试报告》是否组织评审会', null); -insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) -values (23, 3, '测试阶段', 1, '软件测试', 5, '《软件测试报告》是否评审通过', null); -insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) -values (24, 3, '测试阶段', 1, '软件测试', 6, '《软件测试报告》/测试结果是否发出邮件', null); -insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) -values (25, 3, '测试阶段', 1, '软件测试', 7, '《软件测试报告》评审记录表是否签字通过', null); -insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) -values (26, 4, '验收与上线', 1, '产品验收', 1, '《产品验收报告》是否组织评审会', null); -insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) -values (27, 4, '验收与上线', 1, '产品验收', 2, '《产品验收报告》是否评审通过', null); -insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) -values (28, 4, '验收与上线', 1, '产品验收', 3, '《产品验收报告》是否归档到SVN', null); -insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) -values (29, 4, '验收与上线', 1, '产品验收', 4, '《产品验收报告》评审记录表是否签字通过', null); -insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) -values (30, 4, '验收与上线', 2, '上线部署', 1, '产品/开发是否提交上线流程(OA)', null); -insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) -values (31, 4, '验收与上线', 2, '上线部署', 2, '开发是否提交上线相关资料', null); -insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) -values (32, 5, '总结阶段', 1, '项目总结', 1, '《项目总结》邮件是否及时发出', null); -insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +create table OPERATION_LOG +( + id int(9) not null AUTO_INCREMENT, + tablename VARCHAR(30) not null COMMENT '被记录日志表名', + tableid int(8) not null COMMENT '被记录日志ID', + operation_time VARCHAR(30) not null COMMENT '操作时间', + operationer VARCHAR(20) not null COMMENT '操作人员', + operation_description VARCHAR(200) not null COMMENT '描述', + projectid int(8) COMMENT '项目ID', + primary key (ID) +)default character set utf8; +create table QA_ACCIDENT +( + id int(8) not null AUTO_INCREMENT, + projectid int(8) not null COMMENT '项目ID', + accstatus VARCHAR(80) not null COMMENT '事故状态', + eventtime VARCHAR(30) COMMENT '事故发生时间', + reporter VARCHAR(20) not null COMMENT '报告人', + reporttime VARCHAR(30) not null COMMENT '事故报告时间', + accdescription VARCHAR(500) not null COMMENT '事故描述', + acclevel VARCHAR(60) not null COMMENT '事故等级', + causalanalysis VARCHAR(500) COMMENT '原因分析', + causaltype VARCHAR(100) COMMENT '原因类型', + consequenceanalysis VARCHAR(300) COMMENT '后果分析', + correctiveaction VARCHAR(300) COMMENT '纠正措施', + resolutiontime VARCHAR(30) COMMENT '解决时间', + resolutioner VARCHAR(20) COMMENT '解决处理人', + preventiveaction VARCHAR(300) COMMENT '预防措施', + preventiver VARCHAR(20) COMMENT '预防措施责任人', + preventiveplandate VARCHAR(30) COMMENT '预防措施计划完成时间', + preventiveaccdate VARCHAR(30) COMMENT '预防措施实际完成时间', + trouble_duration int(8) COMMENT '事故持续时间', + impact_time int(8), + filename VARCHAR(100) COMMENT '附件路径', + primary key (ID) +)default character set utf8; +create table QA_FLOWCHECK +( + id int(10) not null AUTO_INCREMENT, + checkid int(10) not null COMMENT '检查id', + projectid int(10) not null COMMENT '项目id', + projectphase VARCHAR(20) not null COMMENT '项目阶段', + phasenode VARCHAR(50) not null COMMENT '阶段节点', + checkentry VARCHAR(100) not null COMMENT '检查内容', + checkresult VARCHAR(20) COMMENT '检查结果', + checkdate VARCHAR(20) COMMENT '检查日期', + checkdescriptions VARCHAR(400) COMMENT '不符合项描述', + stateupdate VARCHAR(20) COMMENT '状态更新', + updatedate VARCHAR(20) COMMENT '更新日期', + remark VARCHAR(200) COMMENT '备注', + versionnum VARCHAR(30) COMMENT '版本号', + primary key (ID) +)default character set utf8; +create table QA_FLOWINFO +( + id int(10) not null AUTO_INCREMENT, + phaseid int(10) not null, + phasename VARCHAR(20) not null, + phasenodeid int(10) not null, + phasenodename VARCHAR(20) not null, + checkentryid int(10) not null, + checkentry VARCHAR(200) not null, + remark VARCHAR(100), + primary key (ID) +)default character set utf8; +create table QA_PLANFLOWCHECK +( + id int(8) not null AUTO_INCREMENT, + projectid int(8) not null COMMENT '项目ID', + versionnum VARCHAR(30) COMMENT '版本号', + checkentryid VARCHAR(20) not null COMMENT '检查ID', + plandate VARCHAR(20) not null COMMENT '计划检查日期', + status int(4) not null COMMENT '计划状态:1 检查计划 2 已检查', + primary key (ID) +)default character set utf8; +create table QA_PROJECTVERSION +( + versionid int(10) not null AUTO_INCREMENT, + versionnumber VARCHAR(20) COMMENT '版本号', + plan_launchdate VARCHAR(20) COMMENT '计划上线日期', + actually_launchdate VARCHAR(20) COMMENT '实际上线日期', + plan_devstart VARCHAR(20) COMMENT '计划开发开始时间', + plan_devend VARCHAR(20) COMMENT '计划开发结束时间', + actually_devstart VARCHAR(20) COMMENT '实际开发开始时间', + actually_devend VARCHAR(20) COMMENT '实际开发结束时间', + plan_teststart VARCHAR(20) COMMENT '计划测试开始时间', + plan_testend VARCHAR(20) COMMENT '计划测试结束时间', + actually_teststart VARCHAR(20) COMMENT '实际测试开始时间', + actually_testend VARCHAR(20) COMMENT '实际测试结束时间', + plan_demand int(10) COMMENT '计划上线需求数', + actually_demand int(10) COMMENT '实际上线需求数', + codeline FLOAT(10) COMMENT '代码变动行数', + testcasenum int(10) COMMENT '测试用例数', + changetestingreturn int(10) COMMENT '版本转测试打回次数', + dev_member VARCHAR(50) COMMENT '开发投入人力', + test_member VARCHAR(50) COMMENT '测试投入人力', + human_cost VARCHAR(20) COMMENT '耗费人力 人/天', + per_dev VARCHAR(20) COMMENT '开发平均生产率 人/天/行', + per_test VARCHAR(20) COMMENT '用例编写/用例执行', + code_di VARCHAR(20) COMMENT '代码DI值', + qualityreview VARCHAR(500) COMMENT '质量回溯', + imprint VARCHAR(500) COMMENT '版本说明', + remark VARCHAR(500) COMMENT '备注', + projectid int(10) COMMENT '项目ID', + devtime_deviation VARCHAR(20) COMMENT '开发偏移率', + devdelay_days VARCHAR(20) COMMENT '开发延迟时间', + testtime_deviation VARCHAR(20) COMMENT '测试偏移率', + testdelay_days VARCHAR(20) COMMENT '测试延迟时间', + protime_deviation VARCHAR(20), + prodelay_days VARCHAR(20), + bug_zm int(10), + bug_yz int(10), + bug_yb int(10), + bug_ts int(10), + versiontype int(8) default 1 not null COMMENT '版本类型', + perdemand FLOAT(8) default 0.00, + codestandard_zd int(10) default 0 not null, + codestandard_yz int(10) default 0 not null, + codestandard_zy int(10) default 0 not null, + zt_versionlink VARCHAR(100) COMMENT '禅道链接', + human_costdev VARCHAR(20) default '0' COMMENT '开发人力成本', + human_costtest VARCHAR(20) default '0' COMMENT '测试人力成本', + primary key (versionid) +)default character set utf8; +create table QA_REVIEW +( + id int(8) not null AUTO_INCREMENT, + projectid int(8) not null COMMENT '项目ID', + version VARCHAR(20) not null COMMENT '版本号', + review_type VARCHAR(20) COMMENT '评审类型', + review_date VARCHAR(20) COMMENT '评审日期', + bug_num int(8) COMMENT '问题数', + repair_num int(8) COMMENT '已修复问题数', + confirm_date VARCHAR(20) COMMENT '最后确认日期', + review_object VARCHAR(100) COMMENT '评审对象', + review_result VARCHAR(50) COMMENT '评审结果', + result_confirmor VARCHAR(50) COMMENT '结果确认人', + remark VARCHAR(500) COMMENT '备注', + primary key (id) +)default character set utf8; +create table QA_REVIEWINFO +( + id int(8) not null AUTO_INCREMENT, + review_id int(8) not null COMMENT '评审ID', + bug_description VARCHAR(500) COMMENT '问题描述', + status VARCHAR(20) COMMENT '状态', + duty_officer VARCHAR(100) COMMENT '责任人', + confirm_date VARCHAR(20) COMMENT '最后确认日期', + corrective VARCHAR(500) COMMENT '纠正措施', + primary key (id) +)default character set utf8; +create table QA_SECONDARYSECTOR +( + sectorid int(10) not null AUTO_INCREMENT, + departmenthead VARCHAR(20), + departmentname VARCHAR(20), + primary key (sectorid) +)default character set utf8; +create table QA_SECTORPROJECTS +( + projectid int(10) not null AUTO_INCREMENT, + projectname VARCHAR(100) not null, + projectmanager VARCHAR(100) not null, + sectorid int(10) not null, + projecttype int(4) default 0 not null, + projectsign VARCHAR(20) default 'sign' not null, + primary key (projectid) +)default character set utf8; +create table QA_ZTTASK +( + id int(8) not null AUTO_INCREMENT, + versionid int(8) COMMENT '版本ID', + versionname VARCHAR(100) COMMENT '版本名称', + taskname VARCHAR(300) COMMENT '任务名称', + assigneddate VARCHAR(50) COMMENT '完成时间', + estimate int(8) COMMENT '预期工时', + consumed int(8) COMMENT '实际工时', + finishedby VARCHAR(40) COMMENT '完成人账号', + finishedname VARCHAR(40) COMMENT '完成人姓名', + deadline VARCHAR(40) COMMENT '计划截止日期', + delaystatus int(4) COMMENT '延期状态', + primary key (id) +)default character set utf8; +create table TEST_JOBS +( + id int(10) not null AUTO_INCREMENT, + name VARCHAR(100) not null COMMENT '调度名称', + startdate VARCHAR(100) COMMENT '开始日期', + starttime VARCHAR(100) COMMENT '开始时间', + enddate VARCHAR(100) COMMENT '结束日期', + endtime VARCHAR(100) COMMENT '结束时间', + runtime datetime COMMENT '执行时间', + remark VARCHAR(800) COMMENT '备注', + planproj VARCHAR(100) COMMENT '项目名(testlink)中', + state VARCHAR(4) not null COMMENT '状态', + tasktype VARCHAR(4) not null COMMENT '执行类型 O执行一次 D每天执行', + starttimestr VARCHAR(100) COMMENT '执行时间表达式', + endtimestr VARCHAR(100) COMMENT '结束时间', + createtime datetime not null, + noenddate VARCHAR(10) COMMENT '是否有结束日期', + time int default 0, + timetype VARCHAR(4), + issendmail VARCHAR(4) default "0" COMMENT '是否发送邮件通知', + emailer VARCHAR(250) COMMENT '邮件地址', + threadcount int default 1 COMMENT '客户端线程数(接口)', + testlinkname VARCHAR(200) COMMENT 'TESTLINK中的计划名称', + isbuilding VARCHAR(4) default '0' not null COMMENT '是否自动构建', + buildname VARCHAR(100) COMMENT '构建链接', + isrestart VARCHAR(4) default '0' not null COMMENT '是否自动重启', + restartcomm VARCHAR(200) COMMENT '重启脚本', + extype int(4) default 0 not null COMMENT '执行类型', + browsertype int(4) COMMENT 'UI自动化浏览器类型', + timeout int(8) default 60 not null COMMENT '任务超时中断时间(分钟)', + clientip VARCHAR(30) default '127.0.0.1' not null COMMENT '版本ID', + projecttype int(4) default "0" COMMENT '项目类型 0 testlink 1 系统内项目', + projectid int(8) COMMENT '系统内项目ID', + planid int(8) COMMENT '系统内项目关联测试计划ID', + primary key (id) +)default character set utf8; +create table TEST_CASEDETAIL +( + id int(10) not null AUTO_INCREMENT, + taskid int(10) not null, + caseno VARCHAR(20) not null COMMENT '用例编号', + caseversion VARCHAR(20) not null COMMENT '用例版本', + casetime datetime not null COMMENT '执行时间', + casename VARCHAR(200) not null COMMENT '用例名称', + casestatus VARCHAR(2) default '4' not null COMMENT ' pass:0 fail:1 lock:2 unexcute:4', + primary key (id) +)default character set utf8; +create table TEST_LOGDETAIL +( + logid int(10) not null AUTO_INCREMENT, + logtime datetime not null COMMENT '日志时间', + detail VARCHAR(5000) not null COMMENT '日志', /*V1.1 扩展日志明细字段到2000*/ + loggrade VARCHAR(20) COMMENT '日志级别', + caseid int(10) not null COMMENT '用例编号', + taskid int(10), + step VARCHAR(20) COMMENT '用例步骤', + imgname VARCHAR(30) COMMENT 'UI自动化自动截图地址', + primary key (logid) +)default character set utf8; +create table TEST_TASKEXCUTE +( + id int(10) not null AUTO_INCREMENT, + taskid VARCHAR(150) not null, + casetotal_count int(10) COMMENT '总用例数', + casesucc_count int(10) COMMENT '成功数', + casefail_count int(10) COMMENT '失败数', + caselock_count int(10) COMMENT '锁定数', + createtime datetime COMMENT '时间', + jobid int(10) not null, + finishtime datetime COMMENT '完成时间', + taskstatus VARCHAR(2) default '' COMMENT '状态 0未执行 1执行中 2 成功 4失败 ', + casenoexec_count int default 0 COMMENT '未执行用例', + caseisexec VARCHAR(2) COMMENT '任务是否被成功吊起 0 成功吊起 3 吊起失败', + primary key (id) +)default character set utf8; +create table USERINFO +( + id int(8) not null AUTO_INCREMENT, + usercode VARCHAR(20) not null, + password VARCHAR(200) not null, + username VARCHAR(20), + role VARCHAR(100) COMMENT '角色', + sectorid int(8) default 0 not null COMMENT '所属部门', + projectid int(4) default 0 not null COMMENT '默认选择项目', + primary key (id) +)default character set utf8; + +create table USER_AUTHORITY +( + id int(9) not null AUTO_INCREMENT, + module VARCHAR(50) not null COMMENT '模块', + auth_type VARCHAR(50) not null COMMENT '权限类型', + alias VARCHAR(50) not null COMMENT '别名', + primary key (id) +)default character set utf8; +create table USER_ROLE +( + id int(9) not null AUTO_INCREMENT, + role VARCHAR(50) not null COMMENT '角色', + permission VARCHAR(1000) COMMENT '权限', + primary key (id) +)default character set utf8; + +/*用例管理模块*/ +create table PROJECT_CASE +( + id int(8) not null AUTO_INCREMENT, + sign VARCHAR(20) not null COMMENT '用例标识', + name VARCHAR(200) not null COMMENT '用例名称', + projectid int(8) not null COMMENT '关联项目ID', + moduleid int(8) not null COMMENT '关联项目模块ID', + projectindex int(8) not null COMMENT '项目用例编号', + time VARCHAR(30) COMMENT '最后更新时间', + operationer VARCHAR(20) COMMENT '最后更新人员', + casetype int(2) not null COMMENT '0 接口 1 UI', + remark VARCHAR(200) COMMENT '备注', + primary key (ID) +)default character set utf8; + +create table PROJECT_CASESTEPS +( + id int(8) not null AUTO_INCREMENT, + path VARCHAR(100) COMMENT '包路径|定位路径', + operation VARCHAR(100) COMMENT '方法名|操作', + parameters VARCHAR(500) COMMENT '参数', + action VARCHAR(50) COMMENT '步骤动作', + caseid int(8) not null COMMENT '用例ID', + stepnum int(2) not null COMMENT '步骤编号', + expectedresult VARCHAR(2000) COMMENT '预期结果', + projectid int(8) not null COMMENT '项目ID', + steptype int(2) not null COMMENT '0 接口 1 UI', + time VARCHAR(30) COMMENT '最后更新时间', + operationer VARCHAR(20) COMMENT '最后更新人员', + remark VARCHAR(200) COMMENT '备注', + primary key (ID) +)default character set utf8; + +create table PROJECT_PLAN +( + id int(9) not null AUTO_INCREMENT, + name VARCHAR(50) not null COMMENT '测试计划名称', + casecount int(8) COMMENT '计划中用例总数', + remark VARCHAR(200) COMMENT '备注', + projectid int(8) not null COMMENT '项目ID', + time VARCHAR(30) COMMENT '最后更新时间', + operationer VARCHAR(20) COMMENT '最后更新人员', + primary key (ID) +)default character set utf8; + +create table PROJECT_PLANCASE +( + id int(9) not null AUTO_INCREMENT, + caseid int(8) not null COMMENT '用例ID', + planid int(8) not null COMMENT '项目计划ID', + priority int(8) not null COMMENT '用例优先级', + primary key (ID), + index (caseid), + index (planid) +)default character set utf8; + +create table PROJECT_MODULE +( + id int(9) not null AUTO_INCREMENT, + projectid int(8) not null COMMENT '项目ID', + modulename VARCHAR(50) COMMENT '模块名字', + pid int(4) COMMENT '层级关系', + primary key (ID) +)default character set utf8; +/*插入索引 +CREATE INDEX index_caseid ON TEST_LOGDETAIL (caseid); +CREATE INDEX index_taskid ON TEST_CASEDETAIL (taskid);*/ + +/*插入权限默认定义*/ +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (1, '质量-版本信息', '增加', 'pv_1'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (2, '质量-版本信息', '删除', 'pv_2'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (3, '质量-版本信息', '修改', 'pv_3'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (4, '质量-版本计划信息', '增加', 'pvp_1'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (5, '质量-流程检查信息', '增加', 'fc_1'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (6, '质量-流程检查信息', '删除', 'fc_2'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (7, '质量-流程检查信息', '修改', 'fc_3'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (8, '质量-生产故障信息', '增加', 'acc_1'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (9, '质量-生产故障信息', '删除', 'acc_2'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (10, '质量-生产故障信息', '修改', 'acc_3'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (21, '自动化-任务调度', '启动', 'tast_run'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (22, '自动化-任务调度', '移除', 'tast_remove'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (23, '自动化-任务调度', '执行', 'tast_ex'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (24, '自动化-任务调度', '增加', 'tast_1'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (25, '自动化-任务调度', '删除', 'tast_2'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (26, '自动化-任务调度', '修改', 'tast_3'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (27, '自动化-任务调度', '上传', 'tast_upload'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (11, '质量-流程检查计划', '增加', 'pfc_1'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (12, '质量-流程检查计划', '删除', 'pfc_2'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (13, '质量-流程检查计划', '修改', 'pfc_3'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (14, '质量-流程检查计划', '转计划', 'fc_tocheck'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (15, '质量-评审信息详情', '增加', 'revinfo_1'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (16, '质量-评审信息详情', '删除', 'revinfo_2'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (17, '质量-评审信息详情', '修改', 'revinfo_3'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (18, '质量-评审信息', '删除', 'rev_2'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (19, '质量-评审信息', '修改', 'rev_3'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (20, '质量-生产故障信息', '上传', 'acc_upload'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (41, '用户管理', '增加', 'ui_1'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (42, '用户管理', '删除', 'ui_2'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (43, '用户管理', '修改', 'ui_3'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (44, '用户管理', '查看', 'ui_4'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (45, '用户管理-权限角色', '查看修改', 'role_3'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (28, '自动化-任务列表', '删除', 'tastex_2'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (29, '自动化-用例列表', '执行', 'case_ex'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (46, '用户管理-权限角色', '增加', 'role_1'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (47, '用户管理-权限角色', '删除', 'role_2'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (48, '项目管理', '增加', 'pro_1'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (49, '项目管理', '删除', 'pro_2'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (50, '项目管理', '修改', 'pro_3'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (51, '用例管理', '增加', 'case_1'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (52, '用例管理', '删除', 'case_2'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (53, '用例管理', '修改', 'case_3'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (54, '步骤管理', '增删改查', 'case_step'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (55, '测试计划管理', '增加', 'proplan_1'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (56, '测试计划管理', '删除', 'proplan_2'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (57, '测试计划管理', '修改', 'proplan_3'); + +/*插入角色默认定义*/ +insert into USER_ROLE (id, role, permission) +values (2, '测试工程师', 'acc_1,acc_2,acc_3,'); +insert into USER_ROLE (id, role, permission) +values (3, '自动化工程师', 'acc_1,acc_2,acc_3,tast_run,tast_remove,tast_ex,tast_1,tast_3,tast_2,tast_upload,tastex_2,case_ex,'); +insert into USER_ROLE (id, role, permission) +values (4, '质量工程师', 'pv_1,pv_2,pv_3,pvp_1,fc_1,fc_2,fc_3,acc_1,acc_2,acc_3,pfc_1,pfc_2,pfc_3,fc_tocheck,revinfo_1,revinfo_2,revinfo_3,rev_2,rev_3,acc_upload,'); +insert into USER_ROLE (id, role, permission) +values (1, '管理员', 'pv_1,pv_2,pv_3,pvp_1,fc_1,fc_2,fc_3,acc_1,acc_2,acc_3,tast_run,tast_remove,tast_ex,tast_1,tast_3,tast_2,tast_upload,tastex_2,case_ex,pfc_1,pfc_2,pfc_3,fc_tocheck,revinfo_1,revinfo_2,revinfo_3,rev_2,rev_3,acc_upload,ui_1,ui_2,ui_3,ui_4,role_3,role_1,role_2,pro_1,pro_2,pro_3,'); + +/*插入默认部门分级*/ +insert into QA_SECONDARYSECTOR (sectorid, departmenthead, departmentname) +values (99, '系统管理员', '总部'); +/*插入默认项目*/ +insert into QA_SECTORPROJECTS (projectid, projectname, projectmanager, sectorid, projecttype) +values (99, '全部项目/未知项目', '系统管理员', 99, 0); +/*插入默认管理员*/ +insert into USERINFO (id, usercode, password, username, role, sectorid) +values (1, 'admin', 'uJ45aIeS9N80kaSFDjvk%2FA%3D%3D', '系统管理员', '1', 99); +/*插入流程检查定义数据*/ +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (36, 5, '总结阶段', 2, '计划变更', 1, '如与计划不合,是否提交计划变更邮件', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (37, 5, '总结阶段', 3, '代码质量', 1, 'sonar代码检查是否刷新构建', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (38, 5, '总结阶段', 3, '代码质量', 2, 'sonar代码问题数是否符合要求', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (35, 2, '开发阶段', 3, '开发与编码', 6, '是否每一条禅道开发任务都提交转测申请', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (34, 4, '验收与上线', 2, '上线部署', 3, 'SVN代码是否提交并标注', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (1, 1, '需求阶段', 1, '需求编制', 1, '《产品需求说明书》是否组织评审会', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (2, 1, '需求阶段', 1, '需求编制', 2, '《产品需求说明书》评审是否通过', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (3, 1, '需求阶段', 1, '需求编制', 3, '《产品需求说明书》是否归档到SVN', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (4, 1, '需求阶段', 1, '需求编制', 4, '《产品需求说明书》评审记录表是否签字通过', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (5, 2, '开发阶段', 1, '需求分解', 1, '是否有需求分解/任务讨论会', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (6, 2, '开发阶段', 1, '需求分解', 2, '《项目计划》邮件是否及时发出', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (7, 2, '开发阶段', 1, '需求分解', 3, '《项目计划》邮件内容是否完整', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (10, 2, '开发阶段', 2, '软件设计', 1, '《产品开发概要设计》是否组织评审会', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (11, 2, '开发阶段', 2, '软件设计', 2, '《产品开发概要设计》评审是否通过', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (12, 2, '开发阶段', 2, '软件设计', 3, '《产品开发概要设计》是否归档到SVN', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (13, 2, '开发阶段', 2, '软件设计', 4, '《产品开发概要设计》评审记录表是否签字通过', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (14, 2, '开发阶段', 3, '开发与编码', 1, '是否进行每日晨会', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (15, 2, '开发阶段', 3, '开发与编码', 2, '是否进行代码走读', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (16, 2, '开发阶段', 3, '开发与编码', 3, '是否每一条禅道开发任务都提交转测申请', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (17, 2, '开发阶段', 3, '开发与编码', 4, '转测邮件是否合格', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (18, 2, '开发阶段', 3, '开发与编码', 5, '转测邮件打回次数为0', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (19, 3, '测试阶段', 1, '软件测试', 1, '是否回复测试计划', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (20, 3, '测试阶段', 1, '软件测试', 2, '是否回复测试用例', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (21, 3, '测试阶段', 1, '软件测试', 3, '测试用例是否通过评审/确认', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (22, 3, '测试阶段', 1, '软件测试', 4, '《软件测试报告》是否组织评审会', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (23, 3, '测试阶段', 1, '软件测试', 5, '《软件测试报告》是否评审通过', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (24, 3, '测试阶段', 1, '软件测试', 6, '《软件测试报告》/测试结果是否发出邮件', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (25, 3, '测试阶段', 1, '软件测试', 7, '《软件测试报告》评审记录表是否签字通过', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (26, 4, '验收与上线', 1, '产品验收', 1, '《产品验收报告》是否组织评审会', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (27, 4, '验收与上线', 1, '产品验收', 2, '《产品验收报告》是否评审通过', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (28, 4, '验收与上线', 1, '产品验收', 3, '《产品验收报告》是否归档到SVN', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (29, 4, '验收与上线', 1, '产品验收', 4, '《产品验收报告》评审记录表是否签字通过', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (30, 4, '验收与上线', 2, '上线部署', 1, '产品/开发是否提交上线流程(OA)', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (31, 4, '验收与上线', 2, '上线部署', 2, '开发是否提交上线相关资料', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (32, 5, '总结阶段', 1, '项目总结', 1, '《项目总结》邮件是否及时发出', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) values (33, 5, '总结阶段', 1, '项目总结', 2, '《项目总结》邮件内容是否完整', null); \ No newline at end of file diff --git a/mysqldb/initialization(create table)/V2.1 初始化.sql b/mysqldb/initialization(create table)/V2.1 初始化.sql index 5a48546..8200092 100644 --- a/mysqldb/initialization(create table)/V2.1 初始化.sql +++ b/mysqldb/initialization(create table)/V2.1 初始化.sql @@ -1,547 +1,547 @@ -create table OPERATION_LOG -( - id int(9) not null AUTO_INCREMENT, - tablename VARCHAR(30) not null COMMENT '被记录日志表名', - tableid int(8) not null COMMENT '被记录日志ID', - operation_time VARCHAR(30) not null COMMENT '操作时间', - operationer VARCHAR(20) not null COMMENT '操作人员', - operation_description VARCHAR(200) not null COMMENT '描述', - projectid int(8) COMMENT '项目ID', - primary key (ID) -)default character set utf8; -create table QA_ACCIDENT -( - id int(8) not null AUTO_INCREMENT, - projectid int(8) not null COMMENT '项目ID', - accstatus VARCHAR(80) not null COMMENT '事故状态', - eventtime VARCHAR(30) COMMENT '事故发生时间', - reporter VARCHAR(20) not null COMMENT '报告人', - reporttime VARCHAR(30) not null COMMENT '事故报告时间', - accdescription VARCHAR(500) not null COMMENT '事故描述', - acclevel VARCHAR(60) not null COMMENT '事故等级', - causalanalysis VARCHAR(500) COMMENT '原因分析', - causaltype VARCHAR(100) COMMENT '原因类型', - consequenceanalysis VARCHAR(300) COMMENT '后果分析', - correctiveaction VARCHAR(300) COMMENT '纠正措施', - resolutiontime VARCHAR(30) COMMENT '解决时间', - resolutioner VARCHAR(20) COMMENT '解决处理人', - preventiveaction VARCHAR(300) COMMENT '预防措施', - preventiver VARCHAR(20) COMMENT '预防措施责任人', - preventiveplandate VARCHAR(30) COMMENT '预防措施计划完成时间', - preventiveaccdate VARCHAR(30) COMMENT '预防措施实际完成时间', - trouble_duration int(8) COMMENT '事故持续时间', - impact_time int(8), - filename VARCHAR(100) COMMENT '附件路径', - primary key (ID) -)default character set utf8; -create table QA_FLOWCHECK -( - id int(10) not null AUTO_INCREMENT, - checkid int(10) not null COMMENT '检查id', - projectid int(10) not null COMMENT '项目id', - projectphase VARCHAR(20) not null COMMENT '项目阶段', - phasenode VARCHAR(50) not null COMMENT '阶段节点', - checkentry VARCHAR(100) not null COMMENT '检查内容', - checkresult VARCHAR(20) COMMENT '检查结果', - checkdate VARCHAR(20) COMMENT '检查日期', - checkdescriptions VARCHAR(400) COMMENT '不符合项描述', - stateupdate VARCHAR(20) COMMENT '状态更新', - updatedate VARCHAR(20) COMMENT '更新日期', - remark VARCHAR(200) COMMENT '备注', - versionnum VARCHAR(30) COMMENT '版本号', - primary key (ID) -)default character set utf8; -create table QA_FLOWINFO -( - id int(10) not null AUTO_INCREMENT, - phaseid int(10) not null, - phasename VARCHAR(20) not null, - phasenodeid int(10) not null, - phasenodename VARCHAR(20) not null, - checkentryid int(10) not null, - checkentry VARCHAR(200) not null, - remark VARCHAR(100), - primary key (ID) -)default character set utf8; -create table QA_PLANFLOWCHECK -( - id int(8) not null AUTO_INCREMENT, - projectid int(8) not null COMMENT '项目ID', - versionnum VARCHAR(30) COMMENT '版本号', - checkentryid VARCHAR(20) not null COMMENT '检查ID', - plandate VARCHAR(20) not null COMMENT '计划检查日期', - status int(4) not null COMMENT '计划状态:1 检查计划 2 已检查', - primary key (ID) -)default character set utf8; -create table QA_PROJECTVERSION -( - versionid int(10) not null AUTO_INCREMENT, - versionnumber VARCHAR(20) COMMENT '版本号', - plan_launchdate VARCHAR(20) COMMENT '计划上线日期', - actually_launchdate VARCHAR(20) COMMENT '实际上线日期', - plan_devstart VARCHAR(20) COMMENT '计划开发开始时间', - plan_devend VARCHAR(20) COMMENT '计划开发结束时间', - actually_devstart VARCHAR(20) COMMENT '实际开发开始时间', - actually_devend VARCHAR(20) COMMENT '实际开发结束时间', - plan_teststart VARCHAR(20) COMMENT '计划测试开始时间', - plan_testend VARCHAR(20) COMMENT '计划测试结束时间', - actually_teststart VARCHAR(20) COMMENT '实际测试开始时间', - actually_testend VARCHAR(20) COMMENT '实际测试结束时间', - plan_demand int(10) COMMENT '计划上线需求数', - actually_demand int(10) COMMENT '实际上线需求数', - codeline FLOAT(10) COMMENT '代码变动行数', - testcasenum int(10) COMMENT '测试用例数', - changetestingreturn int(10) COMMENT '版本转测试打回次数', - dev_member VARCHAR(50) COMMENT '开发投入人力', - test_member VARCHAR(50) COMMENT '测试投入人力', - human_cost VARCHAR(20) COMMENT '耗费人力 人/天', - per_dev VARCHAR(20) COMMENT '开发平均生产率 人/天/行', - per_test VARCHAR(20) COMMENT '用例编写/用例执行', - code_di VARCHAR(20) COMMENT '代码DI值', - qualityreview VARCHAR(500) COMMENT '质量回溯', - imprint VARCHAR(500) COMMENT '版本说明', - remark VARCHAR(500) COMMENT '备注', - projectid int(10) COMMENT '项目ID', - devtime_deviation VARCHAR(20) COMMENT '开发偏移率', - devdelay_days VARCHAR(20) COMMENT '开发延迟时间', - testtime_deviation VARCHAR(20) COMMENT '测试偏移率', - testdelay_days VARCHAR(20) COMMENT '测试延迟时间', - protime_deviation VARCHAR(20), - prodelay_days VARCHAR(20), - bug_zm int(10), - bug_yz int(10), - bug_yb int(10), - bug_ts int(10), - versiontype int(8) default 1 not null COMMENT '版本类型', - perdemand FLOAT(8) default 0.00, - codestandard_zd int(10) default 0 not null, - codestandard_yz int(10) default 0 not null, - codestandard_zy int(10) default 0 not null, - zt_versionlink VARCHAR(100) COMMENT '禅道链接', - human_costdev VARCHAR(20) default '0' COMMENT '开发人力成本', - human_costtest VARCHAR(20) default '0' COMMENT '测试人力成本', - primary key (versionid) -)default character set utf8; -create table QA_REVIEW -( - id int(8) not null AUTO_INCREMENT, - projectid int(8) not null COMMENT '项目ID', - version VARCHAR(20) not null COMMENT '版本号', - review_type VARCHAR(20) COMMENT '评审类型', - review_date VARCHAR(20) COMMENT '评审日期', - bug_num int(8) COMMENT '问题数', - repair_num int(8) COMMENT '已修复问题数', - confirm_date VARCHAR(20) COMMENT '最后确认日期', - review_object VARCHAR(100) COMMENT '评审对象', - review_result VARCHAR(50) COMMENT '评审结果', - result_confirmor VARCHAR(50) COMMENT '结果确认人', - remark VARCHAR(500) COMMENT '备注', - primary key (id) -)default character set utf8; -create table QA_REVIEWINFO -( - id int(8) not null AUTO_INCREMENT, - review_id int(8) not null COMMENT '评审ID', - bug_description VARCHAR(500) COMMENT '问题描述', - status VARCHAR(20) COMMENT '状态', - duty_officer VARCHAR(100) COMMENT '责任人', - confirm_date VARCHAR(20) COMMENT '最后确认日期', - corrective VARCHAR(500) COMMENT '纠正措施', - primary key (id) -)default character set utf8; -create table QA_SECONDARYSECTOR -( - sectorid int(10) not null AUTO_INCREMENT, - departmenthead VARCHAR(20), - departmentname VARCHAR(20), - primary key (sectorid) -)default character set utf8; -create table QA_SECTORPROJECTS -( - projectid int(10) not null AUTO_INCREMENT, - projectname VARCHAR(100) not null, - projectmanager VARCHAR(100) not null, - sectorid int(10) not null, - projecttype int(4) default 0 not null, - projectsign VARCHAR(20) default 'sign' not null, - primary key (projectid) -)default character set utf8; -create table QA_ZTTASK -( - id int(8) not null AUTO_INCREMENT, - versionid int(8) COMMENT '版本ID', - versionname VARCHAR(100) COMMENT '版本名称', - taskname VARCHAR(300) COMMENT '任务名称', - assigneddate VARCHAR(50) COMMENT '完成时间', - estimate int(8) COMMENT '预期工时', - consumed int(8) COMMENT '实际工时', - finishedby VARCHAR(40) COMMENT '完成人账号', - finishedname VARCHAR(40) COMMENT '完成人姓名', - deadline VARCHAR(40) COMMENT '计划截止日期', - delaystatus int(4) COMMENT '延期状态', - primary key (id) -)default character set utf8; -create table TEST_JOBS -( - id int(10) not null AUTO_INCREMENT, - name VARCHAR(100) not null COMMENT '调度名称', - startdate VARCHAR(100) COMMENT '开始日期', - starttime VARCHAR(100) COMMENT '开始时间', - enddate VARCHAR(100) COMMENT '结束日期', - endtime VARCHAR(100) COMMENT '结束时间', - runtime datetime COMMENT '执行时间', - remark VARCHAR(800) COMMENT '备注', - planproj VARCHAR(100) COMMENT '项目名(testlink)中', - state VARCHAR(4) not null COMMENT '状态', - tasktype VARCHAR(4) not null COMMENT '执行类型 O执行一次 D每天执行', - starttimestr VARCHAR(100) COMMENT '执行时间表达式', - endtimestr VARCHAR(100) COMMENT '结束时间', - createtime datetime not null, - noenddate VARCHAR(10) COMMENT '是否有结束日期', - time int default 0, - timetype VARCHAR(4), - issendmail VARCHAR(4) default "0" COMMENT '是否发送邮件通知', - emailer VARCHAR(250) COMMENT '邮件地址', - threadcount int default 1 COMMENT '客户端线程数(接口)', - testlinkname VARCHAR(200) COMMENT 'TESTLINK中的计划名称', - isbuilding VARCHAR(4) default '0' not null COMMENT '是否自动构建', - buildname VARCHAR(100) COMMENT '构建链接', - isrestart VARCHAR(4) default '0' not null COMMENT '是否自动重启', - restartcomm VARCHAR(200) COMMENT '重启脚本', - extype int(4) default 0 not null COMMENT '执行类型', - browsertype int(4) COMMENT 'UI自动化浏览器类型', - timeout int(8) default 60 not null COMMENT '任务超时中断时间(分钟)', - clientip VARCHAR(30) default '127.0.0.1' not null COMMENT '版本ID', - projecttype int(4) default "0" COMMENT '项目类型 0 testlink 1 系统内项目', - projectid int(8) COMMENT '系统内项目ID', - planid int(8) COMMENT '系统内项目关联测试计划ID', - primary key (id) -)default character set utf8; -create table TEST_CASEDETAIL -( - id int(10) not null AUTO_INCREMENT, - taskid int(10) not null, - caseno VARCHAR(20) not null COMMENT '用例编号', - caseversion VARCHAR(20) not null COMMENT '用例版本', - casetime datetime not null COMMENT '执行时间', - casename VARCHAR(200) not null COMMENT '用例名称', - casestatus VARCHAR(2) default '4' not null COMMENT ' pass:0 fail:1 lock:2 unexcute:4', - primary key (id) -)default character set utf8; -create table TEST_LOGDETAIL -( - logid int(10) not null AUTO_INCREMENT, - logtime datetime not null COMMENT '日志时间', - detail VARCHAR(5000) not null COMMENT '日志', /*V1.1 扩展日志明细字段到2000*/ - loggrade VARCHAR(20) COMMENT '日志级别', - caseid int(10) not null COMMENT '用例编号', - taskid int(10), - step VARCHAR(20) COMMENT '用例步骤', - imgname VARCHAR(30) COMMENT 'UI自动化自动截图地址', - primary key (logid) -)default character set utf8; -create table TEST_TASKEXCUTE -( - id int(10) not null AUTO_INCREMENT, - taskid VARCHAR(150) not null, - casetotal_count int(10) COMMENT '总用例数', - casesucc_count int(10) COMMENT '成功数', - casefail_count int(10) COMMENT '失败数', - caselock_count int(10) COMMENT '锁定数', - createtime datetime COMMENT '时间', - jobid int(10) not null, - finishtime datetime COMMENT '完成时间', - taskstatus VARCHAR(2) default '' COMMENT '状态 0未执行 1执行中 2 成功 4失败 ', - casenoexec_count int default 0 COMMENT '未执行用例', - caseisexec VARCHAR(2) COMMENT '任务是否被成功吊起 0 成功吊起 3 吊起失败', - primary key (id) -)default character set utf8; -create table USERINFO -( - id int(8) not null AUTO_INCREMENT, - usercode VARCHAR(20) not null, - password VARCHAR(200) not null, - username VARCHAR(20), - role VARCHAR(100) COMMENT '角色', - sectorid int(8) default 0 not null COMMENT '所属部门', - projectid int(4) default 0 not null COMMENT '默认选择项目', - primary key (id) -)default character set utf8; - -create table USER_AUTHORITY -( - id int(9) not null AUTO_INCREMENT, - module VARCHAR(50) not null COMMENT '模块', - auth_type VARCHAR(50) not null COMMENT '权限类型', - alias VARCHAR(50) not null COMMENT '别名', - primary key (id) -)default character set utf8; -create table USER_ROLE -( - id int(9) not null AUTO_INCREMENT, - role VARCHAR(50) not null COMMENT '角色', - permission VARCHAR(1000) COMMENT '权限', - primary key (id) -)default character set utf8; - -/*用例管理模块*/ -create table PROJECT_CASE -( - id int(8) not null AUTO_INCREMENT, - sign VARCHAR(20) not null COMMENT '用例标识', - name VARCHAR(200) not null COMMENT '用例名称', - projectid int(8) not null COMMENT '关联项目ID', - moduleid int(8) not null COMMENT '关联项目模块ID', - projectindex int(8) not null COMMENT '项目用例编号', - time VARCHAR(30) COMMENT '最后更新时间', - operationer VARCHAR(20) COMMENT '最后更新人员', - casetype int(2) not null COMMENT '0 接口 1 UI', - remark VARCHAR(200) COMMENT '备注', - primary key (ID) -)default character set utf8; - -create table PROJECT_CASESTEPS -( - id int(8) not null AUTO_INCREMENT, - path VARCHAR(100) COMMENT '包路径|定位路径', - operation VARCHAR(100) COMMENT '方法名|操作', - parameters VARCHAR(500) COMMENT '参数', - action VARCHAR(50) COMMENT '步骤动作', - caseid int(8) not null COMMENT '用例ID', - stepnum int(2) not null COMMENT '步骤编号', - expectedresult VARCHAR(2000) COMMENT '预期结果', - projectid int(8) not null COMMENT '项目ID', - steptype int(2) not null COMMENT '0 接口 1 UI', - time VARCHAR(30) COMMENT '最后更新时间', - operationer VARCHAR(20) COMMENT '最后更新人员', - remark VARCHAR(200) COMMENT '备注', - primary key (ID) -)default character set utf8; - -create table PROJECT_PLAN -( - id int(9) not null AUTO_INCREMENT, - name VARCHAR(50) not null COMMENT '测试计划名称', - casecount int(8) COMMENT '计划中用例总数', - remark VARCHAR(200) COMMENT '备注', - projectid int(8) not null COMMENT '项目ID', - time VARCHAR(30) COMMENT '最后更新时间', - operationer VARCHAR(20) COMMENT '最后更新人员', - primary key (ID) -)default character set utf8; - -create table PROJECT_PLANCASE -( - id int(9) not null AUTO_INCREMENT, - caseid int(8) not null COMMENT '用例ID', - planid int(8) not null COMMENT '项目计划ID', - priority int(8) not null COMMENT '用例优先级', - primary key (ID), - index (caseid), - index (planid) -)default character set utf8; - -create table PROJECT_MODULE -( - id int(9) not null AUTO_INCREMENT, - projectid int(8) not null COMMENT '项目ID', - modulename VARCHAR(50) COMMENT '模块名字', - pid int(4) COMMENT '层级关系', - primary key (ID) -)default character set utf8; -/*插入索引 -CREATE INDEX index_caseid ON TEST_LOGDETAIL (caseid); -CREATE INDEX index_taskid ON TEST_CASEDETAIL (taskid);*/ - -/*插入权限默认定义*/ -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (1, '质量-版本信息', '增加', 'pv_1'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (2, '质量-版本信息', '删除', 'pv_2'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (3, '质量-版本信息', '修改', 'pv_3'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (4, '质量-版本计划信息', '增加', 'pvp_1'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (5, '质量-流程检查信息', '增加', 'fc_1'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (6, '质量-流程检查信息', '删除', 'fc_2'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (7, '质量-流程检查信息', '修改', 'fc_3'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (8, '质量-生产故障信息', '增加', 'acc_1'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (9, '质量-生产故障信息', '删除', 'acc_2'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (10, '质量-生产故障信息', '修改', 'acc_3'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (21, '自动化-任务调度', '启动', 'tast_run'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (22, '自动化-任务调度', '移除', 'tast_remove'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (23, '自动化-任务调度', '执行', 'tast_ex'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (24, '自动化-任务调度', '增加', 'tast_1'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (25, '自动化-任务调度', '删除', 'tast_2'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (26, '自动化-任务调度', '修改', 'tast_3'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (27, '自动化-任务调度', '上传', 'tast_upload'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (11, '质量-流程检查计划', '增加', 'pfc_1'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (12, '质量-流程检查计划', '删除', 'pfc_2'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (13, '质量-流程检查计划', '修改', 'pfc_3'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (14, '质量-流程检查计划', '转计划', 'fc_tocheck'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (15, '质量-评审信息详情', '增加', 'revinfo_1'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (16, '质量-评审信息详情', '删除', 'revinfo_2'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (17, '质量-评审信息详情', '修改', 'revinfo_3'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (18, '质量-评审信息', '删除', 'rev_2'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (19, '质量-评审信息', '修改', 'rev_3'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (20, '质量-生产故障信息', '上传', 'acc_upload'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (41, '用户管理', '增加', 'ui_1'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (42, '用户管理', '删除', 'ui_2'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (43, '用户管理', '修改', 'ui_3'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (44, '用户管理', '查看', 'ui_4'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (45, '用户管理-权限角色', '查看修改', 'role_3'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (28, '自动化-任务列表', '删除', 'tastex_2'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (29, '自动化-用例列表', '执行', 'case_ex'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (46, '用户管理-权限角色', '增加', 'role_1'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (47, '用户管理-权限角色', '删除', 'role_2'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (48, '项目管理', '增加', 'pro_1'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (49, '项目管理', '删除', 'pro_2'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (50, '项目管理', '修改', 'pro_3'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (51, '用例管理', '增加', 'case_1'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (52, '用例管理', '删除', 'case_2'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (53, '用例管理', '修改', 'case_3'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (54, '步骤管理', '增删改查', 'case_step'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (55, '测试计划管理', '增加', 'proplan_1'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (56, '测试计划管理', '删除', 'proplan_2'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (57, '测试计划管理', '修改', 'proplan_3'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (58, '部门管理', '增加', 'dpmt_1'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (59, '部门管理', '删除', 'dpmt_2'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (60, '部门管理', '修改', 'dpmt_3'); - -/*插入角色默认定义*/ -insert into USER_ROLE (id, role, permission) -values (2, '测试工程师', 'acc_1,acc_2,acc_3,'); -insert into USER_ROLE (id, role, permission) -values (3, '自动化工程师', 'acc_1,acc_2,acc_3,tast_run,tast_remove,tast_ex,tast_1,tast_3,tast_2,tast_upload,tastex_2,case_ex,'); -insert into USER_ROLE (id, role, permission) -values (4, '质量工程师', 'pv_1,pv_2,pv_3,pvp_1,fc_1,fc_2,fc_3,acc_1,acc_2,acc_3,pfc_1,pfc_2,pfc_3,fc_tocheck,revinfo_1,revinfo_2,revinfo_3,rev_2,rev_3,acc_upload,'); -insert into USER_ROLE (id, role, permission) -values (1, '管理员', 'pv_1,pv_2,pv_3,pvp_1,fc_1,fc_2,fc_3,acc_1,acc_2,acc_3,tast_run,tast_remove,tast_ex,tast_1,tast_3,tast_2,tast_upload,tastex_2,case_ex,pfc_1,pfc_2,pfc_3,fc_tocheck,revinfo_1,revinfo_2,revinfo_3,rev_2,rev_3,acc_upload,ui_1,ui_2,ui_3,ui_4,role_3,role_1,role_2,pro_1,pro_2,pro_3,'); - -/*插入默认部门分级*/ -insert into QA_SECONDARYSECTOR (sectorid, departmenthead, departmentname) -values (99, '系统管理员', '总部'); -/*插入默认项目*/ -insert into QA_SECTORPROJECTS (projectid, projectname, projectmanager, sectorid, projecttype) -values (99, '全部项目/未知项目', '系统管理员', 99, 0); -/*插入默认管理员*/ -insert into USERINFO (id, usercode, password, username, role, sectorid) -values (1, 'admin', 'uJ45aIeS9N80kaSFDjvk%2FA%3D%3D', '系统管理员', '1', 99); -/*插入流程检查定义数据*/ -insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) -values (36, 5, '总结阶段', 2, '计划变更', 1, '如与计划不合,是否提交计划变更邮件', null); -insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) -values (37, 5, '总结阶段', 3, '代码质量', 1, 'sonar代码检查是否刷新构建', null); -insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) -values (38, 5, '总结阶段', 3, '代码质量', 2, 'sonar代码问题数是否符合要求', null); -insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) -values (35, 2, '开发阶段', 3, '开发与编码', 6, '是否每一条禅道开发任务都提交转测申请', null); -insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) -values (34, 4, '验收与上线', 2, '上线部署', 3, 'SVN代码是否提交并标注', null); -insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) -values (1, 1, '需求阶段', 1, '需求编制', 1, '《产品需求说明书》是否组织评审会', null); -insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) -values (2, 1, '需求阶段', 1, '需求编制', 2, '《产品需求说明书》评审是否通过', null); -insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) -values (3, 1, '需求阶段', 1, '需求编制', 3, '《产品需求说明书》是否归档到SVN', null); -insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) -values (4, 1, '需求阶段', 1, '需求编制', 4, '《产品需求说明书》评审记录表是否签字通过', null); -insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) -values (5, 2, '开发阶段', 1, '需求分解', 1, '是否有需求分解/任务讨论会', null); -insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) -values (6, 2, '开发阶段', 1, '需求分解', 2, '《项目计划》邮件是否及时发出', null); -insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) -values (7, 2, '开发阶段', 1, '需求分解', 3, '《项目计划》邮件内容是否完整', null); -insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) -values (10, 2, '开发阶段', 2, '软件设计', 1, '《产品开发概要设计》是否组织评审会', null); -insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) -values (11, 2, '开发阶段', 2, '软件设计', 2, '《产品开发概要设计》评审是否通过', null); -insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) -values (12, 2, '开发阶段', 2, '软件设计', 3, '《产品开发概要设计》是否归档到SVN', null); -insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) -values (13, 2, '开发阶段', 2, '软件设计', 4, '《产品开发概要设计》评审记录表是否签字通过', null); -insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) -values (14, 2, '开发阶段', 3, '开发与编码', 1, '是否进行每日晨会', null); -insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) -values (15, 2, '开发阶段', 3, '开发与编码', 2, '是否进行代码走读', null); -insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) -values (16, 2, '开发阶段', 3, '开发与编码', 3, '是否每一条禅道开发任务都提交转测申请', null); -insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) -values (17, 2, '开发阶段', 3, '开发与编码', 4, '转测邮件是否合格', null); -insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) -values (18, 2, '开发阶段', 3, '开发与编码', 5, '转测邮件打回次数为0', null); -insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) -values (19, 3, '测试阶段', 1, '软件测试', 1, '是否回复测试计划', null); -insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) -values (20, 3, '测试阶段', 1, '软件测试', 2, '是否回复测试用例', null); -insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) -values (21, 3, '测试阶段', 1, '软件测试', 3, '测试用例是否通过评审/确认', null); -insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) -values (22, 3, '测试阶段', 1, '软件测试', 4, '《软件测试报告》是否组织评审会', null); -insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) -values (23, 3, '测试阶段', 1, '软件测试', 5, '《软件测试报告》是否评审通过', null); -insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) -values (24, 3, '测试阶段', 1, '软件测试', 6, '《软件测试报告》/测试结果是否发出邮件', null); -insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) -values (25, 3, '测试阶段', 1, '软件测试', 7, '《软件测试报告》评审记录表是否签字通过', null); -insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) -values (26, 4, '验收与上线', 1, '产品验收', 1, '《产品验收报告》是否组织评审会', null); -insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) -values (27, 4, '验收与上线', 1, '产品验收', 2, '《产品验收报告》是否评审通过', null); -insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) -values (28, 4, '验收与上线', 1, '产品验收', 3, '《产品验收报告》是否归档到SVN', null); -insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) -values (29, 4, '验收与上线', 1, '产品验收', 4, '《产品验收报告》评审记录表是否签字通过', null); -insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) -values (30, 4, '验收与上线', 2, '上线部署', 1, '产品/开发是否提交上线流程(OA)', null); -insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) -values (31, 4, '验收与上线', 2, '上线部署', 2, '开发是否提交上线相关资料', null); -insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) -values (32, 5, '总结阶段', 1, '项目总结', 1, '《项目总结》邮件是否及时发出', null); -insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +create table OPERATION_LOG +( + id int(9) not null AUTO_INCREMENT, + tablename VARCHAR(30) not null COMMENT '被记录日志表名', + tableid int(8) not null COMMENT '被记录日志ID', + operation_time VARCHAR(30) not null COMMENT '操作时间', + operationer VARCHAR(20) not null COMMENT '操作人员', + operation_description VARCHAR(200) not null COMMENT '描述', + projectid int(8) COMMENT '项目ID', + primary key (ID) +)default character set utf8; +create table QA_ACCIDENT +( + id int(8) not null AUTO_INCREMENT, + projectid int(8) not null COMMENT '项目ID', + accstatus VARCHAR(80) not null COMMENT '事故状态', + eventtime VARCHAR(30) COMMENT '事故发生时间', + reporter VARCHAR(20) not null COMMENT '报告人', + reporttime VARCHAR(30) not null COMMENT '事故报告时间', + accdescription VARCHAR(500) not null COMMENT '事故描述', + acclevel VARCHAR(60) not null COMMENT '事故等级', + causalanalysis VARCHAR(500) COMMENT '原因分析', + causaltype VARCHAR(100) COMMENT '原因类型', + consequenceanalysis VARCHAR(300) COMMENT '后果分析', + correctiveaction VARCHAR(300) COMMENT '纠正措施', + resolutiontime VARCHAR(30) COMMENT '解决时间', + resolutioner VARCHAR(20) COMMENT '解决处理人', + preventiveaction VARCHAR(300) COMMENT '预防措施', + preventiver VARCHAR(20) COMMENT '预防措施责任人', + preventiveplandate VARCHAR(30) COMMENT '预防措施计划完成时间', + preventiveaccdate VARCHAR(30) COMMENT '预防措施实际完成时间', + trouble_duration int(8) COMMENT '事故持续时间', + impact_time int(8), + filename VARCHAR(100) COMMENT '附件路径', + primary key (ID) +)default character set utf8; +create table QA_FLOWCHECK +( + id int(10) not null AUTO_INCREMENT, + checkid int(10) not null COMMENT '检查id', + projectid int(10) not null COMMENT '项目id', + projectphase VARCHAR(20) not null COMMENT '项目阶段', + phasenode VARCHAR(50) not null COMMENT '阶段节点', + checkentry VARCHAR(100) not null COMMENT '检查内容', + checkresult VARCHAR(20) COMMENT '检查结果', + checkdate VARCHAR(20) COMMENT '检查日期', + checkdescriptions VARCHAR(400) COMMENT '不符合项描述', + stateupdate VARCHAR(20) COMMENT '状态更新', + updatedate VARCHAR(20) COMMENT '更新日期', + remark VARCHAR(200) COMMENT '备注', + versionnum VARCHAR(30) COMMENT '版本号', + primary key (ID) +)default character set utf8; +create table QA_FLOWINFO +( + id int(10) not null AUTO_INCREMENT, + phaseid int(10) not null, + phasename VARCHAR(20) not null, + phasenodeid int(10) not null, + phasenodename VARCHAR(20) not null, + checkentryid int(10) not null, + checkentry VARCHAR(200) not null, + remark VARCHAR(100), + primary key (ID) +)default character set utf8; +create table QA_PLANFLOWCHECK +( + id int(8) not null AUTO_INCREMENT, + projectid int(8) not null COMMENT '项目ID', + versionnum VARCHAR(30) COMMENT '版本号', + checkentryid VARCHAR(20) not null COMMENT '检查ID', + plandate VARCHAR(20) not null COMMENT '计划检查日期', + status int(4) not null COMMENT '计划状态:1 检查计划 2 已检查', + primary key (ID) +)default character set utf8; +create table QA_PROJECTVERSION +( + versionid int(10) not null AUTO_INCREMENT, + versionnumber VARCHAR(20) COMMENT '版本号', + plan_launchdate VARCHAR(20) COMMENT '计划上线日期', + actually_launchdate VARCHAR(20) COMMENT '实际上线日期', + plan_devstart VARCHAR(20) COMMENT '计划开发开始时间', + plan_devend VARCHAR(20) COMMENT '计划开发结束时间', + actually_devstart VARCHAR(20) COMMENT '实际开发开始时间', + actually_devend VARCHAR(20) COMMENT '实际开发结束时间', + plan_teststart VARCHAR(20) COMMENT '计划测试开始时间', + plan_testend VARCHAR(20) COMMENT '计划测试结束时间', + actually_teststart VARCHAR(20) COMMENT '实际测试开始时间', + actually_testend VARCHAR(20) COMMENT '实际测试结束时间', + plan_demand int(10) COMMENT '计划上线需求数', + actually_demand int(10) COMMENT '实际上线需求数', + codeline FLOAT(10) COMMENT '代码变动行数', + testcasenum int(10) COMMENT '测试用例数', + changetestingreturn int(10) COMMENT '版本转测试打回次数', + dev_member VARCHAR(50) COMMENT '开发投入人力', + test_member VARCHAR(50) COMMENT '测试投入人力', + human_cost VARCHAR(20) COMMENT '耗费人力 人/天', + per_dev VARCHAR(20) COMMENT '开发平均生产率 人/天/行', + per_test VARCHAR(20) COMMENT '用例编写/用例执行', + code_di VARCHAR(20) COMMENT '代码DI值', + qualityreview VARCHAR(500) COMMENT '质量回溯', + imprint VARCHAR(500) COMMENT '版本说明', + remark VARCHAR(500) COMMENT '备注', + projectid int(10) COMMENT '项目ID', + devtime_deviation VARCHAR(20) COMMENT '开发偏移率', + devdelay_days VARCHAR(20) COMMENT '开发延迟时间', + testtime_deviation VARCHAR(20) COMMENT '测试偏移率', + testdelay_days VARCHAR(20) COMMENT '测试延迟时间', + protime_deviation VARCHAR(20), + prodelay_days VARCHAR(20), + bug_zm int(10), + bug_yz int(10), + bug_yb int(10), + bug_ts int(10), + versiontype int(8) default 1 not null COMMENT '版本类型', + perdemand FLOAT(8) default 0.00, + codestandard_zd int(10) default 0 not null, + codestandard_yz int(10) default 0 not null, + codestandard_zy int(10) default 0 not null, + zt_versionlink VARCHAR(100) COMMENT '禅道链接', + human_costdev VARCHAR(20) default '0' COMMENT '开发人力成本', + human_costtest VARCHAR(20) default '0' COMMENT '测试人力成本', + primary key (versionid) +)default character set utf8; +create table QA_REVIEW +( + id int(8) not null AUTO_INCREMENT, + projectid int(8) not null COMMENT '项目ID', + version VARCHAR(20) not null COMMENT '版本号', + review_type VARCHAR(20) COMMENT '评审类型', + review_date VARCHAR(20) COMMENT '评审日期', + bug_num int(8) COMMENT '问题数', + repair_num int(8) COMMENT '已修复问题数', + confirm_date VARCHAR(20) COMMENT '最后确认日期', + review_object VARCHAR(100) COMMENT '评审对象', + review_result VARCHAR(50) COMMENT '评审结果', + result_confirmor VARCHAR(50) COMMENT '结果确认人', + remark VARCHAR(500) COMMENT '备注', + primary key (id) +)default character set utf8; +create table QA_REVIEWINFO +( + id int(8) not null AUTO_INCREMENT, + review_id int(8) not null COMMENT '评审ID', + bug_description VARCHAR(500) COMMENT '问题描述', + status VARCHAR(20) COMMENT '状态', + duty_officer VARCHAR(100) COMMENT '责任人', + confirm_date VARCHAR(20) COMMENT '最后确认日期', + corrective VARCHAR(500) COMMENT '纠正措施', + primary key (id) +)default character set utf8; +create table QA_SECONDARYSECTOR +( + sectorid int(10) not null AUTO_INCREMENT, + departmenthead VARCHAR(20), + departmentname VARCHAR(20), + primary key (sectorid) +)default character set utf8; +create table QA_SECTORPROJECTS +( + projectid int(10) not null AUTO_INCREMENT, + projectname VARCHAR(100) not null, + projectmanager VARCHAR(100) not null, + sectorid int(10) not null, + projecttype int(4) default 0 not null, + projectsign VARCHAR(20) default 'sign' not null, + primary key (projectid) +)default character set utf8; +create table QA_ZTTASK +( + id int(8) not null AUTO_INCREMENT, + versionid int(8) COMMENT '版本ID', + versionname VARCHAR(100) COMMENT '版本名称', + taskname VARCHAR(300) COMMENT '任务名称', + assigneddate VARCHAR(50) COMMENT '完成时间', + estimate int(8) COMMENT '预期工时', + consumed int(8) COMMENT '实际工时', + finishedby VARCHAR(40) COMMENT '完成人账号', + finishedname VARCHAR(40) COMMENT '完成人姓名', + deadline VARCHAR(40) COMMENT '计划截止日期', + delaystatus int(4) COMMENT '延期状态', + primary key (id) +)default character set utf8; +create table TEST_JOBS +( + id int(10) not null AUTO_INCREMENT, + name VARCHAR(100) not null COMMENT '调度名称', + startdate VARCHAR(100) COMMENT '开始日期', + starttime VARCHAR(100) COMMENT '开始时间', + enddate VARCHAR(100) COMMENT '结束日期', + endtime VARCHAR(100) COMMENT '结束时间', + runtime datetime COMMENT '执行时间', + remark VARCHAR(800) COMMENT '备注', + planproj VARCHAR(100) COMMENT '项目名(testlink)中', + state VARCHAR(4) not null COMMENT '状态', + tasktype VARCHAR(4) not null COMMENT '执行类型 O执行一次 D每天执行', + starttimestr VARCHAR(100) COMMENT '执行时间表达式', + endtimestr VARCHAR(100) COMMENT '结束时间', + createtime datetime not null, + noenddate VARCHAR(10) COMMENT '是否有结束日期', + time int default 0, + timetype VARCHAR(4), + issendmail VARCHAR(4) default "0" COMMENT '是否发送邮件通知', + emailer VARCHAR(250) COMMENT '邮件地址', + threadcount int default 1 COMMENT '客户端线程数(接口)', + testlinkname VARCHAR(200) COMMENT 'TESTLINK中的计划名称', + isbuilding VARCHAR(4) default '0' not null COMMENT '是否自动构建', + buildname VARCHAR(100) COMMENT '构建链接', + isrestart VARCHAR(4) default '0' not null COMMENT '是否自动重启', + restartcomm VARCHAR(200) COMMENT '重启脚本', + extype int(4) default 0 not null COMMENT '执行类型', + browsertype int(4) COMMENT 'UI自动化浏览器类型', + timeout int(8) default 60 not null COMMENT '任务超时中断时间(分钟)', + clientip VARCHAR(30) default '127.0.0.1' not null COMMENT '版本ID', + projecttype int(4) default "0" COMMENT '项目类型 0 testlink 1 系统内项目', + projectid int(8) COMMENT '系统内项目ID', + planid int(8) COMMENT '系统内项目关联测试计划ID', + primary key (id) +)default character set utf8; +create table TEST_CASEDETAIL +( + id int(10) not null AUTO_INCREMENT, + taskid int(10) not null, + caseno VARCHAR(20) not null COMMENT '用例编号', + caseversion VARCHAR(20) not null COMMENT '用例版本', + casetime datetime not null COMMENT '执行时间', + casename VARCHAR(200) not null COMMENT '用例名称', + casestatus VARCHAR(2) default '4' not null COMMENT ' pass:0 fail:1 lock:2 unexcute:4', + primary key (id) +)default character set utf8; +create table TEST_LOGDETAIL +( + logid int(10) not null AUTO_INCREMENT, + logtime datetime not null COMMENT '日志时间', + detail VARCHAR(5000) not null COMMENT '日志', /*V1.1 扩展日志明细字段到2000*/ + loggrade VARCHAR(20) COMMENT '日志级别', + caseid int(10) not null COMMENT '用例编号', + taskid int(10), + step VARCHAR(20) COMMENT '用例步骤', + imgname VARCHAR(30) COMMENT 'UI自动化自动截图地址', + primary key (logid) +)default character set utf8; +create table TEST_TASKEXCUTE +( + id int(10) not null AUTO_INCREMENT, + taskid VARCHAR(150) not null, + casetotal_count int(10) COMMENT '总用例数', + casesucc_count int(10) COMMENT '成功数', + casefail_count int(10) COMMENT '失败数', + caselock_count int(10) COMMENT '锁定数', + createtime datetime COMMENT '时间', + jobid int(10) not null, + finishtime datetime COMMENT '完成时间', + taskstatus VARCHAR(2) default '' COMMENT '状态 0未执行 1执行中 2 成功 4失败 ', + casenoexec_count int default 0 COMMENT '未执行用例', + caseisexec VARCHAR(2) COMMENT '任务是否被成功吊起 0 成功吊起 3 吊起失败', + primary key (id) +)default character set utf8; +create table USERINFO +( + id int(8) not null AUTO_INCREMENT, + usercode VARCHAR(20) not null, + password VARCHAR(200) not null, + username VARCHAR(20), + role VARCHAR(100) COMMENT '角色', + sectorid int(8) default 0 not null COMMENT '所属部门', + projectid int(4) default 0 not null COMMENT '默认选择项目', + primary key (id) +)default character set utf8; + +create table USER_AUTHORITY +( + id int(9) not null AUTO_INCREMENT, + module VARCHAR(50) not null COMMENT '模块', + auth_type VARCHAR(50) not null COMMENT '权限类型', + alias VARCHAR(50) not null COMMENT '别名', + primary key (id) +)default character set utf8; +create table USER_ROLE +( + id int(9) not null AUTO_INCREMENT, + role VARCHAR(50) not null COMMENT '角色', + permission VARCHAR(1000) COMMENT '权限', + primary key (id) +)default character set utf8; + +/*用例管理模块*/ +create table PROJECT_CASE +( + id int(8) not null AUTO_INCREMENT, + sign VARCHAR(20) not null COMMENT '用例标识', + name VARCHAR(200) not null COMMENT '用例名称', + projectid int(8) not null COMMENT '关联项目ID', + moduleid int(8) not null COMMENT '关联项目模块ID', + projectindex int(8) not null COMMENT '项目用例编号', + time VARCHAR(30) COMMENT '最后更新时间', + operationer VARCHAR(20) COMMENT '最后更新人员', + casetype int(2) not null COMMENT '0 接口 1 UI', + remark VARCHAR(200) COMMENT '备注', + primary key (ID) +)default character set utf8; + +create table PROJECT_CASESTEPS +( + id int(8) not null AUTO_INCREMENT, + path VARCHAR(100) COMMENT '包路径|定位路径', + operation VARCHAR(100) COMMENT '方法名|操作', + parameters VARCHAR(500) COMMENT '参数', + action VARCHAR(50) COMMENT '步骤动作', + caseid int(8) not null COMMENT '用例ID', + stepnum int(2) not null COMMENT '步骤编号', + expectedresult VARCHAR(2000) COMMENT '预期结果', + projectid int(8) not null COMMENT '项目ID', + steptype int(2) not null COMMENT '0 接口 1 UI', + time VARCHAR(30) COMMENT '最后更新时间', + operationer VARCHAR(20) COMMENT '最后更新人员', + remark VARCHAR(200) COMMENT '备注', + primary key (ID) +)default character set utf8; + +create table PROJECT_PLAN +( + id int(9) not null AUTO_INCREMENT, + name VARCHAR(50) not null COMMENT '测试计划名称', + casecount int(8) COMMENT '计划中用例总数', + remark VARCHAR(200) COMMENT '备注', + projectid int(8) not null COMMENT '项目ID', + time VARCHAR(30) COMMENT '最后更新时间', + operationer VARCHAR(20) COMMENT '最后更新人员', + primary key (ID) +)default character set utf8; + +create table PROJECT_PLANCASE +( + id int(9) not null AUTO_INCREMENT, + caseid int(8) not null COMMENT '用例ID', + planid int(8) not null COMMENT '项目计划ID', + priority int(8) not null COMMENT '用例优先级', + primary key (ID), + index (caseid), + index (planid) +)default character set utf8; + +create table PROJECT_MODULE +( + id int(9) not null AUTO_INCREMENT, + projectid int(8) not null COMMENT '项目ID', + modulename VARCHAR(50) COMMENT '模块名字', + pid int(4) COMMENT '层级关系', + primary key (ID) +)default character set utf8; +/*插入索引 +CREATE INDEX index_caseid ON TEST_LOGDETAIL (caseid); +CREATE INDEX index_taskid ON TEST_CASEDETAIL (taskid);*/ + +/*插入权限默认定义*/ +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (1, '质量-版本信息', '增加', 'pv_1'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (2, '质量-版本信息', '删除', 'pv_2'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (3, '质量-版本信息', '修改', 'pv_3'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (4, '质量-版本计划信息', '增加', 'pvp_1'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (5, '质量-流程检查信息', '增加', 'fc_1'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (6, '质量-流程检查信息', '删除', 'fc_2'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (7, '质量-流程检查信息', '修改', 'fc_3'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (8, '质量-生产故障信息', '增加', 'acc_1'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (9, '质量-生产故障信息', '删除', 'acc_2'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (10, '质量-生产故障信息', '修改', 'acc_3'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (21, '自动化-任务调度', '启动', 'tast_run'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (22, '自动化-任务调度', '移除', 'tast_remove'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (23, '自动化-任务调度', '执行', 'tast_ex'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (24, '自动化-任务调度', '增加', 'tast_1'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (25, '自动化-任务调度', '删除', 'tast_2'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (26, '自动化-任务调度', '修改', 'tast_3'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (27, '自动化-任务调度', '上传', 'tast_upload'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (11, '质量-流程检查计划', '增加', 'pfc_1'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (12, '质量-流程检查计划', '删除', 'pfc_2'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (13, '质量-流程检查计划', '修改', 'pfc_3'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (14, '质量-流程检查计划', '转计划', 'fc_tocheck'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (15, '质量-评审信息详情', '增加', 'revinfo_1'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (16, '质量-评审信息详情', '删除', 'revinfo_2'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (17, '质量-评审信息详情', '修改', 'revinfo_3'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (18, '质量-评审信息', '删除', 'rev_2'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (19, '质量-评审信息', '修改', 'rev_3'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (20, '质量-生产故障信息', '上传', 'acc_upload'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (41, '用户管理', '增加', 'ui_1'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (42, '用户管理', '删除', 'ui_2'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (43, '用户管理', '修改', 'ui_3'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (44, '用户管理', '查看', 'ui_4'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (45, '用户管理-权限角色', '查看修改', 'role_3'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (28, '自动化-任务列表', '删除', 'tastex_2'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (29, '自动化-用例列表', '执行', 'case_ex'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (46, '用户管理-权限角色', '增加', 'role_1'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (47, '用户管理-权限角色', '删除', 'role_2'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (48, '项目管理', '增加', 'pro_1'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (49, '项目管理', '删除', 'pro_2'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (50, '项目管理', '修改', 'pro_3'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (51, '用例管理', '增加', 'case_1'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (52, '用例管理', '删除', 'case_2'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (53, '用例管理', '修改', 'case_3'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (54, '步骤管理', '增删改查', 'case_step'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (55, '测试计划管理', '增加', 'proplan_1'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (56, '测试计划管理', '删除', 'proplan_2'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (57, '测试计划管理', '修改', 'proplan_3'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (58, '部门管理', '增加', 'dpmt_1'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (59, '部门管理', '删除', 'dpmt_2'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (60, '部门管理', '修改', 'dpmt_3'); + +/*插入角色默认定义*/ +insert into USER_ROLE (id, role, permission) +values (2, '测试工程师', 'acc_1,acc_2,acc_3,'); +insert into USER_ROLE (id, role, permission) +values (3, '自动化工程师', 'acc_1,acc_2,acc_3,tast_run,tast_remove,tast_ex,tast_1,tast_3,tast_2,tast_upload,tastex_2,case_ex,'); +insert into USER_ROLE (id, role, permission) +values (4, '质量工程师', 'pv_1,pv_2,pv_3,pvp_1,fc_1,fc_2,fc_3,acc_1,acc_2,acc_3,pfc_1,pfc_2,pfc_3,fc_tocheck,revinfo_1,revinfo_2,revinfo_3,rev_2,rev_3,acc_upload,'); +insert into USER_ROLE (id, role, permission) +values (1, '管理员', 'pv_1,pv_2,pv_3,pvp_1,fc_1,fc_2,fc_3,acc_1,acc_2,acc_3,tast_run,tast_remove,tast_ex,tast_1,tast_3,tast_2,tast_upload,tastex_2,case_ex,pfc_1,pfc_2,pfc_3,fc_tocheck,revinfo_1,revinfo_2,revinfo_3,rev_2,rev_3,acc_upload,ui_1,ui_2,ui_3,ui_4,role_3,role_1,role_2,pro_1,pro_2,pro_3,'); + +/*插入默认部门分级*/ +insert into QA_SECONDARYSECTOR (sectorid, departmenthead, departmentname) +values (99, '系统管理员', '总部'); +/*插入默认项目*/ +insert into QA_SECTORPROJECTS (projectid, projectname, projectmanager, sectorid, projecttype) +values (99, '全部项目/未知项目', '系统管理员', 99, 0); +/*插入默认管理员*/ +insert into USERINFO (id, usercode, password, username, role, sectorid) +values (1, 'admin', 'uJ45aIeS9N80kaSFDjvk%2FA%3D%3D', '系统管理员', '1', 99); +/*插入流程检查定义数据*/ +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (36, 5, '总结阶段', 2, '计划变更', 1, '如与计划不合,是否提交计划变更邮件', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (37, 5, '总结阶段', 3, '代码质量', 1, 'sonar代码检查是否刷新构建', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (38, 5, '总结阶段', 3, '代码质量', 2, 'sonar代码问题数是否符合要求', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (35, 2, '开发阶段', 3, '开发与编码', 6, '是否每一条禅道开发任务都提交转测申请', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (34, 4, '验收与上线', 2, '上线部署', 3, 'SVN代码是否提交并标注', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (1, 1, '需求阶段', 1, '需求编制', 1, '《产品需求说明书》是否组织评审会', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (2, 1, '需求阶段', 1, '需求编制', 2, '《产品需求说明书》评审是否通过', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (3, 1, '需求阶段', 1, '需求编制', 3, '《产品需求说明书》是否归档到SVN', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (4, 1, '需求阶段', 1, '需求编制', 4, '《产品需求说明书》评审记录表是否签字通过', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (5, 2, '开发阶段', 1, '需求分解', 1, '是否有需求分解/任务讨论会', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (6, 2, '开发阶段', 1, '需求分解', 2, '《项目计划》邮件是否及时发出', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (7, 2, '开发阶段', 1, '需求分解', 3, '《项目计划》邮件内容是否完整', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (10, 2, '开发阶段', 2, '软件设计', 1, '《产品开发概要设计》是否组织评审会', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (11, 2, '开发阶段', 2, '软件设计', 2, '《产品开发概要设计》评审是否通过', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (12, 2, '开发阶段', 2, '软件设计', 3, '《产品开发概要设计》是否归档到SVN', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (13, 2, '开发阶段', 2, '软件设计', 4, '《产品开发概要设计》评审记录表是否签字通过', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (14, 2, '开发阶段', 3, '开发与编码', 1, '是否进行每日晨会', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (15, 2, '开发阶段', 3, '开发与编码', 2, '是否进行代码走读', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (16, 2, '开发阶段', 3, '开发与编码', 3, '是否每一条禅道开发任务都提交转测申请', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (17, 2, '开发阶段', 3, '开发与编码', 4, '转测邮件是否合格', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (18, 2, '开发阶段', 3, '开发与编码', 5, '转测邮件打回次数为0', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (19, 3, '测试阶段', 1, '软件测试', 1, '是否回复测试计划', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (20, 3, '测试阶段', 1, '软件测试', 2, '是否回复测试用例', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (21, 3, '测试阶段', 1, '软件测试', 3, '测试用例是否通过评审/确认', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (22, 3, '测试阶段', 1, '软件测试', 4, '《软件测试报告》是否组织评审会', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (23, 3, '测试阶段', 1, '软件测试', 5, '《软件测试报告》是否评审通过', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (24, 3, '测试阶段', 1, '软件测试', 6, '《软件测试报告》/测试结果是否发出邮件', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (25, 3, '测试阶段', 1, '软件测试', 7, '《软件测试报告》评审记录表是否签字通过', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (26, 4, '验收与上线', 1, '产品验收', 1, '《产品验收报告》是否组织评审会', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (27, 4, '验收与上线', 1, '产品验收', 2, '《产品验收报告》是否评审通过', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (28, 4, '验收与上线', 1, '产品验收', 3, '《产品验收报告》是否归档到SVN', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (29, 4, '验收与上线', 1, '产品验收', 4, '《产品验收报告》评审记录表是否签字通过', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (30, 4, '验收与上线', 2, '上线部署', 1, '产品/开发是否提交上线流程(OA)', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (31, 4, '验收与上线', 2, '上线部署', 2, '开发是否提交上线相关资料', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (32, 5, '总结阶段', 1, '项目总结', 1, '《项目总结》邮件是否及时发出', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) values (33, 5, '总结阶段', 1, '项目总结', 2, '《项目总结》邮件内容是否完整', null); \ No newline at end of file diff --git a/mysqldb/initialization(create table)/V2.2 初始化 .sql b/mysqldb/initialization(create table)/V2.2 初始化 .sql index 85b36f5..f64c15f 100644 --- a/mysqldb/initialization(create table)/V2.2 初始化 .sql +++ b/mysqldb/initialization(create table)/V2.2 初始化 .sql @@ -1,690 +1,690 @@ -create table OPERATION_LOG -( - id int(9) not null AUTO_INCREMENT, - tablename VARCHAR(30) not null COMMENT '被记录日志表名', - tableid int(8) not null COMMENT '被记录日志ID', - operation_time VARCHAR(30) not null COMMENT '操作时间', - operationer VARCHAR(20) not null COMMENT '操作人员', - operation_description VARCHAR(200) not null COMMENT '描述', - projectid int(8) COMMENT '项目ID', - primary key (ID) -)default character set utf8; -create table QA_ACCIDENT -( - id int(8) not null AUTO_INCREMENT, - projectid int(8) not null COMMENT '项目ID', - accstatus VARCHAR(80) not null COMMENT '事故状态', - eventtime VARCHAR(30) COMMENT '事故发生时间', - reporter VARCHAR(20) not null COMMENT '报告人', - reporttime VARCHAR(30) not null COMMENT '事故报告时间', - accdescription VARCHAR(500) not null COMMENT '事故描述', - acclevel VARCHAR(60) not null COMMENT '事故等级', - causalanalysis VARCHAR(500) COMMENT '原因分析', - causaltype VARCHAR(100) COMMENT '原因类型', - consequenceanalysis VARCHAR(300) COMMENT '后果分析', - correctiveaction VARCHAR(300) COMMENT '纠正措施', - resolutiontime VARCHAR(30) COMMENT '解决时间', - resolutioner VARCHAR(20) COMMENT '解决处理人', - preventiveaction VARCHAR(300) COMMENT '预防措施', - preventiver VARCHAR(20) COMMENT '预防措施责任人', - preventiveplandate VARCHAR(30) COMMENT '预防措施计划完成时间', - preventiveaccdate VARCHAR(30) COMMENT '预防措施实际完成时间', - trouble_duration int(8) COMMENT '事故持续时间', - impact_time int(8), - filename VARCHAR(100) COMMENT '附件路径', - primary key (ID) -)default character set utf8; -create table QA_FLOWCHECK -( - id int(10) not null AUTO_INCREMENT, - checkid int(10) not null COMMENT '检查id', - projectid int(10) not null COMMENT '项目id', - projectphase VARCHAR(20) not null COMMENT '项目阶段', - phasenode VARCHAR(50) not null COMMENT '阶段节点', - checkentry VARCHAR(100) not null COMMENT '检查内容', - checkresult VARCHAR(20) COMMENT '检查结果', - checkdate VARCHAR(20) COMMENT '检查日期', - checkdescriptions VARCHAR(400) COMMENT '不符合项描述', - stateupdate VARCHAR(20) COMMENT '状态更新', - updatedate VARCHAR(20) COMMENT '更新日期', - remark VARCHAR(200) COMMENT '备注', - versionnum VARCHAR(30) COMMENT '版本号', - primary key (ID) -)default character set utf8; -create table QA_FLOWINFO -( - id int(10) not null AUTO_INCREMENT, - phaseid int(10) not null, - phasename VARCHAR(20) not null, - phasenodeid int(10) not null, - phasenodename VARCHAR(20) not null, - checkentryid int(10) not null, - checkentry VARCHAR(200) not null, - remark VARCHAR(100), - primary key (ID) -)default character set utf8; -create table QA_PLANFLOWCHECK -( - id int(8) not null AUTO_INCREMENT, - projectid int(8) not null COMMENT '项目ID', - versionnum VARCHAR(30) COMMENT '版本号', - checkentryid VARCHAR(20) not null COMMENT '检查ID', - plandate VARCHAR(20) not null COMMENT '计划检查日期', - status int(4) not null COMMENT '计划状态:1 检查计划 2 已检查', - primary key (ID) -)default character set utf8; -create table QA_PROJECTVERSION -( - versionid int(10) not null AUTO_INCREMENT, - versionnumber VARCHAR(20) COMMENT '版本号', - plan_launchdate VARCHAR(20) COMMENT '计划上线日期', - actually_launchdate VARCHAR(20) COMMENT '实际上线日期', - plan_devstart VARCHAR(20) COMMENT '计划开发开始时间', - plan_devend VARCHAR(20) COMMENT '计划开发结束时间', - actually_devstart VARCHAR(20) COMMENT '实际开发开始时间', - actually_devend VARCHAR(20) COMMENT '实际开发结束时间', - plan_teststart VARCHAR(20) COMMENT '计划测试开始时间', - plan_testend VARCHAR(20) COMMENT '计划测试结束时间', - actually_teststart VARCHAR(20) COMMENT '实际测试开始时间', - actually_testend VARCHAR(20) COMMENT '实际测试结束时间', - plan_demand int(10) COMMENT '计划上线需求数', - actually_demand int(10) COMMENT '实际上线需求数', - codeline FLOAT(10) COMMENT '代码变动行数', - testcasenum int(10) COMMENT '测试用例数', - changetestingreturn int(10) COMMENT '版本转测试打回次数', - dev_member VARCHAR(50) COMMENT '开发投入人力', - test_member VARCHAR(50) COMMENT '测试投入人力', - human_cost VARCHAR(20) COMMENT '耗费人力 人/天', - per_dev VARCHAR(20) COMMENT '开发平均生产率 人/天/行', - per_test VARCHAR(20) COMMENT '用例编写/用例执行', - code_di VARCHAR(20) COMMENT '代码DI值', - qualityreview VARCHAR(500) COMMENT '质量回溯', - imprint VARCHAR(500) COMMENT '版本说明', - remark VARCHAR(500) COMMENT '备注', - projectid int(10) COMMENT '项目ID', - devtime_deviation VARCHAR(20) COMMENT '开发偏移率', - devdelay_days VARCHAR(20) COMMENT '开发延迟时间', - testtime_deviation VARCHAR(20) COMMENT '测试偏移率', - testdelay_days VARCHAR(20) COMMENT '测试延迟时间', - protime_deviation VARCHAR(20), - prodelay_days VARCHAR(20), - bug_zm int(10), - bug_yz int(10), - bug_yb int(10), - bug_ts int(10), - versiontype int(8) default 1 not null COMMENT '版本类型', - perdemand FLOAT(8) default 0.00, - codestandard_zd int(10) default 0 not null, - codestandard_yz int(10) default 0 not null, - codestandard_zy int(10) default 0 not null, - zt_versionlink VARCHAR(100) COMMENT '禅道链接', - human_costdev VARCHAR(20) default '0' COMMENT '开发人力成本', - human_costtest VARCHAR(20) default '0' COMMENT '测试人力成本', - primary key (versionid) -)default character set utf8; -create table QA_REVIEW -( - id int(8) not null AUTO_INCREMENT, - projectid int(8) not null COMMENT '项目ID', - version VARCHAR(20) not null COMMENT '版本号', - review_type VARCHAR(20) COMMENT '评审类型', - review_date VARCHAR(20) COMMENT '评审日期', - bug_num int(8) COMMENT '问题数', - repair_num int(8) COMMENT '已修复问题数', - confirm_date VARCHAR(20) COMMENT '最后确认日期', - review_object VARCHAR(100) COMMENT '评审对象', - review_result VARCHAR(50) COMMENT '评审结果', - result_confirmor VARCHAR(50) COMMENT '结果确认人', - remark VARCHAR(500) COMMENT '备注', - primary key (id) -)default character set utf8; -create table QA_REVIEWINFO -( - id int(8) not null AUTO_INCREMENT, - review_id int(8) not null COMMENT '评审ID', - bug_description VARCHAR(500) COMMENT '问题描述', - status VARCHAR(20) COMMENT '状态', - duty_officer VARCHAR(100) COMMENT '责任人', - confirm_date VARCHAR(20) COMMENT '最后确认日期', - corrective VARCHAR(500) COMMENT '纠正措施', - primary key (id) -)default character set utf8; -create table QA_SECONDARYSECTOR -( - sectorid int(10) not null AUTO_INCREMENT, - departmenthead VARCHAR(20), - departmentname VARCHAR(20), - primary key (sectorid) -)default character set utf8; -create table QA_SECTORPROJECTS -( - projectid int(10) not null AUTO_INCREMENT, - projectname VARCHAR(100) not null, - projectmanager VARCHAR(100) not null, - sectorid int(10) not null, - projecttype int(4) default 0 not null, - projectsign VARCHAR(20) default 'sign' not null, - primary key (projectid) -)default character set utf8; -create table QA_ZTTASK -( - id int(8) not null AUTO_INCREMENT, - versionid int(8) COMMENT '版本ID', - versionname VARCHAR(100) COMMENT '版本名称', - taskname VARCHAR(300) COMMENT '任务名称', - assigneddate VARCHAR(50) COMMENT '完成时间', - estimate int(8) COMMENT '预期工时', - consumed int(8) COMMENT '实际工时', - finishedby VARCHAR(40) COMMENT '完成人账号', - finishedname VARCHAR(40) COMMENT '完成人姓名', - deadline VARCHAR(40) COMMENT '计划截止日期', - delaystatus int(4) COMMENT '延期状态', - primary key (id) -)default character set utf8; -create table TEST_JOBS -( - id int(10) not null AUTO_INCREMENT, - name VARCHAR(100) not null COMMENT '调度名称', - startdate VARCHAR(100) COMMENT '开始日期', - starttime VARCHAR(100) COMMENT '开始时间', - enddate VARCHAR(100) COMMENT '结束日期', - endtime VARCHAR(100) COMMENT '结束时间', - runtime datetime COMMENT '执行时间', - remark VARCHAR(800) COMMENT '备注', - planproj VARCHAR(100) COMMENT '项目名(testlink)中', - state VARCHAR(4) not null COMMENT '状态', - tasktype VARCHAR(4) not null COMMENT '执行类型 O执行一次 D每天执行', - starttimestr VARCHAR(100) COMMENT '执行时间表达式', - endtimestr VARCHAR(100) COMMENT '结束时间', - createtime datetime not null, - noenddate VARCHAR(10) COMMENT '是否有结束日期', - time int default 0, - timetype VARCHAR(4), - issendmail VARCHAR(4) default "0" COMMENT '是否发送邮件通知', - emailer VARCHAR(250) COMMENT '邮件地址', - threadcount int default 1 COMMENT '客户端线程数(接口)', - testlinkname VARCHAR(200) COMMENT 'TESTLINK中的计划名称', - isbuilding VARCHAR(4) default '0' not null COMMENT '是否自动构建', - buildname VARCHAR(100) COMMENT '构建链接', - isrestart VARCHAR(4) default '0' not null COMMENT '是否自动重启', - restartcomm VARCHAR(200) COMMENT '重启脚本', - extype int(4) default 0 not null COMMENT '执行类型', - browsertype int(4) COMMENT 'UI自动化浏览器类型', - timeout int(8) default 60 not null COMMENT '任务超时中断时间(分钟)', - clientip VARCHAR(30) default '127.0.0.1' not null COMMENT '版本ID', - projecttype int(4) default "0" COMMENT '项目类型 0 testlink 1 系统内项目', - projectid int(8) COMMENT '系统内项目ID', - planid int(8) COMMENT '系统内项目关联测试计划ID', - primary key (id) -)default character set utf8; -create table TEST_CASEDETAIL -( - id int(10) not null AUTO_INCREMENT, - taskid int(10) not null, - caseno VARCHAR(20) not null COMMENT '用例编号', - caseversion VARCHAR(20) not null COMMENT '用例版本', - casetime datetime not null COMMENT '执行时间', - casename VARCHAR(200) not null COMMENT '用例名称', - casestatus VARCHAR(2) default '4' not null COMMENT ' pass:0 fail:1 lock:2 unexcute:4', - primary key (id) -)default character set utf8; -create table TEST_LOGDETAIL -( - logid int(10) not null AUTO_INCREMENT, - logtime datetime not null COMMENT '日志时间', - detail VARCHAR(5000) not null COMMENT '日志', /*V1.1 扩展日志明细字段到2000*/ - loggrade VARCHAR(20) COMMENT '日志级别', - caseid int(10) not null COMMENT '用例编号', - taskid int(10), - step VARCHAR(20) COMMENT '用例步骤', - imgname VARCHAR(30) COMMENT 'UI自动化自动截图地址', - primary key (logid) -)default character set utf8; -create table TEST_TASKEXCUTE -( - id int(10) not null AUTO_INCREMENT, - taskid VARCHAR(150) not null, - casetotal_count int(10) COMMENT '总用例数', - casesucc_count int(10) COMMENT '成功数', - casefail_count int(10) COMMENT '失败数', - caselock_count int(10) COMMENT '锁定数', - createtime datetime COMMENT '时间', - jobid int(10) not null, - finishtime datetime COMMENT '完成时间', - taskstatus VARCHAR(2) default '' COMMENT '状态 0未执行 1执行中 2 成功 4失败 ', - casenoexec_count int default 0 COMMENT '未执行用例', - caseisexec VARCHAR(2) COMMENT '任务是否被成功吊起 0 成功吊起 3 吊起失败', - primary key (id) -)default character set utf8; -create table USERINFO -( - id int(8) not null AUTO_INCREMENT, - usercode VARCHAR(20) not null, - password VARCHAR(200) not null, - username VARCHAR(20), - role VARCHAR(100) COMMENT '角色', - sectorid int(8) default 0 not null COMMENT '所属部门', - projectid int(4) default 0 not null COMMENT '默认选择项目', - primary key (id) -)default character set utf8; - -create table USER_AUTHORITY -( - id int(9) not null AUTO_INCREMENT, - module VARCHAR(50) not null COMMENT '模块', - auth_type VARCHAR(50) not null COMMENT '权限类型', - alias VARCHAR(50) not null COMMENT '别名', - primary key (id) -)default character set utf8; -create table USER_ROLE -( - id int(9) not null AUTO_INCREMENT, - role VARCHAR(50) not null COMMENT '角色', - permission VARCHAR(1000) COMMENT '权限', - primary key (id) -)default character set utf8; - -/*用例管理模块*/ -create table PROJECT_CASE -( - id int(8) not null AUTO_INCREMENT, - sign VARCHAR(20) not null COMMENT '用例标识', - name VARCHAR(200) not null COMMENT '用例名称', - projectid int(8) not null COMMENT '关联项目ID', - moduleid int(8) not null COMMENT '关联项目模块ID', - projectindex int(8) not null COMMENT '项目用例编号', - time VARCHAR(30) COMMENT '最后更新时间', - operationer VARCHAR(20) COMMENT '最后更新人员', - casetype int(2) not null COMMENT '0 接口 1 UI', - remark VARCHAR(200) COMMENT '备注', - primary key (ID) -)default character set utf8; - -create table PROJECT_CASESTEPS -( - id int(8) not null AUTO_INCREMENT, - path VARCHAR(100) COMMENT '包路径|定位路径', - operation VARCHAR(100) COMMENT '方法名|操作', - parameters VARCHAR(500) COMMENT '参数', - action VARCHAR(50) COMMENT '步骤动作', - caseid int(8) not null COMMENT '用例ID', - stepnum int(2) not null COMMENT '步骤编号', - expectedresult VARCHAR(2000) COMMENT '预期结果', - projectid int(8) not null COMMENT '项目ID', - steptype int(2) not null COMMENT '0 接口 1 UI', - time VARCHAR(30) COMMENT '最后更新时间', - operationer VARCHAR(20) COMMENT '最后更新人员', - remark VARCHAR(200) COMMENT '备注', - primary key (ID) -)default character set utf8; - -create table PROJECT_PLAN -( - id int(9) not null AUTO_INCREMENT, - name VARCHAR(50) not null COMMENT '测试计划名称', - casecount int(8) COMMENT '计划中用例总数', - remark VARCHAR(200) COMMENT '备注', - projectid int(8) not null COMMENT '项目ID', - time VARCHAR(30) COMMENT '最后更新时间', - operationer VARCHAR(20) COMMENT '最后更新人员', - primary key (ID) -)default character set utf8; - -create table PROJECT_PLANCASE -( - id int(9) not null AUTO_INCREMENT, - caseid int(8) not null COMMENT '用例ID', - planid int(8) not null COMMENT '项目计划ID', - priority int(8) not null COMMENT '用例优先级', - primary key (ID), - index (caseid), - index (planid) -)default character set utf8; - -create table PROJECT_MODULE -( - id int(9) not null AUTO_INCREMENT, - projectid int(8) not null COMMENT '项目ID', - modulename VARCHAR(50) COMMENT '模块名字', - pid int(4) COMMENT '层级关系', - primary key (ID) -)default character set utf8; - -create table PROJECT_PROTOCOLTEMPLATE -( - id int(8) not null AUTO_INCREMENT, - projectid int(8) not null COMMENT '项目ID', - name VARCHAR(50) not null COMMENT '模板名称', - protocoltype VARCHAR(20) not null COMMENT '协议类型', - contentencoding VARCHAR(20) not null COMMENT '编码格式', - time VARCHAR(30) COMMENT '最后更新时间', - operationer VARCHAR(20) COMMENT '最后更新人员', - remark VARCHAR(200) COMMENT '备注', - primary key (ID) -)default character set utf8; - -create table PROJECT_TEMPLATEPARAMS -( - id int(9) not null AUTO_INCREMENT, - templateid int(8) not null COMMENT '模块ID', - paramname VARCHAR(50) not null COMMENT '参数名', - param VARCHAR(2000) COMMENT '参数默认值', - primary key (ID) -)default character set utf8; - -create table PROJECT_CASESTEPSPARAMS -( - id int(8) not null AUTO_INCREMENT, - steptype int(2) not null COMMENT '步骤类型', - parentid int(8) not null COMMENT '父节点ID', - fieldname VARCHAR(50) COMMENT '所属字段名', - paramvalue VARCHAR(200) COMMENT '参数值', - description VARCHAR(50) COMMENT '描述', - primary key (ID) -)default character set utf8; - -create table TEMP_CASESTEPDEBUG -( - id int(8) not null AUTO_INCREMENT, - sign VARCHAR(20) not null COMMENT '用例标识', - executor VARCHAR(20) not null COMMENT '执行人', - loglevel VARCHAR(10) not null COMMENT '日志级别', - detail VARCHAR(5000) not null COMMENT '日志', /*V1.1 扩展日志明细字段到2000*/ - primary key (ID) -)default character set utf8; -/*插入索引 -CREATE INDEX index_caseid ON TEST_LOGDETAIL (caseid); -CREATE INDEX index_taskid ON TEST_CASEDETAIL (taskid);*/ - -/*插入权限默认定义*/ -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (1, '质量-版本信息', '增加', 'pv_1'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (2, '质量-版本信息', '删除', 'pv_2'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (3, '质量-版本信息', '修改', 'pv_3'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (4, '质量-版本计划信息', '增加', 'pvp_1'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (5, '质量-流程检查信息', '增加', 'fc_1'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (6, '质量-流程检查信息', '删除', 'fc_2'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (7, '质量-流程检查信息', '修改', 'fc_3'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (8, '质量-生产故障信息', '增加', 'acc_1'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (9, '质量-生产故障信息', '删除', 'acc_2'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (10, '质量-生产故障信息', '修改', 'acc_3'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (21, '自动化-任务调度', '启动', 'tast_run'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (22, '自动化-任务调度', '移除', 'tast_remove'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (23, '自动化-任务调度', '执行', 'tast_ex'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (24, '自动化-任务调度', '增加', 'tast_1'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (25, '自动化-任务调度', '删除', 'tast_2'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (26, '自动化-任务调度', '修改', 'tast_3'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (27, '自动化-任务调度', '上传', 'tast_upload'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (11, '质量-流程检查计划', '增加', 'pfc_1'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (12, '质量-流程检查计划', '删除', 'pfc_2'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (13, '质量-流程检查计划', '修改', 'pfc_3'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (14, '质量-流程检查计划', '转计划', 'fc_tocheck'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (15, '质量-评审信息详情', '增加', 'revinfo_1'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (16, '质量-评审信息详情', '删除', 'revinfo_2'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (17, '质量-评审信息详情', '修改', 'revinfo_3'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (18, '质量-评审信息', '删除', 'rev_2'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (19, '质量-评审信息', '修改', 'rev_3'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (20, '质量-生产故障信息', '上传', 'acc_upload'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (41, '用户管理', '增加', 'ui_1'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (42, '用户管理', '删除', 'ui_2'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (43, '用户管理', '修改', 'ui_3'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (44, '用户管理', '查看', 'ui_4'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (45, '用户管理-权限角色', '查看修改', 'role_3'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (28, '自动化-任务列表', '删除', 'tastex_2'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (29, '自动化-用例列表', '执行', 'case_ex'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (46, '用户管理-权限角色', '增加', 'role_1'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (47, '用户管理-权限角色', '删除', 'role_2'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (48, '项目管理', '增加', 'pro_1'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (49, '项目管理', '删除', 'pro_2'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (50, '项目管理', '修改', 'pro_3'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (51, '用例管理', '增加', 'case_1'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (52, '用例管理', '删除', 'case_2'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (53, '用例管理', '修改', 'case_3'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (54, '步骤管理', '增删改查', 'case_step'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (55, '测试计划管理', '增加', 'proplan_1'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (56, '测试计划管理', '删除', 'proplan_2'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (57, '测试计划管理', '修改', 'proplan_3'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (58, '部门管理', '增加', 'dpmt_1'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (59, '部门管理', '删除', 'dpmt_2'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (60, '部门管理', '修改', 'dpmt_3'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (61, '协议模板', '增加', 'ptct_1'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (62, '协议模板', '删除', 'ptct_2'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (63, '协议模板', '修改', 'ptct_3'); - -/*插入步骤界面定义各个字段的默认值*/ -insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) -values (1, 2, 0, 'operation','HttpURLPost','使用HttpURLConnection发送post请求'); -insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) -values (2, 2, 0, 'operation','URLPost','使用URLConnection发送post'); -insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) -values (3, 2, 0, 'operation','GetAndSaveFile','发送get请求保存下载文件到客户端'); -insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) -values (4, 2, 0, 'operation','HttpURLGet','使用HttpURLConnection发送get请求'); -insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) -values (5, 2, 0, 'operation','URLGet','使用URLConnection发送get请求'); -insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) -values (6, 2, 0, 'operation','HttpClientPost','使用HttpClient发送post请求'); -insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) -values (7, 2, 0, 'operation','HttpClientGet','使用HttpClient发送get请求'); -insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) -values (8, 3, 0, 'operation','SocketPost','使用socket发送post请求'); -insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) -values (9, 3, 0, 'operation','SocketGet','使用socket发送get请求'); -insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) -values (10, 1, 0, 'operation','click','点击对象'); -insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) -values (11, 1, 0, 'operation','sendkeys','输入'); -insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) -values (12, 1, 0, 'operation','clear','清除输入框'); -insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) -values (13, 1, 0, 'operation','gotoframe','跳转框架(iframe)'); -insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) -values (14, 1, 0, 'operation','isenabled','判断对象是否可用'); -insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) -values (15, 1, 0, 'operation','isdisplayed','判断对象是否可见'); -insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) -values (16, 1, 0, 'operation','exjsob','针对对象执行JS脚本'); -insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) -values (17, 1, 0, 'operation','gettext','获取对象文本属性'); -insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) -values (18, 1, 0, 'operation','gettagname','获取对象标签类型'); -insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) -values (19, 1, 0, 'operation','getcaptcha','获取对象中的验证码(识别率较低)'); -insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) -values (20, 1, 0, 'operation','selectbyvisibletext','通过下拉框的文本进行选择'); -insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) -values (21, 1, 0, 'operation','selectbyvalue','通过下拉框的VALUE属性进行选择'); -insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) -values (22, 1, 0, 'operation','selectbyindex','通过下拉框的index属性进行选择(从0开始)'); -insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) -values (23, 1, 0, 'operation','isselect','判断是否已经被选择,同用于单选\复选框'); -insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) -values (24, 1, 0, 'operation','open','打开URL'); -insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) -values (25, 1, 0, 'operation','exjs','执行js脚本'); -insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) -values (26, 1, 0, 'operation','gotodefaultcontent','跳转回到默认iframe'); -insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) -values (27, 1, 0, 'operation','gettitle','获取窗口标题'); -insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) -values (28, 1, 0, 'operation','getwindowhandle','获取窗口句柄'); -insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) -values (29, 1, 0, 'operation','gotowindow','跳转窗口句柄'); -insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) -values (30, 1, 0, 'operation','wait','等待时间(S)'); -insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) -values (31, 1, 0, 'operation','alertaccept','弹出框点击OK'); -insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) -values (32, 1, 0, 'operation','alertdismiss','弹出框点击取消'); -insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) -values (33, 1, 0, 'operation','alertgettext','获取弹出框TEXT'); -insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) -values (34, 1, 0, 'operation','mouselkclick','模拟鼠标左键单击(可带页面对象)'); -insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) -values (35, 1, 0, 'operation','mouserkclick','模拟鼠标右键单击(可带页面对象)'); -insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) -values (36, 1, 0, 'operation','mousedclick','模拟鼠标双击(可带页面对象)'); -insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) -values (37, 1, 0, 'operation','mouseclickhold','模拟鼠标左键单击后不释放(可带页面对象)'); -insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) -values (38, 1, 0, 'operation','mousedrag','模拟鼠标拖拽(可带页面对象)'); -insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) -values (39, 1, 0, 'operation','mouseto','模拟鼠标移动到指定坐标(可带页面对象)'); -insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) -values (40, 1, 0, 'operation','mouserelease','模拟鼠标释放(可带页面对象)'); -insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) -values (41, 1, 0, 'operation','mousekey(tab)','模拟键盘Tab键'); -insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) -values (42, 1, 0, 'operation','mousekey(space)','模拟键盘Space键'); -insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) -values (43, 1, 0, 'operation','mousekey(ctrl)','模拟键盘Ctrl键'); -insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) -values (44, 1, 0, 'operation','mousekey(shift)','模拟键盘Shift键'); -insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) -values (45, 1, 0, 'operation','mousekey(enter)','模拟键盘Enter键'); -insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) -values (46, 1, 0, 'operation','runcase','调用指定接口用例'); - -/*插入角色默认定义*/ -insert into USER_ROLE (id, role, permission) -values (2, '测试工程师', 'acc_1,acc_2,acc_3,'); -insert into USER_ROLE (id, role, permission) -values (3, '自动化工程师', 'acc_1,acc_2,acc_3,tast_run,tast_remove,tast_ex,tast_1,tast_3,tast_2,tast_upload,tastex_2,case_ex,'); -insert into USER_ROLE (id, role, permission) -values (4, '质量工程师', 'pv_1,pv_2,pv_3,pvp_1,fc_1,fc_2,fc_3,acc_1,acc_2,acc_3,pfc_1,pfc_2,pfc_3,fc_tocheck,revinfo_1,revinfo_2,revinfo_3,rev_2,rev_3,acc_upload,'); -insert into USER_ROLE (id, role, permission) -values (1, '管理员', 'pv_1,pv_2,pv_3,pvp_1,fc_1,fc_2,fc_3,acc_1,acc_2,acc_3,tast_run,tast_remove,tast_ex,tast_1,tast_3,tast_2,tast_upload,tastex_2,case_ex,pfc_1,pfc_2,pfc_3,fc_tocheck,revinfo_1,revinfo_2,revinfo_3,rev_2,rev_3,acc_upload,ui_1,ui_2,ui_3,ui_4,role_3,role_1,role_2,pro_1,pro_2,pro_3,'); - -/*插入默认部门分级*/ -insert into QA_SECONDARYSECTOR (sectorid, departmenthead, departmentname) -values (99, '系统管理员', '总部'); -/*插入默认项目*/ -insert into QA_SECTORPROJECTS (projectid, projectname, projectmanager, sectorid, projecttype) -values (99, '全部项目/未知项目', '系统管理员', 99, 0); -/*插入默认管理员*/ -insert into USERINFO (id, usercode, password, username, role, sectorid) -values (1, 'admin', 'uJ45aIeS9N80kaSFDjvk%2FA%3D%3D', '系统管理员', '1', 99); -/*插入流程检查定义数据*/ -insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) -values (36, 5, '总结阶段', 2, '计划变更', 1, '如与计划不合,是否提交计划变更邮件', null); -insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) -values (37, 5, '总结阶段', 3, '代码质量', 1, 'sonar代码检查是否刷新构建', null); -insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) -values (38, 5, '总结阶段', 3, '代码质量', 2, 'sonar代码问题数是否符合要求', null); -insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) -values (35, 2, '开发阶段', 3, '开发与编码', 6, '是否每一条禅道开发任务都提交转测申请', null); -insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) -values (34, 4, '验收与上线', 2, '上线部署', 3, 'SVN代码是否提交并标注', null); -insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) -values (1, 1, '需求阶段', 1, '需求编制', 1, '《产品需求说明书》是否组织评审会', null); -insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) -values (2, 1, '需求阶段', 1, '需求编制', 2, '《产品需求说明书》评审是否通过', null); -insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) -values (3, 1, '需求阶段', 1, '需求编制', 3, '《产品需求说明书》是否归档到SVN', null); -insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) -values (4, 1, '需求阶段', 1, '需求编制', 4, '《产品需求说明书》评审记录表是否签字通过', null); -insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) -values (5, 2, '开发阶段', 1, '需求分解', 1, '是否有需求分解/任务讨论会', null); -insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) -values (6, 2, '开发阶段', 1, '需求分解', 2, '《项目计划》邮件是否及时发出', null); -insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) -values (7, 2, '开发阶段', 1, '需求分解', 3, '《项目计划》邮件内容是否完整', null); -insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) -values (10, 2, '开发阶段', 2, '软件设计', 1, '《产品开发概要设计》是否组织评审会', null); -insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) -values (11, 2, '开发阶段', 2, '软件设计', 2, '《产品开发概要设计》评审是否通过', null); -insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) -values (12, 2, '开发阶段', 2, '软件设计', 3, '《产品开发概要设计》是否归档到SVN', null); -insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) -values (13, 2, '开发阶段', 2, '软件设计', 4, '《产品开发概要设计》评审记录表是否签字通过', null); -insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) -values (14, 2, '开发阶段', 3, '开发与编码', 1, '是否进行每日晨会', null); -insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) -values (15, 2, '开发阶段', 3, '开发与编码', 2, '是否进行代码走读', null); -insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) -values (16, 2, '开发阶段', 3, '开发与编码', 3, '是否每一条禅道开发任务都提交转测申请', null); -insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) -values (17, 2, '开发阶段', 3, '开发与编码', 4, '转测邮件是否合格', null); -insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) -values (18, 2, '开发阶段', 3, '开发与编码', 5, '转测邮件打回次数为0', null); -insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) -values (19, 3, '测试阶段', 1, '软件测试', 1, '是否回复测试计划', null); -insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) -values (20, 3, '测试阶段', 1, '软件测试', 2, '是否回复测试用例', null); -insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) -values (21, 3, '测试阶段', 1, '软件测试', 3, '测试用例是否通过评审/确认', null); -insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) -values (22, 3, '测试阶段', 1, '软件测试', 4, '《软件测试报告》是否组织评审会', null); -insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) -values (23, 3, '测试阶段', 1, '软件测试', 5, '《软件测试报告》是否评审通过', null); -insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) -values (24, 3, '测试阶段', 1, '软件测试', 6, '《软件测试报告》/测试结果是否发出邮件', null); -insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) -values (25, 3, '测试阶段', 1, '软件测试', 7, '《软件测试报告》评审记录表是否签字通过', null); -insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) -values (26, 4, '验收与上线', 1, '产品验收', 1, '《产品验收报告》是否组织评审会', null); -insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) -values (27, 4, '验收与上线', 1, '产品验收', 2, '《产品验收报告》是否评审通过', null); -insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) -values (28, 4, '验收与上线', 1, '产品验收', 3, '《产品验收报告》是否归档到SVN', null); -insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) -values (29, 4, '验收与上线', 1, '产品验收', 4, '《产品验收报告》评审记录表是否签字通过', null); -insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) -values (30, 4, '验收与上线', 2, '上线部署', 1, '产品/开发是否提交上线流程(OA)', null); -insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) -values (31, 4, '验收与上线', 2, '上线部署', 2, '开发是否提交上线相关资料', null); -insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) -values (32, 5, '总结阶段', 1, '项目总结', 1, '《项目总结》邮件是否及时发出', null); -insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +create table OPERATION_LOG +( + id int(9) not null AUTO_INCREMENT, + tablename VARCHAR(30) not null COMMENT '被记录日志表名', + tableid int(8) not null COMMENT '被记录日志ID', + operation_time VARCHAR(30) not null COMMENT '操作时间', + operationer VARCHAR(20) not null COMMENT '操作人员', + operation_description VARCHAR(200) not null COMMENT '描述', + projectid int(8) COMMENT '项目ID', + primary key (ID) +)default character set utf8; +create table QA_ACCIDENT +( + id int(8) not null AUTO_INCREMENT, + projectid int(8) not null COMMENT '项目ID', + accstatus VARCHAR(80) not null COMMENT '事故状态', + eventtime VARCHAR(30) COMMENT '事故发生时间', + reporter VARCHAR(20) not null COMMENT '报告人', + reporttime VARCHAR(30) not null COMMENT '事故报告时间', + accdescription VARCHAR(500) not null COMMENT '事故描述', + acclevel VARCHAR(60) not null COMMENT '事故等级', + causalanalysis VARCHAR(500) COMMENT '原因分析', + causaltype VARCHAR(100) COMMENT '原因类型', + consequenceanalysis VARCHAR(300) COMMENT '后果分析', + correctiveaction VARCHAR(300) COMMENT '纠正措施', + resolutiontime VARCHAR(30) COMMENT '解决时间', + resolutioner VARCHAR(20) COMMENT '解决处理人', + preventiveaction VARCHAR(300) COMMENT '预防措施', + preventiver VARCHAR(20) COMMENT '预防措施责任人', + preventiveplandate VARCHAR(30) COMMENT '预防措施计划完成时间', + preventiveaccdate VARCHAR(30) COMMENT '预防措施实际完成时间', + trouble_duration int(8) COMMENT '事故持续时间', + impact_time int(8), + filename VARCHAR(100) COMMENT '附件路径', + primary key (ID) +)default character set utf8; +create table QA_FLOWCHECK +( + id int(10) not null AUTO_INCREMENT, + checkid int(10) not null COMMENT '检查id', + projectid int(10) not null COMMENT '项目id', + projectphase VARCHAR(20) not null COMMENT '项目阶段', + phasenode VARCHAR(50) not null COMMENT '阶段节点', + checkentry VARCHAR(100) not null COMMENT '检查内容', + checkresult VARCHAR(20) COMMENT '检查结果', + checkdate VARCHAR(20) COMMENT '检查日期', + checkdescriptions VARCHAR(400) COMMENT '不符合项描述', + stateupdate VARCHAR(20) COMMENT '状态更新', + updatedate VARCHAR(20) COMMENT '更新日期', + remark VARCHAR(200) COMMENT '备注', + versionnum VARCHAR(30) COMMENT '版本号', + primary key (ID) +)default character set utf8; +create table QA_FLOWINFO +( + id int(10) not null AUTO_INCREMENT, + phaseid int(10) not null, + phasename VARCHAR(20) not null, + phasenodeid int(10) not null, + phasenodename VARCHAR(20) not null, + checkentryid int(10) not null, + checkentry VARCHAR(200) not null, + remark VARCHAR(100), + primary key (ID) +)default character set utf8; +create table QA_PLANFLOWCHECK +( + id int(8) not null AUTO_INCREMENT, + projectid int(8) not null COMMENT '项目ID', + versionnum VARCHAR(30) COMMENT '版本号', + checkentryid VARCHAR(20) not null COMMENT '检查ID', + plandate VARCHAR(20) not null COMMENT '计划检查日期', + status int(4) not null COMMENT '计划状态:1 检查计划 2 已检查', + primary key (ID) +)default character set utf8; +create table QA_PROJECTVERSION +( + versionid int(10) not null AUTO_INCREMENT, + versionnumber VARCHAR(20) COMMENT '版本号', + plan_launchdate VARCHAR(20) COMMENT '计划上线日期', + actually_launchdate VARCHAR(20) COMMENT '实际上线日期', + plan_devstart VARCHAR(20) COMMENT '计划开发开始时间', + plan_devend VARCHAR(20) COMMENT '计划开发结束时间', + actually_devstart VARCHAR(20) COMMENT '实际开发开始时间', + actually_devend VARCHAR(20) COMMENT '实际开发结束时间', + plan_teststart VARCHAR(20) COMMENT '计划测试开始时间', + plan_testend VARCHAR(20) COMMENT '计划测试结束时间', + actually_teststart VARCHAR(20) COMMENT '实际测试开始时间', + actually_testend VARCHAR(20) COMMENT '实际测试结束时间', + plan_demand int(10) COMMENT '计划上线需求数', + actually_demand int(10) COMMENT '实际上线需求数', + codeline FLOAT(10) COMMENT '代码变动行数', + testcasenum int(10) COMMENT '测试用例数', + changetestingreturn int(10) COMMENT '版本转测试打回次数', + dev_member VARCHAR(50) COMMENT '开发投入人力', + test_member VARCHAR(50) COMMENT '测试投入人力', + human_cost VARCHAR(20) COMMENT '耗费人力 人/天', + per_dev VARCHAR(20) COMMENT '开发平均生产率 人/天/行', + per_test VARCHAR(20) COMMENT '用例编写/用例执行', + code_di VARCHAR(20) COMMENT '代码DI值', + qualityreview VARCHAR(500) COMMENT '质量回溯', + imprint VARCHAR(500) COMMENT '版本说明', + remark VARCHAR(500) COMMENT '备注', + projectid int(10) COMMENT '项目ID', + devtime_deviation VARCHAR(20) COMMENT '开发偏移率', + devdelay_days VARCHAR(20) COMMENT '开发延迟时间', + testtime_deviation VARCHAR(20) COMMENT '测试偏移率', + testdelay_days VARCHAR(20) COMMENT '测试延迟时间', + protime_deviation VARCHAR(20), + prodelay_days VARCHAR(20), + bug_zm int(10), + bug_yz int(10), + bug_yb int(10), + bug_ts int(10), + versiontype int(8) default 1 not null COMMENT '版本类型', + perdemand FLOAT(8) default 0.00, + codestandard_zd int(10) default 0 not null, + codestandard_yz int(10) default 0 not null, + codestandard_zy int(10) default 0 not null, + zt_versionlink VARCHAR(100) COMMENT '禅道链接', + human_costdev VARCHAR(20) default '0' COMMENT '开发人力成本', + human_costtest VARCHAR(20) default '0' COMMENT '测试人力成本', + primary key (versionid) +)default character set utf8; +create table QA_REVIEW +( + id int(8) not null AUTO_INCREMENT, + projectid int(8) not null COMMENT '项目ID', + version VARCHAR(20) not null COMMENT '版本号', + review_type VARCHAR(20) COMMENT '评审类型', + review_date VARCHAR(20) COMMENT '评审日期', + bug_num int(8) COMMENT '问题数', + repair_num int(8) COMMENT '已修复问题数', + confirm_date VARCHAR(20) COMMENT '最后确认日期', + review_object VARCHAR(100) COMMENT '评审对象', + review_result VARCHAR(50) COMMENT '评审结果', + result_confirmor VARCHAR(50) COMMENT '结果确认人', + remark VARCHAR(500) COMMENT '备注', + primary key (id) +)default character set utf8; +create table QA_REVIEWINFO +( + id int(8) not null AUTO_INCREMENT, + review_id int(8) not null COMMENT '评审ID', + bug_description VARCHAR(500) COMMENT '问题描述', + status VARCHAR(20) COMMENT '状态', + duty_officer VARCHAR(100) COMMENT '责任人', + confirm_date VARCHAR(20) COMMENT '最后确认日期', + corrective VARCHAR(500) COMMENT '纠正措施', + primary key (id) +)default character set utf8; +create table QA_SECONDARYSECTOR +( + sectorid int(10) not null AUTO_INCREMENT, + departmenthead VARCHAR(20), + departmentname VARCHAR(20), + primary key (sectorid) +)default character set utf8; +create table QA_SECTORPROJECTS +( + projectid int(10) not null AUTO_INCREMENT, + projectname VARCHAR(100) not null, + projectmanager VARCHAR(100) not null, + sectorid int(10) not null, + projecttype int(4) default 0 not null, + projectsign VARCHAR(20) default 'sign' not null, + primary key (projectid) +)default character set utf8; +create table QA_ZTTASK +( + id int(8) not null AUTO_INCREMENT, + versionid int(8) COMMENT '版本ID', + versionname VARCHAR(100) COMMENT '版本名称', + taskname VARCHAR(300) COMMENT '任务名称', + assigneddate VARCHAR(50) COMMENT '完成时间', + estimate int(8) COMMENT '预期工时', + consumed int(8) COMMENT '实际工时', + finishedby VARCHAR(40) COMMENT '完成人账号', + finishedname VARCHAR(40) COMMENT '完成人姓名', + deadline VARCHAR(40) COMMENT '计划截止日期', + delaystatus int(4) COMMENT '延期状态', + primary key (id) +)default character set utf8; +create table TEST_JOBS +( + id int(10) not null AUTO_INCREMENT, + name VARCHAR(100) not null COMMENT '调度名称', + startdate VARCHAR(100) COMMENT '开始日期', + starttime VARCHAR(100) COMMENT '开始时间', + enddate VARCHAR(100) COMMENT '结束日期', + endtime VARCHAR(100) COMMENT '结束时间', + runtime datetime COMMENT '执行时间', + remark VARCHAR(800) COMMENT '备注', + planproj VARCHAR(100) COMMENT '项目名(testlink)中', + state VARCHAR(4) not null COMMENT '状态', + tasktype VARCHAR(4) not null COMMENT '执行类型 O执行一次 D每天执行', + starttimestr VARCHAR(100) COMMENT '执行时间表达式', + endtimestr VARCHAR(100) COMMENT '结束时间', + createtime datetime not null, + noenddate VARCHAR(10) COMMENT '是否有结束日期', + time int default 0, + timetype VARCHAR(4), + issendmail VARCHAR(4) default "0" COMMENT '是否发送邮件通知', + emailer VARCHAR(250) COMMENT '邮件地址', + threadcount int default 1 COMMENT '客户端线程数(接口)', + testlinkname VARCHAR(200) COMMENT 'TESTLINK中的计划名称', + isbuilding VARCHAR(4) default '0' not null COMMENT '是否自动构建', + buildname VARCHAR(100) COMMENT '构建链接', + isrestart VARCHAR(4) default '0' not null COMMENT '是否自动重启', + restartcomm VARCHAR(200) COMMENT '重启脚本', + extype int(4) default 0 not null COMMENT '执行类型', + browsertype int(4) COMMENT 'UI自动化浏览器类型', + timeout int(8) default 60 not null COMMENT '任务超时中断时间(分钟)', + clientip VARCHAR(30) default '127.0.0.1' not null COMMENT '版本ID', + projecttype int(4) default "0" COMMENT '项目类型 0 testlink 1 系统内项目', + projectid int(8) COMMENT '系统内项目ID', + planid int(8) COMMENT '系统内项目关联测试计划ID', + primary key (id) +)default character set utf8; +create table TEST_CASEDETAIL +( + id int(10) not null AUTO_INCREMENT, + taskid int(10) not null, + caseno VARCHAR(20) not null COMMENT '用例编号', + caseversion VARCHAR(20) not null COMMENT '用例版本', + casetime datetime not null COMMENT '执行时间', + casename VARCHAR(200) not null COMMENT '用例名称', + casestatus VARCHAR(2) default '4' not null COMMENT ' pass:0 fail:1 lock:2 unexcute:4', + primary key (id) +)default character set utf8; +create table TEST_LOGDETAIL +( + logid int(10) not null AUTO_INCREMENT, + logtime datetime not null COMMENT '日志时间', + detail VARCHAR(5000) not null COMMENT '日志', /*V1.1 扩展日志明细字段到2000*/ + loggrade VARCHAR(20) COMMENT '日志级别', + caseid int(10) not null COMMENT '用例编号', + taskid int(10), + step VARCHAR(20) COMMENT '用例步骤', + imgname VARCHAR(30) COMMENT 'UI自动化自动截图地址', + primary key (logid) +)default character set utf8; +create table TEST_TASKEXCUTE +( + id int(10) not null AUTO_INCREMENT, + taskid VARCHAR(150) not null, + casetotal_count int(10) COMMENT '总用例数', + casesucc_count int(10) COMMENT '成功数', + casefail_count int(10) COMMENT '失败数', + caselock_count int(10) COMMENT '锁定数', + createtime datetime COMMENT '时间', + jobid int(10) not null, + finishtime datetime COMMENT '完成时间', + taskstatus VARCHAR(2) default '' COMMENT '状态 0未执行 1执行中 2 成功 4失败 ', + casenoexec_count int default 0 COMMENT '未执行用例', + caseisexec VARCHAR(2) COMMENT '任务是否被成功吊起 0 成功吊起 3 吊起失败', + primary key (id) +)default character set utf8; +create table USERINFO +( + id int(8) not null AUTO_INCREMENT, + usercode VARCHAR(20) not null, + password VARCHAR(200) not null, + username VARCHAR(20), + role VARCHAR(100) COMMENT '角色', + sectorid int(8) default 0 not null COMMENT '所属部门', + projectid int(4) default 0 not null COMMENT '默认选择项目', + primary key (id) +)default character set utf8; + +create table USER_AUTHORITY +( + id int(9) not null AUTO_INCREMENT, + module VARCHAR(50) not null COMMENT '模块', + auth_type VARCHAR(50) not null COMMENT '权限类型', + alias VARCHAR(50) not null COMMENT '别名', + primary key (id) +)default character set utf8; +create table USER_ROLE +( + id int(9) not null AUTO_INCREMENT, + role VARCHAR(50) not null COMMENT '角色', + permission VARCHAR(1000) COMMENT '权限', + primary key (id) +)default character set utf8; + +/*用例管理模块*/ +create table PROJECT_CASE +( + id int(8) not null AUTO_INCREMENT, + sign VARCHAR(20) not null COMMENT '用例标识', + name VARCHAR(200) not null COMMENT '用例名称', + projectid int(8) not null COMMENT '关联项目ID', + moduleid int(8) not null COMMENT '关联项目模块ID', + projectindex int(8) not null COMMENT '项目用例编号', + time VARCHAR(30) COMMENT '最后更新时间', + operationer VARCHAR(20) COMMENT '最后更新人员', + casetype int(2) not null COMMENT '0 接口 1 UI', + remark VARCHAR(200) COMMENT '备注', + primary key (ID) +)default character set utf8; + +create table PROJECT_CASESTEPS +( + id int(8) not null AUTO_INCREMENT, + path VARCHAR(100) COMMENT '包路径|定位路径', + operation VARCHAR(100) COMMENT '方法名|操作', + parameters VARCHAR(500) COMMENT '参数', + action VARCHAR(50) COMMENT '步骤动作', + caseid int(8) not null COMMENT '用例ID', + stepnum int(2) not null COMMENT '步骤编号', + expectedresult VARCHAR(2000) COMMENT '预期结果', + projectid int(8) not null COMMENT '项目ID', + steptype int(2) not null COMMENT '0 接口 1 UI', + time VARCHAR(30) COMMENT '最后更新时间', + operationer VARCHAR(20) COMMENT '最后更新人员', + remark VARCHAR(200) COMMENT '备注', + primary key (ID) +)default character set utf8; + +create table PROJECT_PLAN +( + id int(9) not null AUTO_INCREMENT, + name VARCHAR(50) not null COMMENT '测试计划名称', + casecount int(8) COMMENT '计划中用例总数', + remark VARCHAR(200) COMMENT '备注', + projectid int(8) not null COMMENT '项目ID', + time VARCHAR(30) COMMENT '最后更新时间', + operationer VARCHAR(20) COMMENT '最后更新人员', + primary key (ID) +)default character set utf8; + +create table PROJECT_PLANCASE +( + id int(9) not null AUTO_INCREMENT, + caseid int(8) not null COMMENT '用例ID', + planid int(8) not null COMMENT '项目计划ID', + priority int(8) not null COMMENT '用例优先级', + primary key (ID), + index (caseid), + index (planid) +)default character set utf8; + +create table PROJECT_MODULE +( + id int(9) not null AUTO_INCREMENT, + projectid int(8) not null COMMENT '项目ID', + modulename VARCHAR(50) COMMENT '模块名字', + pid int(4) COMMENT '层级关系', + primary key (ID) +)default character set utf8; + +create table PROJECT_PROTOCOLTEMPLATE +( + id int(8) not null AUTO_INCREMENT, + projectid int(8) not null COMMENT '项目ID', + name VARCHAR(50) not null COMMENT '模板名称', + protocoltype VARCHAR(20) not null COMMENT '协议类型', + contentencoding VARCHAR(20) not null COMMENT '编码格式', + time VARCHAR(30) COMMENT '最后更新时间', + operationer VARCHAR(20) COMMENT '最后更新人员', + remark VARCHAR(200) COMMENT '备注', + primary key (ID) +)default character set utf8; + +create table PROJECT_TEMPLATEPARAMS +( + id int(9) not null AUTO_INCREMENT, + templateid int(8) not null COMMENT '模块ID', + paramname VARCHAR(50) not null COMMENT '参数名', + param VARCHAR(2000) COMMENT '参数默认值', + primary key (ID) +)default character set utf8; + +create table PROJECT_CASESTEPSPARAMS +( + id int(8) not null AUTO_INCREMENT, + steptype int(2) not null COMMENT '步骤类型', + parentid int(8) not null COMMENT '父节点ID', + fieldname VARCHAR(50) COMMENT '所属字段名', + paramvalue VARCHAR(200) COMMENT '参数值', + description VARCHAR(50) COMMENT '描述', + primary key (ID) +)default character set utf8; + +create table TEMP_CASESTEPDEBUG +( + id int(8) not null AUTO_INCREMENT, + sign VARCHAR(20) not null COMMENT '用例标识', + executor VARCHAR(20) not null COMMENT '执行人', + loglevel VARCHAR(10) not null COMMENT '日志级别', + detail VARCHAR(5000) not null COMMENT '日志', /*V1.1 扩展日志明细字段到2000*/ + primary key (ID) +)default character set utf8; +/*插入索引 +CREATE INDEX index_caseid ON TEST_LOGDETAIL (caseid); +CREATE INDEX index_taskid ON TEST_CASEDETAIL (taskid);*/ + +/*插入权限默认定义*/ +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (1, '质量-版本信息', '增加', 'pv_1'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (2, '质量-版本信息', '删除', 'pv_2'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (3, '质量-版本信息', '修改', 'pv_3'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (4, '质量-版本计划信息', '增加', 'pvp_1'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (5, '质量-流程检查信息', '增加', 'fc_1'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (6, '质量-流程检查信息', '删除', 'fc_2'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (7, '质量-流程检查信息', '修改', 'fc_3'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (8, '质量-生产故障信息', '增加', 'acc_1'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (9, '质量-生产故障信息', '删除', 'acc_2'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (10, '质量-生产故障信息', '修改', 'acc_3'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (21, '自动化-任务调度', '启动', 'tast_run'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (22, '自动化-任务调度', '移除', 'tast_remove'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (23, '自动化-任务调度', '执行', 'tast_ex'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (24, '自动化-任务调度', '增加', 'tast_1'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (25, '自动化-任务调度', '删除', 'tast_2'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (26, '自动化-任务调度', '修改', 'tast_3'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (27, '自动化-任务调度', '上传', 'tast_upload'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (11, '质量-流程检查计划', '增加', 'pfc_1'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (12, '质量-流程检查计划', '删除', 'pfc_2'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (13, '质量-流程检查计划', '修改', 'pfc_3'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (14, '质量-流程检查计划', '转计划', 'fc_tocheck'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (15, '质量-评审信息详情', '增加', 'revinfo_1'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (16, '质量-评审信息详情', '删除', 'revinfo_2'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (17, '质量-评审信息详情', '修改', 'revinfo_3'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (18, '质量-评审信息', '删除', 'rev_2'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (19, '质量-评审信息', '修改', 'rev_3'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (20, '质量-生产故障信息', '上传', 'acc_upload'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (41, '用户管理', '增加', 'ui_1'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (42, '用户管理', '删除', 'ui_2'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (43, '用户管理', '修改', 'ui_3'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (44, '用户管理', '查看', 'ui_4'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (45, '用户管理-权限角色', '查看修改', 'role_3'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (28, '自动化-任务列表', '删除', 'tastex_2'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (29, '自动化-用例列表', '执行', 'case_ex'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (46, '用户管理-权限角色', '增加', 'role_1'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (47, '用户管理-权限角色', '删除', 'role_2'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (48, '项目管理', '增加', 'pro_1'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (49, '项目管理', '删除', 'pro_2'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (50, '项目管理', '修改', 'pro_3'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (51, '用例管理', '增加', 'case_1'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (52, '用例管理', '删除', 'case_2'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (53, '用例管理', '修改', 'case_3'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (54, '步骤管理', '增删改查', 'case_step'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (55, '测试计划管理', '增加', 'proplan_1'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (56, '测试计划管理', '删除', 'proplan_2'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (57, '测试计划管理', '修改', 'proplan_3'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (58, '部门管理', '增加', 'dpmt_1'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (59, '部门管理', '删除', 'dpmt_2'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (60, '部门管理', '修改', 'dpmt_3'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (61, '协议模板', '增加', 'ptct_1'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (62, '协议模板', '删除', 'ptct_2'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (63, '协议模板', '修改', 'ptct_3'); + +/*插入步骤界面定义各个字段的默认值*/ +insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) +values (1, 2, 0, 'operation','HttpURLPost','使用HttpURLConnection发送post请求'); +insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) +values (2, 2, 0, 'operation','URLPost','使用URLConnection发送post'); +insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) +values (3, 2, 0, 'operation','GetAndSaveFile','发送get请求保存下载文件到客户端'); +insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) +values (4, 2, 0, 'operation','HttpURLGet','使用HttpURLConnection发送get请求'); +insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) +values (5, 2, 0, 'operation','URLGet','使用URLConnection发送get请求'); +insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) +values (6, 2, 0, 'operation','HttpClientPost','使用HttpClient发送post请求'); +insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) +values (7, 2, 0, 'operation','HttpClientGet','使用HttpClient发送get请求'); +insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) +values (8, 3, 0, 'operation','SocketPost','使用socket发送post请求'); +insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) +values (9, 3, 0, 'operation','SocketGet','使用socket发送get请求'); +insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) +values (10, 1, 0, 'operation','click','点击对象'); +insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) +values (11, 1, 0, 'operation','sendkeys','输入'); +insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) +values (12, 1, 0, 'operation','clear','清除输入框'); +insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) +values (13, 1, 0, 'operation','gotoframe','跳转框架(iframe)'); +insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) +values (14, 1, 0, 'operation','isenabled','判断对象是否可用'); +insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) +values (15, 1, 0, 'operation','isdisplayed','判断对象是否可见'); +insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) +values (16, 1, 0, 'operation','exjsob','针对对象执行JS脚本'); +insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) +values (17, 1, 0, 'operation','gettext','获取对象文本属性'); +insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) +values (18, 1, 0, 'operation','gettagname','获取对象标签类型'); +insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) +values (19, 1, 0, 'operation','getcaptcha','获取对象中的验证码(识别率较低)'); +insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) +values (20, 1, 0, 'operation','selectbyvisibletext','通过下拉框的文本进行选择'); +insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) +values (21, 1, 0, 'operation','selectbyvalue','通过下拉框的VALUE属性进行选择'); +insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) +values (22, 1, 0, 'operation','selectbyindex','通过下拉框的index属性进行选择(从0开始)'); +insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) +values (23, 1, 0, 'operation','isselect','判断是否已经被选择,同用于单选\复选框'); +insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) +values (24, 1, 0, 'operation','open','打开URL'); +insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) +values (25, 1, 0, 'operation','exjs','执行js脚本'); +insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) +values (26, 1, 0, 'operation','gotodefaultcontent','跳转回到默认iframe'); +insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) +values (27, 1, 0, 'operation','gettitle','获取窗口标题'); +insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) +values (28, 1, 0, 'operation','getwindowhandle','获取窗口句柄'); +insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) +values (29, 1, 0, 'operation','gotowindow','跳转窗口句柄'); +insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) +values (30, 1, 0, 'operation','wait','等待时间(S)'); +insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) +values (31, 1, 0, 'operation','alertaccept','弹出框点击OK'); +insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) +values (32, 1, 0, 'operation','alertdismiss','弹出框点击取消'); +insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) +values (33, 1, 0, 'operation','alertgettext','获取弹出框TEXT'); +insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) +values (34, 1, 0, 'operation','mouselkclick','模拟鼠标左键单击(可带页面对象)'); +insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) +values (35, 1, 0, 'operation','mouserkclick','模拟鼠标右键单击(可带页面对象)'); +insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) +values (36, 1, 0, 'operation','mousedclick','模拟鼠标双击(可带页面对象)'); +insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) +values (37, 1, 0, 'operation','mouseclickhold','模拟鼠标左键单击后不释放(可带页面对象)'); +insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) +values (38, 1, 0, 'operation','mousedrag','模拟鼠标拖拽(可带页面对象)'); +insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) +values (39, 1, 0, 'operation','mouseto','模拟鼠标移动到指定坐标(可带页面对象)'); +insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) +values (40, 1, 0, 'operation','mouserelease','模拟鼠标释放(可带页面对象)'); +insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) +values (41, 1, 0, 'operation','mousekey(tab)','模拟键盘Tab键'); +insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) +values (42, 1, 0, 'operation','mousekey(space)','模拟键盘Space键'); +insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) +values (43, 1, 0, 'operation','mousekey(ctrl)','模拟键盘Ctrl键'); +insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) +values (44, 1, 0, 'operation','mousekey(shift)','模拟键盘Shift键'); +insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) +values (45, 1, 0, 'operation','mousekey(enter)','模拟键盘Enter键'); +insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) +values (46, 1, 0, 'operation','runcase','调用指定接口用例'); + +/*插入角色默认定义*/ +insert into USER_ROLE (id, role, permission) +values (2, '测试工程师', 'acc_1,acc_2,acc_3,'); +insert into USER_ROLE (id, role, permission) +values (3, '自动化工程师', 'acc_1,acc_2,acc_3,tast_run,tast_remove,tast_ex,tast_1,tast_3,tast_2,tast_upload,tastex_2,case_ex,'); +insert into USER_ROLE (id, role, permission) +values (4, '质量工程师', 'pv_1,pv_2,pv_3,pvp_1,fc_1,fc_2,fc_3,acc_1,acc_2,acc_3,pfc_1,pfc_2,pfc_3,fc_tocheck,revinfo_1,revinfo_2,revinfo_3,rev_2,rev_3,acc_upload,'); +insert into USER_ROLE (id, role, permission) +values (1, '管理员', 'pv_1,pv_2,pv_3,pvp_1,fc_1,fc_2,fc_3,acc_1,acc_2,acc_3,tast_run,tast_remove,tast_ex,tast_1,tast_3,tast_2,tast_upload,tastex_2,case_ex,pfc_1,pfc_2,pfc_3,fc_tocheck,revinfo_1,revinfo_2,revinfo_3,rev_2,rev_3,acc_upload,ui_1,ui_2,ui_3,ui_4,role_3,role_1,role_2,pro_1,pro_2,pro_3,'); + +/*插入默认部门分级*/ +insert into QA_SECONDARYSECTOR (sectorid, departmenthead, departmentname) +values (99, '系统管理员', '总部'); +/*插入默认项目*/ +insert into QA_SECTORPROJECTS (projectid, projectname, projectmanager, sectorid, projecttype) +values (99, '全部项目/未知项目', '系统管理员', 99, 0); +/*插入默认管理员*/ +insert into USERINFO (id, usercode, password, username, role, sectorid) +values (1, 'admin', 'uJ45aIeS9N80kaSFDjvk%2FA%3D%3D', '系统管理员', '1', 99); +/*插入流程检查定义数据*/ +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (36, 5, '总结阶段', 2, '计划变更', 1, '如与计划不合,是否提交计划变更邮件', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (37, 5, '总结阶段', 3, '代码质量', 1, 'sonar代码检查是否刷新构建', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (38, 5, '总结阶段', 3, '代码质量', 2, 'sonar代码问题数是否符合要求', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (35, 2, '开发阶段', 3, '开发与编码', 6, '是否每一条禅道开发任务都提交转测申请', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (34, 4, '验收与上线', 2, '上线部署', 3, 'SVN代码是否提交并标注', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (1, 1, '需求阶段', 1, '需求编制', 1, '《产品需求说明书》是否组织评审会', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (2, 1, '需求阶段', 1, '需求编制', 2, '《产品需求说明书》评审是否通过', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (3, 1, '需求阶段', 1, '需求编制', 3, '《产品需求说明书》是否归档到SVN', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (4, 1, '需求阶段', 1, '需求编制', 4, '《产品需求说明书》评审记录表是否签字通过', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (5, 2, '开发阶段', 1, '需求分解', 1, '是否有需求分解/任务讨论会', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (6, 2, '开发阶段', 1, '需求分解', 2, '《项目计划》邮件是否及时发出', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (7, 2, '开发阶段', 1, '需求分解', 3, '《项目计划》邮件内容是否完整', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (10, 2, '开发阶段', 2, '软件设计', 1, '《产品开发概要设计》是否组织评审会', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (11, 2, '开发阶段', 2, '软件设计', 2, '《产品开发概要设计》评审是否通过', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (12, 2, '开发阶段', 2, '软件设计', 3, '《产品开发概要设计》是否归档到SVN', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (13, 2, '开发阶段', 2, '软件设计', 4, '《产品开发概要设计》评审记录表是否签字通过', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (14, 2, '开发阶段', 3, '开发与编码', 1, '是否进行每日晨会', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (15, 2, '开发阶段', 3, '开发与编码', 2, '是否进行代码走读', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (16, 2, '开发阶段', 3, '开发与编码', 3, '是否每一条禅道开发任务都提交转测申请', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (17, 2, '开发阶段', 3, '开发与编码', 4, '转测邮件是否合格', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (18, 2, '开发阶段', 3, '开发与编码', 5, '转测邮件打回次数为0', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (19, 3, '测试阶段', 1, '软件测试', 1, '是否回复测试计划', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (20, 3, '测试阶段', 1, '软件测试', 2, '是否回复测试用例', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (21, 3, '测试阶段', 1, '软件测试', 3, '测试用例是否通过评审/确认', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (22, 3, '测试阶段', 1, '软件测试', 4, '《软件测试报告》是否组织评审会', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (23, 3, '测试阶段', 1, '软件测试', 5, '《软件测试报告》是否评审通过', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (24, 3, '测试阶段', 1, '软件测试', 6, '《软件测试报告》/测试结果是否发出邮件', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (25, 3, '测试阶段', 1, '软件测试', 7, '《软件测试报告》评审记录表是否签字通过', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (26, 4, '验收与上线', 1, '产品验收', 1, '《产品验收报告》是否组织评审会', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (27, 4, '验收与上线', 1, '产品验收', 2, '《产品验收报告》是否评审通过', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (28, 4, '验收与上线', 1, '产品验收', 3, '《产品验收报告》是否归档到SVN', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (29, 4, '验收与上线', 1, '产品验收', 4, '《产品验收报告》评审记录表是否签字通过', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (30, 4, '验收与上线', 2, '上线部署', 1, '产品/开发是否提交上线流程(OA)', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (31, 4, '验收与上线', 2, '上线部署', 2, '开发是否提交上线相关资料', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (32, 5, '总结阶段', 1, '项目总结', 1, '《项目总结》邮件是否及时发出', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) values (33, 5, '总结阶段', 1, '项目总结', 2, '《项目总结》邮件内容是否完整', null); \ No newline at end of file diff --git a/mysqldb/initialization(create table)/V2.3 初始化.sql b/mysqldb/initialization(create table)/V2.3 初始化.sql index 1b4c2e1..9625d83 100644 --- a/mysqldb/initialization(create table)/V2.3 初始化.sql +++ b/mysqldb/initialization(create table)/V2.3 初始化.sql @@ -1,706 +1,706 @@ -create table OPERATION_LOG -( - id int(9) not null AUTO_INCREMENT, - tablename VARCHAR(30) not null COMMENT '被记录日志表名', - tableid int(8) not null COMMENT '被记录日志ID', - operation_time VARCHAR(30) not null COMMENT '操作时间', - operationer VARCHAR(20) not null COMMENT '操作人员', - operation_description VARCHAR(200) not null COMMENT '描述', - projectid int(8) COMMENT '项目ID', - primary key (ID) -)default character set utf8; -create table QA_ACCIDENT -( - id int(8) not null AUTO_INCREMENT, - projectid int(8) not null COMMENT '项目ID', - accstatus VARCHAR(80) not null COMMENT '事故状态', - eventtime VARCHAR(30) COMMENT '事故发生时间', - reporter VARCHAR(20) not null COMMENT '报告人', - reporttime VARCHAR(30) not null COMMENT '事故报告时间', - accdescription VARCHAR(500) not null COMMENT '事故描述', - acclevel VARCHAR(60) not null COMMENT '事故等级', - causalanalysis VARCHAR(500) COMMENT '原因分析', - causaltype VARCHAR(100) COMMENT '原因类型', - consequenceanalysis VARCHAR(300) COMMENT '后果分析', - correctiveaction VARCHAR(300) COMMENT '纠正措施', - resolutiontime VARCHAR(30) COMMENT '解决时间', - resolutioner VARCHAR(20) COMMENT '解决处理人', - preventiveaction VARCHAR(300) COMMENT '预防措施', - preventiver VARCHAR(20) COMMENT '预防措施责任人', - preventiveplandate VARCHAR(30) COMMENT '预防措施计划完成时间', - preventiveaccdate VARCHAR(30) COMMENT '预防措施实际完成时间', - trouble_duration int(8) COMMENT '事故持续时间', - impact_time int(8), - filename VARCHAR(100) COMMENT '附件路径', - primary key (ID) -)default character set utf8; -create table QA_FLOWCHECK -( - id int(10) not null AUTO_INCREMENT, - checkid int(10) not null COMMENT '检查id', - projectid int(10) not null COMMENT '项目id', - projectphase VARCHAR(20) not null COMMENT '项目阶段', - phasenode VARCHAR(50) not null COMMENT '阶段节点', - checkentry VARCHAR(100) not null COMMENT '检查内容', - checkresult VARCHAR(20) COMMENT '检查结果', - checkdate VARCHAR(20) COMMENT '检查日期', - checkdescriptions VARCHAR(400) COMMENT '不符合项描述', - stateupdate VARCHAR(20) COMMENT '状态更新', - updatedate VARCHAR(20) COMMENT '更新日期', - remark VARCHAR(200) COMMENT '备注', - versionnum VARCHAR(30) COMMENT '版本号', - primary key (ID) -)default character set utf8; -create table QA_FLOWINFO -( - id int(10) not null AUTO_INCREMENT, - phaseid int(10) not null, - phasename VARCHAR(20) not null, - phasenodeid int(10) not null, - phasenodename VARCHAR(20) not null, - checkentryid int(10) not null, - checkentry VARCHAR(200) not null, - remark VARCHAR(100), - primary key (ID) -)default character set utf8; -create table QA_PLANFLOWCHECK -( - id int(8) not null AUTO_INCREMENT, - projectid int(8) not null COMMENT '项目ID', - versionnum VARCHAR(30) COMMENT '版本号', - checkentryid VARCHAR(20) not null COMMENT '检查ID', - plandate VARCHAR(20) not null COMMENT '计划检查日期', - status int(4) not null COMMENT '计划状态:1 检查计划 2 已检查', - primary key (ID) -)default character set utf8; -create table QA_PROJECTVERSION -( - versionid int(10) not null AUTO_INCREMENT, - versionnumber VARCHAR(20) COMMENT '版本号', - plan_launchdate VARCHAR(20) COMMENT '计划上线日期', - actually_launchdate VARCHAR(20) COMMENT '实际上线日期', - plan_devstart VARCHAR(20) COMMENT '计划开发开始时间', - plan_devend VARCHAR(20) COMMENT '计划开发结束时间', - actually_devstart VARCHAR(20) COMMENT '实际开发开始时间', - actually_devend VARCHAR(20) COMMENT '实际开发结束时间', - plan_teststart VARCHAR(20) COMMENT '计划测试开始时间', - plan_testend VARCHAR(20) COMMENT '计划测试结束时间', - actually_teststart VARCHAR(20) COMMENT '实际测试开始时间', - actually_testend VARCHAR(20) COMMENT '实际测试结束时间', - plan_demand int(10) COMMENT '计划上线需求数', - actually_demand int(10) COMMENT '实际上线需求数', - codeline FLOAT(10) COMMENT '代码变动行数', - testcasenum int(10) COMMENT '测试用例数', - changetestingreturn int(10) COMMENT '版本转测试打回次数', - dev_member VARCHAR(50) COMMENT '开发投入人力', - test_member VARCHAR(50) COMMENT '测试投入人力', - human_cost VARCHAR(20) COMMENT '耗费人力 人/天', - per_dev VARCHAR(20) COMMENT '开发平均生产率 人/天/行', - per_test VARCHAR(20) COMMENT '用例编写/用例执行', - code_di VARCHAR(20) COMMENT '代码DI值', - qualityreview VARCHAR(500) COMMENT '质量回溯', - imprint VARCHAR(500) COMMENT '版本说明', - remark VARCHAR(500) COMMENT '备注', - projectid int(10) COMMENT '项目ID', - devtime_deviation VARCHAR(20) COMMENT '开发偏移率', - devdelay_days VARCHAR(20) COMMENT '开发延迟时间', - testtime_deviation VARCHAR(20) COMMENT '测试偏移率', - testdelay_days VARCHAR(20) COMMENT '测试延迟时间', - protime_deviation VARCHAR(20), - prodelay_days VARCHAR(20), - bug_zm int(10), - bug_yz int(10), - bug_yb int(10), - bug_ts int(10), - versiontype int(8) default 1 not null COMMENT '版本类型', - perdemand FLOAT(8) default 0.00, - codestandard_zd int(10) default 0 not null, - codestandard_yz int(10) default 0 not null, - codestandard_zy int(10) default 0 not null, - zt_versionlink VARCHAR(100) COMMENT '禅道链接', - human_costdev VARCHAR(20) default '0' COMMENT '开发人力成本', - human_costtest VARCHAR(20) default '0' COMMENT '测试人力成本', - primary key (versionid) -)default character set utf8; -create table QA_REVIEW -( - id int(8) not null AUTO_INCREMENT, - projectid int(8) not null COMMENT '项目ID', - version VARCHAR(20) not null COMMENT '版本号', - review_type VARCHAR(20) COMMENT '评审类型', - review_date VARCHAR(20) COMMENT '评审日期', - bug_num int(8) COMMENT '问题数', - repair_num int(8) COMMENT '已修复问题数', - confirm_date VARCHAR(20) COMMENT '最后确认日期', - review_object VARCHAR(100) COMMENT '评审对象', - review_result VARCHAR(50) COMMENT '评审结果', - result_confirmor VARCHAR(50) COMMENT '结果确认人', - remark VARCHAR(500) COMMENT '备注', - primary key (id) -)default character set utf8; -create table QA_REVIEWINFO -( - id int(8) not null AUTO_INCREMENT, - review_id int(8) not null COMMENT '评审ID', - bug_description VARCHAR(500) COMMENT '问题描述', - status VARCHAR(20) COMMENT '状态', - duty_officer VARCHAR(100) COMMENT '责任人', - confirm_date VARCHAR(20) COMMENT '最后确认日期', - corrective VARCHAR(500) COMMENT '纠正措施', - primary key (id) -)default character set utf8; -create table QA_SECONDARYSECTOR -( - sectorid int(10) not null AUTO_INCREMENT, - departmenthead VARCHAR(20), - departmentname VARCHAR(20), - primary key (sectorid) -)default character set utf8; -create table QA_SECTORPROJECTS -( - projectid int(10) not null AUTO_INCREMENT, - projectname VARCHAR(100) not null, - projectmanager VARCHAR(100) not null, - sectorid int(10) not null, - projecttype int(4) default 0 not null, - projectsign VARCHAR(20) default 'sign' not null, - primary key (projectid) -)default character set utf8; -create table QA_ZTTASK -( - id int(8) not null AUTO_INCREMENT, - versionid int(8) COMMENT '版本ID', - versionname VARCHAR(100) COMMENT '版本名称', - taskname VARCHAR(300) COMMENT '任务名称', - assigneddate VARCHAR(50) COMMENT '完成时间', - estimate int(8) COMMENT '预期工时', - consumed int(8) COMMENT '实际工时', - finishedby VARCHAR(40) COMMENT '完成人账号', - finishedname VARCHAR(40) COMMENT '完成人姓名', - deadline VARCHAR(40) COMMENT '计划截止日期', - delaystatus int(4) COMMENT '延期状态', - primary key (id) -)default character set utf8; -create table TEST_JOBS -( - id int(10) not null AUTO_INCREMENT, - name VARCHAR(100) not null COMMENT '调度名称', - startdate VARCHAR(100) COMMENT '开始日期', - starttime VARCHAR(100) COMMENT '开始时间', - enddate VARCHAR(100) COMMENT '结束日期', - endtime VARCHAR(100) COMMENT '结束时间', - runtime datetime COMMENT '执行时间', - remark VARCHAR(800) COMMENT '备注', - planproj VARCHAR(100) COMMENT '项目名(testlink)中', - state VARCHAR(4) not null COMMENT '状态', - tasktype VARCHAR(4) not null COMMENT '执行类型 O执行一次 D每天执行', - starttimestr VARCHAR(100) COMMENT '执行时间表达式', - endtimestr VARCHAR(100) COMMENT '结束时间', - createtime datetime not null, - noenddate VARCHAR(10) COMMENT '是否有结束日期', - time int default 0, - timetype VARCHAR(4), - issendmail VARCHAR(4) default "0" COMMENT '是否发送邮件通知', - emailer VARCHAR(250) COMMENT '邮件地址', - threadcount int default 1 COMMENT '客户端线程数(接口)', - testlinkname VARCHAR(200) COMMENT 'TESTLINK中的计划名称', - isbuilding VARCHAR(4) default '0' not null COMMENT '是否自动构建', - buildname VARCHAR(100) COMMENT '构建链接', - isrestart VARCHAR(4) default '0' not null COMMENT '是否自动重启', - restartcomm VARCHAR(200) COMMENT '重启脚本', - extype int(4) default 0 not null COMMENT '执行类型', - browsertype int(4) COMMENT 'UI自动化浏览器类型', - timeout int(8) default 60 not null COMMENT '任务超时中断时间(分钟)', - clientip VARCHAR(30) default '127.0.0.1' not null COMMENT '版本ID', - projecttype int(4) default "0" COMMENT '项目类型 系统内项目 0 testlink 1', - projectid int(8) COMMENT '系统内项目ID', - planid int(8) COMMENT '系统内项目关联测试计划ID', - primary key (id) -)default character set utf8; -create table TEST_CASEDETAIL -( - id int(10) not null AUTO_INCREMENT, - taskid int(10) not null, - caseno VARCHAR(20) not null COMMENT '用例编号', - caseversion VARCHAR(20) not null COMMENT '用例版本', - casetime datetime not null COMMENT '执行时间', - casename VARCHAR(200) not null COMMENT '用例名称', - casestatus VARCHAR(2) default '4' not null COMMENT ' pass:0 fail:1 lock:2 unexcute:4', - primary key (id) -)default character set utf8; -create table TEST_LOGDETAIL -( - logid int(10) not null AUTO_INCREMENT, - logtime datetime not null COMMENT '日志时间', - detail VARCHAR(5000) not null COMMENT '日志', /*V1.1 扩展日志明细字段到2000*/ - loggrade VARCHAR(20) COMMENT '日志级别', - caseid int(10) not null COMMENT '用例编号', - taskid int(10), - step VARCHAR(20) COMMENT '用例步骤', - imgname VARCHAR(30) COMMENT 'UI自动化自动截图地址', - primary key (logid) -)default character set utf8; -create table TEST_TASKEXCUTE -( - id int(10) not null AUTO_INCREMENT, - taskid VARCHAR(150) not null, - casetotal_count int(10) COMMENT '总用例数', - casesucc_count int(10) COMMENT '成功数', - casefail_count int(10) COMMENT '失败数', - caselock_count int(10) COMMENT '锁定数', - createtime datetime COMMENT '时间', - jobid int(10) not null, - finishtime datetime COMMENT '完成时间', - taskstatus VARCHAR(2) default '' COMMENT '状态 0未执行 1执行中 2 成功 4失败 ', - casenoexec_count int default 0 COMMENT '未执行用例', - caseisexec VARCHAR(2) COMMENT '任务是否被成功吊起 0 成功吊起 3 吊起失败', - primary key (id) -)default character set utf8; -create table USERINFO -( - id int(8) not null AUTO_INCREMENT, - usercode VARCHAR(20) not null, - password VARCHAR(200) not null, - username VARCHAR(20), - role VARCHAR(100) COMMENT '角色', - sectorid int(8) default 0 not null COMMENT '所属部门', - projectid int(4) default 0 not null COMMENT '默认选择项目', - primary key (id) -)default character set utf8; -create table USER_AUTHORITY -( - id int(9) not null AUTO_INCREMENT, - module VARCHAR(50) not null COMMENT '模块', - auth_type VARCHAR(50) not null COMMENT '权限类型', - alias VARCHAR(50) not null COMMENT '别名', - primary key (id) -)default character set utf8; -create table USER_ROLE -( - id int(9) not null AUTO_INCREMENT, - role VARCHAR(50) not null COMMENT '角色', - permission VARCHAR(1000) COMMENT '权限', - opprojectid VARCHAR(200) COMMENT '可操作的项目', - primary key (id) -)default character set utf8; -create table TEST_CLIENT -( - id int(8) not null AUTO_INCREMENT, - clientip VARCHAR(30) not null COMMENT '客户端IP', - name VARCHAR(30) not null COMMENT '客户端名称', - projectper VARCHAR(200) COMMENT '使用项目', - status int(2) COMMENT '客户端超时 0 正常 1 链接失败 2 状态未知', - checkinterval int(6) not null COMMENT '检查客户端状态心跳间隔时间 单位:秒', - remark VARCHAR(100) COMMENT '备注', - primary key (id) -)default character set utf8; -/*用例管理模块*/ -create table PROJECT_CASE -( - id int(8) not null AUTO_INCREMENT, - sign VARCHAR(20) not null COMMENT '用例标识', - name VARCHAR(200) not null COMMENT '用例名称', - projectid int(8) not null COMMENT '关联项目ID', - moduleid int(8) not null COMMENT '关联项目模块ID', - projectindex int(8) not null COMMENT '项目用例编号', - time VARCHAR(30) COMMENT '最后更新时间', - operationer VARCHAR(20) COMMENT '最后更新人员', - casetype int(2) not null COMMENT '0 接口 1 UI', - remark VARCHAR(200) COMMENT '备注', - primary key (ID) -)default character set utf8; - -create table PROJECT_CASESTEPS -( - id int(8) not null AUTO_INCREMENT, - path VARCHAR(100) COMMENT '包路径|定位路径', - operation VARCHAR(100) COMMENT '方法名|操作', - parameters VARCHAR(500) COMMENT '参数', - action VARCHAR(50) COMMENT '步骤动作', - caseid int(8) not null COMMENT '用例ID', - stepnum int(2) not null COMMENT '步骤编号', - expectedresult VARCHAR(2000) COMMENT '预期结果', - projectid int(8) not null COMMENT '项目ID', - steptype int(2) not null COMMENT '0 接口 1 UI', - time VARCHAR(30) COMMENT '最后更新时间', - operationer VARCHAR(20) COMMENT '最后更新人员', - remark VARCHAR(200) COMMENT '备注', - primary key (ID) -)default character set utf8; - -create table PROJECT_PLAN -( - id int(9) not null AUTO_INCREMENT, - name VARCHAR(50) not null COMMENT '测试计划名称', - casecount int(8) COMMENT '计划中用例总数', - remark VARCHAR(200) COMMENT '备注', - projectid int(8) not null COMMENT '项目ID', - time VARCHAR(30) COMMENT '最后更新时间', - operationer VARCHAR(20) COMMENT '最后更新人员', - primary key (ID) -)default character set utf8; - -create table PROJECT_PLANCASE -( - id int(9) not null AUTO_INCREMENT, - caseid int(8) not null COMMENT '用例ID', - planid int(8) not null COMMENT '项目计划ID', - priority int(8) not null COMMENT '用例优先级', - primary key (ID), - index (caseid), - index (planid) -)default character set utf8; - -create table PROJECT_MODULE -( - id int(9) not null AUTO_INCREMENT, - projectid int(8) not null COMMENT '项目ID', - modulename VARCHAR(50) COMMENT '模块名字', - pid int(4) COMMENT '层级关系', - primary key (ID) -)default character set utf8; - -create table PROJECT_PROTOCOLTEMPLATE -( - id int(8) not null AUTO_INCREMENT, - projectid int(8) not null COMMENT '项目ID', - name VARCHAR(50) not null COMMENT '模板名称', - protocoltype VARCHAR(20) not null COMMENT '协议类型', - contentencoding VARCHAR(20) not null COMMENT '编码格式', - time VARCHAR(30) COMMENT '最后更新时间', - operationer VARCHAR(20) COMMENT '最后更新人员', - remark VARCHAR(200) COMMENT '备注', - primary key (ID) -)default character set utf8; - -create table PROJECT_TEMPLATEPARAMS -( - id int(9) not null AUTO_INCREMENT, - templateid int(8) not null COMMENT '模块ID', - paramname VARCHAR(50) not null COMMENT '参数名', - param VARCHAR(2000) COMMENT '参数默认值', - primary key (ID) -)default character set utf8; - -create table PROJECT_CASESTEPSPARAMS -( - id int(8) not null AUTO_INCREMENT, - steptype int(2) not null COMMENT '步骤类型', - parentid int(8) not null COMMENT '父节点ID', - fieldname VARCHAR(50) COMMENT '所属字段名', - paramvalue VARCHAR(200) COMMENT '参数值', - description VARCHAR(50) COMMENT '描述', - primary key (ID) -)default character set utf8; - -create table TEMP_CASESTEPDEBUG -( - id int(8) not null AUTO_INCREMENT, - sign VARCHAR(20) not null COMMENT '用例标识', - executor VARCHAR(20) not null COMMENT '执行人', - loglevel VARCHAR(10) not null COMMENT '日志级别', - detail VARCHAR(5000) not null COMMENT '日志', /*V1.1 扩展日志明细字段到2000*/ - primary key (ID) -)default character set utf8; -/*插入索引 -CREATE INDEX index_caseid ON TEST_LOGDETAIL (caseid); -CREATE INDEX index_taskid ON TEST_CASEDETAIL (taskid);*/ - -/*插入权限默认定义*/ -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (1, '质量-版本信息', '增加', 'pv_1'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (2, '质量-版本信息', '删除', 'pv_2'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (3, '质量-版本信息', '修改', 'pv_3'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (4, '质量-版本计划信息', '增加', 'pvp_1'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (5, '质量-流程检查信息', '增加', 'fc_1'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (6, '质量-流程检查信息', '删除', 'fc_2'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (7, '质量-流程检查信息', '修改', 'fc_3'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (8, '质量-生产故障信息', '增加', 'acc_1'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (9, '质量-生产故障信息', '删除', 'acc_2'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (10, '质量-生产故障信息', '修改', 'acc_3'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (21, '自动化-任务调度', '启动', 'tast_run'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (22, '自动化-任务调度', '移除', 'tast_remove'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (23, '自动化-任务调度', '执行', 'tast_ex'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (24, '自动化-任务调度', '增加', 'tast_1'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (25, '自动化-任务调度', '删除', 'tast_2'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (26, '自动化-任务调度', '修改', 'tast_3'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (27, '自动化-任务调度', '上传', 'tast_upload'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (11, '质量-流程检查计划', '增加', 'pfc_1'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (12, '质量-流程检查计划', '删除', 'pfc_2'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (13, '质量-流程检查计划', '修改', 'pfc_3'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (14, '质量-流程检查计划', '转计划', 'fc_tocheck'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (15, '质量-评审信息详情', '增加', 'revinfo_1'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (16, '质量-评审信息详情', '删除', 'revinfo_2'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (17, '质量-评审信息详情', '修改', 'revinfo_3'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (18, '质量-评审信息', '删除', 'rev_2'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (19, '质量-评审信息', '修改', 'rev_3'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (20, '质量-生产故障信息', '上传', 'acc_upload'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (41, '用户管理', '增加', 'ui_1'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (42, '用户管理', '删除', 'ui_2'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (43, '用户管理', '修改', 'ui_3'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (44, '用户管理', '查看', 'ui_4'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (45, '用户管理-权限角色', '查看修改', 'role_3'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (28, '自动化-任务列表', '删除', 'tastex_2'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (29, '自动化-用例列表', '执行', 'case_ex'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (46, '用户管理-权限角色', '增加', 'role_1'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (47, '用户管理-权限角色', '删除', 'role_2'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (48, '项目管理', '增加', 'pro_1'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (49, '项目管理', '删除', 'pro_2'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (50, '项目管理', '修改', 'pro_3'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (51, '用例管理', '增加', 'case_1'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (52, '用例管理', '删除', 'case_2'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (53, '用例管理', '修改', 'case_3'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (54, '步骤管理', '增删改查', 'case_step'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (55, '测试计划管理', '增加', 'proplan_1'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (56, '测试计划管理', '删除', 'proplan_2'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (57, '测试计划管理', '修改', 'proplan_3'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (58, '部门管理', '增加', 'dpmt_1'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (59, '部门管理', '删除', 'dpmt_2'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (60, '部门管理', '修改', 'dpmt_3'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (61, '协议模板', '增加', 'ptct_1'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (62, '协议模板', '删除', 'ptct_2'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (63, '协议模板', '修改', 'ptct_3'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (64, '客户端管理', '增加', 'client_1'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (65, '客户端管理', '删除', 'client_2'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (66, '客户端管理', '修改', 'client_3'); - -/*插入步骤界面定义各个字段的默认值*/ -insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) -values (1, 2, 0, 'operation','HttpURLPost','使用HttpURLConnection发送post请求'); -insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) -values (2, 2, 0, 'operation','URLPost','使用URLConnection发送post'); -insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) -values (3, 2, 0, 'operation','GetAndSaveFile','发送get请求保存下载文件到客户端'); -insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) -values (4, 2, 0, 'operation','HttpURLGet','使用HttpURLConnection发送get请求'); -insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) -values (5, 2, 0, 'operation','URLGet','使用URLConnection发送get请求'); -insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) -values (6, 2, 0, 'operation','HttpClientPost','使用HttpClient发送post请求'); -insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) -values (7, 2, 0, 'operation','HttpClientGet','使用HttpClient发送get请求'); -insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) -values (8, 3, 0, 'operation','SocketPost','使用socket发送post请求'); -insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) -values (9, 3, 0, 'operation','SocketGet','使用socket发送get请求'); -insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) -values (10, 1, 0, 'operation','click','点击对象'); -insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) -values (11, 1, 0, 'operation','sendkeys','输入'); -insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) -values (12, 1, 0, 'operation','clear','清除输入框'); -insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) -values (13, 1, 0, 'operation','gotoframe','跳转框架(iframe)'); -insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) -values (14, 1, 0, 'operation','isenabled','判断对象是否可用'); -insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) -values (15, 1, 0, 'operation','isdisplayed','判断对象是否可见'); -insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) -values (16, 1, 0, 'operation','exjsob','针对对象执行JS脚本'); -insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) -values (17, 1, 0, 'operation','gettext','获取对象文本属性'); -insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) -values (18, 1, 0, 'operation','gettagname','获取对象标签类型'); -insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) -values (19, 1, 0, 'operation','getcaptcha','获取对象中的验证码(识别率较低)'); -insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) -values (20, 1, 0, 'operation','selectbyvisibletext','通过下拉框的文本进行选择'); -insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) -values (21, 1, 0, 'operation','selectbyvalue','通过下拉框的VALUE属性进行选择'); -insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) -values (22, 1, 0, 'operation','selectbyindex','通过下拉框的index属性进行选择(从0开始)'); -insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) -values (23, 1, 0, 'operation','isselect','判断是否已经被选择,同用于单选\复选框'); -insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) -values (24, 1, 0, 'operation','open','打开URL'); -insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) -values (25, 1, 0, 'operation','exjs','执行js脚本'); -insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) -values (26, 1, 0, 'operation','gotodefaultcontent','跳转回到默认iframe'); -insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) -values (27, 1, 0, 'operation','gettitle','获取窗口标题'); -insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) -values (28, 1, 0, 'operation','getwindowhandle','获取窗口句柄'); -insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) -values (29, 1, 0, 'operation','gotowindow','跳转窗口句柄'); -insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) -values (30, 1, 0, 'operation','wait','等待时间(S)'); -insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) -values (31, 1, 0, 'operation','alertaccept','弹出框点击OK'); -insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) -values (32, 1, 0, 'operation','alertdismiss','弹出框点击取消'); -insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) -values (33, 1, 0, 'operation','alertgettext','获取弹出框TEXT'); -insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) -values (34, 1, 0, 'operation','mouselkclick','模拟鼠标左键单击(可带页面对象)'); -insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) -values (35, 1, 0, 'operation','mouserkclick','模拟鼠标右键单击(可带页面对象)'); -insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) -values (36, 1, 0, 'operation','mousedclick','模拟鼠标双击(可带页面对象)'); -insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) -values (37, 1, 0, 'operation','mouseclickhold','模拟鼠标左键单击后不释放(可带页面对象)'); -insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) -values (38, 1, 0, 'operation','mousedrag','模拟鼠标拖拽(可带页面对象)'); -insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) -values (39, 1, 0, 'operation','mouseto','模拟鼠标移动到指定坐标(可带页面对象)'); -insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) -values (40, 1, 0, 'operation','mouserelease','模拟鼠标释放(可带页面对象)'); -insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) -values (41, 1, 0, 'operation','mousekey(tab)','模拟键盘Tab键'); -insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) -values (42, 1, 0, 'operation','mousekey(space)','模拟键盘Space键'); -insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) -values (43, 1, 0, 'operation','mousekey(ctrl)','模拟键盘Ctrl键'); -insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) -values (44, 1, 0, 'operation','mousekey(shift)','模拟键盘Shift键'); -insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) -values (45, 1, 0, 'operation','mousekey(enter)','模拟键盘Enter键'); -insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) -values (46, 1, 0, 'operation','runcase','调用指定接口用例'); - -/*插入角色默认定义*/ -insert into USER_ROLE (id, role, permission) -values (2, '测试工程师', 'acc_1,acc_2,acc_3,'); -insert into USER_ROLE (id, role, permission) -values (3, '自动化工程师', 'acc_1,acc_2,acc_3,tast_run,tast_remove,tast_ex,tast_1,tast_3,tast_2,tast_upload,tastex_2,case_ex,'); -insert into USER_ROLE (id, role, permission) -values (4, '质量工程师', 'pv_1,pv_2,pv_3,pvp_1,fc_1,fc_2,fc_3,acc_1,acc_2,acc_3,pfc_1,pfc_2,pfc_3,fc_tocheck,revinfo_1,revinfo_2,revinfo_3,rev_2,rev_3,acc_upload,'); -insert into USER_ROLE (id, role, permission) -values (1, '管理员', 'pv_1,pv_2,pv_3,pvp_1,fc_1,fc_2,fc_3,acc_1,acc_2,acc_3,tast_run,tast_remove,tast_ex,tast_1,tast_3,tast_2,tast_upload,tastex_2,case_ex,pfc_1,pfc_2,pfc_3,fc_tocheck,revinfo_1,revinfo_2,revinfo_3,rev_2,rev_3,acc_upload,ui_1,ui_2,ui_3,ui_4,role_3,role_1,role_2,pro_1,pro_2,pro_3,case_1,case_2,case_3,case_step,proplan_1,proplan_2,proplan_3,dpmt_1,dpmt_2,dpmt_3,ptct_1,ptct_2,ptct_3,client_1,client_2,client_3,'); - -/*插入默认部门分级*/ -insert into QA_SECONDARYSECTOR (sectorid, departmenthead, departmentname) -values (99, '系统管理员', '总部'); -/*插入默认项目*/ -insert into QA_SECTORPROJECTS (projectid, projectname, projectmanager, sectorid, projecttype) -values (99, '全部项目/未知项目', '系统管理员', 99, 0); -/*插入默认管理员*/ -insert into USERINFO (id, usercode, password, username, role, sectorid) -values (1, 'admin', 'uJ45aIeS9N80kaSFDjvk%2FA%3D%3D', '系统管理员', '1', 99); -/*插入流程检查定义数据*/ -insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) -values (36, 5, '总结阶段', 2, '计划变更', 1, '如与计划不合,是否提交计划变更邮件', null); -insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) -values (37, 5, '总结阶段', 3, '代码质量', 1, 'sonar代码检查是否刷新构建', null); -insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) -values (38, 5, '总结阶段', 3, '代码质量', 2, 'sonar代码问题数是否符合要求', null); -insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) -values (35, 2, '开发阶段', 3, '开发与编码', 6, '是否每一条禅道开发任务都提交转测申请', null); -insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) -values (34, 4, '验收与上线', 2, '上线部署', 3, 'SVN代码是否提交并标注', null); -insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) -values (1, 1, '需求阶段', 1, '需求编制', 1, '《产品需求说明书》是否组织评审会', null); -insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) -values (2, 1, '需求阶段', 1, '需求编制', 2, '《产品需求说明书》评审是否通过', null); -insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) -values (3, 1, '需求阶段', 1, '需求编制', 3, '《产品需求说明书》是否归档到SVN', null); -insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) -values (4, 1, '需求阶段', 1, '需求编制', 4, '《产品需求说明书》评审记录表是否签字通过', null); -insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) -values (5, 2, '开发阶段', 1, '需求分解', 1, '是否有需求分解/任务讨论会', null); -insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) -values (6, 2, '开发阶段', 1, '需求分解', 2, '《项目计划》邮件是否及时发出', null); -insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) -values (7, 2, '开发阶段', 1, '需求分解', 3, '《项目计划》邮件内容是否完整', null); -insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) -values (10, 2, '开发阶段', 2, '软件设计', 1, '《产品开发概要设计》是否组织评审会', null); -insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) -values (11, 2, '开发阶段', 2, '软件设计', 2, '《产品开发概要设计》评审是否通过', null); -insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) -values (12, 2, '开发阶段', 2, '软件设计', 3, '《产品开发概要设计》是否归档到SVN', null); -insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) -values (13, 2, '开发阶段', 2, '软件设计', 4, '《产品开发概要设计》评审记录表是否签字通过', null); -insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) -values (14, 2, '开发阶段', 3, '开发与编码', 1, '是否进行每日晨会', null); -insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) -values (15, 2, '开发阶段', 3, '开发与编码', 2, '是否进行代码走读', null); -insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) -values (16, 2, '开发阶段', 3, '开发与编码', 3, '是否每一条禅道开发任务都提交转测申请', null); -insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) -values (17, 2, '开发阶段', 3, '开发与编码', 4, '转测邮件是否合格', null); -insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) -values (18, 2, '开发阶段', 3, '开发与编码', 5, '转测邮件打回次数为0', null); -insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) -values (19, 3, '测试阶段', 1, '软件测试', 1, '是否回复测试计划', null); -insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) -values (20, 3, '测试阶段', 1, '软件测试', 2, '是否回复测试用例', null); -insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) -values (21, 3, '测试阶段', 1, '软件测试', 3, '测试用例是否通过评审/确认', null); -insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) -values (22, 3, '测试阶段', 1, '软件测试', 4, '《软件测试报告》是否组织评审会', null); -insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) -values (23, 3, '测试阶段', 1, '软件测试', 5, '《软件测试报告》是否评审通过', null); -insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) -values (24, 3, '测试阶段', 1, '软件测试', 6, '《软件测试报告》/测试结果是否发出邮件', null); -insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) -values (25, 3, '测试阶段', 1, '软件测试', 7, '《软件测试报告》评审记录表是否签字通过', null); -insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) -values (26, 4, '验收与上线', 1, '产品验收', 1, '《产品验收报告》是否组织评审会', null); -insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) -values (27, 4, '验收与上线', 1, '产品验收', 2, '《产品验收报告》是否评审通过', null); -insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) -values (28, 4, '验收与上线', 1, '产品验收', 3, '《产品验收报告》是否归档到SVN', null); -insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) -values (29, 4, '验收与上线', 1, '产品验收', 4, '《产品验收报告》评审记录表是否签字通过', null); -insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) -values (30, 4, '验收与上线', 2, '上线部署', 1, '产品/开发是否提交上线流程(OA)', null); -insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) -values (31, 4, '验收与上线', 2, '上线部署', 2, '开发是否提交上线相关资料', null); -insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) -values (32, 5, '总结阶段', 1, '项目总结', 1, '《项目总结》邮件是否及时发出', null); -insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +create table OPERATION_LOG +( + id int(9) not null AUTO_INCREMENT, + tablename VARCHAR(30) not null COMMENT '被记录日志表名', + tableid int(8) not null COMMENT '被记录日志ID', + operation_time VARCHAR(30) not null COMMENT '操作时间', + operationer VARCHAR(20) not null COMMENT '操作人员', + operation_description VARCHAR(200) not null COMMENT '描述', + projectid int(8) COMMENT '项目ID', + primary key (ID) +)default character set utf8; +create table QA_ACCIDENT +( + id int(8) not null AUTO_INCREMENT, + projectid int(8) not null COMMENT '项目ID', + accstatus VARCHAR(80) not null COMMENT '事故状态', + eventtime VARCHAR(30) COMMENT '事故发生时间', + reporter VARCHAR(20) not null COMMENT '报告人', + reporttime VARCHAR(30) not null COMMENT '事故报告时间', + accdescription VARCHAR(500) not null COMMENT '事故描述', + acclevel VARCHAR(60) not null COMMENT '事故等级', + causalanalysis VARCHAR(500) COMMENT '原因分析', + causaltype VARCHAR(100) COMMENT '原因类型', + consequenceanalysis VARCHAR(300) COMMENT '后果分析', + correctiveaction VARCHAR(300) COMMENT '纠正措施', + resolutiontime VARCHAR(30) COMMENT '解决时间', + resolutioner VARCHAR(20) COMMENT '解决处理人', + preventiveaction VARCHAR(300) COMMENT '预防措施', + preventiver VARCHAR(20) COMMENT '预防措施责任人', + preventiveplandate VARCHAR(30) COMMENT '预防措施计划完成时间', + preventiveaccdate VARCHAR(30) COMMENT '预防措施实际完成时间', + trouble_duration int(8) COMMENT '事故持续时间', + impact_time int(8), + filename VARCHAR(100) COMMENT '附件路径', + primary key (ID) +)default character set utf8; +create table QA_FLOWCHECK +( + id int(10) not null AUTO_INCREMENT, + checkid int(10) not null COMMENT '检查id', + projectid int(10) not null COMMENT '项目id', + projectphase VARCHAR(20) not null COMMENT '项目阶段', + phasenode VARCHAR(50) not null COMMENT '阶段节点', + checkentry VARCHAR(100) not null COMMENT '检查内容', + checkresult VARCHAR(20) COMMENT '检查结果', + checkdate VARCHAR(20) COMMENT '检查日期', + checkdescriptions VARCHAR(400) COMMENT '不符合项描述', + stateupdate VARCHAR(20) COMMENT '状态更新', + updatedate VARCHAR(20) COMMENT '更新日期', + remark VARCHAR(200) COMMENT '备注', + versionnum VARCHAR(30) COMMENT '版本号', + primary key (ID) +)default character set utf8; +create table QA_FLOWINFO +( + id int(10) not null AUTO_INCREMENT, + phaseid int(10) not null, + phasename VARCHAR(20) not null, + phasenodeid int(10) not null, + phasenodename VARCHAR(20) not null, + checkentryid int(10) not null, + checkentry VARCHAR(200) not null, + remark VARCHAR(100), + primary key (ID) +)default character set utf8; +create table QA_PLANFLOWCHECK +( + id int(8) not null AUTO_INCREMENT, + projectid int(8) not null COMMENT '项目ID', + versionnum VARCHAR(30) COMMENT '版本号', + checkentryid VARCHAR(20) not null COMMENT '检查ID', + plandate VARCHAR(20) not null COMMENT '计划检查日期', + status int(4) not null COMMENT '计划状态:1 检查计划 2 已检查', + primary key (ID) +)default character set utf8; +create table QA_PROJECTVERSION +( + versionid int(10) not null AUTO_INCREMENT, + versionnumber VARCHAR(20) COMMENT '版本号', + plan_launchdate VARCHAR(20) COMMENT '计划上线日期', + actually_launchdate VARCHAR(20) COMMENT '实际上线日期', + plan_devstart VARCHAR(20) COMMENT '计划开发开始时间', + plan_devend VARCHAR(20) COMMENT '计划开发结束时间', + actually_devstart VARCHAR(20) COMMENT '实际开发开始时间', + actually_devend VARCHAR(20) COMMENT '实际开发结束时间', + plan_teststart VARCHAR(20) COMMENT '计划测试开始时间', + plan_testend VARCHAR(20) COMMENT '计划测试结束时间', + actually_teststart VARCHAR(20) COMMENT '实际测试开始时间', + actually_testend VARCHAR(20) COMMENT '实际测试结束时间', + plan_demand int(10) COMMENT '计划上线需求数', + actually_demand int(10) COMMENT '实际上线需求数', + codeline FLOAT(10) COMMENT '代码变动行数', + testcasenum int(10) COMMENT '测试用例数', + changetestingreturn int(10) COMMENT '版本转测试打回次数', + dev_member VARCHAR(50) COMMENT '开发投入人力', + test_member VARCHAR(50) COMMENT '测试投入人力', + human_cost VARCHAR(20) COMMENT '耗费人力 人/天', + per_dev VARCHAR(20) COMMENT '开发平均生产率 人/天/行', + per_test VARCHAR(20) COMMENT '用例编写/用例执行', + code_di VARCHAR(20) COMMENT '代码DI值', + qualityreview VARCHAR(500) COMMENT '质量回溯', + imprint VARCHAR(500) COMMENT '版本说明', + remark VARCHAR(500) COMMENT '备注', + projectid int(10) COMMENT '项目ID', + devtime_deviation VARCHAR(20) COMMENT '开发偏移率', + devdelay_days VARCHAR(20) COMMENT '开发延迟时间', + testtime_deviation VARCHAR(20) COMMENT '测试偏移率', + testdelay_days VARCHAR(20) COMMENT '测试延迟时间', + protime_deviation VARCHAR(20), + prodelay_days VARCHAR(20), + bug_zm int(10), + bug_yz int(10), + bug_yb int(10), + bug_ts int(10), + versiontype int(8) default 1 not null COMMENT '版本类型', + perdemand FLOAT(8) default 0.00, + codestandard_zd int(10) default 0 not null, + codestandard_yz int(10) default 0 not null, + codestandard_zy int(10) default 0 not null, + zt_versionlink VARCHAR(100) COMMENT '禅道链接', + human_costdev VARCHAR(20) default '0' COMMENT '开发人力成本', + human_costtest VARCHAR(20) default '0' COMMENT '测试人力成本', + primary key (versionid) +)default character set utf8; +create table QA_REVIEW +( + id int(8) not null AUTO_INCREMENT, + projectid int(8) not null COMMENT '项目ID', + version VARCHAR(20) not null COMMENT '版本号', + review_type VARCHAR(20) COMMENT '评审类型', + review_date VARCHAR(20) COMMENT '评审日期', + bug_num int(8) COMMENT '问题数', + repair_num int(8) COMMENT '已修复问题数', + confirm_date VARCHAR(20) COMMENT '最后确认日期', + review_object VARCHAR(100) COMMENT '评审对象', + review_result VARCHAR(50) COMMENT '评审结果', + result_confirmor VARCHAR(50) COMMENT '结果确认人', + remark VARCHAR(500) COMMENT '备注', + primary key (id) +)default character set utf8; +create table QA_REVIEWINFO +( + id int(8) not null AUTO_INCREMENT, + review_id int(8) not null COMMENT '评审ID', + bug_description VARCHAR(500) COMMENT '问题描述', + status VARCHAR(20) COMMENT '状态', + duty_officer VARCHAR(100) COMMENT '责任人', + confirm_date VARCHAR(20) COMMENT '最后确认日期', + corrective VARCHAR(500) COMMENT '纠正措施', + primary key (id) +)default character set utf8; +create table QA_SECONDARYSECTOR +( + sectorid int(10) not null AUTO_INCREMENT, + departmenthead VARCHAR(20), + departmentname VARCHAR(20), + primary key (sectorid) +)default character set utf8; +create table QA_SECTORPROJECTS +( + projectid int(10) not null AUTO_INCREMENT, + projectname VARCHAR(100) not null, + projectmanager VARCHAR(100) not null, + sectorid int(10) not null, + projecttype int(4) default 0 not null, + projectsign VARCHAR(20) default 'sign' not null, + primary key (projectid) +)default character set utf8; +create table QA_ZTTASK +( + id int(8) not null AUTO_INCREMENT, + versionid int(8) COMMENT '版本ID', + versionname VARCHAR(100) COMMENT '版本名称', + taskname VARCHAR(300) COMMENT '任务名称', + assigneddate VARCHAR(50) COMMENT '完成时间', + estimate int(8) COMMENT '预期工时', + consumed int(8) COMMENT '实际工时', + finishedby VARCHAR(40) COMMENT '完成人账号', + finishedname VARCHAR(40) COMMENT '完成人姓名', + deadline VARCHAR(40) COMMENT '计划截止日期', + delaystatus int(4) COMMENT '延期状态', + primary key (id) +)default character set utf8; +create table TEST_JOBS +( + id int(10) not null AUTO_INCREMENT, + name VARCHAR(100) not null COMMENT '调度名称', + startdate VARCHAR(100) COMMENT '开始日期', + starttime VARCHAR(100) COMMENT '开始时间', + enddate VARCHAR(100) COMMENT '结束日期', + endtime VARCHAR(100) COMMENT '结束时间', + runtime datetime COMMENT '执行时间', + remark VARCHAR(800) COMMENT '备注', + planproj VARCHAR(100) COMMENT '项目名(testlink)中', + state VARCHAR(4) not null COMMENT '状态', + tasktype VARCHAR(4) not null COMMENT '执行类型 O执行一次 D每天执行', + starttimestr VARCHAR(100) COMMENT '执行时间表达式', + endtimestr VARCHAR(100) COMMENT '结束时间', + createtime datetime not null, + noenddate VARCHAR(10) COMMENT '是否有结束日期', + time int default 0, + timetype VARCHAR(4), + issendmail VARCHAR(4) default "0" COMMENT '是否发送邮件通知', + emailer VARCHAR(250) COMMENT '邮件地址', + threadcount int default 1 COMMENT '客户端线程数(接口)', + testlinkname VARCHAR(200) COMMENT 'TESTLINK中的计划名称', + isbuilding VARCHAR(4) default '0' not null COMMENT '是否自动构建', + buildname VARCHAR(100) COMMENT '构建链接', + isrestart VARCHAR(4) default '0' not null COMMENT '是否自动重启', + restartcomm VARCHAR(200) COMMENT '重启脚本', + extype int(4) default 0 not null COMMENT '执行类型', + browsertype int(4) COMMENT 'UI自动化浏览器类型', + timeout int(8) default 60 not null COMMENT '任务超时中断时间(分钟)', + clientip VARCHAR(30) default '127.0.0.1' not null COMMENT '版本ID', + projecttype int(4) default "0" COMMENT '项目类型 系统内项目 0 testlink 1', + projectid int(8) COMMENT '系统内项目ID', + planid int(8) COMMENT '系统内项目关联测试计划ID', + primary key (id) +)default character set utf8; +create table TEST_CASEDETAIL +( + id int(10) not null AUTO_INCREMENT, + taskid int(10) not null, + caseno VARCHAR(20) not null COMMENT '用例编号', + caseversion VARCHAR(20) not null COMMENT '用例版本', + casetime datetime not null COMMENT '执行时间', + casename VARCHAR(200) not null COMMENT '用例名称', + casestatus VARCHAR(2) default '4' not null COMMENT ' pass:0 fail:1 lock:2 unexcute:4', + primary key (id) +)default character set utf8; +create table TEST_LOGDETAIL +( + logid int(10) not null AUTO_INCREMENT, + logtime datetime not null COMMENT '日志时间', + detail VARCHAR(5000) not null COMMENT '日志', /*V1.1 扩展日志明细字段到2000*/ + loggrade VARCHAR(20) COMMENT '日志级别', + caseid int(10) not null COMMENT '用例编号', + taskid int(10), + step VARCHAR(20) COMMENT '用例步骤', + imgname VARCHAR(30) COMMENT 'UI自动化自动截图地址', + primary key (logid) +)default character set utf8; +create table TEST_TASKEXCUTE +( + id int(10) not null AUTO_INCREMENT, + taskid VARCHAR(150) not null, + casetotal_count int(10) COMMENT '总用例数', + casesucc_count int(10) COMMENT '成功数', + casefail_count int(10) COMMENT '失败数', + caselock_count int(10) COMMENT '锁定数', + createtime datetime COMMENT '时间', + jobid int(10) not null, + finishtime datetime COMMENT '完成时间', + taskstatus VARCHAR(2) default '' COMMENT '状态 0未执行 1执行中 2 成功 4失败 ', + casenoexec_count int default 0 COMMENT '未执行用例', + caseisexec VARCHAR(2) COMMENT '任务是否被成功吊起 0 成功吊起 3 吊起失败', + primary key (id) +)default character set utf8; +create table USERINFO +( + id int(8) not null AUTO_INCREMENT, + usercode VARCHAR(20) not null, + password VARCHAR(200) not null, + username VARCHAR(20), + role VARCHAR(100) COMMENT '角色', + sectorid int(8) default 0 not null COMMENT '所属部门', + projectid int(4) default 0 not null COMMENT '默认选择项目', + primary key (id) +)default character set utf8; +create table USER_AUTHORITY +( + id int(9) not null AUTO_INCREMENT, + module VARCHAR(50) not null COMMENT '模块', + auth_type VARCHAR(50) not null COMMENT '权限类型', + alias VARCHAR(50) not null COMMENT '别名', + primary key (id) +)default character set utf8; +create table USER_ROLE +( + id int(9) not null AUTO_INCREMENT, + role VARCHAR(50) not null COMMENT '角色', + permission VARCHAR(1000) COMMENT '权限', + opprojectid VARCHAR(200) COMMENT '可操作的项目', + primary key (id) +)default character set utf8; +create table TEST_CLIENT +( + id int(8) not null AUTO_INCREMENT, + clientip VARCHAR(30) not null COMMENT '客户端IP', + name VARCHAR(30) not null COMMENT '客户端名称', + projectper VARCHAR(200) COMMENT '使用项目', + status int(2) COMMENT '客户端超时 0 正常 1 链接失败 2 状态未知', + checkinterval int(6) not null COMMENT '检查客户端状态心跳间隔时间 单位:秒', + remark VARCHAR(100) COMMENT '备注', + primary key (id) +)default character set utf8; +/*用例管理模块*/ +create table PROJECT_CASE +( + id int(8) not null AUTO_INCREMENT, + sign VARCHAR(20) not null COMMENT '用例标识', + name VARCHAR(200) not null COMMENT '用例名称', + projectid int(8) not null COMMENT '关联项目ID', + moduleid int(8) not null COMMENT '关联项目模块ID', + projectindex int(8) not null COMMENT '项目用例编号', + time VARCHAR(30) COMMENT '最后更新时间', + operationer VARCHAR(20) COMMENT '最后更新人员', + casetype int(2) not null COMMENT '0 接口 1 UI', + remark VARCHAR(200) COMMENT '备注', + primary key (ID) +)default character set utf8; + +create table PROJECT_CASESTEPS +( + id int(8) not null AUTO_INCREMENT, + path VARCHAR(100) COMMENT '包路径|定位路径', + operation VARCHAR(100) COMMENT '方法名|操作', + parameters VARCHAR(500) COMMENT '参数', + action VARCHAR(50) COMMENT '步骤动作', + caseid int(8) not null COMMENT '用例ID', + stepnum int(2) not null COMMENT '步骤编号', + expectedresult VARCHAR(2000) COMMENT '预期结果', + projectid int(8) not null COMMENT '项目ID', + steptype int(2) not null COMMENT '0 接口 1 UI', + time VARCHAR(30) COMMENT '最后更新时间', + operationer VARCHAR(20) COMMENT '最后更新人员', + remark VARCHAR(200) COMMENT '备注', + primary key (ID) +)default character set utf8; + +create table PROJECT_PLAN +( + id int(9) not null AUTO_INCREMENT, + name VARCHAR(50) not null COMMENT '测试计划名称', + casecount int(8) COMMENT '计划中用例总数', + remark VARCHAR(200) COMMENT '备注', + projectid int(8) not null COMMENT '项目ID', + time VARCHAR(30) COMMENT '最后更新时间', + operationer VARCHAR(20) COMMENT '最后更新人员', + primary key (ID) +)default character set utf8; + +create table PROJECT_PLANCASE +( + id int(9) not null AUTO_INCREMENT, + caseid int(8) not null COMMENT '用例ID', + planid int(8) not null COMMENT '项目计划ID', + priority int(8) not null COMMENT '用例优先级', + primary key (ID), + index (caseid), + index (planid) +)default character set utf8; + +create table PROJECT_MODULE +( + id int(9) not null AUTO_INCREMENT, + projectid int(8) not null COMMENT '项目ID', + modulename VARCHAR(50) COMMENT '模块名字', + pid int(4) COMMENT '层级关系', + primary key (ID) +)default character set utf8; + +create table PROJECT_PROTOCOLTEMPLATE +( + id int(8) not null AUTO_INCREMENT, + projectid int(8) not null COMMENT '项目ID', + name VARCHAR(50) not null COMMENT '模板名称', + protocoltype VARCHAR(20) not null COMMENT '协议类型', + contentencoding VARCHAR(20) not null COMMENT '编码格式', + time VARCHAR(30) COMMENT '最后更新时间', + operationer VARCHAR(20) COMMENT '最后更新人员', + remark VARCHAR(200) COMMENT '备注', + primary key (ID) +)default character set utf8; + +create table PROJECT_TEMPLATEPARAMS +( + id int(9) not null AUTO_INCREMENT, + templateid int(8) not null COMMENT '模块ID', + paramname VARCHAR(50) not null COMMENT '参数名', + param VARCHAR(2000) COMMENT '参数默认值', + primary key (ID) +)default character set utf8; + +create table PROJECT_CASESTEPSPARAMS +( + id int(8) not null AUTO_INCREMENT, + steptype int(2) not null COMMENT '步骤类型', + parentid int(8) not null COMMENT '父节点ID', + fieldname VARCHAR(50) COMMENT '所属字段名', + paramvalue VARCHAR(200) COMMENT '参数值', + description VARCHAR(50) COMMENT '描述', + primary key (ID) +)default character set utf8; + +create table TEMP_CASESTEPDEBUG +( + id int(8) not null AUTO_INCREMENT, + sign VARCHAR(20) not null COMMENT '用例标识', + executor VARCHAR(20) not null COMMENT '执行人', + loglevel VARCHAR(10) not null COMMENT '日志级别', + detail VARCHAR(5000) not null COMMENT '日志', /*V1.1 扩展日志明细字段到2000*/ + primary key (ID) +)default character set utf8; +/*插入索引 +CREATE INDEX index_caseid ON TEST_LOGDETAIL (caseid); +CREATE INDEX index_taskid ON TEST_CASEDETAIL (taskid);*/ + +/*插入权限默认定义*/ +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (1, '质量-版本信息', '增加', 'pv_1'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (2, '质量-版本信息', '删除', 'pv_2'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (3, '质量-版本信息', '修改', 'pv_3'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (4, '质量-版本计划信息', '增加', 'pvp_1'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (5, '质量-流程检查信息', '增加', 'fc_1'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (6, '质量-流程检查信息', '删除', 'fc_2'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (7, '质量-流程检查信息', '修改', 'fc_3'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (8, '质量-生产故障信息', '增加', 'acc_1'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (9, '质量-生产故障信息', '删除', 'acc_2'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (10, '质量-生产故障信息', '修改', 'acc_3'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (21, '自动化-任务调度', '启动', 'tast_run'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (22, '自动化-任务调度', '移除', 'tast_remove'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (23, '自动化-任务调度', '执行', 'tast_ex'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (24, '自动化-任务调度', '增加', 'tast_1'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (25, '自动化-任务调度', '删除', 'tast_2'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (26, '自动化-任务调度', '修改', 'tast_3'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (27, '自动化-任务调度', '上传', 'tast_upload'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (11, '质量-流程检查计划', '增加', 'pfc_1'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (12, '质量-流程检查计划', '删除', 'pfc_2'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (13, '质量-流程检查计划', '修改', 'pfc_3'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (14, '质量-流程检查计划', '转计划', 'fc_tocheck'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (15, '质量-评审信息详情', '增加', 'revinfo_1'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (16, '质量-评审信息详情', '删除', 'revinfo_2'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (17, '质量-评审信息详情', '修改', 'revinfo_3'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (18, '质量-评审信息', '删除', 'rev_2'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (19, '质量-评审信息', '修改', 'rev_3'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (20, '质量-生产故障信息', '上传', 'acc_upload'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (41, '用户管理', '增加', 'ui_1'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (42, '用户管理', '删除', 'ui_2'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (43, '用户管理', '修改', 'ui_3'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (44, '用户管理', '查看', 'ui_4'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (45, '用户管理-权限角色', '查看修改', 'role_3'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (28, '自动化-任务列表', '删除', 'tastex_2'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (29, '自动化-用例列表', '执行', 'case_ex'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (46, '用户管理-权限角色', '增加', 'role_1'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (47, '用户管理-权限角色', '删除', 'role_2'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (48, '项目管理', '增加', 'pro_1'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (49, '项目管理', '删除', 'pro_2'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (50, '项目管理', '修改', 'pro_3'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (51, '用例管理', '增加', 'case_1'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (52, '用例管理', '删除', 'case_2'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (53, '用例管理', '修改', 'case_3'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (54, '步骤管理', '增删改查', 'case_step'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (55, '测试计划管理', '增加', 'proplan_1'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (56, '测试计划管理', '删除', 'proplan_2'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (57, '测试计划管理', '修改', 'proplan_3'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (58, '部门管理', '增加', 'dpmt_1'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (59, '部门管理', '删除', 'dpmt_2'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (60, '部门管理', '修改', 'dpmt_3'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (61, '协议模板', '增加', 'ptct_1'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (62, '协议模板', '删除', 'ptct_2'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (63, '协议模板', '修改', 'ptct_3'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (64, '客户端管理', '增加', 'client_1'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (65, '客户端管理', '删除', 'client_2'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (66, '客户端管理', '修改', 'client_3'); + +/*插入步骤界面定义各个字段的默认值*/ +insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) +values (1, 2, 0, 'operation','HttpURLPost','使用HttpURLConnection发送post请求'); +insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) +values (2, 2, 0, 'operation','URLPost','使用URLConnection发送post'); +insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) +values (3, 2, 0, 'operation','GetAndSaveFile','发送get请求保存下载文件到客户端'); +insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) +values (4, 2, 0, 'operation','HttpURLGet','使用HttpURLConnection发送get请求'); +insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) +values (5, 2, 0, 'operation','URLGet','使用URLConnection发送get请求'); +insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) +values (6, 2, 0, 'operation','HttpClientPost','使用HttpClient发送post请求'); +insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) +values (7, 2, 0, 'operation','HttpClientGet','使用HttpClient发送get请求'); +insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) +values (8, 3, 0, 'operation','SocketPost','使用socket发送post请求'); +insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) +values (9, 3, 0, 'operation','SocketGet','使用socket发送get请求'); +insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) +values (10, 1, 0, 'operation','click','点击对象'); +insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) +values (11, 1, 0, 'operation','sendkeys','输入'); +insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) +values (12, 1, 0, 'operation','clear','清除输入框'); +insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) +values (13, 1, 0, 'operation','gotoframe','跳转框架(iframe)'); +insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) +values (14, 1, 0, 'operation','isenabled','判断对象是否可用'); +insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) +values (15, 1, 0, 'operation','isdisplayed','判断对象是否可见'); +insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) +values (16, 1, 0, 'operation','exjsob','针对对象执行JS脚本'); +insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) +values (17, 1, 0, 'operation','gettext','获取对象文本属性'); +insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) +values (18, 1, 0, 'operation','gettagname','获取对象标签类型'); +insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) +values (19, 1, 0, 'operation','getcaptcha','获取对象中的验证码(识别率较低)'); +insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) +values (20, 1, 0, 'operation','selectbyvisibletext','通过下拉框的文本进行选择'); +insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) +values (21, 1, 0, 'operation','selectbyvalue','通过下拉框的VALUE属性进行选择'); +insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) +values (22, 1, 0, 'operation','selectbyindex','通过下拉框的index属性进行选择(从0开始)'); +insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) +values (23, 1, 0, 'operation','isselect','判断是否已经被选择,同用于单选\复选框'); +insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) +values (24, 1, 0, 'operation','open','打开URL'); +insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) +values (25, 1, 0, 'operation','exjs','执行js脚本'); +insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) +values (26, 1, 0, 'operation','gotodefaultcontent','跳转回到默认iframe'); +insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) +values (27, 1, 0, 'operation','gettitle','获取窗口标题'); +insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) +values (28, 1, 0, 'operation','getwindowhandle','获取窗口句柄'); +insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) +values (29, 1, 0, 'operation','gotowindow','跳转窗口句柄'); +insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) +values (30, 1, 0, 'operation','wait','等待时间(S)'); +insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) +values (31, 1, 0, 'operation','alertaccept','弹出框点击OK'); +insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) +values (32, 1, 0, 'operation','alertdismiss','弹出框点击取消'); +insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) +values (33, 1, 0, 'operation','alertgettext','获取弹出框TEXT'); +insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) +values (34, 1, 0, 'operation','mouselkclick','模拟鼠标左键单击(可带页面对象)'); +insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) +values (35, 1, 0, 'operation','mouserkclick','模拟鼠标右键单击(可带页面对象)'); +insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) +values (36, 1, 0, 'operation','mousedclick','模拟鼠标双击(可带页面对象)'); +insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) +values (37, 1, 0, 'operation','mouseclickhold','模拟鼠标左键单击后不释放(可带页面对象)'); +insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) +values (38, 1, 0, 'operation','mousedrag','模拟鼠标拖拽(可带页面对象)'); +insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) +values (39, 1, 0, 'operation','mouseto','模拟鼠标移动到指定坐标(可带页面对象)'); +insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) +values (40, 1, 0, 'operation','mouserelease','模拟鼠标释放(可带页面对象)'); +insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) +values (41, 1, 0, 'operation','mousekey(tab)','模拟键盘Tab键'); +insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) +values (42, 1, 0, 'operation','mousekey(space)','模拟键盘Space键'); +insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) +values (43, 1, 0, 'operation','mousekey(ctrl)','模拟键盘Ctrl键'); +insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) +values (44, 1, 0, 'operation','mousekey(shift)','模拟键盘Shift键'); +insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) +values (45, 1, 0, 'operation','mousekey(enter)','模拟键盘Enter键'); +insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) +values (46, 1, 0, 'operation','runcase','调用指定接口用例'); + +/*插入角色默认定义*/ +insert into USER_ROLE (id, role, permission) +values (2, '测试工程师', 'acc_1,acc_2,acc_3,'); +insert into USER_ROLE (id, role, permission) +values (3, '自动化工程师', 'acc_1,acc_2,acc_3,tast_run,tast_remove,tast_ex,tast_1,tast_3,tast_2,tast_upload,tastex_2,case_ex,'); +insert into USER_ROLE (id, role, permission) +values (4, '质量工程师', 'pv_1,pv_2,pv_3,pvp_1,fc_1,fc_2,fc_3,acc_1,acc_2,acc_3,pfc_1,pfc_2,pfc_3,fc_tocheck,revinfo_1,revinfo_2,revinfo_3,rev_2,rev_3,acc_upload,'); +insert into USER_ROLE (id, role, permission) +values (1, '管理员', 'pv_1,pv_2,pv_3,pvp_1,fc_1,fc_2,fc_3,acc_1,acc_2,acc_3,tast_run,tast_remove,tast_ex,tast_1,tast_3,tast_2,tast_upload,tastex_2,case_ex,pfc_1,pfc_2,pfc_3,fc_tocheck,revinfo_1,revinfo_2,revinfo_3,rev_2,rev_3,acc_upload,ui_1,ui_2,ui_3,ui_4,role_3,role_1,role_2,pro_1,pro_2,pro_3,case_1,case_2,case_3,case_step,proplan_1,proplan_2,proplan_3,dpmt_1,dpmt_2,dpmt_3,ptct_1,ptct_2,ptct_3,client_1,client_2,client_3,'); + +/*插入默认部门分级*/ +insert into QA_SECONDARYSECTOR (sectorid, departmenthead, departmentname) +values (99, '系统管理员', '总部'); +/*插入默认项目*/ +insert into QA_SECTORPROJECTS (projectid, projectname, projectmanager, sectorid, projecttype) +values (99, '全部项目/未知项目', '系统管理员', 99, 0); +/*插入默认管理员*/ +insert into USERINFO (id, usercode, password, username, role, sectorid) +values (1, 'admin', 'uJ45aIeS9N80kaSFDjvk%2FA%3D%3D', '系统管理员', '1', 99); +/*插入流程检查定义数据*/ +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (36, 5, '总结阶段', 2, '计划变更', 1, '如与计划不合,是否提交计划变更邮件', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (37, 5, '总结阶段', 3, '代码质量', 1, 'sonar代码检查是否刷新构建', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (38, 5, '总结阶段', 3, '代码质量', 2, 'sonar代码问题数是否符合要求', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (35, 2, '开发阶段', 3, '开发与编码', 6, '是否每一条禅道开发任务都提交转测申请', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (34, 4, '验收与上线', 2, '上线部署', 3, 'SVN代码是否提交并标注', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (1, 1, '需求阶段', 1, '需求编制', 1, '《产品需求说明书》是否组织评审会', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (2, 1, '需求阶段', 1, '需求编制', 2, '《产品需求说明书》评审是否通过', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (3, 1, '需求阶段', 1, '需求编制', 3, '《产品需求说明书》是否归档到SVN', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (4, 1, '需求阶段', 1, '需求编制', 4, '《产品需求说明书》评审记录表是否签字通过', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (5, 2, '开发阶段', 1, '需求分解', 1, '是否有需求分解/任务讨论会', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (6, 2, '开发阶段', 1, '需求分解', 2, '《项目计划》邮件是否及时发出', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (7, 2, '开发阶段', 1, '需求分解', 3, '《项目计划》邮件内容是否完整', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (10, 2, '开发阶段', 2, '软件设计', 1, '《产品开发概要设计》是否组织评审会', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (11, 2, '开发阶段', 2, '软件设计', 2, '《产品开发概要设计》评审是否通过', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (12, 2, '开发阶段', 2, '软件设计', 3, '《产品开发概要设计》是否归档到SVN', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (13, 2, '开发阶段', 2, '软件设计', 4, '《产品开发概要设计》评审记录表是否签字通过', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (14, 2, '开发阶段', 3, '开发与编码', 1, '是否进行每日晨会', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (15, 2, '开发阶段', 3, '开发与编码', 2, '是否进行代码走读', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (16, 2, '开发阶段', 3, '开发与编码', 3, '是否每一条禅道开发任务都提交转测申请', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (17, 2, '开发阶段', 3, '开发与编码', 4, '转测邮件是否合格', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (18, 2, '开发阶段', 3, '开发与编码', 5, '转测邮件打回次数为0', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (19, 3, '测试阶段', 1, '软件测试', 1, '是否回复测试计划', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (20, 3, '测试阶段', 1, '软件测试', 2, '是否回复测试用例', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (21, 3, '测试阶段', 1, '软件测试', 3, '测试用例是否通过评审/确认', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (22, 3, '测试阶段', 1, '软件测试', 4, '《软件测试报告》是否组织评审会', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (23, 3, '测试阶段', 1, '软件测试', 5, '《软件测试报告》是否评审通过', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (24, 3, '测试阶段', 1, '软件测试', 6, '《软件测试报告》/测试结果是否发出邮件', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (25, 3, '测试阶段', 1, '软件测试', 7, '《软件测试报告》评审记录表是否签字通过', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (26, 4, '验收与上线', 1, '产品验收', 1, '《产品验收报告》是否组织评审会', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (27, 4, '验收与上线', 1, '产品验收', 2, '《产品验收报告》是否评审通过', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (28, 4, '验收与上线', 1, '产品验收', 3, '《产品验收报告》是否归档到SVN', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (29, 4, '验收与上线', 1, '产品验收', 4, '《产品验收报告》评审记录表是否签字通过', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (30, 4, '验收与上线', 2, '上线部署', 1, '产品/开发是否提交上线流程(OA)', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (31, 4, '验收与上线', 2, '上线部署', 2, '开发是否提交上线相关资料', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (32, 5, '总结阶段', 1, '项目总结', 1, '《项目总结》邮件是否及时发出', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) values (33, 5, '总结阶段', 1, '项目总结', 2, '《项目总结》邮件内容是否完整', null); \ No newline at end of file diff --git a/mysqldb/initialization(create table)/V2.4 初始化 .sql b/mysqldb/initialization(create table)/V2.4 初始化 .sql new file mode 100644 index 0000000..44b1605 --- /dev/null +++ b/mysqldb/initialization(create table)/V2.4 初始化 .sql @@ -0,0 +1,708 @@ +create table OPERATION_LOG +( + id int(9) not null AUTO_INCREMENT, + tablename VARCHAR(30) not null COMMENT '被记录日志表名', + tableid int(8) not null COMMENT '被记录日志ID', + operation_time VARCHAR(30) not null COMMENT '操作时间', + operationer VARCHAR(20) not null COMMENT '操作人员', + operation_description VARCHAR(200) not null COMMENT '描述', + projectid int(8) COMMENT '项目ID', + primary key (ID) +)default character set utf8; +create table QA_ACCIDENT +( + id int(8) not null AUTO_INCREMENT, + projectid int(8) not null COMMENT '项目ID', + accstatus VARCHAR(80) not null COMMENT '事故状态', + eventtime VARCHAR(30) COMMENT '事故发生时间', + reporter VARCHAR(20) not null COMMENT '报告人', + reporttime VARCHAR(30) not null COMMENT '事故报告时间', + accdescription VARCHAR(500) not null COMMENT '事故描述', + acclevel VARCHAR(60) not null COMMENT '事故等级', + causalanalysis VARCHAR(500) COMMENT '原因分析', + causaltype VARCHAR(100) COMMENT '原因类型', + consequenceanalysis VARCHAR(300) COMMENT '后果分析', + correctiveaction VARCHAR(300) COMMENT '纠正措施', + resolutiontime VARCHAR(30) COMMENT '解决时间', + resolutioner VARCHAR(20) COMMENT '解决处理人', + preventiveaction VARCHAR(300) COMMENT '预防措施', + preventiver VARCHAR(20) COMMENT '预防措施责任人', + preventiveplandate VARCHAR(30) COMMENT '预防措施计划完成时间', + preventiveaccdate VARCHAR(30) COMMENT '预防措施实际完成时间', + trouble_duration int(8) COMMENT '事故持续时间', + impact_time int(8), + filename VARCHAR(100) COMMENT '附件路径', + primary key (ID) +)default character set utf8; +create table QA_FLOWCHECK +( + id int(10) not null AUTO_INCREMENT, + checkid int(10) not null COMMENT '检查id', + projectid int(10) not null COMMENT '项目id', + projectphase VARCHAR(20) not null COMMENT '项目阶段', + phasenode VARCHAR(50) not null COMMENT '阶段节点', + checkentry VARCHAR(100) not null COMMENT '检查内容', + checkresult VARCHAR(20) COMMENT '检查结果', + checkdate VARCHAR(20) COMMENT '检查日期', + checkdescriptions VARCHAR(400) COMMENT '不符合项描述', + stateupdate VARCHAR(20) COMMENT '状态更新', + updatedate VARCHAR(20) COMMENT '更新日期', + remark VARCHAR(200) COMMENT '备注', + versionnum VARCHAR(30) COMMENT '版本号', + primary key (ID) +)default character set utf8; +create table QA_FLOWINFO +( + id int(10) not null AUTO_INCREMENT, + phaseid int(10) not null, + phasename VARCHAR(20) not null, + phasenodeid int(10) not null, + phasenodename VARCHAR(20) not null, + checkentryid int(10) not null, + checkentry VARCHAR(200) not null, + remark VARCHAR(100), + primary key (ID) +)default character set utf8; +create table QA_PLANFLOWCHECK +( + id int(8) not null AUTO_INCREMENT, + projectid int(8) not null COMMENT '项目ID', + versionnum VARCHAR(30) COMMENT '版本号', + checkentryid VARCHAR(20) not null COMMENT '检查ID', + plandate VARCHAR(20) not null COMMENT '计划检查日期', + status int(4) not null COMMENT '计划状态:1 检查计划 2 已检查', + primary key (ID) +)default character set utf8; +create table QA_PROJECTVERSION +( + versionid int(10) not null AUTO_INCREMENT, + versionnumber VARCHAR(20) COMMENT '版本号', + plan_launchdate VARCHAR(20) COMMENT '计划上线日期', + actually_launchdate VARCHAR(20) COMMENT '实际上线日期', + plan_devstart VARCHAR(20) COMMENT '计划开发开始时间', + plan_devend VARCHAR(20) COMMENT '计划开发结束时间', + actually_devstart VARCHAR(20) COMMENT '实际开发开始时间', + actually_devend VARCHAR(20) COMMENT '实际开发结束时间', + plan_teststart VARCHAR(20) COMMENT '计划测试开始时间', + plan_testend VARCHAR(20) COMMENT '计划测试结束时间', + actually_teststart VARCHAR(20) COMMENT '实际测试开始时间', + actually_testend VARCHAR(20) COMMENT '实际测试结束时间', + plan_demand int(10) COMMENT '计划上线需求数', + actually_demand int(10) COMMENT '实际上线需求数', + codeline FLOAT(10) COMMENT '代码变动行数', + testcasenum int(10) COMMENT '测试用例数', + changetestingreturn int(10) COMMENT '版本转测试打回次数', + dev_member VARCHAR(50) COMMENT '开发投入人力', + test_member VARCHAR(50) COMMENT '测试投入人力', + human_cost VARCHAR(20) COMMENT '耗费人力 人/天', + per_dev VARCHAR(20) COMMENT '开发平均生产率 人/天/行', + per_test VARCHAR(20) COMMENT '用例编写/用例执行', + code_di VARCHAR(20) COMMENT '代码DI值', + qualityreview VARCHAR(500) COMMENT '质量回溯', + imprint VARCHAR(500) COMMENT '版本说明', + remark VARCHAR(500) COMMENT '备注', + projectid int(10) COMMENT '项目ID', + devtime_deviation VARCHAR(20) COMMENT '开发偏移率', + devdelay_days VARCHAR(20) COMMENT '开发延迟时间', + testtime_deviation VARCHAR(20) COMMENT '测试偏移率', + testdelay_days VARCHAR(20) COMMENT '测试延迟时间', + protime_deviation VARCHAR(20), + prodelay_days VARCHAR(20), + bug_zm int(10), + bug_yz int(10), + bug_yb int(10), + bug_ts int(10), + versiontype int(8) default 1 not null COMMENT '版本类型', + perdemand FLOAT(8) default 0.00, + codestandard_zd int(10) default 0 not null, + codestandard_yz int(10) default 0 not null, + codestandard_zy int(10) default 0 not null, + zt_versionlink VARCHAR(100) COMMENT '禅道链接', + human_costdev VARCHAR(20) default '0' COMMENT '开发人力成本', + human_costtest VARCHAR(20) default '0' COMMENT '测试人力成本', + primary key (versionid) +)default character set utf8; +create table QA_REVIEW +( + id int(8) not null AUTO_INCREMENT, + projectid int(8) not null COMMENT '项目ID', + version VARCHAR(20) not null COMMENT '版本号', + review_type VARCHAR(20) COMMENT '评审类型', + review_date VARCHAR(20) COMMENT '评审日期', + bug_num int(8) COMMENT '问题数', + repair_num int(8) COMMENT '已修复问题数', + confirm_date VARCHAR(20) COMMENT '最后确认日期', + review_object VARCHAR(100) COMMENT '评审对象', + review_result VARCHAR(50) COMMENT '评审结果', + result_confirmor VARCHAR(50) COMMENT '结果确认人', + remark VARCHAR(500) COMMENT '备注', + primary key (id) +)default character set utf8; +create table QA_REVIEWINFO +( + id int(8) not null AUTO_INCREMENT, + review_id int(8) not null COMMENT '评审ID', + bug_description VARCHAR(500) COMMENT '问题描述', + status VARCHAR(20) COMMENT '状态', + duty_officer VARCHAR(100) COMMENT '责任人', + confirm_date VARCHAR(20) COMMENT '最后确认日期', + corrective VARCHAR(500) COMMENT '纠正措施', + primary key (id) +)default character set utf8; +create table QA_SECONDARYSECTOR +( + sectorid int(10) not null AUTO_INCREMENT, + departmenthead VARCHAR(20), + departmentname VARCHAR(20), + primary key (sectorid) +)default character set utf8; +create table QA_SECTORPROJECTS +( + projectid int(10) not null AUTO_INCREMENT, + projectname VARCHAR(100) not null, + projectmanager VARCHAR(100) not null, + sectorid int(10) not null, + projecttype int(4) default 0 not null, + projectsign VARCHAR(20) default 'sign' not null, + primary key (projectid) +)default character set utf8; +create table QA_ZTTASK +( + id int(8) not null AUTO_INCREMENT, + versionid int(8) COMMENT '版本ID', + versionname VARCHAR(100) COMMENT '版本名称', + taskname VARCHAR(300) COMMENT '任务名称', + assigneddate VARCHAR(50) COMMENT '完成时间', + estimate int(8) COMMENT '预期工时', + consumed int(8) COMMENT '实际工时', + finishedby VARCHAR(40) COMMENT '完成人账号', + finishedname VARCHAR(40) COMMENT '完成人姓名', + deadline VARCHAR(40) COMMENT '计划截止日期', + delaystatus int(4) COMMENT '延期状态', + primary key (id) +)default character set utf8; +create table TEST_JOBS +( + id int(10) not null AUTO_INCREMENT, + name VARCHAR(100) not null COMMENT '调度名称', + startdate VARCHAR(100) COMMENT '开始日期', + starttime VARCHAR(100) COMMENT '开始时间', + enddate VARCHAR(100) COMMENT '结束日期', + endtime VARCHAR(100) COMMENT '结束时间', + runtime datetime COMMENT '执行时间', + remark VARCHAR(800) COMMENT '备注', + planproj VARCHAR(100) COMMENT '项目名(testlink)中', + state VARCHAR(4) not null COMMENT '状态', + tasktype VARCHAR(4) not null COMMENT '执行类型 O执行一次 D每天执行', + starttimestr VARCHAR(100) COMMENT '执行时间表达式', + endtimestr VARCHAR(100) COMMENT '结束时间', + createtime datetime not null, + noenddate VARCHAR(10) COMMENT '是否有结束日期', + time int default 0, + timetype VARCHAR(4), + issendmail VARCHAR(4) default "0" COMMENT '是否发送邮件通知', + emailer VARCHAR(250) COMMENT '邮件地址', + threadcount int default 1 COMMENT '客户端线程数(接口)', + testlinkname VARCHAR(200) COMMENT 'TESTLINK中的计划名称', + isbuilding VARCHAR(4) default '0' not null COMMENT '是否自动构建', + buildname VARCHAR(100) COMMENT '构建链接', + isrestart VARCHAR(4) default '0' not null COMMENT '是否自动重启', + restartcomm VARCHAR(200) COMMENT '重启脚本', + extype int(4) default 0 not null COMMENT '执行类型', + browsertype int(4) COMMENT 'UI自动化浏览器类型', + timeout int(8) default 60 not null COMMENT '任务超时中断时间(分钟)', + clientip VARCHAR(30) default '127.0.0.1' not null COMMENT '版本ID', + clientpath VARCHAR(100) COMMENT '客户端测试驱动桩路径', + projecttype int(4) default "0" COMMENT '项目类型 系统内项目 0 testlink 1', + projectid int(8) COMMENT '系统内项目ID', + planid int(8) COMMENT '系统内项目关联测试计划ID', + primary key (id) +)default character set utf8; +create table TEST_CASEDETAIL +( + id int(10) not null AUTO_INCREMENT, + taskid int(10) not null, + caseno VARCHAR(20) not null COMMENT '用例编号', + caseversion VARCHAR(20) not null COMMENT '用例版本', + casetime datetime not null COMMENT '执行时间', + casename VARCHAR(200) not null COMMENT '用例名称', + casestatus VARCHAR(2) default '4' not null COMMENT ' pass:0 fail:1 lock:2 unexcute:4', + primary key (id) +)default character set utf8; +create table TEST_LOGDETAIL +( + logid int(10) not null AUTO_INCREMENT, + logtime datetime not null COMMENT '日志时间', + detail VARCHAR(5000) not null COMMENT '日志', /*V1.1 扩展日志明细字段到2000*/ + loggrade VARCHAR(20) COMMENT '日志级别', + caseid int(10) not null COMMENT '用例编号', + taskid int(10), + step VARCHAR(20) COMMENT '用例步骤', + imgname VARCHAR(30) COMMENT 'UI自动化自动截图地址', + primary key (logid) +)default character set utf8; +create table TEST_TASKEXCUTE +( + id int(10) not null AUTO_INCREMENT, + taskid VARCHAR(150) not null, + casetotal_count int(10) COMMENT '总用例数', + casesucc_count int(10) COMMENT '成功数', + casefail_count int(10) COMMENT '失败数', + caselock_count int(10) COMMENT '锁定数', + createtime datetime COMMENT '时间', + jobid int(10) not null, + finishtime datetime COMMENT '完成时间', + taskstatus VARCHAR(2) default '' COMMENT '状态 0未执行 1执行中 2 成功 4失败 ', + casenoexec_count int default 0 COMMENT '未执行用例', + caseisexec VARCHAR(2) COMMENT '任务是否被成功吊起 0 成功吊起 3 吊起失败', + primary key (id) +)default character set utf8; +create table USERINFO +( + id int(8) not null AUTO_INCREMENT, + usercode VARCHAR(20) not null, + password VARCHAR(200) not null, + username VARCHAR(20), + role VARCHAR(100) COMMENT '角色', + sectorid int(8) default 0 not null COMMENT '所属部门', + projectid int(4) default 0 not null COMMENT '默认选择项目', + primary key (id) +)default character set utf8; +create table USER_AUTHORITY +( + id int(9) not null AUTO_INCREMENT, + module VARCHAR(50) not null COMMENT '模块', + auth_type VARCHAR(50) not null COMMENT '权限类型', + alias VARCHAR(50) not null COMMENT '别名', + primary key (id) +)default character set utf8; +create table USER_ROLE +( + id int(9) not null AUTO_INCREMENT, + role VARCHAR(50) not null COMMENT '角色', + permission VARCHAR(1000) COMMENT '权限', + opprojectid VARCHAR(200) COMMENT '可操作的项目', + primary key (id) +)default character set utf8; +create table TEST_CLIENT +( + id int(8) not null AUTO_INCREMENT, + clientip VARCHAR(30) not null COMMENT '客户端IP', + name VARCHAR(30) not null COMMENT '客户端名称', + projectper VARCHAR(200) COMMENT '使用项目', + status int(2) COMMENT '客户端超时 0 正常 1 链接失败 2 状态未知', + checkinterval int(6) not null COMMENT '检查客户端状态心跳间隔时间 单位:秒', + clientpath VARCHAR(100) COMMENT '客户端测试驱动桩路径 多个;做分隔'; + remark VARCHAR(100) COMMENT '备注', + primary key (id) +)default character set utf8; +/*用例管理模块*/ +create table PROJECT_CASE +( + id int(8) not null AUTO_INCREMENT, + sign VARCHAR(20) not null COMMENT '用例标识', + name VARCHAR(200) not null COMMENT '用例名称', + projectid int(8) not null COMMENT '关联项目ID', + moduleid int(8) not null COMMENT '关联项目模块ID', + projectindex int(8) not null COMMENT '项目用例编号', + time VARCHAR(30) COMMENT '最后更新时间', + operationer VARCHAR(20) COMMENT '最后更新人员', + casetype int(2) not null COMMENT '0 接口 1 UI', + remark VARCHAR(200) COMMENT '备注', + primary key (ID) +)default character set utf8; + +create table PROJECT_CASESTEPS +( + id int(8) not null AUTO_INCREMENT, + path VARCHAR(100) COMMENT '包路径|定位路径', + operation VARCHAR(100) COMMENT '方法名|操作', + parameters VARCHAR(500) COMMENT '参数', + action VARCHAR(50) COMMENT '步骤动作', + caseid int(8) not null COMMENT '用例ID', + stepnum int(2) not null COMMENT '步骤编号', + expectedresult VARCHAR(2000) COMMENT '预期结果', + projectid int(8) not null COMMENT '项目ID', + steptype int(2) not null COMMENT '0 接口 1 UI', + time VARCHAR(30) COMMENT '最后更新时间', + operationer VARCHAR(20) COMMENT '最后更新人员', + remark VARCHAR(200) COMMENT '备注', + primary key (ID) +)default character set utf8; + +create table PROJECT_PLAN +( + id int(9) not null AUTO_INCREMENT, + name VARCHAR(50) not null COMMENT '测试计划名称', + casecount int(8) COMMENT '计划中用例总数', + remark VARCHAR(200) COMMENT '备注', + projectid int(8) not null COMMENT '项目ID', + time VARCHAR(30) COMMENT '最后更新时间', + operationer VARCHAR(20) COMMENT '最后更新人员', + primary key (ID) +)default character set utf8; + +create table PROJECT_PLANCASE +( + id int(9) not null AUTO_INCREMENT, + caseid int(8) not null COMMENT '用例ID', + planid int(8) not null COMMENT '项目计划ID', + priority int(8) not null COMMENT '用例优先级', + primary key (ID), + index (caseid), + index (planid) +)default character set utf8; + +create table PROJECT_MODULE +( + id int(9) not null AUTO_INCREMENT, + projectid int(8) not null COMMENT '项目ID', + modulename VARCHAR(50) COMMENT '模块名字', + pid int(4) COMMENT '层级关系', + primary key (ID) +)default character set utf8; + +create table PROJECT_PROTOCOLTEMPLATE +( + id int(8) not null AUTO_INCREMENT, + projectid int(8) not null COMMENT '项目ID', + name VARCHAR(50) not null COMMENT '模板名称', + protocoltype VARCHAR(20) not null COMMENT '协议类型', + contentencoding VARCHAR(20) not null COMMENT '编码格式', + time VARCHAR(30) COMMENT '最后更新时间', + operationer VARCHAR(20) COMMENT '最后更新人员', + remark VARCHAR(200) COMMENT '备注', + primary key (ID) +)default character set utf8; + +create table PROJECT_TEMPLATEPARAMS +( + id int(9) not null AUTO_INCREMENT, + templateid int(8) not null COMMENT '模块ID', + paramname VARCHAR(50) not null COMMENT '参数名', + param VARCHAR(2000) COMMENT '参数默认值', + primary key (ID) +)default character set utf8; + +create table PROJECT_CASESTEPSPARAMS +( + id int(8) not null AUTO_INCREMENT, + steptype int(2) not null COMMENT '步骤类型', + parentid int(8) not null COMMENT '父节点ID', + fieldname VARCHAR(50) COMMENT '所属字段名', + paramvalue VARCHAR(200) COMMENT '参数值', + description VARCHAR(50) COMMENT '描述', + primary key (ID) +)default character set utf8; + +create table TEMP_CASESTEPDEBUG +( + id int(8) not null AUTO_INCREMENT, + sign VARCHAR(20) not null COMMENT '用例标识', + executor VARCHAR(20) not null COMMENT '执行人', + loglevel VARCHAR(10) not null COMMENT '日志级别', + detail VARCHAR(5000) not null COMMENT '日志', /*V1.1 扩展日志明细字段到2000*/ + primary key (ID) +)default character set utf8; +/*插入索引 +CREATE INDEX index_caseid ON TEST_LOGDETAIL (caseid); +CREATE INDEX index_taskid ON TEST_CASEDETAIL (taskid);*/ + +/*插入权限默认定义*/ +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (1, '质量-版本信息', '增加', 'pv_1'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (2, '质量-版本信息', '删除', 'pv_2'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (3, '质量-版本信息', '修改', 'pv_3'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (4, '质量-版本计划信息', '增加', 'pvp_1'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (5, '质量-流程检查信息', '增加', 'fc_1'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (6, '质量-流程检查信息', '删除', 'fc_2'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (7, '质量-流程检查信息', '修改', 'fc_3'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (8, '质量-生产故障信息', '增加', 'acc_1'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (9, '质量-生产故障信息', '删除', 'acc_2'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (10, '质量-生产故障信息', '修改', 'acc_3'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (21, '自动化-任务调度', '启动', 'tast_run'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (22, '自动化-任务调度', '移除', 'tast_remove'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (23, '自动化-任务调度', '执行', 'tast_ex'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (24, '自动化-任务调度', '增加', 'tast_1'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (25, '自动化-任务调度', '删除', 'tast_2'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (26, '自动化-任务调度', '修改', 'tast_3'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (27, '自动化-任务调度', '上传', 'tast_upload'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (11, '质量-流程检查计划', '增加', 'pfc_1'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (12, '质量-流程检查计划', '删除', 'pfc_2'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (13, '质量-流程检查计划', '修改', 'pfc_3'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (14, '质量-流程检查计划', '转计划', 'fc_tocheck'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (15, '质量-评审信息详情', '增加', 'revinfo_1'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (16, '质量-评审信息详情', '删除', 'revinfo_2'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (17, '质量-评审信息详情', '修改', 'revinfo_3'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (18, '质量-评审信息', '删除', 'rev_2'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (19, '质量-评审信息', '修改', 'rev_3'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (20, '质量-生产故障信息', '上传', 'acc_upload'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (41, '用户管理', '增加', 'ui_1'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (42, '用户管理', '删除', 'ui_2'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (43, '用户管理', '修改', 'ui_3'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (44, '用户管理', '查看', 'ui_4'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (45, '用户管理-权限角色', '查看修改', 'role_3'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (28, '自动化-任务列表', '删除', 'tastex_2'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (29, '自动化-用例列表', '执行', 'case_ex'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (46, '用户管理-权限角色', '增加', 'role_1'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (47, '用户管理-权限角色', '删除', 'role_2'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (48, '项目管理', '增加', 'pro_1'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (49, '项目管理', '删除', 'pro_2'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (50, '项目管理', '修改', 'pro_3'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (51, '用例管理', '增加', 'case_1'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (52, '用例管理', '删除', 'case_2'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (53, '用例管理', '修改', 'case_3'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (54, '步骤管理', '增删改查', 'case_step'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (55, '测试计划管理', '增加', 'proplan_1'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (56, '测试计划管理', '删除', 'proplan_2'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (57, '测试计划管理', '修改', 'proplan_3'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (58, '部门管理', '增加', 'dpmt_1'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (59, '部门管理', '删除', 'dpmt_2'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (60, '部门管理', '修改', 'dpmt_3'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (61, '协议模板', '增加', 'ptct_1'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (62, '协议模板', '删除', 'ptct_2'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (63, '协议模板', '修改', 'ptct_3'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (64, '客户端管理', '增加', 'client_1'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (65, '客户端管理', '删除', 'client_2'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (66, '客户端管理', '修改', 'client_3'); + +/*插入步骤界面定义各个字段的默认值*/ +insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) +values (1, 2, 0, 'operation','HttpURLPost','使用HttpURLConnection发送post请求'); +insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) +values (2, 2, 0, 'operation','URLPost','使用URLConnection发送post'); +insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) +values (3, 2, 0, 'operation','GetAndSaveFile','发送get请求保存下载文件到客户端'); +insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) +values (4, 2, 0, 'operation','HttpURLGet','使用HttpURLConnection发送get请求'); +insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) +values (5, 2, 0, 'operation','URLGet','使用URLConnection发送get请求'); +insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) +values (6, 2, 0, 'operation','HttpClientPost','使用HttpClient发送post请求'); +insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) +values (7, 2, 0, 'operation','HttpClientGet','使用HttpClient发送get请求'); +insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) +values (8, 3, 0, 'operation','SocketPost','使用socket发送post请求'); +insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) +values (9, 3, 0, 'operation','SocketGet','使用socket发送get请求'); +insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) +values (10, 1, 0, 'operation','click','点击对象'); +insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) +values (11, 1, 0, 'operation','sendkeys','输入'); +insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) +values (12, 1, 0, 'operation','clear','清除输入框'); +insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) +values (13, 1, 0, 'operation','gotoframe','跳转框架(iframe)'); +insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) +values (14, 1, 0, 'operation','isenabled','判断对象是否可用'); +insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) +values (15, 1, 0, 'operation','isdisplayed','判断对象是否可见'); +insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) +values (16, 1, 0, 'operation','exjsob','针对对象执行JS脚本'); +insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) +values (17, 1, 0, 'operation','gettext','获取对象文本属性'); +insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) +values (18, 1, 0, 'operation','gettagname','获取对象标签类型'); +insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) +values (19, 1, 0, 'operation','getcaptcha','获取对象中的验证码(识别率较低)'); +insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) +values (20, 1, 0, 'operation','selectbyvisibletext','通过下拉框的文本进行选择'); +insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) +values (21, 1, 0, 'operation','selectbyvalue','通过下拉框的VALUE属性进行选择'); +insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) +values (22, 1, 0, 'operation','selectbyindex','通过下拉框的index属性进行选择(从0开始)'); +insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) +values (23, 1, 0, 'operation','isselect','判断是否已经被选择,同用于单选\复选框'); +insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) +values (24, 1, 0, 'operation','open','打开URL'); +insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) +values (25, 1, 0, 'operation','exjs','执行js脚本'); +insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) +values (26, 1, 0, 'operation','gotodefaultcontent','跳转回到默认iframe'); +insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) +values (27, 1, 0, 'operation','gettitle','获取窗口标题'); +insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) +values (28, 1, 0, 'operation','getwindowhandle','获取窗口句柄'); +insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) +values (29, 1, 0, 'operation','gotowindow','跳转窗口句柄'); +insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) +values (30, 1, 0, 'operation','wait','等待时间(S)'); +insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) +values (31, 1, 0, 'operation','alertaccept','弹出框点击OK'); +insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) +values (32, 1, 0, 'operation','alertdismiss','弹出框点击取消'); +insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) +values (33, 1, 0, 'operation','alertgettext','获取弹出框TEXT'); +insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) +values (34, 1, 0, 'operation','mouselkclick','模拟鼠标左键单击(可带页面对象)'); +insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) +values (35, 1, 0, 'operation','mouserkclick','模拟鼠标右键单击(可带页面对象)'); +insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) +values (36, 1, 0, 'operation','mousedclick','模拟鼠标双击(可带页面对象)'); +insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) +values (37, 1, 0, 'operation','mouseclickhold','模拟鼠标左键单击后不释放(可带页面对象)'); +insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) +values (38, 1, 0, 'operation','mousedrag','模拟鼠标拖拽(可带页面对象)'); +insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) +values (39, 1, 0, 'operation','mouseto','模拟鼠标移动到指定坐标(可带页面对象)'); +insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) +values (40, 1, 0, 'operation','mouserelease','模拟鼠标释放(可带页面对象)'); +insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) +values (41, 1, 0, 'operation','mousekey(tab)','模拟键盘Tab键'); +insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) +values (42, 1, 0, 'operation','mousekey(space)','模拟键盘Space键'); +insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) +values (43, 1, 0, 'operation','mousekey(ctrl)','模拟键盘Ctrl键'); +insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) +values (44, 1, 0, 'operation','mousekey(shift)','模拟键盘Shift键'); +insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) +values (45, 1, 0, 'operation','mousekey(enter)','模拟键盘Enter键'); +insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) +values (46, 1, 0, 'operation','runcase','调用指定接口用例'); + +/*插入角色默认定义*/ +insert into USER_ROLE (id, role, permission) +values (2, '测试工程师', 'acc_1,acc_2,acc_3,'); +insert into USER_ROLE (id, role, permission) +values (3, '自动化工程师', 'acc_1,acc_2,acc_3,tast_run,tast_remove,tast_ex,tast_1,tast_3,tast_2,tast_upload,tastex_2,case_ex,'); +insert into USER_ROLE (id, role, permission) +values (4, '质量工程师', 'pv_1,pv_2,pv_3,pvp_1,fc_1,fc_2,fc_3,acc_1,acc_2,acc_3,pfc_1,pfc_2,pfc_3,fc_tocheck,revinfo_1,revinfo_2,revinfo_3,rev_2,rev_3,acc_upload,'); +insert into USER_ROLE (id, role, permission) +values (1, '管理员', 'pv_1,pv_2,pv_3,pvp_1,fc_1,fc_2,fc_3,acc_1,acc_2,acc_3,tast_run,tast_remove,tast_ex,tast_1,tast_3,tast_2,tast_upload,tastex_2,case_ex,pfc_1,pfc_2,pfc_3,fc_tocheck,revinfo_1,revinfo_2,revinfo_3,rev_2,rev_3,acc_upload,ui_1,ui_2,ui_3,ui_4,role_3,role_1,role_2,pro_1,pro_2,pro_3,case_1,case_2,case_3,case_step,proplan_1,proplan_2,proplan_3,dpmt_1,dpmt_2,dpmt_3,ptct_1,ptct_2,ptct_3,client_1,client_2,client_3,'); + +/*插入默认部门分级*/ +insert into QA_SECONDARYSECTOR (sectorid, departmenthead, departmentname) +values (99, '系统管理员', '总部'); +/*插入默认项目*/ +insert into QA_SECTORPROJECTS (projectid, projectname, projectmanager, sectorid, projecttype) +values (99, '全部项目/未知项目', '系统管理员', 99, 0); +/*插入默认管理员*/ +insert into USERINFO (id, usercode, password, username, role, sectorid) +values (1, 'admin', 'uJ45aIeS9N80kaSFDjvk%2FA%3D%3D', '系统管理员', '1', 99); +/*插入流程检查定义数据*/ +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (36, 5, '总结阶段', 2, '计划变更', 1, '如与计划不合,是否提交计划变更邮件', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (37, 5, '总结阶段', 3, '代码质量', 1, 'sonar代码检查是否刷新构建', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (38, 5, '总结阶段', 3, '代码质量', 2, 'sonar代码问题数是否符合要求', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (35, 2, '开发阶段', 3, '开发与编码', 6, '是否每一条禅道开发任务都提交转测申请', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (34, 4, '验收与上线', 2, '上线部署', 3, 'SVN代码是否提交并标注', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (1, 1, '需求阶段', 1, '需求编制', 1, '《产品需求说明书》是否组织评审会', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (2, 1, '需求阶段', 1, '需求编制', 2, '《产品需求说明书》评审是否通过', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (3, 1, '需求阶段', 1, '需求编制', 3, '《产品需求说明书》是否归档到SVN', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (4, 1, '需求阶段', 1, '需求编制', 4, '《产品需求说明书》评审记录表是否签字通过', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (5, 2, '开发阶段', 1, '需求分解', 1, '是否有需求分解/任务讨论会', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (6, 2, '开发阶段', 1, '需求分解', 2, '《项目计划》邮件是否及时发出', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (7, 2, '开发阶段', 1, '需求分解', 3, '《项目计划》邮件内容是否完整', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (10, 2, '开发阶段', 2, '软件设计', 1, '《产品开发概要设计》是否组织评审会', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (11, 2, '开发阶段', 2, '软件设计', 2, '《产品开发概要设计》评审是否通过', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (12, 2, '开发阶段', 2, '软件设计', 3, '《产品开发概要设计》是否归档到SVN', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (13, 2, '开发阶段', 2, '软件设计', 4, '《产品开发概要设计》评审记录表是否签字通过', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (14, 2, '开发阶段', 3, '开发与编码', 1, '是否进行每日晨会', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (15, 2, '开发阶段', 3, '开发与编码', 2, '是否进行代码走读', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (16, 2, '开发阶段', 3, '开发与编码', 3, '是否每一条禅道开发任务都提交转测申请', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (17, 2, '开发阶段', 3, '开发与编码', 4, '转测邮件是否合格', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (18, 2, '开发阶段', 3, '开发与编码', 5, '转测邮件打回次数为0', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (19, 3, '测试阶段', 1, '软件测试', 1, '是否回复测试计划', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (20, 3, '测试阶段', 1, '软件测试', 2, '是否回复测试用例', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (21, 3, '测试阶段', 1, '软件测试', 3, '测试用例是否通过评审/确认', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (22, 3, '测试阶段', 1, '软件测试', 4, '《软件测试报告》是否组织评审会', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (23, 3, '测试阶段', 1, '软件测试', 5, '《软件测试报告》是否评审通过', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (24, 3, '测试阶段', 1, '软件测试', 6, '《软件测试报告》/测试结果是否发出邮件', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (25, 3, '测试阶段', 1, '软件测试', 7, '《软件测试报告》评审记录表是否签字通过', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (26, 4, '验收与上线', 1, '产品验收', 1, '《产品验收报告》是否组织评审会', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (27, 4, '验收与上线', 1, '产品验收', 2, '《产品验收报告》是否评审通过', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (28, 4, '验收与上线', 1, '产品验收', 3, '《产品验收报告》是否归档到SVN', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (29, 4, '验收与上线', 1, '产品验收', 4, '《产品验收报告》评审记录表是否签字通过', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (30, 4, '验收与上线', 2, '上线部署', 1, '产品/开发是否提交上线流程(OA)', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (31, 4, '验收与上线', 2, '上线部署', 2, '开发是否提交上线相关资料', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (32, 5, '总结阶段', 1, '项目总结', 1, '《项目总结》邮件是否及时发出', null); +insert into QA_FLOWINFO (id, phaseid, phasename, phasenodeid, phasenodename, checkentryid, checkentry, remark) +values (33, 5, '总结阶段', 1, '项目总结', 2, '《项目总结》邮件内容是否完整', null); \ No newline at end of file diff --git a/mysqldb/update(alter table)/V1.0 upgrade V1.1/V1.1.sql b/mysqldb/update(alter table)/V1.0 upgrade V1.1/V1.1.sql index 339682c..2aa4fb1 100644 --- a/mysqldb/update(alter table)/V1.0 upgrade V1.1/V1.1.sql +++ b/mysqldb/update(alter table)/V1.0 upgrade V1.1/V1.1.sql @@ -1,9 +1,9 @@ -/*չ־ϸֶε5000*/ -alter table test_logdetail modify column detail varchar(5000); -/*ĿȨ޿*/ -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (48, 'Ŀ', '', 'pro_1'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (49, 'Ŀ', 'ɾ', 'pro_2'); -insert into USER_AUTHORITY (id, module, auth_type, alias) +/*չ־ϸֶε5000*/ +alter table test_logdetail modify column detail varchar(5000); +/*ĿȨ޿*/ +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (48, 'Ŀ', '', 'pro_1'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (49, 'Ŀ', 'ɾ', 'pro_2'); +insert into USER_AUTHORITY (id, module, auth_type, alias) values (50, 'Ŀ', '޸', 'pro_3'); \ No newline at end of file diff --git a/mysqldb/update(alter table)/V1.1 upgrade V2.0/V2.0.sql b/mysqldb/update(alter table)/V1.1 upgrade V2.0/V2.0.sql index b983e7c..e731eaf 100644 --- a/mysqldb/update(alter table)/V1.1 upgrade V2.0/V2.0.sql +++ b/mysqldb/update(alter table)/V1.1 upgrade V2.0/V2.0.sql @@ -1,88 +1,88 @@ -create table PROJECT_CASE -( - id int(8) not null AUTO_INCREMENT, - sign VARCHAR(20) not null COMMENT '用例标识', - name VARCHAR(200) not null COMMENT '用例名称', - projectid int(8) not null COMMENT '关联项目ID', - moduleid int(8) not null COMMENT '关联项目模块ID', - projectindex int(8) not null COMMENT '项目用例编号', - time VARCHAR(30) COMMENT '最后更新时间', - operationer VARCHAR(20) COMMENT '最后更新人员', - casetype int(2) not null COMMENT '0 接口 1 UI', - remark VARCHAR(200) COMMENT '备注', - primary key (ID) -)default character set utf8; - -create table PROJECT_CASESTEPS -( - id int(8) not null AUTO_INCREMENT, - path VARCHAR(100) COMMENT '包路径|定位路径', - operation VARCHAR(100) COMMENT '方法名|操作', - parameters VARCHAR(500) COMMENT '参数', - action VARCHAR(50) COMMENT '步骤动作', - caseid int(8) not null COMMENT '用例ID', - stepnum int(2) not null COMMENT '步骤编号', - expectedresult VARCHAR(2000) COMMENT '预期结果', - projectid int(8) not null COMMENT '项目ID', - steptype int(2) not null COMMENT '0 接口 1 UI', - time VARCHAR(30) COMMENT '最后更新时间', - operationer VARCHAR(20) COMMENT '最后更新人员', - remark VARCHAR(200) COMMENT '备注', - primary key (ID) -)default character set utf8; - -create table PROJECT_PLAN -( - id int(9) not null AUTO_INCREMENT, - name VARCHAR(50) not null COMMENT '测试计划名称', - casecount int(8) COMMENT '计划中用例总数', - remark VARCHAR(200) COMMENT '备注', - projectid int(8) not null COMMENT '项目ID', - time VARCHAR(30) COMMENT '最后更新时间', - operationer VARCHAR(20) COMMENT '最后更新人员', - primary key (ID) -)default character set utf8; - -create table PROJECT_PLANCASE -( - id int(9) not null AUTO_INCREMENT, - caseid int(8) not null COMMENT '用例ID', - planid int(8) not null COMMENT '项目计划ID', - priority int(8) not null COMMENT '用例优先级', - primary key (ID), - index (caseid), - index (planid) -)default character set utf8; - -create table PROJECT_MODULE -( - id int(9) not null AUTO_INCREMENT, - projectid int(8) not null COMMENT '项目ID', - modulename VARCHAR(50) COMMENT '模块名字', - pid int(4) COMMENT '层级关系', - primary key (ID) -)default character set utf8; - -/*用户增加默认选择字段*/ -alter table userinfo add projectid int(4) default '0'; -/*项目管理表增加项目标识字段*/ -alter table QA_SECTORPROJECTS add projectsign VARCHAR(20) default 'sign' not null; -/*调度任务配置增加三个支持内部项目字段*/ -alter table TEST_JOBS add projecttype int(8) default '0' COMMENT '项目类型 0 testlink 1 系统内项目'; -alter table TEST_JOBS add projectid int(8) COMMENT '系统内项目ID'; -alter table TEST_JOBS add planid int(8) COMMENT '系统内项目关联测试计划ID'; -/*增加权限标识*/ -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (51, '用例管理', '增加', 'case_1'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (52, '用例管理', '删除', 'case_2'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (53, '用例管理', '修改', 'case_3'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (54, '步骤管理', '增删改查', 'case_step'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (55, '测试计划管理', '增加', 'proplan_1'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (56, '测试计划管理', '删除', 'proplan_2'); -insert into USER_AUTHORITY (id, module, auth_type, alias) +create table PROJECT_CASE +( + id int(8) not null AUTO_INCREMENT, + sign VARCHAR(20) not null COMMENT '用例标识', + name VARCHAR(200) not null COMMENT '用例名称', + projectid int(8) not null COMMENT '关联项目ID', + moduleid int(8) not null COMMENT '关联项目模块ID', + projectindex int(8) not null COMMENT '项目用例编号', + time VARCHAR(30) COMMENT '最后更新时间', + operationer VARCHAR(20) COMMENT '最后更新人员', + casetype int(2) not null COMMENT '0 接口 1 UI', + remark VARCHAR(200) COMMENT '备注', + primary key (ID) +)default character set utf8; + +create table PROJECT_CASESTEPS +( + id int(8) not null AUTO_INCREMENT, + path VARCHAR(100) COMMENT '包路径|定位路径', + operation VARCHAR(100) COMMENT '方法名|操作', + parameters VARCHAR(500) COMMENT '参数', + action VARCHAR(50) COMMENT '步骤动作', + caseid int(8) not null COMMENT '用例ID', + stepnum int(2) not null COMMENT '步骤编号', + expectedresult VARCHAR(2000) COMMENT '预期结果', + projectid int(8) not null COMMENT '项目ID', + steptype int(2) not null COMMENT '0 接口 1 UI', + time VARCHAR(30) COMMENT '最后更新时间', + operationer VARCHAR(20) COMMENT '最后更新人员', + remark VARCHAR(200) COMMENT '备注', + primary key (ID) +)default character set utf8; + +create table PROJECT_PLAN +( + id int(9) not null AUTO_INCREMENT, + name VARCHAR(50) not null COMMENT '测试计划名称', + casecount int(8) COMMENT '计划中用例总数', + remark VARCHAR(200) COMMENT '备注', + projectid int(8) not null COMMENT '项目ID', + time VARCHAR(30) COMMENT '最后更新时间', + operationer VARCHAR(20) COMMENT '最后更新人员', + primary key (ID) +)default character set utf8; + +create table PROJECT_PLANCASE +( + id int(9) not null AUTO_INCREMENT, + caseid int(8) not null COMMENT '用例ID', + planid int(8) not null COMMENT '项目计划ID', + priority int(8) not null COMMENT '用例优先级', + primary key (ID), + index (caseid), + index (planid) +)default character set utf8; + +create table PROJECT_MODULE +( + id int(9) not null AUTO_INCREMENT, + projectid int(8) not null COMMENT '项目ID', + modulename VARCHAR(50) COMMENT '模块名字', + pid int(4) COMMENT '层级关系', + primary key (ID) +)default character set utf8; + +/*用户增加默认选择字段*/ +alter table userinfo add projectid int(4) default '0'; +/*项目管理表增加项目标识字段*/ +alter table QA_SECTORPROJECTS add projectsign VARCHAR(20) default 'sign' not null; +/*调度任务配置增加三个支持内部项目字段*/ +alter table TEST_JOBS add projecttype int(8) default '0' COMMENT '项目类型 0 testlink 1 系统内项目'; +alter table TEST_JOBS add projectid int(8) COMMENT '系统内项目ID'; +alter table TEST_JOBS add planid int(8) COMMENT '系统内项目关联测试计划ID'; +/*增加权限标识*/ +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (51, '用例管理', '增加', 'case_1'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (52, '用例管理', '删除', 'case_2'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (53, '用例管理', '修改', 'case_3'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (54, '步骤管理', '增删改查', 'case_step'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (55, '测试计划管理', '增加', 'proplan_1'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (56, '测试计划管理', '删除', 'proplan_2'); +insert into USER_AUTHORITY (id, module, auth_type, alias) values (57, '测试计划管理', '修改', 'proplan_3'); \ No newline at end of file diff --git a/mysqldb/update(alter table)/V2.0 upgrade V2.1/V2.1.sql b/mysqldb/update(alter table)/V2.0 upgrade V2.1/V2.1.sql index fafb356..658e4b8 100644 --- a/mysqldb/update(alter table)/V2.0 upgrade V2.1/V2.1.sql +++ b/mysqldb/update(alter table)/V2.0 upgrade V2.1/V2.1.sql @@ -1,7 +1,7 @@ -/*插入部门管理权限*/ -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (58, '部门管理', '增加', 'dpmt_1'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (59, '部门管理', '删除', 'dpmt_2'); -insert into USER_AUTHORITY (id, module, auth_type, alias) +/*插入部门管理权限*/ +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (58, '部门管理', '增加', 'dpmt_1'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (59, '部门管理', '删除', 'dpmt_2'); +insert into USER_AUTHORITY (id, module, auth_type, alias) values (60, '部门管理', '修改', 'dpmt_3'); \ No newline at end of file diff --git a/mysqldb/update(alter table)/V2.1 upgrade V2.2/V2.2.sql b/mysqldb/update(alter table)/V2.1 upgrade V2.2/V2.2.sql index 0c5ca21..b163c70 100644 --- a/mysqldb/update(alter table)/V2.1 upgrade V2.2/V2.2.sql +++ b/mysqldb/update(alter table)/V2.1 upgrade V2.2/V2.2.sql @@ -1,146 +1,146 @@ -/*增加支持协议模板表*/ -create table PROJECT_PROTOCOLTEMPLATE -( - id int(8) not null AUTO_INCREMENT, - projectid int(8) not null COMMENT '项目ID', - name VARCHAR(50) not null COMMENT '模板名称', - protocoltype VARCHAR(20) not null COMMENT '协议类型', - contentencoding VARCHAR(20) not null COMMENT '编码格式', - connecttimeout int(8) not null COMMENT '超时时间', - time VARCHAR(30) COMMENT '最后更新时间', - operationer VARCHAR(20) COMMENT '最后更新人员', - remark VARCHAR(200) COMMENT '备注', - primary key (ID) -)default character set utf8; - -create table PROJECT_TEMPLATEPARAMS -( - id int(9) not null AUTO_INCREMENT, - templateid int(8) not null COMMENT '模块ID', - paramname VARCHAR(50) not null COMMENT '参数名', - param VARCHAR(2000) COMMENT '参数默认值', - primary key (ID) -)default character set utf8; - -create table PROJECT_CASESTEPSPARAMS -( - id int(8) not null AUTO_INCREMENT, - steptype int(2) not null COMMENT '步骤类型', - parentid int(8) not null COMMENT '父节点ID', - fieldname VARCHAR(50) COMMENT '所属字段名', - paramvalue VARCHAR(200) COMMENT '参数值', - description VARCHAR(50) COMMENT '描述', - primary key (ID) -)default character set utf8; - -create table TEMP_CASESTEPDEBUG -( - id int(8) not null AUTO_INCREMENT, - sign VARCHAR(20) not null COMMENT '用例标识', - executor VARCHAR(20) not null COMMENT '执行人', - loglevel VARCHAR(10) not null COMMENT '日志级别', - detail VARCHAR(5000) not null COMMENT '日志', - primary key (ID) -)default character set utf8; - -/*插入部门管理权限*/ -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (61, '协议模板', '增加', 'ptct_1'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (62, '协议模板', '删除', 'ptct_2'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (63, '协议模板', '修改', 'ptct_3'); - -/*插入步骤界面定义各个字段的默认值*/ -insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) -values (1, 2, 0, 'operation','HttpURLPost','使用HttpURLConnection发送post请求'); -insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) -values (2, 2, 0, 'operation','URLPost','使用URLConnection发送post'); -insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) -values (3, 2, 0, 'operation','GetAndSaveFile','发送get请求保存下载文件到客户端'); -insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) -values (4, 2, 0, 'operation','HttpURLGet','使用HttpURLConnection发送get请求'); -insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) -values (5, 2, 0, 'operation','URLGet','使用URLConnection发送get请求'); -insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) -values (6, 2, 0, 'operation','HttpClientPost','使用HttpClient发送post请求'); -insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) -values (7, 2, 0, 'operation','HttpClientGet','使用HttpClient发送get请求'); -insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) -values (8, 3, 0, 'operation','SocketPost','使用socket发送post请求'); -insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) -values (9, 3, 0, 'operation','SocketGet','使用socket发送get请求'); -insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) -values (10, 1, 0, 'operation','click','点击对象'); -insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) -values (11, 1, 0, 'operation','sendkeys','输入'); -insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) -values (12, 1, 0, 'operation','clear','清除输入框'); -insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) -values (13, 1, 0, 'operation','gotoframe','跳转框架(iframe)'); -insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) -values (14, 1, 0, 'operation','isenabled','判断对象是否可用'); -insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) -values (15, 1, 0, 'operation','isdisplayed','判断对象是否可见'); -insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) -values (16, 1, 0, 'operation','exjsob','针对对象执行JS脚本'); -insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) -values (17, 1, 0, 'operation','gettext','获取对象文本属性'); -insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) -values (18, 1, 0, 'operation','gettagname','获取对象标签类型'); -insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) -values (19, 1, 0, 'operation','getcaptcha','获取对象中的验证码(识别率较低)'); -insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) -values (20, 1, 0, 'operation','selectbyvisibletext','通过下拉框的文本进行选择'); -insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) -values (21, 1, 0, 'operation','selectbyvalue','通过下拉框的VALUE属性进行选择'); -insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) -values (22, 1, 0, 'operation','selectbyindex','通过下拉框的index属性进行选择(从0开始)'); -insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) -values (23, 1, 0, 'operation','isselect','判断是否已经被选择,同用于单选\复选框'); -insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) -values (24, 1, 0, 'operation','open','打开URL'); -insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) -values (25, 1, 0, 'operation','exjs','执行js脚本'); -insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) -values (26, 1, 0, 'operation','gotodefaultcontent','跳转回到默认iframe'); -insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) -values (27, 1, 0, 'operation','gettitle','获取窗口标题'); -insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) -values (28, 1, 0, 'operation','getwindowhandle','获取窗口句柄'); -insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) -values (29, 1, 0, 'operation','gotowindow','跳转窗口句柄'); -insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) -values (30, 1, 0, 'operation','wait','等待时间(S)'); -insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) -values (31, 1, 0, 'operation','alertaccept','弹出框点击OK'); -insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) -values (32, 1, 0, 'operation','alertdismiss','弹出框点击取消'); -insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) -values (33, 1, 0, 'operation','alertgettext','获取弹出框TEXT'); -insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) -values (34, 1, 0, 'operation','mouselkclick','模拟鼠标左键单击(可带页面对象)'); -insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) -values (35, 1, 0, 'operation','mouserkclick','模拟鼠标右键单击(可带页面对象)'); -insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) -values (36, 1, 0, 'operation','mousedclick','模拟鼠标双击(可带页面对象)'); -insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) -values (37, 1, 0, 'operation','mouseclickhold','模拟鼠标左键单击后不释放(可带页面对象)'); -insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) -values (38, 1, 0, 'operation','mousedrag','模拟鼠标拖拽(可带页面对象)'); -insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) -values (39, 1, 0, 'operation','mouseto','模拟鼠标移动到指定坐标(可带页面对象)'); -insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) -values (40, 1, 0, 'operation','mouserelease','模拟鼠标释放(可带页面对象)'); -insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) -values (41, 1, 0, 'operation','mousekey(tab)','模拟键盘Tab键'); -insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) -values (42, 1, 0, 'operation','mousekey(space)','模拟键盘Space键'); -insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) -values (43, 1, 0, 'operation','mousekey(ctrl)','模拟键盘Ctrl键'); -insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) -values (44, 1, 0, 'operation','mousekey(shift)','模拟键盘Shift键'); -insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) -values (45, 1, 0, 'operation','mousekey(enter)','模拟键盘Enter键'); -insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) +/*增加支持协议模板表*/ +create table PROJECT_PROTOCOLTEMPLATE +( + id int(8) not null AUTO_INCREMENT, + projectid int(8) not null COMMENT '项目ID', + name VARCHAR(50) not null COMMENT '模板名称', + protocoltype VARCHAR(20) not null COMMENT '协议类型', + contentencoding VARCHAR(20) not null COMMENT '编码格式', + connecttimeout int(8) not null COMMENT '超时时间', + time VARCHAR(30) COMMENT '最后更新时间', + operationer VARCHAR(20) COMMENT '最后更新人员', + remark VARCHAR(200) COMMENT '备注', + primary key (ID) +)default character set utf8; + +create table PROJECT_TEMPLATEPARAMS +( + id int(9) not null AUTO_INCREMENT, + templateid int(8) not null COMMENT '模块ID', + paramname VARCHAR(50) not null COMMENT '参数名', + param VARCHAR(2000) COMMENT '参数默认值', + primary key (ID) +)default character set utf8; + +create table PROJECT_CASESTEPSPARAMS +( + id int(8) not null AUTO_INCREMENT, + steptype int(2) not null COMMENT '步骤类型', + parentid int(8) not null COMMENT '父节点ID', + fieldname VARCHAR(50) COMMENT '所属字段名', + paramvalue VARCHAR(200) COMMENT '参数值', + description VARCHAR(50) COMMENT '描述', + primary key (ID) +)default character set utf8; + +create table TEMP_CASESTEPDEBUG +( + id int(8) not null AUTO_INCREMENT, + sign VARCHAR(20) not null COMMENT '用例标识', + executor VARCHAR(20) not null COMMENT '执行人', + loglevel VARCHAR(10) not null COMMENT '日志级别', + detail VARCHAR(5000) not null COMMENT '日志', + primary key (ID) +)default character set utf8; + +/*插入部门管理权限*/ +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (61, '协议模板', '增加', 'ptct_1'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (62, '协议模板', '删除', 'ptct_2'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (63, '协议模板', '修改', 'ptct_3'); + +/*插入步骤界面定义各个字段的默认值*/ +insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) +values (1, 2, 0, 'operation','HttpURLPost','使用HttpURLConnection发送post请求'); +insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) +values (2, 2, 0, 'operation','URLPost','使用URLConnection发送post'); +insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) +values (3, 2, 0, 'operation','GetAndSaveFile','发送get请求保存下载文件到客户端'); +insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) +values (4, 2, 0, 'operation','HttpURLGet','使用HttpURLConnection发送get请求'); +insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) +values (5, 2, 0, 'operation','URLGet','使用URLConnection发送get请求'); +insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) +values (6, 2, 0, 'operation','HttpClientPost','使用HttpClient发送post请求'); +insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) +values (7, 2, 0, 'operation','HttpClientGet','使用HttpClient发送get请求'); +insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) +values (8, 3, 0, 'operation','SocketPost','使用socket发送post请求'); +insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) +values (9, 3, 0, 'operation','SocketGet','使用socket发送get请求'); +insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) +values (10, 1, 0, 'operation','click','点击对象'); +insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) +values (11, 1, 0, 'operation','sendkeys','输入'); +insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) +values (12, 1, 0, 'operation','clear','清除输入框'); +insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) +values (13, 1, 0, 'operation','gotoframe','跳转框架(iframe)'); +insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) +values (14, 1, 0, 'operation','isenabled','判断对象是否可用'); +insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) +values (15, 1, 0, 'operation','isdisplayed','判断对象是否可见'); +insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) +values (16, 1, 0, 'operation','exjsob','针对对象执行JS脚本'); +insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) +values (17, 1, 0, 'operation','gettext','获取对象文本属性'); +insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) +values (18, 1, 0, 'operation','gettagname','获取对象标签类型'); +insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) +values (19, 1, 0, 'operation','getcaptcha','获取对象中的验证码(识别率较低)'); +insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) +values (20, 1, 0, 'operation','selectbyvisibletext','通过下拉框的文本进行选择'); +insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) +values (21, 1, 0, 'operation','selectbyvalue','通过下拉框的VALUE属性进行选择'); +insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) +values (22, 1, 0, 'operation','selectbyindex','通过下拉框的index属性进行选择(从0开始)'); +insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) +values (23, 1, 0, 'operation','isselect','判断是否已经被选择,同用于单选\复选框'); +insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) +values (24, 1, 0, 'operation','open','打开URL'); +insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) +values (25, 1, 0, 'operation','exjs','执行js脚本'); +insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) +values (26, 1, 0, 'operation','gotodefaultcontent','跳转回到默认iframe'); +insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) +values (27, 1, 0, 'operation','gettitle','获取窗口标题'); +insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) +values (28, 1, 0, 'operation','getwindowhandle','获取窗口句柄'); +insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) +values (29, 1, 0, 'operation','gotowindow','跳转窗口句柄'); +insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) +values (30, 1, 0, 'operation','wait','等待时间(S)'); +insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) +values (31, 1, 0, 'operation','alertaccept','弹出框点击OK'); +insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) +values (32, 1, 0, 'operation','alertdismiss','弹出框点击取消'); +insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) +values (33, 1, 0, 'operation','alertgettext','获取弹出框TEXT'); +insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) +values (34, 1, 0, 'operation','mouselkclick','模拟鼠标左键单击(可带页面对象)'); +insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) +values (35, 1, 0, 'operation','mouserkclick','模拟鼠标右键单击(可带页面对象)'); +insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) +values (36, 1, 0, 'operation','mousedclick','模拟鼠标双击(可带页面对象)'); +insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) +values (37, 1, 0, 'operation','mouseclickhold','模拟鼠标左键单击后不释放(可带页面对象)'); +insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) +values (38, 1, 0, 'operation','mousedrag','模拟鼠标拖拽(可带页面对象)'); +insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) +values (39, 1, 0, 'operation','mouseto','模拟鼠标移动到指定坐标(可带页面对象)'); +insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) +values (40, 1, 0, 'operation','mouserelease','模拟鼠标释放(可带页面对象)'); +insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) +values (41, 1, 0, 'operation','mousekey(tab)','模拟键盘Tab键'); +insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) +values (42, 1, 0, 'operation','mousekey(space)','模拟键盘Space键'); +insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) +values (43, 1, 0, 'operation','mousekey(ctrl)','模拟键盘Ctrl键'); +insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) +values (44, 1, 0, 'operation','mousekey(shift)','模拟键盘Shift键'); +insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) +values (45, 1, 0, 'operation','mousekey(enter)','模拟键盘Enter键'); +insert into PROJECT_CASESTEPSPARAMS (id, steptype, parentid, fieldname,paramvalue,description) values (46, 1, 0, 'operation','runcase','调用指定接口用例'); \ No newline at end of file diff --git a/mysqldb/update(alter table)/V2.2 upgrade V2.3/V2.3.sql b/mysqldb/update(alter table)/V2.2 upgrade V2.3/V2.3.sql index 700ae16..0b4016a 100644 --- a/mysqldb/update(alter table)/V2.2 upgrade V2.3/V2.3.sql +++ b/mysqldb/update(alter table)/V2.2 upgrade V2.3/V2.3.sql @@ -1,21 +1,21 @@ -/*创建客户端IP管理表*/ -create table TEST_CLIENT -( - id int(8) not null AUTO_INCREMENT, - clientip VARCHAR(30) not null COMMENT '客户端IP', - name VARCHAR(30) not null COMMENT '客户端名称', - projectper VARCHAR(200) COMMENT '使用项目', - status int(2) COMMENT '客户端超时 0 正常 1 链接失败 2 状态未知', - checkinterval int(6) not null COMMENT '检查客户端状态心跳间隔时间 单位:秒', - remark VARCHAR(100) COMMENT '备注', - primary key (id) -)default character set utf8; -/*角色权限表增加操作项目权限字段*/ -alter table USER_ROLE add opprojectid VARCHAR(200); -/*增加客户端操作相关权限*/ -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (64, '客户端管理', '增加', 'client_1'); -insert into USER_AUTHORITY (id, module, auth_type, alias) -values (65, '客户端管理', '删除', 'client_2'); -insert into USER_AUTHORITY (id, module, auth_type, alias) +/*创建客户端IP管理表*/ +create table TEST_CLIENT +( + id int(8) not null AUTO_INCREMENT, + clientip VARCHAR(30) not null COMMENT '客户端IP', + name VARCHAR(30) not null COMMENT '客户端名称', + projectper VARCHAR(200) COMMENT '使用项目', + status int(2) COMMENT '客户端超时 0 正常 1 链接失败 2 状态未知', + checkinterval int(6) not null COMMENT '检查客户端状态心跳间隔时间 单位:秒', + remark VARCHAR(100) COMMENT '备注', + primary key (id) +)default character set utf8; +/*角色权限表增加操作项目权限字段*/ +alter table USER_ROLE add opprojectid VARCHAR(200); +/*增加客户端操作相关权限*/ +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (64, '客户端管理', '增加', 'client_1'); +insert into USER_AUTHORITY (id, module, auth_type, alias) +values (65, '客户端管理', '删除', 'client_2'); +insert into USER_AUTHORITY (id, module, auth_type, alias) values (66, '客户端管理', '修改', 'client_3'); \ No newline at end of file diff --git a/mysqldb/update(alter table)/V2.3 upgrade V2.4/V2.4.sql b/mysqldb/update(alter table)/V2.3 upgrade V2.4/V2.4.sql new file mode 100644 index 0000000..0b11530 --- /dev/null +++ b/mysqldb/update(alter table)/V2.3 upgrade V2.4/V2.4.sql @@ -0,0 +1,4 @@ +/*调度表增加客户端load驱动桩路径字段*/ +alter table TEST_JOBS add clientpath VARCHAR(100) COMMENT '客户端测试驱动桩路径'; +/*调度表增加客户端load驱动桩路径字段*/ +alter table TEST_CLIENT add clientpath VARCHAR(100) COMMENT '客户端测试驱动桩路径 多个;做分隔'; diff --git a/pom.xml b/pom.xml index a5a16ef..5457d87 100644 --- a/pom.xml +++ b/pom.xml @@ -1,364 +1,364 @@ - - 4.0.0 - com.seagull - LuckyFrameServer - war - 0.0.1-SNAPSHOT - LuckyFrameServer Maven Webapp - http://maven.apache.org - - LuckyFrameServer - - - org.apache.maven.plugins - maven-compiler-plugin - 3.3 - - 1.7 - 1.7 - - - - org.apache.maven.plugins - maven-surefire-plugin - - true - - - - - - src/main/resources - - **/*.properties - **/*.xml - - true - - - - - UTF-8 - - - - junit - junit - 3.8.1 - test - - - antlr - antlr - 2.7.7 - - - aopalliance - aopalliance - 1.0 - - - org.aspectj - aspectjweaver - 1.8.10 - - - org.hibernate - hibernate-validator - 5.4.0.Final - - - c3p0 - c3p0 - 0.9.1.2 - - - - commons-beanutils - commons-beanutils - 1.9.3 - - - commons-codec - commons-codec - 1.10 - - - commons-collections - commons-collections - 3.2.2 - - - commons-dbcp - commons-dbcp - 1.4 - - - commons-digester - commons-digester - 2.1 - - - commons-discovery - commons-discovery - 0.5 - - - commons-fileupload - commons-fileupload - 1.3.2 - - - commons-httpclient - commons-httpclient - 3.1 - - - commons-io - commons-io - 2.5 - - - commons-lang - commons-lang - 2.6 - - - commons-logging - commons-logging - 1.2 - - - commons-pool - commons-pool - 1.6 - - - dom4j - dom4j - 1.6.1 - - - commons-validator - commons-validator - 1.5.1 - - - org.hibernate - ejb3-persistence - 3.3.2.Beta1 - - - net.sf.ezmorph - ezmorph - 1.0.6 - - - org.springframework - spring-hibernate3 - 2.0.8 - - - org.hibernate - hibernate-annotations - 3.5.6-Final - - - org.hibernate.javax.persistence - hibernate-jpa-2.0-api - 1.0.1.Final - - - org.hibernate - hibernate-validator-annotation-processor - 5.3.4.Final - - - org.javassist - javassist - 3.21.0-GA - - - javax.servlet.jsp - javax.servlet.jsp-api - 2.3.1 - - - javax.servlet - javax.servlet-api - 3.1.0 - - - net.sf.json-lib - json-lib - 2.4 - jdk15 - - - jstl - jstl - 1.2 - - - javax.transaction - jta - 1.1 - - - log4j - log4j - 1.2.17 - - - mysql - mysql-connector-java - 6.0.5 - - - org.quartz-scheduler - quartz - 1.8.6 - - - opensymphony - quartz-all - 1.6.2 - - - org.quartz-scheduler - quartz-commonj - 1.8.6 - - - org.quartz-scheduler - quartz-oracle - 1.8.6 - - - org.w3c.css - sac - 1.3 - - - org.slf4j - slf4j-api - 1.7.22 - - - org.slf4j - slf4j-log4j12 - 1.7.22 - - - org.springframework - spring-aop - 4.3.6.RELEASE - - - org.springframework - spring-aspects - 4.3.6.RELEASE - - - org.springframework - spring-beans - 4.3.6.RELEASE - - - org.springframework - spring-context - 4.3.6.RELEASE - - - org.springframework - spring-context-support - 4.3.6.RELEASE - - - org.springframework - spring-core - 4.3.6.RELEASE - - - org.springframework - spring-expression - 4.3.6.RELEASE - - - org.springframework - spring-instrument - 4.3.6.RELEASE - - - org.springframework - spring-instrument-tomcat - 4.3.6.RELEASE - - - org.springframework - spring-jdbc - 4.3.6.RELEASE - - - org.springframework - spring-jms - 4.3.6.RELEASE - - - org.springframework - spring-orm - 4.3.6.RELEASE - - - org.springframework - spring-oxm - 4.3.6.RELEASE - - - org.springframework - spring-struts - 3.2.18.RELEASE - - - org.springframework - spring-test - 4.3.6.RELEASE - - - org.springframework - spring-tx - 4.3.6.RELEASE - - - org.springframework - spring-web - 4.3.6.RELEASE - - - org.springframework - spring-webmvc - 4.3.6.RELEASE - - - taglibs - standard - 1.1.2 - - - javax.validation - validation-api - 1.1.0.Final - - - - + + 4.0.0 + com.seagull + LuckyFrameServer + war + 0.0.1-SNAPSHOT + LuckyFrameServer Maven Webapp + http://maven.apache.org + + LuckyFrameServer + + + org.apache.maven.plugins + maven-compiler-plugin + 3.3 + + 1.7 + 1.7 + + + + org.apache.maven.plugins + maven-surefire-plugin + + true + + + + + + src/main/resources + + **/*.properties + **/*.xml + + true + + + + + UTF-8 + + + + junit + junit + 3.8.1 + test + + + antlr + antlr + 2.7.7 + + + aopalliance + aopalliance + 1.0 + + + org.aspectj + aspectjweaver + 1.8.10 + + + org.hibernate + hibernate-validator + 5.4.0.Final + + + c3p0 + c3p0 + 0.9.1.2 + + + + commons-beanutils + commons-beanutils + 1.9.3 + + + commons-codec + commons-codec + 1.10 + + + commons-collections + commons-collections + 3.2.2 + + + commons-dbcp + commons-dbcp + 1.4 + + + commons-digester + commons-digester + 2.1 + + + commons-discovery + commons-discovery + 0.5 + + + commons-fileupload + commons-fileupload + 1.3.2 + + + commons-httpclient + commons-httpclient + 3.1 + + + commons-io + commons-io + 2.5 + + + commons-lang + commons-lang + 2.6 + + + commons-logging + commons-logging + 1.2 + + + commons-pool + commons-pool + 1.6 + + + dom4j + dom4j + 1.6.1 + + + commons-validator + commons-validator + 1.5.1 + + + org.hibernate + ejb3-persistence + 3.3.2.Beta1 + + + net.sf.ezmorph + ezmorph + 1.0.6 + + + org.springframework + spring-hibernate3 + 2.0.8 + + + org.hibernate + hibernate-annotations + 3.5.6-Final + + + org.hibernate.javax.persistence + hibernate-jpa-2.0-api + 1.0.1.Final + + + org.hibernate + hibernate-validator-annotation-processor + 5.3.4.Final + + + org.javassist + javassist + 3.21.0-GA + + + javax.servlet.jsp + javax.servlet.jsp-api + 2.3.1 + + + javax.servlet + javax.servlet-api + 3.1.0 + + + net.sf.json-lib + json-lib + 2.4 + jdk15 + + + jstl + jstl + 1.2 + + + javax.transaction + jta + 1.1 + + + log4j + log4j + 1.2.17 + + + mysql + mysql-connector-java + 6.0.5 + + + org.quartz-scheduler + quartz + 1.8.6 + + + opensymphony + quartz-all + 1.6.2 + + + org.quartz-scheduler + quartz-commonj + 1.8.6 + + + org.quartz-scheduler + quartz-oracle + 1.8.6 + + + org.w3c.css + sac + 1.3 + + + org.slf4j + slf4j-api + 1.7.22 + + + org.slf4j + slf4j-log4j12 + 1.7.22 + + + org.springframework + spring-aop + 4.3.6.RELEASE + + + org.springframework + spring-aspects + 4.3.6.RELEASE + + + org.springframework + spring-beans + 4.3.6.RELEASE + + + org.springframework + spring-context + 4.3.6.RELEASE + + + org.springframework + spring-context-support + 4.3.6.RELEASE + + + org.springframework + spring-core + 4.3.6.RELEASE + + + org.springframework + spring-expression + 4.3.6.RELEASE + + + org.springframework + spring-instrument + 4.3.6.RELEASE + + + org.springframework + spring-instrument-tomcat + 4.3.6.RELEASE + + + org.springframework + spring-jdbc + 4.3.6.RELEASE + + + org.springframework + spring-jms + 4.3.6.RELEASE + + + org.springframework + spring-orm + 4.3.6.RELEASE + + + org.springframework + spring-oxm + 4.3.6.RELEASE + + + org.springframework + spring-struts + 3.2.18.RELEASE + + + org.springframework + spring-test + 4.3.6.RELEASE + + + org.springframework + spring-tx + 4.3.6.RELEASE + + + org.springframework + spring-web + 4.3.6.RELEASE + + + org.springframework + spring-webmvc + 4.3.6.RELEASE + + + taglibs + standard + 1.1.2 + + + javax.validation + validation-api + 1.1.0.Final + + + + diff --git a/src/main/java/luckyweb/seagull/comm/QueueListener.java b/src/main/java/luckyweb/seagull/comm/QueueListener.java index b65fd3e..720b213 100644 --- a/src/main/java/luckyweb/seagull/comm/QueueListener.java +++ b/src/main/java/luckyweb/seagull/comm/QueueListener.java @@ -1,82 +1,82 @@ -package luckyweb.seagull.comm; - -import java.util.ArrayList; -import java.util.List; - -import javax.servlet.ServletContextEvent; -import javax.servlet.ServletContextListener; - -import org.apache.log4j.Logger; -import org.hibernate.Session; -import org.quartz.Scheduler; -import org.quartz.SchedulerException; -import org.quartz.SchedulerFactory; -import org.springframework.web.context.ContextLoaderListener; - -import luckyweb.seagull.spring.dao.TestJobsDaoImpl; -import luckyweb.seagull.spring.entity.SectorProjects; -import luckyweb.seagull.spring.entity.TestClient; -import luckyweb.seagull.spring.entity.TestJobs; -import luckyweb.seagull.util.HibernateSessionFactoryUtil; - -public class QueueListener extends ContextLoaderListener implements - ServletContextListener { - - private static final Logger log = Logger.getLogger(QueueListener.class); - public static List list = new ArrayList(); - public static List projlist = new ArrayList(); - public static List qa_projlist = new ArrayList(); - public static List listen_Clientlist = new ArrayList(); - public static Session session = HibernateSessionFactoryUtil.getCurrentSession(); - - public static SchedulerFactory gSchedulerFactory = null; - public static Scheduler sched = null; - public static String JOB_GROUP_NAME = "EXTJWEB_JOBGROUP_NAME"; - public static String TRIGGER_GROUP_NAME = "EXTJWEB_TRIGGERGROUP_NAME"; - - @Override - public void contextInitialized(ServletContextEvent arg0) { - // Session session=HibernateSessionFactoryUtil.getCurrentSession(); - - // 加载定时任务,tomcat启动时则启动 - try { - TestJobsDaoImpl.init(session); - log.info("服务器启动时则启动,加载定时任务"); - } catch (Exception e) { - log.error(" 服务启动异常 :" + e); - try { - HibernateSessionFactoryUtil.closeSession(); - } catch (Exception e1) { - log.error(" 关闭sessionFactory 异常 :" + e); - } - } - - } - - - @Override - public void contextDestroyed(ServletContextEvent arg0) { - // 服务关闭时,定时任务关闭 - - try { - if (QueueListener.sched.isStarted()) { - QueueListener.sched.shutdown(); - Thread.sleep(1000); - } - } catch (SchedulerException | InterruptedException e2) { - e2.printStackTrace(); - } - - try { - TestJobsDaoImpl.stop(session); - log.info(" 服务关闭时,定时任务关闭"); - } catch (Exception e) { - log.error(" 服务关闭异常 :" + e); - - } - - } - - - -} +package luckyweb.seagull.comm; + +import java.util.ArrayList; +import java.util.List; + +import javax.servlet.ServletContextEvent; +import javax.servlet.ServletContextListener; + +import org.apache.log4j.Logger; +import org.hibernate.Session; +import org.quartz.Scheduler; +import org.quartz.SchedulerException; +import org.quartz.SchedulerFactory; +import org.springframework.web.context.ContextLoaderListener; + +import luckyweb.seagull.spring.dao.TestJobsDaoImpl; +import luckyweb.seagull.spring.entity.SectorProjects; +import luckyweb.seagull.spring.entity.TestClient; +import luckyweb.seagull.spring.entity.TestJobs; +import luckyweb.seagull.util.HibernateSessionFactoryUtil; + +public class QueueListener extends ContextLoaderListener implements + ServletContextListener { + + private static final Logger log = Logger.getLogger(QueueListener.class); + public static List list = new ArrayList(); + public static List projlist = new ArrayList(); + public static List qa_projlist = new ArrayList(); + public static List listen_Clientlist = new ArrayList(); + public static Session session = HibernateSessionFactoryUtil.getCurrentSession(); + + public static SchedulerFactory gSchedulerFactory = null; + public static Scheduler sched = null; + public static String JOB_GROUP_NAME = "EXTJWEB_JOBGROUP_NAME"; + public static String TRIGGER_GROUP_NAME = "EXTJWEB_TRIGGERGROUP_NAME"; + + @Override + public void contextInitialized(ServletContextEvent arg0) { + // Session session=HibernateSessionFactoryUtil.getCurrentSession(); + + // 加载定时任务,tomcat启动时则启动 + try { + TestJobsDaoImpl.init(session); + log.info("服务器启动时则启动,加载定时任务"); + } catch (Exception e) { + log.error(" 服务启动异常 :" + e); + try { + HibernateSessionFactoryUtil.closeSession(); + } catch (Exception e1) { + log.error(" 关闭sessionFactory 异常 :" + e); + } + } + + } + + + @Override + public void contextDestroyed(ServletContextEvent arg0) { + // 服务关闭时,定时任务关闭 + + try { + if (QueueListener.sched.isStarted()) { + QueueListener.sched.shutdown(); + Thread.sleep(1000); + } + } catch (SchedulerException | InterruptedException e2) { + e2.printStackTrace(); + } + + try { + TestJobsDaoImpl.stop(session); + log.info(" 服务关闭时,定时任务关闭"); + } catch (Exception e) { + log.error(" 服务关闭异常 :" + e); + + } + + } + + + +} diff --git a/src/main/java/luckyweb/seagull/quartz/QuartzJob.java b/src/main/java/luckyweb/seagull/quartz/QuartzJob.java index 4f59e37..d93751d 100644 --- a/src/main/java/luckyweb/seagull/quartz/QuartzJob.java +++ b/src/main/java/luckyweb/seagull/quartz/QuartzJob.java @@ -1,242 +1,242 @@ -package luckyweb.seagull.quartz; - -import java.io.IOException; -import java.rmi.Naming; -import java.rmi.RemoteException; -import java.text.SimpleDateFormat; - -import javax.annotation.Resource; - -import org.apache.log4j.Logger; -import org.hibernate.Query; -import org.hibernate.Session; -import org.hibernate.Transaction; -import org.quartz.Job; -import org.quartz.JobExecutionContext; -import org.quartz.JobExecutionException; - -import luckyweb.seagull.comm.QueueListener; -import luckyweb.seagull.spring.entity.TestClient; -import luckyweb.seagull.spring.entity.TestJobs; -import luckyweb.seagull.spring.entity.TestTaskexcute; -import luckyweb.seagull.spring.service.TestJobsService; -import luckyweb.seagull.spring.service.TestTastExcuteService; -import luckyweb.seagull.util.DateUtil; -import luckyweb.seagull.util.HibernateSessionFactoryUtil; -import luckyweb.seagull.util.StrLib; -import rmi.model.RunBatchCaseEntity; -import rmi.model.RunCaseEntity; -import rmi.model.RunTaskEntity; -import rmi.service.RunService; - -public class QuartzJob implements Job { - private static final Logger log = Logger.getLogger(QuartzJob.class); - @Resource(name = "tastExcuteService") - private TestTastExcuteService tastExcuteService; - - @Resource(name = "testJobsService") - private TestJobsService testJobsService; - - public static Session session = HibernateSessionFactoryUtil.getCurrentSession(); - @Override - public void execute(JobExecutionContext context) - throws JobExecutionException { - try { - String name = context.getJobDetail().getName(); - - if(name.indexOf("*JOB")>-1){ - TestJobs job = new TestJobs(); - String id=name.substring(0,name.indexOf("*JOB")); - System.out.println("执行命令中。。。"); - for (int i = 0; i < QueueListener.list.size(); i++) { - job = QueueListener.list.get(i); - if (id.equals("" + job.getId())) { - break; - }else{ - job=null; - } - } - if(null!=job){ - toRunTask(job.getPlanproj(), job.getId(),job.getTaskName(),job.getClientip(),job.getClientpath()); - System.out.println("调用程序结束。。。"); - }else{ - System.out.println("没有定时任务需要启动。。。"); - } - }else if(name.indexOf("*CLIENT")>-1){ - TestClient tc = new TestClient(); - String id=name.substring(0,name.indexOf("*CLIENT")); - for (int i = 0; i < QueueListener.listen_Clientlist.size(); i++) { - tc = QueueListener.listen_Clientlist.get(i); - if (id.equals("" + tc.getId())) { - if(null!=tc){ - String clientip=tc.getClientip(); - try{ - //调用远程对象,注意RMI路径与接口必须与服务器配置一致 - RunService service=(RunService)Naming.lookup("rmi://"+clientip+":6633/RunService"); - String result=service.getClientStatus(); - if("success".equals(result)){ - if(tc.getStatus()!=0){ - tc.setStatus(0); - QueueListener.listen_Clientlist.set(i, tc); - Query query = session.createQuery("update TestClient t set t.status =0 where id="+tc.getId()); - query.executeUpdate(); - } - }else{ - if(tc.getStatus()!=1){ - tc.setStatus(1); - QueueListener.listen_Clientlist.set(i, tc); - Query query = session.createQuery("update TestClient t set t.status =1 where id="+tc.getId()); - query.executeUpdate(); - } - } - }catch (RemoteException e) { - if(tc.getStatus()!=1){ - tc.setStatus(1); - QueueListener.listen_Clientlist.set(i, tc); - Query query = session.createQuery("update TestClient t set t.status =1 where id="+tc.getId()); - query.executeUpdate(); - } - break; - } - } - break; - } - } - } - - } catch (Exception e) { - e.printStackTrace(); - } - } - - public String toRunTask(String projname,int jobId,String jobname,String clientip,String loadpath){ - Session s = null; - Transaction tx = null; - //System.out.println(tastId); - String tastName = ""; - String time = new SimpleDateFormat("yyyyMMddHHmmss").format(new java.util.Date().getTime()); - tastName ="【"+jobname+ "】_"+time; - - TestTaskexcute task=add(tastName, jobId, s, tx); - projname = projname.replaceAll(" ","\" \""); //防止计划名称或是项目名称带了空格符号,在run.exec中会执行出错 - String result="启动失败!"; - try{ - //调用远程对象,注意RMI路径与接口必须与服务器配置一致 - RunService service=(RunService)Naming.lookup("rmi://"+clientip+":6633/RunService"); - - RunTaskEntity tasken = new RunTaskEntity(); - tasken.setProjectname(projname); - tasken.setTaskid(String.valueOf(task.getId())); - if(StrLib.isEmpty(loadpath)){ - loadpath="/TestDriven"; - } - result=service.runtask(tasken,loadpath); - System.out.println(result); - return result; - }catch (Exception e) { - execFail(s, tx,task.getId(),jobId,tastName); - e.printStackTrace(); - return result; - } - - } - - - public String toRunCase(String projname,int tastId,String caseName,String casVersion,String clientip,String loadpath) { - String result="启动失败!"; - try{ - //调用远程对象,注意RMI路径与接口必须与服务器配置一致 - RunService service=(RunService)Naming.lookup("rmi://"+clientip+":6633/RunService"); - RunCaseEntity onecase = new RunCaseEntity(); - onecase.setProjectname(projname); - onecase.setTaskid(String.valueOf(tastId)); - onecase.setTestCaseExternalId(caseName); - onecase.setVersion(casVersion); - if(StrLib.isEmpty(loadpath)){ - loadpath="/TestDriven"; - } - result=service.runcase(onecase,loadpath); - System.out.println(result); - return result; - } catch (Exception e) { - e.printStackTrace(); - return result; - } - } - - - - public String toRunCaseBatch(String projname,int taskid,String caseInfo,String clientip,String loadpath) { - String result="启动失败!"; - try{ - //调用远程对象,注意RMI路径与接口必须与服务器配置一致 - RunService service=(RunService)Naming.lookup("rmi://"+clientip+":6633/RunService"); - RunBatchCaseEntity batchcase = new RunBatchCaseEntity(); - batchcase.setProjectname(projname); - batchcase.setTaskid(String.valueOf(taskid)); - batchcase.setBatchcase(caseInfo); - if(StrLib.isEmpty(loadpath)){ - loadpath="/TestDriven"; - } - result=service.runbatchcase(batchcase,loadpath); - System.out.println(result); - return result; - } catch (Exception e) { - e.printStackTrace(); - return result; - } - } - - /** - * 加入 testJobs表 - * @param tastId - * @param name - * @param jobId - * @param s - * @param tx - */ - private TestTaskexcute add(String tastName,int jobId,Session s,Transaction tx){ - TestTaskexcute tast = new TestTaskexcute(); - try { - tast.getTestJob().setId(jobId); - tast.setTaskId(tastName); - tast.setCaseIsExec("0"); - tast.setTaskStatus("0"); - tast.setCreateTime(DateUtil.now()); - s = HibernateSessionFactoryUtil.openSession(); - tx = s.beginTransaction(); - s.save(tast); - System.out.println("tastId:"+tast.getId()); - tx.commit(); - } catch (Exception e) { - tx.rollback(); - e.printStackTrace(); - } finally { - s.close(); - - } - return tast; - } - - private void execFail(Session s,Transaction tx,int id,int jobId,String tastId){ - //执行失败时,写入任务表记录为执行失败 - TestTaskexcute tast = new TestTaskexcute(); - s = HibernateSessionFactoryUtil.openSession(); - tx = s.beginTransaction(); - tast=(TestTaskexcute) s.load(TestTaskexcute.class, id); - tast.setTaskStatus("3"); - tast.setJobid(jobId); - tast.setTaskId(tastId); - tast.setCaseIsExec("1"); - tast.setTaskStatus("3"); - s.update(tast); - tx.commit(); - s.close(); - - } - - - public static void main(String[] args) throws IOException { - - } -} +package luckyweb.seagull.quartz; + +import java.io.IOException; +import java.rmi.Naming; +import java.rmi.RemoteException; +import java.text.SimpleDateFormat; + +import javax.annotation.Resource; + +import org.apache.log4j.Logger; +import org.hibernate.Query; +import org.hibernate.Session; +import org.hibernate.Transaction; +import org.quartz.Job; +import org.quartz.JobExecutionContext; +import org.quartz.JobExecutionException; + +import luckyweb.seagull.comm.QueueListener; +import luckyweb.seagull.spring.entity.TestClient; +import luckyweb.seagull.spring.entity.TestJobs; +import luckyweb.seagull.spring.entity.TestTaskexcute; +import luckyweb.seagull.spring.service.TestJobsService; +import luckyweb.seagull.spring.service.TestTastExcuteService; +import luckyweb.seagull.util.DateUtil; +import luckyweb.seagull.util.HibernateSessionFactoryUtil; +import luckyweb.seagull.util.StrLib; +import rmi.model.RunBatchCaseEntity; +import rmi.model.RunCaseEntity; +import rmi.model.RunTaskEntity; +import rmi.service.RunService; + +public class QuartzJob implements Job { + private static final Logger log = Logger.getLogger(QuartzJob.class); + @Resource(name = "tastExcuteService") + private TestTastExcuteService tastExcuteService; + + @Resource(name = "testJobsService") + private TestJobsService testJobsService; + + public static Session session = HibernateSessionFactoryUtil.getCurrentSession(); + @Override + public void execute(JobExecutionContext context) + throws JobExecutionException { + try { + String name = context.getJobDetail().getName(); + + if(name.indexOf("*JOB")>-1){ + TestJobs job = new TestJobs(); + String id=name.substring(0,name.indexOf("*JOB")); + System.out.println("执行命令中。。。"); + for (int i = 0; i < QueueListener.list.size(); i++) { + job = QueueListener.list.get(i); + if (id.equals("" + job.getId())) { + break; + }else{ + job=null; + } + } + if(null!=job){ + toRunTask(job.getPlanproj(), job.getId(),job.getTaskName(),job.getClientip(),job.getClientpath()); + System.out.println("调用程序结束。。。"); + }else{ + System.out.println("没有定时任务需要启动。。。"); + } + }else if(name.indexOf("*CLIENT")>-1){ + TestClient tc = new TestClient(); + String id=name.substring(0,name.indexOf("*CLIENT")); + for (int i = 0; i < QueueListener.listen_Clientlist.size(); i++) { + tc = QueueListener.listen_Clientlist.get(i); + if (id.equals("" + tc.getId())) { + if(null!=tc){ + String clientip=tc.getClientip(); + try{ + //调用远程对象,注意RMI路径与接口必须与服务器配置一致 + RunService service=(RunService)Naming.lookup("rmi://"+clientip+":6633/RunService"); + String result=service.getClientStatus(); + if("success".equals(result)){ + if(tc.getStatus()!=0){ + tc.setStatus(0); + QueueListener.listen_Clientlist.set(i, tc); + Query query = session.createQuery("update TestClient t set t.status =0 where id="+tc.getId()); + query.executeUpdate(); + } + }else{ + if(tc.getStatus()!=1){ + tc.setStatus(1); + QueueListener.listen_Clientlist.set(i, tc); + Query query = session.createQuery("update TestClient t set t.status =1 where id="+tc.getId()); + query.executeUpdate(); + } + } + }catch (RemoteException e) { + if(tc.getStatus()!=1){ + tc.setStatus(1); + QueueListener.listen_Clientlist.set(i, tc); + Query query = session.createQuery("update TestClient t set t.status =1 where id="+tc.getId()); + query.executeUpdate(); + } + break; + } + } + break; + } + } + } + + } catch (Exception e) { + e.printStackTrace(); + } + } + + public String toRunTask(String projname,int jobId,String jobname,String clientip,String loadpath){ + Session s = null; + Transaction tx = null; + //System.out.println(tastId); + String tastName = ""; + String time = new SimpleDateFormat("yyyyMMddHHmmss").format(new java.util.Date().getTime()); + tastName ="【"+jobname+ "】_"+time; + + TestTaskexcute task=add(tastName, jobId, s, tx); + projname = projname.replaceAll(" ","\" \""); //防止计划名称或是项目名称带了空格符号,在run.exec中会执行出错 + String result="启动失败!"; + try{ + //调用远程对象,注意RMI路径与接口必须与服务器配置一致 + RunService service=(RunService)Naming.lookup("rmi://"+clientip+":6633/RunService"); + + RunTaskEntity tasken = new RunTaskEntity(); + tasken.setProjectname(projname); + tasken.setTaskid(String.valueOf(task.getId())); + if(StrLib.isEmpty(loadpath)){ + loadpath="/TestDriven"; + } + result=service.runtask(tasken,loadpath); + System.out.println(result); + return result; + }catch (Exception e) { + execFail(s, tx,task.getId(),jobId,tastName); + e.printStackTrace(); + return result; + } + + } + + + public String toRunCase(String projname,int tastId,String caseName,String casVersion,String clientip,String loadpath) { + String result="启动失败!"; + try{ + //调用远程对象,注意RMI路径与接口必须与服务器配置一致 + RunService service=(RunService)Naming.lookup("rmi://"+clientip+":6633/RunService"); + RunCaseEntity onecase = new RunCaseEntity(); + onecase.setProjectname(projname); + onecase.setTaskid(String.valueOf(tastId)); + onecase.setTestCaseExternalId(caseName); + onecase.setVersion(casVersion); + if(StrLib.isEmpty(loadpath)){ + loadpath="/TestDriven"; + } + result=service.runcase(onecase,loadpath); + System.out.println(result); + return result; + } catch (Exception e) { + e.printStackTrace(); + return result; + } + } + + + + public String toRunCaseBatch(String projname,int taskid,String caseInfo,String clientip,String loadpath) { + String result="启动失败!"; + try{ + //调用远程对象,注意RMI路径与接口必须与服务器配置一致 + RunService service=(RunService)Naming.lookup("rmi://"+clientip+":6633/RunService"); + RunBatchCaseEntity batchcase = new RunBatchCaseEntity(); + batchcase.setProjectname(projname); + batchcase.setTaskid(String.valueOf(taskid)); + batchcase.setBatchcase(caseInfo); + if(StrLib.isEmpty(loadpath)){ + loadpath="/TestDriven"; + } + result=service.runbatchcase(batchcase,loadpath); + System.out.println(result); + return result; + } catch (Exception e) { + e.printStackTrace(); + return result; + } + } + + /** + * 加入 testJobs表 + * @param tastId + * @param name + * @param jobId + * @param s + * @param tx + */ + private TestTaskexcute add(String tastName,int jobId,Session s,Transaction tx){ + TestTaskexcute tast = new TestTaskexcute(); + try { + tast.getTestJob().setId(jobId); + tast.setTaskId(tastName); + tast.setCaseIsExec("0"); + tast.setTaskStatus("0"); + tast.setCreateTime(DateUtil.now()); + s = HibernateSessionFactoryUtil.openSession(); + tx = s.beginTransaction(); + s.save(tast); + System.out.println("tastId:"+tast.getId()); + tx.commit(); + } catch (Exception e) { + tx.rollback(); + e.printStackTrace(); + } finally { + s.close(); + + } + return tast; + } + + private void execFail(Session s,Transaction tx,int id,int jobId,String tastId){ + //执行失败时,写入任务表记录为执行失败 + TestTaskexcute tast = new TestTaskexcute(); + s = HibernateSessionFactoryUtil.openSession(); + tx = s.beginTransaction(); + tast=(TestTaskexcute) s.load(TestTaskexcute.class, id); + tast.setTaskStatus("3"); + tast.setJobid(jobId); + tast.setTaskId(tastId); + tast.setCaseIsExec("1"); + tast.setTaskStatus("3"); + s.update(tast); + tx.commit(); + s.close(); + + } + + + public static void main(String[] args) throws IOException { + + } +} diff --git a/src/main/java/luckyweb/seagull/quartz/QuartzManager.java b/src/main/java/luckyweb/seagull/quartz/QuartzManager.java index cb7a134..842b618 100644 --- a/src/main/java/luckyweb/seagull/quartz/QuartzManager.java +++ b/src/main/java/luckyweb/seagull/quartz/QuartzManager.java @@ -1,226 +1,226 @@ -package luckyweb.seagull.quartz; - -import org.apache.log4j.Logger; -import org.quartz.CronTrigger; -import org.quartz.JobDetail; -import org.quartz.Scheduler; -import org.quartz.SchedulerException; - -import luckyweb.seagull.comm.QueueListener; - - -public class QuartzManager { - - //private static SchedulerFactory gSchedulerFactory = new StdSchedulerFactory(); - //private static String JOB_GROUP_NAME = "EXTJWEB_JOBGROUP_NAME"; - //private static String TRIGGER_GROUP_NAME = "EXTJWEB_TRIGGERGROUP_NAME"; - - private static final Logger log = Logger.getLogger(QuartzManager.class); - - - /** - * @Description: 添加一个定时任务,使用默认的任务组名,触发器名,触发器组名 - * - * @param jobName - * 任务名 - * @param cls - * 任务 - * @param time - * 时间设置,参考quartz说明文档 - * - */ - @SuppressWarnings("unchecked") - public static void addJob(String jobName, Class cls, String time) { - try { - JobDetail jobDetail = new JobDetail(jobName, QueueListener.JOB_GROUP_NAME, cls);// 任务名,任务组,任务执行类 - //System.out.println("jobDetail 's Name :"+jobDetail.getName()); - // 触发器 - CronTrigger trigger = new CronTrigger(jobDetail.getName(), QueueListener.TRIGGER_GROUP_NAME);// 触发器名,触发器组 - trigger.setCronExpression(time);// 触发器时间设定 - QueueListener.sched.scheduleJob(jobDetail, trigger); - // 启动 - if (!QueueListener.sched.isShutdown()) { - System.out.println("启动。。"+jobName +" ,时间:"+time); - QueueListener.sched.start(); - } - } catch (Exception e) { - throw new RuntimeException(e); - } - } - - /** - * @Description: 添加一个定时任务 - * - * @param jobName - * 任务名 - * @param jobGroupName - * 任务组名 - * @param triggerName - * 触发器名 - * @param triggerGroupName - * 触发器组名 - * @param jobClass - * 任务 - * @param time - * 时间设置,参考quartz说明文档 - * @throws SchedulerException - * - * @Title: QuartzManager.java - * - */ - @SuppressWarnings("unchecked") - public static void addJob(String jobName, String jobGroupName, - String triggerName, String triggerGroupName, Class jobClass, - String time) throws SchedulerException { - // QueueListener.sched=QueueListener.gSchedulerFactory.getScheduler(); - try { - JobDetail jobDetail = new JobDetail(jobName, jobGroupName, jobClass);// 任务名,任务组,任务执行类 - // 触发器 - CronTrigger trigger = new CronTrigger(triggerName, triggerGroupName);// 触发器名,触发器组 - trigger.setCronExpression(time);// 触发器时间设定 - QueueListener.sched.scheduleJob(jobDetail, trigger); - } catch (Exception e) { - throw new RuntimeException(e); - } - } - - /** - * @Description: 修改一个任务的触发时间(使用默认的任务组名,触发器名,触发器组名) - * - * @param jobName - * @param time - * - * @Title: QuartzManager.java - * - */ - @SuppressWarnings("unchecked") - public static String modifyJobTime(String jobName, String time) { - try { - Scheduler sched=QueueListener.gSchedulerFactory.getScheduler(); - - CronTrigger trigger = (CronTrigger) sched.getTrigger(jobName,QueueListener.TRIGGER_GROUP_NAME); - if (trigger == null) { - return "任务已经执行过或者不在队列中,请暂定运行后,重启再修改时间."; - } - String oldTime = trigger.getCronExpression(); - if (!oldTime.equalsIgnoreCase(time)) { - JobDetail jobDetail = sched.getJobDetail(jobName, QueueListener.JOB_GROUP_NAME); - Class objJobClass = jobDetail.getJobClass(); - removeJob(jobName); - addJob(jobName, objJobClass, time); - } - } catch (Exception e) { - throw new RuntimeException(e); - } - return ""; - } - - /** - * @Description: 修改一个任务的触发时间 - * - * @param triggerName - * @param triggerGroupName - * @param time - * - */ - public static void modifyJobTime(String triggerName, - String triggerGroupName, String time) { - try { - QueueListener.sched = QueueListener.gSchedulerFactory.getScheduler(); - CronTrigger trigger = (CronTrigger) QueueListener.sched.getTrigger(triggerName, - triggerGroupName); - if (trigger == null) { - return; - } - String oldTime = trigger.getCronExpression(); - if (!oldTime.equalsIgnoreCase(time)) { - CronTrigger ct = (CronTrigger) trigger; - // 修改时间 - ct.setCronExpression(time); - // 重启触发器 - QueueListener.sched.resumeTrigger(triggerName, triggerGroupName); - } - } catch (Exception e) { - throw new RuntimeException(e); - } - } - - /** - * @Description: 移除一个任务(使用默认的任务组名,触发器名,触发器组名) - * - * @param jobName - * - * @Title: QuartzManager.java - */ - public static void removeJob(String jobName) { - try { - QueueListener.sched = QueueListener.gSchedulerFactory.getScheduler(); - QueueListener.sched.pauseTrigger(jobName, QueueListener.TRIGGER_GROUP_NAME);// 停止触发器 - QueueListener.sched.unscheduleJob(jobName, QueueListener.TRIGGER_GROUP_NAME);// 移除触发器 - QueueListener.sched.deleteJob(jobName, QueueListener.TRIGGER_GROUP_NAME);// 删除任务 - } catch (Exception e) { - throw new RuntimeException(e); - } - } - - /** - * @Description: 移除一个任务 - * - * @param jobName - * @param jobGroupName - * @param triggerName - * @param triggerGroupName - * - * @Title: QuartzManager.java - */ - public static void removeJob(String jobName, String jobGroupName, - String triggerName, String triggerGroupName) { - try { - Scheduler sched = QueueListener.gSchedulerFactory.getScheduler(); - sched.pauseTrigger(triggerName, triggerGroupName);// 停止触发器 - sched.unscheduleJob(triggerName, triggerGroupName);// 移除触发器 - sched.deleteJob(jobName, jobGroupName);// 删除任务 - } catch (Exception e) { - throw new RuntimeException(e); - } - } - - /** - * @Description:启动所有定时任务 - * - * - * @Title: QuartzManager.java - */ - public static void startJobs() { - try { - Scheduler sched = QueueListener.gSchedulerFactory.getScheduler(); - sched.start(); - } catch (Exception e) { - throw new RuntimeException(e); - } - } - - /** - * @Description:关闭所有定时任务 - * - * - * @Title: QuartzManager.java - * @Copyright: Copyright (c) 2014 - * - * @author Comsys-LZP - * @date 2014-6-26 下午03:50:26 - * @version V2.0 - */ - public static void shutdownJobs() { - try { - Scheduler sched = QueueListener.gSchedulerFactory.getScheduler(); - if (!sched.isShutdown()) { - sched.shutdown(); - } - } catch (Exception e) { - throw new RuntimeException(e); - } - } - - -} +package luckyweb.seagull.quartz; + +import org.apache.log4j.Logger; +import org.quartz.CronTrigger; +import org.quartz.JobDetail; +import org.quartz.Scheduler; +import org.quartz.SchedulerException; + +import luckyweb.seagull.comm.QueueListener; + + +public class QuartzManager { + + //private static SchedulerFactory gSchedulerFactory = new StdSchedulerFactory(); + //private static String JOB_GROUP_NAME = "EXTJWEB_JOBGROUP_NAME"; + //private static String TRIGGER_GROUP_NAME = "EXTJWEB_TRIGGERGROUP_NAME"; + + private static final Logger log = Logger.getLogger(QuartzManager.class); + + + /** + * @Description: 添加一个定时任务,使用默认的任务组名,触发器名,触发器组名 + * + * @param jobName + * 任务名 + * @param cls + * 任务 + * @param time + * 时间设置,参考quartz说明文档 + * + */ + @SuppressWarnings("unchecked") + public static void addJob(String jobName, Class cls, String time) { + try { + JobDetail jobDetail = new JobDetail(jobName, QueueListener.JOB_GROUP_NAME, cls);// 任务名,任务组,任务执行类 + //System.out.println("jobDetail 's Name :"+jobDetail.getName()); + // 触发器 + CronTrigger trigger = new CronTrigger(jobDetail.getName(), QueueListener.TRIGGER_GROUP_NAME);// 触发器名,触发器组 + trigger.setCronExpression(time);// 触发器时间设定 + QueueListener.sched.scheduleJob(jobDetail, trigger); + // 启动 + if (!QueueListener.sched.isShutdown()) { + System.out.println("启动。。"+jobName +" ,时间:"+time); + QueueListener.sched.start(); + } + } catch (Exception e) { + throw new RuntimeException(e); + } + } + + /** + * @Description: 添加一个定时任务 + * + * @param jobName + * 任务名 + * @param jobGroupName + * 任务组名 + * @param triggerName + * 触发器名 + * @param triggerGroupName + * 触发器组名 + * @param jobClass + * 任务 + * @param time + * 时间设置,参考quartz说明文档 + * @throws SchedulerException + * + * @Title: QuartzManager.java + * + */ + @SuppressWarnings("unchecked") + public static void addJob(String jobName, String jobGroupName, + String triggerName, String triggerGroupName, Class jobClass, + String time) throws SchedulerException { + // QueueListener.sched=QueueListener.gSchedulerFactory.getScheduler(); + try { + JobDetail jobDetail = new JobDetail(jobName, jobGroupName, jobClass);// 任务名,任务组,任务执行类 + // 触发器 + CronTrigger trigger = new CronTrigger(triggerName, triggerGroupName);// 触发器名,触发器组 + trigger.setCronExpression(time);// 触发器时间设定 + QueueListener.sched.scheduleJob(jobDetail, trigger); + } catch (Exception e) { + throw new RuntimeException(e); + } + } + + /** + * @Description: 修改一个任务的触发时间(使用默认的任务组名,触发器名,触发器组名) + * + * @param jobName + * @param time + * + * @Title: QuartzManager.java + * + */ + @SuppressWarnings("unchecked") + public static String modifyJobTime(String jobName, String time) { + try { + Scheduler sched=QueueListener.gSchedulerFactory.getScheduler(); + + CronTrigger trigger = (CronTrigger) sched.getTrigger(jobName,QueueListener.TRIGGER_GROUP_NAME); + if (trigger == null) { + return "任务已经执行过或者不在队列中,请暂定运行后,重启再修改时间."; + } + String oldTime = trigger.getCronExpression(); + if (!oldTime.equalsIgnoreCase(time)) { + JobDetail jobDetail = sched.getJobDetail(jobName, QueueListener.JOB_GROUP_NAME); + Class objJobClass = jobDetail.getJobClass(); + removeJob(jobName); + addJob(jobName, objJobClass, time); + } + } catch (Exception e) { + throw new RuntimeException(e); + } + return ""; + } + + /** + * @Description: 修改一个任务的触发时间 + * + * @param triggerName + * @param triggerGroupName + * @param time + * + */ + public static void modifyJobTime(String triggerName, + String triggerGroupName, String time) { + try { + QueueListener.sched = QueueListener.gSchedulerFactory.getScheduler(); + CronTrigger trigger = (CronTrigger) QueueListener.sched.getTrigger(triggerName, + triggerGroupName); + if (trigger == null) { + return; + } + String oldTime = trigger.getCronExpression(); + if (!oldTime.equalsIgnoreCase(time)) { + CronTrigger ct = (CronTrigger) trigger; + // 修改时间 + ct.setCronExpression(time); + // 重启触发器 + QueueListener.sched.resumeTrigger(triggerName, triggerGroupName); + } + } catch (Exception e) { + throw new RuntimeException(e); + } + } + + /** + * @Description: 移除一个任务(使用默认的任务组名,触发器名,触发器组名) + * + * @param jobName + * + * @Title: QuartzManager.java + */ + public static void removeJob(String jobName) { + try { + QueueListener.sched = QueueListener.gSchedulerFactory.getScheduler(); + QueueListener.sched.pauseTrigger(jobName, QueueListener.TRIGGER_GROUP_NAME);// 停止触发器 + QueueListener.sched.unscheduleJob(jobName, QueueListener.TRIGGER_GROUP_NAME);// 移除触发器 + QueueListener.sched.deleteJob(jobName, QueueListener.TRIGGER_GROUP_NAME);// 删除任务 + } catch (Exception e) { + throw new RuntimeException(e); + } + } + + /** + * @Description: 移除一个任务 + * + * @param jobName + * @param jobGroupName + * @param triggerName + * @param triggerGroupName + * + * @Title: QuartzManager.java + */ + public static void removeJob(String jobName, String jobGroupName, + String triggerName, String triggerGroupName) { + try { + Scheduler sched = QueueListener.gSchedulerFactory.getScheduler(); + sched.pauseTrigger(triggerName, triggerGroupName);// 停止触发器 + sched.unscheduleJob(triggerName, triggerGroupName);// 移除触发器 + sched.deleteJob(jobName, jobGroupName);// 删除任务 + } catch (Exception e) { + throw new RuntimeException(e); + } + } + + /** + * @Description:启动所有定时任务 + * + * + * @Title: QuartzManager.java + */ + public static void startJobs() { + try { + Scheduler sched = QueueListener.gSchedulerFactory.getScheduler(); + sched.start(); + } catch (Exception e) { + throw new RuntimeException(e); + } + } + + /** + * @Description:关闭所有定时任务 + * + * + * @Title: QuartzManager.java + * @Copyright: Copyright (c) 2014 + * + * @author Comsys-LZP + * @date 2014-6-26 下午03:50:26 + * @version V2.0 + */ + public static void shutdownJobs() { + try { + Scheduler sched = QueueListener.gSchedulerFactory.getScheduler(); + if (!sched.isShutdown()) { + sched.shutdown(); + } + } catch (Exception e) { + throw new RuntimeException(e); + } + } + + +} diff --git a/src/main/java/luckyweb/seagull/quartz/QuratzJobDataMgr.java b/src/main/java/luckyweb/seagull/quartz/QuratzJobDataMgr.java index e3cd2e5..546bce6 100644 --- a/src/main/java/luckyweb/seagull/quartz/QuratzJobDataMgr.java +++ b/src/main/java/luckyweb/seagull/quartz/QuratzJobDataMgr.java @@ -1,44 +1,44 @@ -package luckyweb.seagull.quartz; - -import org.apache.log4j.Logger; - -import luckyweb.seagull.spring.entity.TestClient; -import luckyweb.seagull.spring.entity.TestJobs; - -public class QuratzJobDataMgr -{ - private static final Logger logger = Logger.getLogger(QuratzJobDataMgr.class); - - public void addJobRunTime(TestJobs tj, int id) throws Exception - { - // 比较任务的开始时间和当前时间。如果是返回1,说明任务的开始时间是还没有过,如果返回2 说明任务的开时间应过去 - try - { - String startTime = tj.getStartTimestr(); - // String startTime=setStartTime(tj); - QuartzManager.addJob(id + "*JOB", QuartzJob.class, startTime); - } - catch (Exception e) - { - logger.error(e); - throw e; - } - } - - public void addTestClient(TestClient tc, int id) throws Exception - { - // 比较任务的开始时间和当前时间。如果是返回1,说明任务的开始时间是还没有过,如果返回2 说明任务的开时间应过去 - try - { - int checkTime = tc.getCheckinterval(); - String startTime="0/"+checkTime+" * * * * ?"; - QuartzManager.addJob(id + "*CLIENT", QuartzJob.class, startTime); - } - catch (Exception e) - { - logger.error(e); - throw e; - } - } - -} +package luckyweb.seagull.quartz; + +import org.apache.log4j.Logger; + +import luckyweb.seagull.spring.entity.TestClient; +import luckyweb.seagull.spring.entity.TestJobs; + +public class QuratzJobDataMgr +{ + private static final Logger logger = Logger.getLogger(QuratzJobDataMgr.class); + + public void addJobRunTime(TestJobs tj, int id) throws Exception + { + // 比较任务的开始时间和当前时间。如果是返回1,说明任务的开始时间是还没有过,如果返回2 说明任务的开时间应过去 + try + { + String startTime = tj.getStartTimestr(); + // String startTime=setStartTime(tj); + QuartzManager.addJob(id + "*JOB", QuartzJob.class, startTime); + } + catch (Exception e) + { + logger.error(e); + throw e; + } + } + + public void addTestClient(TestClient tc, int id) throws Exception + { + // 比较任务的开始时间和当前时间。如果是返回1,说明任务的开始时间是还没有过,如果返回2 说明任务的开时间应过去 + try + { + int checkTime = tc.getCheckinterval(); + String startTime="0/"+checkTime+" * * * * ?"; + QuartzManager.addJob(id + "*CLIENT", QuartzJob.class, startTime); + } + catch (Exception e) + { + logger.error(e); + throw e; + } + } + +} diff --git a/src/main/java/luckyweb/seagull/spring/dao/AccidentDao.java b/src/main/java/luckyweb/seagull/spring/dao/AccidentDao.java index a2bf399..733c33f 100644 --- a/src/main/java/luckyweb/seagull/spring/dao/AccidentDao.java +++ b/src/main/java/luckyweb/seagull/spring/dao/AccidentDao.java @@ -1,48 +1,48 @@ -package luckyweb.seagull.spring.dao; - -import java.util.List; - -import org.springframework.transaction.annotation.Propagation; -import org.springframework.transaction.annotation.Transactional; - -import luckyweb.seagull.spring.entity.Accident; - - -@Transactional -public interface AccidentDao { - public int add(Accident accident) throws Exception; - - public void modify(Accident accident) throws Exception; - - public void modifyState(Accident accident) throws Exception; - - public void modifyInfo(Accident accident) throws Exception; - - public void delete(int id) throws Exception; - - @Transactional(propagation = Propagation.NOT_SUPPORTED) - public List list(Accident accident) throws Exception; - - @Transactional(propagation = Propagation.NOT_SUPPORTED) - public List list(String hql) throws Exception; - - @Transactional(propagation = Propagation.NOT_SUPPORTED) - public List listavgpro(String sql) throws Exception; - - public Accident load(int id) throws Exception; - - public List load(String name, String cmdType, String planPath) - throws Exception; - - public Accident get(int id) throws Exception; - -// public List findByPage(final String hql, final int offset,final int pageSize); -// -// public List findByPage(final String hql, final Object[] values,final int offset, final int pageSize); - - public List findByPage(final String hql, final Object value,final int offset, final int pageSize); - - public int findRows(Accident accident,String hql); - - public List findJobsList(); -} +package luckyweb.seagull.spring.dao; + +import java.util.List; + +import org.springframework.transaction.annotation.Propagation; +import org.springframework.transaction.annotation.Transactional; + +import luckyweb.seagull.spring.entity.Accident; + + +@Transactional +public interface AccidentDao { + public int add(Accident accident) throws Exception; + + public void modify(Accident accident) throws Exception; + + public void modifyState(Accident accident) throws Exception; + + public void modifyInfo(Accident accident) throws Exception; + + public void delete(int id) throws Exception; + + @Transactional(propagation = Propagation.NOT_SUPPORTED) + public List list(Accident accident) throws Exception; + + @Transactional(propagation = Propagation.NOT_SUPPORTED) + public List list(String hql) throws Exception; + + @Transactional(propagation = Propagation.NOT_SUPPORTED) + public List listavgpro(String sql) throws Exception; + + public Accident load(int id) throws Exception; + + public List load(String name, String cmdType, String planPath) + throws Exception; + + public Accident get(int id) throws Exception; + +// public List findByPage(final String hql, final int offset,final int pageSize); +// +// public List findByPage(final String hql, final Object[] values,final int offset, final int pageSize); + + public List findByPage(final String hql, final Object value,final int offset, final int pageSize); + + public int findRows(Accident accident,String hql); + + public List findJobsList(); +} diff --git a/src/main/java/luckyweb/seagull/spring/dao/AccidentDaoImpl.java b/src/main/java/luckyweb/seagull/spring/dao/AccidentDaoImpl.java index 488679e..2c8bea7 100644 --- a/src/main/java/luckyweb/seagull/spring/dao/AccidentDaoImpl.java +++ b/src/main/java/luckyweb/seagull/spring/dao/AccidentDaoImpl.java @@ -1,204 +1,204 @@ -package luckyweb.seagull.spring.dao; - -import java.util.List; - -import javax.annotation.Resource; - -import org.hibernate.HibernateException; -import org.hibernate.Query; -import org.hibernate.Session; -import org.hibernate.SessionFactory; -import org.springframework.orm.hibernate3.HibernateCallback; -import org.springframework.orm.hibernate3.support.HibernateDaoSupport; -import org.springframework.stereotype.Repository; - -import luckyweb.seagull.spring.entity.Accident; - -@Repository("accidentDao") -public class AccidentDaoImpl extends HibernateDaoSupport implements AccidentDao{ - - @Resource(name = "sessionFactory") - public void setSuperSessionFactory(SessionFactory sessionFactory) { - super.setSessionFactory(sessionFactory); - } - - - - @Override - public void delete(int id) throws Exception { - try{ - Accident accident = this.load(id); - this.getHibernateTemplate().delete(accident); - }catch(Exception e){ - e.printStackTrace(); - } - - } - - private void whereParameter(Accident accident, Query query) { - - if (accident.getProjectid()!=0) { - query.setParameter("projectid", accident.getProjectid()); - } - if (accident.getAccstatus()!=null&&!accident.getAccstatus().equals("")&&!accident.getAccstatus().equals("00")) { - query.setParameter("accstatus", accident.getAccstatus()); - } - if (accident.getAccstarttime()!=null&&!"".equals(accident.getAccstarttime())) { - query.setParameter("accstarttime", accident.getAccstarttime()); - } - if (accident.getAccendtime()!=null&&!"".equals(accident.getAccendtime())) { - query.setParameter("accendtime", accident.getAccendtime()); - } - if (null!=accident.getAccdescription()&&!"".equals(accident.getAccdescription())) { - query.setParameter("accdescription", "%"+accident.getAccdescription()+"%"); - } - if (null!=accident.getCausaltype()&&!"".equals(accident.getCausaltype())) { - query.setParameter("causaltype", "%"+accident.getCausaltype()+"%"); - } - } - - @Override - public List findByPage(final String hql, final Object value, final int offset, final int pageSize) { - // TODO Auto-generated method stub - // 通过一个HibernateCallback 对象来执行查询 - //System.out.println(hql); - List list = getHibernateTemplate().executeFind(new HibernateCallback() { - // 实现hibernateCallback接口必须实现的方法 - - public Object doInHibernate(Session session) - throws HibernateException { - // 执行hibernate 分页查询 - Query query= session.createQuery(hql); - whereParameter((Accident)value, query); - List result =query - .setFirstResult(offset).setMaxResults(pageSize).list(); - session.close(); - return result; - } - - }); - return list; - } - - @Override - public int findRows(Accident accident, String hql) { - int s=0; - Session session=this.getSession(true); - try { - Query query=session.createQuery(hql); - whereParameter(accident, query); - s= Integer.valueOf( - query - .list().get(0) - .toString()); - } catch (Exception e) { - e.printStackTrace(); - }finally{ - session.close(); - } - return s; - } - - - - @Override - public int add(Accident accident) throws Exception { - this.getHibernateTemplate().save(accident); - return accident.getId(); - } - - - - @Override - public void modify(Accident accident) throws Exception { - this.getHibernateTemplate().update(accident); - - } - - - - @Override - public void modifyState(Accident accident) throws Exception { - // TODO Auto-generated method stub - - } - - - - @Override - public void modifyInfo(Accident accident) throws Exception { - // TODO Auto-generated method stub - - } - - - - @Override - public List list(Accident accident) - throws Exception { - // TODO Auto-generated method stub - return null; - } - - - - @SuppressWarnings("unchecked") - @Override - public List list(String hql) throws Exception { - return this.getHibernateTemplate().find(hql); - } - - - - @Override - public Accident load(int id) throws Exception { - - return (Accident) this.getHibernateTemplate().get(Accident.class, id); - //return (Accident) this.getSession().load(Accident.class, id); - } - - - - @Override - public List load(String name, String cmdType, - String planPath) throws Exception { - // TODO Auto-generated method stub - return null; - } - - - - @Override - public Accident get(int id) throws Exception { - // TODO Auto-generated method stub - return null; - } - - - - @Override - public List findJobsList() { - // TODO Auto-generated method stub - return null; - } - - - - @SuppressWarnings("rawtypes") - @Override - public List listavgpro(String sql) throws Exception { - // TODO Auto-generated method stub - List count=null; - Session session=this.getSession(true); - try { - count = session.createSQLQuery(sql).list(); - } catch (Exception e) { - e.printStackTrace(); - }finally{ - session.close(); - } - return count; - } - - -} +package luckyweb.seagull.spring.dao; + +import java.util.List; + +import javax.annotation.Resource; + +import org.hibernate.HibernateException; +import org.hibernate.Query; +import org.hibernate.Session; +import org.hibernate.SessionFactory; +import org.springframework.orm.hibernate3.HibernateCallback; +import org.springframework.orm.hibernate3.support.HibernateDaoSupport; +import org.springframework.stereotype.Repository; + +import luckyweb.seagull.spring.entity.Accident; + +@Repository("accidentDao") +public class AccidentDaoImpl extends HibernateDaoSupport implements AccidentDao{ + + @Resource(name = "sessionFactory") + public void setSuperSessionFactory(SessionFactory sessionFactory) { + super.setSessionFactory(sessionFactory); + } + + + + @Override + public void delete(int id) throws Exception { + try{ + Accident accident = this.load(id); + this.getHibernateTemplate().delete(accident); + }catch(Exception e){ + e.printStackTrace(); + } + + } + + private void whereParameter(Accident accident, Query query) { + + if (accident.getProjectid()!=0) { + query.setParameter("projectid", accident.getProjectid()); + } + if (accident.getAccstatus()!=null&&!accident.getAccstatus().equals("")&&!accident.getAccstatus().equals("00")) { + query.setParameter("accstatus", accident.getAccstatus()); + } + if (accident.getAccstarttime()!=null&&!"".equals(accident.getAccstarttime())) { + query.setParameter("accstarttime", accident.getAccstarttime()); + } + if (accident.getAccendtime()!=null&&!"".equals(accident.getAccendtime())) { + query.setParameter("accendtime", accident.getAccendtime()); + } + if (null!=accident.getAccdescription()&&!"".equals(accident.getAccdescription())) { + query.setParameter("accdescription", "%"+accident.getAccdescription()+"%"); + } + if (null!=accident.getCausaltype()&&!"".equals(accident.getCausaltype())) { + query.setParameter("causaltype", "%"+accident.getCausaltype()+"%"); + } + } + + @Override + public List findByPage(final String hql, final Object value, final int offset, final int pageSize) { + // TODO Auto-generated method stub + // 通过一个HibernateCallback 对象来执行查询 + //System.out.println(hql); + List list = getHibernateTemplate().executeFind(new HibernateCallback() { + // 实现hibernateCallback接口必须实现的方法 + + public Object doInHibernate(Session session) + throws HibernateException { + // 执行hibernate 分页查询 + Query query= session.createQuery(hql); + whereParameter((Accident)value, query); + List result =query + .setFirstResult(offset).setMaxResults(pageSize).list(); + session.close(); + return result; + } + + }); + return list; + } + + @Override + public int findRows(Accident accident, String hql) { + int s=0; + Session session=this.getSession(true); + try { + Query query=session.createQuery(hql); + whereParameter(accident, query); + s= Integer.valueOf( + query + .list().get(0) + .toString()); + } catch (Exception e) { + e.printStackTrace(); + }finally{ + session.close(); + } + return s; + } + + + + @Override + public int add(Accident accident) throws Exception { + this.getHibernateTemplate().save(accident); + return accident.getId(); + } + + + + @Override + public void modify(Accident accident) throws Exception { + this.getHibernateTemplate().update(accident); + + } + + + + @Override + public void modifyState(Accident accident) throws Exception { + // TODO Auto-generated method stub + + } + + + + @Override + public void modifyInfo(Accident accident) throws Exception { + // TODO Auto-generated method stub + + } + + + + @Override + public List list(Accident accident) + throws Exception { + // TODO Auto-generated method stub + return null; + } + + + + @SuppressWarnings("unchecked") + @Override + public List list(String hql) throws Exception { + return this.getHibernateTemplate().find(hql); + } + + + + @Override + public Accident load(int id) throws Exception { + + return (Accident) this.getHibernateTemplate().get(Accident.class, id); + //return (Accident) this.getSession().load(Accident.class, id); + } + + + + @Override + public List load(String name, String cmdType, + String planPath) throws Exception { + // TODO Auto-generated method stub + return null; + } + + + + @Override + public Accident get(int id) throws Exception { + // TODO Auto-generated method stub + return null; + } + + + + @Override + public List findJobsList() { + // TODO Auto-generated method stub + return null; + } + + + + @SuppressWarnings("rawtypes") + @Override + public List listavgpro(String sql) throws Exception { + // TODO Auto-generated method stub + List count=null; + Session session=this.getSession(true); + try { + count = session.createSQLQuery(sql).list(); + } catch (Exception e) { + e.printStackTrace(); + }finally{ + session.close(); + } + return count; + } + + +} diff --git a/src/main/java/luckyweb/seagull/spring/dao/FlowCheckDao.java b/src/main/java/luckyweb/seagull/spring/dao/FlowCheckDao.java index 8735549..816a6f3 100644 --- a/src/main/java/luckyweb/seagull/spring/dao/FlowCheckDao.java +++ b/src/main/java/luckyweb/seagull/spring/dao/FlowCheckDao.java @@ -1,53 +1,53 @@ -package luckyweb.seagull.spring.dao; - -import java.util.List; - -import org.springframework.transaction.annotation.Propagation; -import org.springframework.transaction.annotation.Transactional; - -import luckyweb.seagull.spring.entity.FlowCheck; - -@Transactional -public interface FlowCheckDao { - public int add(FlowCheck flowcheck) throws Exception; - - public void modify(FlowCheck flowcheck) throws Exception; - - public void modifyState(FlowCheck flowcheck) throws Exception; - - public void modifyVersion(String sql) throws Exception; - - public void delete(int id) throws Exception; - - @Transactional(propagation = Propagation.NOT_SUPPORTED) - public List list(FlowCheck flowcheck) throws Exception; - - @Transactional(propagation = Propagation.NOT_SUPPORTED) - public List list(String hql) throws Exception; - - @Transactional(propagation = Propagation.NOT_SUPPORTED) - public List listcheckinfo(String sql) throws Exception; - - public FlowCheck load(int id) throws Exception; - - public List load(String name, String cmdType, String planPath) - throws Exception; - - public String get(String sql) throws Exception; - -// public List findByPage(final String hql, final int offset,final int pageSize); -// -// public List findByPage(final String hql, final Object[] values,final int offset, final int pageSize); - - public List findByPage(final String hql, final Object value,final int offset, final int pageSize); - - public int findRows(FlowCheck flowcheck,String hql); - - public List findByPageTable(final String hql, final Object value,final int offset, final int pageSize); - - public int findRowsTable(FlowCheck flowcheck,String hql); - - /*public List findRows(String sql);*/ - - public List findJobsList(); -} +package luckyweb.seagull.spring.dao; + +import java.util.List; + +import org.springframework.transaction.annotation.Propagation; +import org.springframework.transaction.annotation.Transactional; + +import luckyweb.seagull.spring.entity.FlowCheck; + +@Transactional +public interface FlowCheckDao { + public int add(FlowCheck flowcheck) throws Exception; + + public void modify(FlowCheck flowcheck) throws Exception; + + public void modifyState(FlowCheck flowcheck) throws Exception; + + public void modifyVersion(String sql) throws Exception; + + public void delete(int id) throws Exception; + + @Transactional(propagation = Propagation.NOT_SUPPORTED) + public List list(FlowCheck flowcheck) throws Exception; + + @Transactional(propagation = Propagation.NOT_SUPPORTED) + public List list(String hql) throws Exception; + + @Transactional(propagation = Propagation.NOT_SUPPORTED) + public List listcheckinfo(String sql) throws Exception; + + public FlowCheck load(int id) throws Exception; + + public List load(String name, String cmdType, String planPath) + throws Exception; + + public String get(String sql) throws Exception; + +// public List findByPage(final String hql, final int offset,final int pageSize); +// +// public List findByPage(final String hql, final Object[] values,final int offset, final int pageSize); + + public List findByPage(final String hql, final Object value,final int offset, final int pageSize); + + public int findRows(FlowCheck flowcheck,String hql); + + public List findByPageTable(final String hql, final Object value,final int offset, final int pageSize); + + public int findRowsTable(FlowCheck flowcheck,String hql); + + /*public List findRows(String sql);*/ + + public List findJobsList(); +} diff --git a/src/main/java/luckyweb/seagull/spring/dao/FlowCheckDaoImpl.java b/src/main/java/luckyweb/seagull/spring/dao/FlowCheckDaoImpl.java index 20a87cb..333836d 100644 --- a/src/main/java/luckyweb/seagull/spring/dao/FlowCheckDaoImpl.java +++ b/src/main/java/luckyweb/seagull/spring/dao/FlowCheckDaoImpl.java @@ -1,264 +1,264 @@ -package luckyweb.seagull.spring.dao; - -import java.util.List; - -import javax.annotation.Resource; - -import org.hibernate.HibernateException; -import org.hibernate.Query; -import org.hibernate.Session; -import org.hibernate.SessionFactory; -import org.springframework.orm.hibernate3.HibernateCallback; -import org.springframework.orm.hibernate3.support.HibernateDaoSupport; -import org.springframework.stereotype.Repository; - -import luckyweb.seagull.spring.entity.Accident; -import luckyweb.seagull.spring.entity.FlowCheck; -import luckyweb.seagull.spring.entity.FlowInfo; - -@Repository("flowcheckDao") -public class FlowCheckDaoImpl extends HibernateDaoSupport implements FlowCheckDao{ - - @Resource(name = "sessionFactory") - public void setSuperSessionFactory(SessionFactory sessionFactory) { - super.setSessionFactory(sessionFactory); - } - - - - @Override - public void delete(int id) throws Exception { - FlowCheck flowcheck = this.load(id); - this.getHibernateTemplate().delete(flowcheck); - - } - - private void whereParameter(FlowCheck flowcheck, Query query) { - if (flowcheck.getId()!=0) { - query.setParameter("id", flowcheck.getId()); - } - if (flowcheck.getProjectid()!=0) { - query.setParameter("projectid", flowcheck.getProjectid()); - } - if (flowcheck.getCheckid()!=0) { - query.setParameter("checkid", flowcheck.getCheckid()); - } - if (flowcheck.getVersionnum()!=null&&!flowcheck.getVersionnum().equals("")) { - query.setParameter("versionnum", flowcheck.getVersionnum()); - } - if (flowcheck.getCheckenddate()!=null&&flowcheck.getCheckstartdate()!=null&& - !flowcheck.getCheckenddate().equals("")&&!flowcheck.getCheckstartdate().equals("")) { - query.setParameter("checkstartdate", flowcheck.getCheckstartdate()); - query.setParameter("checkenddate", flowcheck.getCheckenddate()); - } - } - - private void whereParameter(FlowInfo flowinfo, Query query) { - if (flowinfo.getId()!=0&&flowinfo.getId()!=99) { - query.setParameter("projectid", flowinfo.getId()); - } - } - - @Override - public List findByPage(final String hql, final Object value, final int offset, final int pageSize) { - // TODO Auto-generated method stub - // 通过一个HibernateCallback 对象来执行查询 - //System.out.println(hql); - List list = getHibernateTemplate().executeFind(new HibernateCallback() { - // 实现hibernateCallback接口必须实现的方法 - - public Object doInHibernate(Session session) - throws HibernateException { - // 执行hibernate 分页查询 - //Query query= session.createQuery(hql); - Query query= session.createSQLQuery(hql); - whereParameter((FlowCheck)value, query); - List result =query - .setFirstResult(offset).setMaxResults(pageSize).list(); - session.close(); - return result; - } - - }); - return list; - } - - @Override - public List findByPageTable(final String hql, final Object value, final int offset, final int pageSize) { - // TODO Auto-generated method stub - // 通过一个HibernateCallback 对象来执行查询 - //System.out.println(hql); - List list = getHibernateTemplate().executeFind(new HibernateCallback() { - // 实现hibernateCallback接口必须实现的方法 - - public Object doInHibernate(Session session) - throws HibernateException { - // 执行hibernate 分页查询 - Query query= session.createQuery(hql); - whereParameter((FlowCheck)value, query); - List result =query - .setFirstResult(offset).setMaxResults(pageSize).list(); - session.close(); - return result; - } - - }); - return list; - } - - - @Override - public int findRows(FlowCheck flowcheck, String hql) { - int s=0; - Session session=this.getSession(true); - try { - /*Query query=session.createQuery(hql);*/ - Query query= session.createSQLQuery(hql); - whereParameter(flowcheck, query); - s= Integer.valueOf( - query.list().size()); - } catch (Exception e) { - e.printStackTrace(); - }finally{ - session.close(); - } - return s; - } - - - @Override - public int findRowsTable(FlowCheck flowcheck, String hql) { - int s=0; - Session session=this.getSession(true); - try { - Query query=session.createQuery(hql); - whereParameter(flowcheck, query); - s= Integer.valueOf( - query.list().get(0) - .toString()); - } catch (Exception e) { - e.printStackTrace(); - }finally{ - session.close(); - } - return s; - } - - - @Override - public int add(FlowCheck flowcheck) throws Exception { - this.getHibernateTemplate().save(flowcheck); - return flowcheck.getCheckid(); - } - - - - @Override - public void modify(FlowCheck flowcheck) throws Exception { - this.getHibernateTemplate().update(flowcheck); - - } - - - - @Override - public void modifyState(FlowCheck flowcheck) throws Exception { - // TODO Auto-generated method stub - - } - - - - @Override - public void modifyVersion(String sql) throws Exception { - // TODO Auto-generated method stub - Session session=this.getSession(true); - try { - session.beginTransaction(); - Query query =session .createQuery(sql); - query.executeUpdate(); - - session.getTransaction().commit(); - } catch (Exception e) { - e.printStackTrace(); - }finally - { - session.close(); - } - } - - - - @Override - public List list(FlowCheck flowcheck) - throws Exception { - // TODO Auto-generated method stub - return null; - } - - - - @SuppressWarnings("unchecked") - @Override - public List list(String hql) throws Exception { - return this.getHibernateTemplate().find(hql); - } - - - - @Override - public FlowCheck load(int id) throws Exception { - return (FlowCheck) this.getHibernateTemplate().get(FlowCheck.class, id); - //return (FlowCheck) this.getSession().load(FlowCheck.class, id); - } - - - - @Override - public List load(String name, String cmdType, - String planPath) throws Exception { - // TODO Auto-generated method stub - return null; - } - - - - @Override - public String get(String sql) throws Exception { - String result = ""; - Session session = this.getSession(true); - @SuppressWarnings("unchecked") - List count = session.createSQLQuery(sql).list(); - if(count.size()!=0&&count.get(0)!=null){ - result = count.get(0).toString(); - } - session.close(); - return result; - } - - - @Override - public List findJobsList() { - // TODO Auto-generated method stub - return null; - } - - - - @Override - public List listcheckinfo(String sql) throws Exception { - // TODO Auto-generated method stub - List count=null; - Session session=this.getSession(true); - try { - count = session.createSQLQuery(sql).list(); - } catch (Exception e) { - e.printStackTrace(); - }finally{ - session.close(); - } - return count; - } - - -} +package luckyweb.seagull.spring.dao; + +import java.util.List; + +import javax.annotation.Resource; + +import org.hibernate.HibernateException; +import org.hibernate.Query; +import org.hibernate.Session; +import org.hibernate.SessionFactory; +import org.springframework.orm.hibernate3.HibernateCallback; +import org.springframework.orm.hibernate3.support.HibernateDaoSupport; +import org.springframework.stereotype.Repository; + +import luckyweb.seagull.spring.entity.Accident; +import luckyweb.seagull.spring.entity.FlowCheck; +import luckyweb.seagull.spring.entity.FlowInfo; + +@Repository("flowcheckDao") +public class FlowCheckDaoImpl extends HibernateDaoSupport implements FlowCheckDao{ + + @Resource(name = "sessionFactory") + public void setSuperSessionFactory(SessionFactory sessionFactory) { + super.setSessionFactory(sessionFactory); + } + + + + @Override + public void delete(int id) throws Exception { + FlowCheck flowcheck = this.load(id); + this.getHibernateTemplate().delete(flowcheck); + + } + + private void whereParameter(FlowCheck flowcheck, Query query) { + if (flowcheck.getId()!=0) { + query.setParameter("id", flowcheck.getId()); + } + if (flowcheck.getProjectid()!=0) { + query.setParameter("projectid", flowcheck.getProjectid()); + } + if (flowcheck.getCheckid()!=0) { + query.setParameter("checkid", flowcheck.getCheckid()); + } + if (flowcheck.getVersionnum()!=null&&!flowcheck.getVersionnum().equals("")) { + query.setParameter("versionnum", flowcheck.getVersionnum()); + } + if (flowcheck.getCheckenddate()!=null&&flowcheck.getCheckstartdate()!=null&& + !flowcheck.getCheckenddate().equals("")&&!flowcheck.getCheckstartdate().equals("")) { + query.setParameter("checkstartdate", flowcheck.getCheckstartdate()); + query.setParameter("checkenddate", flowcheck.getCheckenddate()); + } + } + + private void whereParameter(FlowInfo flowinfo, Query query) { + if (flowinfo.getId()!=0&&flowinfo.getId()!=99) { + query.setParameter("projectid", flowinfo.getId()); + } + } + + @Override + public List findByPage(final String hql, final Object value, final int offset, final int pageSize) { + // TODO Auto-generated method stub + // 通过一个HibernateCallback 对象来执行查询 + //System.out.println(hql); + List list = getHibernateTemplate().executeFind(new HibernateCallback() { + // 实现hibernateCallback接口必须实现的方法 + + public Object doInHibernate(Session session) + throws HibernateException { + // 执行hibernate 分页查询 + //Query query= session.createQuery(hql); + Query query= session.createSQLQuery(hql); + whereParameter((FlowCheck)value, query); + List result =query + .setFirstResult(offset).setMaxResults(pageSize).list(); + session.close(); + return result; + } + + }); + return list; + } + + @Override + public List findByPageTable(final String hql, final Object value, final int offset, final int pageSize) { + // TODO Auto-generated method stub + // 通过一个HibernateCallback 对象来执行查询 + //System.out.println(hql); + List list = getHibernateTemplate().executeFind(new HibernateCallback() { + // 实现hibernateCallback接口必须实现的方法 + + public Object doInHibernate(Session session) + throws HibernateException { + // 执行hibernate 分页查询 + Query query= session.createQuery(hql); + whereParameter((FlowCheck)value, query); + List result =query + .setFirstResult(offset).setMaxResults(pageSize).list(); + session.close(); + return result; + } + + }); + return list; + } + + + @Override + public int findRows(FlowCheck flowcheck, String hql) { + int s=0; + Session session=this.getSession(true); + try { + /*Query query=session.createQuery(hql);*/ + Query query= session.createSQLQuery(hql); + whereParameter(flowcheck, query); + s= Integer.valueOf( + query.list().size()); + } catch (Exception e) { + e.printStackTrace(); + }finally{ + session.close(); + } + return s; + } + + + @Override + public int findRowsTable(FlowCheck flowcheck, String hql) { + int s=0; + Session session=this.getSession(true); + try { + Query query=session.createQuery(hql); + whereParameter(flowcheck, query); + s= Integer.valueOf( + query.list().get(0) + .toString()); + } catch (Exception e) { + e.printStackTrace(); + }finally{ + session.close(); + } + return s; + } + + + @Override + public int add(FlowCheck flowcheck) throws Exception { + this.getHibernateTemplate().save(flowcheck); + return flowcheck.getCheckid(); + } + + + + @Override + public void modify(FlowCheck flowcheck) throws Exception { + this.getHibernateTemplate().update(flowcheck); + + } + + + + @Override + public void modifyState(FlowCheck flowcheck) throws Exception { + // TODO Auto-generated method stub + + } + + + + @Override + public void modifyVersion(String sql) throws Exception { + // TODO Auto-generated method stub + Session session=this.getSession(true); + try { + session.beginTransaction(); + Query query =session .createQuery(sql); + query.executeUpdate(); + + session.getTransaction().commit(); + } catch (Exception e) { + e.printStackTrace(); + }finally + { + session.close(); + } + } + + + + @Override + public List list(FlowCheck flowcheck) + throws Exception { + // TODO Auto-generated method stub + return null; + } + + + + @SuppressWarnings("unchecked") + @Override + public List list(String hql) throws Exception { + return this.getHibernateTemplate().find(hql); + } + + + + @Override + public FlowCheck load(int id) throws Exception { + return (FlowCheck) this.getHibernateTemplate().get(FlowCheck.class, id); + //return (FlowCheck) this.getSession().load(FlowCheck.class, id); + } + + + + @Override + public List load(String name, String cmdType, + String planPath) throws Exception { + // TODO Auto-generated method stub + return null; + } + + + + @Override + public String get(String sql) throws Exception { + String result = ""; + Session session = this.getSession(true); + @SuppressWarnings("unchecked") + List count = session.createSQLQuery(sql).list(); + if(count.size()!=0&&count.get(0)!=null){ + result = count.get(0).toString(); + } + session.close(); + return result; + } + + + @Override + public List findJobsList() { + // TODO Auto-generated method stub + return null; + } + + + + @Override + public List listcheckinfo(String sql) throws Exception { + // TODO Auto-generated method stub + List count=null; + Session session=this.getSession(true); + try { + count = session.createSQLQuery(sql).list(); + } catch (Exception e) { + e.printStackTrace(); + }finally{ + session.close(); + } + return count; + } + + +} diff --git a/src/main/java/luckyweb/seagull/spring/dao/FlowInfoDao.java b/src/main/java/luckyweb/seagull/spring/dao/FlowInfoDao.java index 06ab0eb..c6f58f7 100644 --- a/src/main/java/luckyweb/seagull/spring/dao/FlowInfoDao.java +++ b/src/main/java/luckyweb/seagull/spring/dao/FlowInfoDao.java @@ -1,25 +1,25 @@ -package luckyweb.seagull.spring.dao; - -import java.util.List; - -import org.springframework.transaction.annotation.Propagation; -import org.springframework.transaction.annotation.Transactional; - -import luckyweb.seagull.spring.entity.FlowInfo; - -@Transactional -public interface FlowInfoDao { - - @Transactional(propagation = Propagation.NOT_SUPPORTED) - public List list(FlowInfo flowinfo) throws Exception; - - @Transactional(propagation = Propagation.NOT_SUPPORTED) - public List list(String hql) throws Exception; - - @Transactional(propagation = Propagation.NOT_SUPPORTED) - public List listcheckinfo(String sql) throws Exception; - - public FlowInfo load(int id) throws Exception; - - public FlowInfo get(int id) throws Exception; -} +package luckyweb.seagull.spring.dao; + +import java.util.List; + +import org.springframework.transaction.annotation.Propagation; +import org.springframework.transaction.annotation.Transactional; + +import luckyweb.seagull.spring.entity.FlowInfo; + +@Transactional +public interface FlowInfoDao { + + @Transactional(propagation = Propagation.NOT_SUPPORTED) + public List list(FlowInfo flowinfo) throws Exception; + + @Transactional(propagation = Propagation.NOT_SUPPORTED) + public List list(String hql) throws Exception; + + @Transactional(propagation = Propagation.NOT_SUPPORTED) + public List listcheckinfo(String sql) throws Exception; + + public FlowInfo load(int id) throws Exception; + + public FlowInfo get(int id) throws Exception; +} diff --git a/src/main/java/luckyweb/seagull/spring/dao/FlowInfoDaoImpl.java b/src/main/java/luckyweb/seagull/spring/dao/FlowInfoDaoImpl.java index d157306..0198552 100644 --- a/src/main/java/luckyweb/seagull/spring/dao/FlowInfoDaoImpl.java +++ b/src/main/java/luckyweb/seagull/spring/dao/FlowInfoDaoImpl.java @@ -1,75 +1,75 @@ -package luckyweb.seagull.spring.dao; - -import java.util.List; - -import javax.annotation.Resource; - -import org.hibernate.HibernateException; -import org.hibernate.Query; -import org.hibernate.Session; -import org.hibernate.SessionFactory; -import org.springframework.orm.hibernate3.HibernateCallback; -import org.springframework.orm.hibernate3.support.HibernateDaoSupport; -import org.springframework.stereotype.Repository; - -import luckyweb.seagull.spring.entity.Accident; -import luckyweb.seagull.spring.entity.FlowCheck; -import luckyweb.seagull.spring.entity.FlowInfo; - -@Repository("flowinfoDao") -public class FlowInfoDaoImpl extends HibernateDaoSupport implements FlowInfoDao{ - - @Resource(name = "sessionFactory") - public void setSuperSessionFactory(SessionFactory sessionFactory) { - super.setSessionFactory(sessionFactory); - } - - - @Override - public List list(FlowInfo flowinfo) - throws Exception { - // TODO Auto-generated method stub - return null; - } - - - - @SuppressWarnings("unchecked") - @Override - public List list(String hql) throws Exception { - return this.getHibernateTemplate().find(hql); - } - - - - @Override - public FlowInfo load(int id) throws Exception { - return (FlowInfo) this.getSession().load(FlowInfo.class, id); - } - - @Override - public FlowInfo get(int id) throws Exception { - // TODO Auto-generated method stub - return (FlowInfo) this.getHibernateTemplate().get(FlowInfo.class, id); - } - - - @Override - public List listcheckinfo(String sql) throws Exception { - // TODO Auto-generated method stub -// List list=new ArrayList(); - List count=null; - Session session=this.getSession(true); - try { - count = session.createSQLQuery(sql).list(); - - } catch (Exception e) { - e.printStackTrace(); - }finally{ - session.close(); - } - return count; - } - - -} +package luckyweb.seagull.spring.dao; + +import java.util.List; + +import javax.annotation.Resource; + +import org.hibernate.HibernateException; +import org.hibernate.Query; +import org.hibernate.Session; +import org.hibernate.SessionFactory; +import org.springframework.orm.hibernate3.HibernateCallback; +import org.springframework.orm.hibernate3.support.HibernateDaoSupport; +import org.springframework.stereotype.Repository; + +import luckyweb.seagull.spring.entity.Accident; +import luckyweb.seagull.spring.entity.FlowCheck; +import luckyweb.seagull.spring.entity.FlowInfo; + +@Repository("flowinfoDao") +public class FlowInfoDaoImpl extends HibernateDaoSupport implements FlowInfoDao{ + + @Resource(name = "sessionFactory") + public void setSuperSessionFactory(SessionFactory sessionFactory) { + super.setSessionFactory(sessionFactory); + } + + + @Override + public List list(FlowInfo flowinfo) + throws Exception { + // TODO Auto-generated method stub + return null; + } + + + + @SuppressWarnings("unchecked") + @Override + public List list(String hql) throws Exception { + return this.getHibernateTemplate().find(hql); + } + + + + @Override + public FlowInfo load(int id) throws Exception { + return (FlowInfo) this.getSession().load(FlowInfo.class, id); + } + + @Override + public FlowInfo get(int id) throws Exception { + // TODO Auto-generated method stub + return (FlowInfo) this.getHibernateTemplate().get(FlowInfo.class, id); + } + + + @Override + public List listcheckinfo(String sql) throws Exception { + // TODO Auto-generated method stub +// List list=new ArrayList(); + List count=null; + Session session=this.getSession(true); + try { + count = session.createSQLQuery(sql).list(); + + } catch (Exception e) { + e.printStackTrace(); + }finally{ + session.close(); + } + return count; + } + + +} diff --git a/src/main/java/luckyweb/seagull/spring/dao/OperationLogDao.java b/src/main/java/luckyweb/seagull/spring/dao/OperationLogDao.java index bb8b517..eae67f6 100644 --- a/src/main/java/luckyweb/seagull/spring/dao/OperationLogDao.java +++ b/src/main/java/luckyweb/seagull/spring/dao/OperationLogDao.java @@ -1,22 +1,22 @@ -package luckyweb.seagull.spring.dao; - -import java.util.List; - -import org.springframework.transaction.annotation.Transactional; - -import luckyweb.seagull.spring.entity.OperationLog; - - -@Transactional -public interface OperationLogDao { - - public OperationLog load(int id) throws Exception; - - public int add(OperationLog oplog) throws Exception; - - public List findByPage(final String hql, final Object value, final int offset, final int pageSize); - - public int findRows(OperationLog oplog, String hql); - public void delete(String hql) throws Exception; - -} +package luckyweb.seagull.spring.dao; + +import java.util.List; + +import org.springframework.transaction.annotation.Transactional; + +import luckyweb.seagull.spring.entity.OperationLog; + + +@Transactional +public interface OperationLogDao { + + public OperationLog load(int id) throws Exception; + + public int add(OperationLog oplog) throws Exception; + + public List findByPage(final String hql, final Object value, final int offset, final int pageSize); + + public int findRows(OperationLog oplog, String hql); + public void delete(String hql) throws Exception; + +} diff --git a/src/main/java/luckyweb/seagull/spring/dao/OperationLogDaoImpl.java b/src/main/java/luckyweb/seagull/spring/dao/OperationLogDaoImpl.java index dbee9a1..be7cf6f 100644 --- a/src/main/java/luckyweb/seagull/spring/dao/OperationLogDaoImpl.java +++ b/src/main/java/luckyweb/seagull/spring/dao/OperationLogDaoImpl.java @@ -1,115 +1,115 @@ -package luckyweb.seagull.spring.dao; - -import java.util.List; - -import javax.annotation.Resource; - -import org.hibernate.HibernateException; -import org.hibernate.Query; -import org.hibernate.Session; -import org.hibernate.SessionFactory; -import org.springframework.orm.hibernate3.HibernateCallback; -import org.springframework.orm.hibernate3.support.HibernateDaoSupport; -import org.springframework.stereotype.Repository; - -import luckyweb.seagull.spring.entity.OperationLog; - - - - -@Repository("operationlogDao") -public class OperationLogDaoImpl extends HibernateDaoSupport implements OperationLogDao{ - - @Resource(name = "sessionFactory") - public void setSuperSessionFactory(SessionFactory sessionFactory) { - super.setSessionFactory(sessionFactory); - } - - - @Override - public OperationLog load(int id) throws Exception { - //return (UserInfo)this.getSession().get(UserInfo.class, id); - return (OperationLog) this.getHibernateTemplate().get(OperationLog.class, id); - } - - @Override - public int add(OperationLog oplog) throws Exception { - this.getHibernateTemplate().save(oplog); - return oplog.getId(); - } - - private void whereParameter(OperationLog oplog, Query query) { - if (oplog.getStarttime()!=null&&oplog.getEndtime()!=null - &&!oplog.getStarttime().equals("")&&!oplog.getEndtime().equals("")) { - query.setParameter("starttime", oplog.getStarttime()); - query.setParameter("endtime", oplog.getEndtime()); - } - if (oplog.getProjectid()!=0) { - query.setParameter("projectid", oplog.getProjectid()); - } - if (oplog.getOperationer()!=null&&!oplog.getOperationer().equals("")) { - query.setParameter("operationer", "%"+oplog.getOperationer()+"%"); - } - if (oplog.getOperation_description()!=null&&!oplog.getOperation_description().equals("")) { - query.setParameter("operation_description", "%"+oplog.getOperation_description()+"%"); - } - - } - - @Override - public List findByPage(final String hql, final Object value, final int offset, final int pageSize) { - List list = getHibernateTemplate().executeFind(new HibernateCallback() { - // 实现hibernateCallback接口必须实现的方法 - - public Object doInHibernate(Session session) - throws HibernateException { - // 执行hibernate 分页查询 - Query query= session.createQuery(hql); - whereParameter((OperationLog)value, query); - List result =query - .setFirstResult(offset).setMaxResults(pageSize).list(); - session.close(); - return result; - } - - }); - return list; - } - - - @Override - public int findRows(OperationLog oplog, String hql) { - int s=0; - Session session=this.getSession(true); - try { - Query query=session.createQuery(hql); - whereParameter(oplog, query); - s= Integer.valueOf( - query - .list().get(0) - .toString()); - } catch (Exception e) { - e.printStackTrace(); - }finally{ - session.close(); - } - return s; - } - - @Override - public void delete(String hql) throws Exception { - Session session=this.getSession(true); - try { - session.beginTransaction(); - Query query =session .createQuery(hql); - query.executeUpdate(); - - session.getTransaction().commit(); - } catch (Exception e) { - e.printStackTrace(); - }finally{ - session.close(); - } - } - -} +package luckyweb.seagull.spring.dao; + +import java.util.List; + +import javax.annotation.Resource; + +import org.hibernate.HibernateException; +import org.hibernate.Query; +import org.hibernate.Session; +import org.hibernate.SessionFactory; +import org.springframework.orm.hibernate3.HibernateCallback; +import org.springframework.orm.hibernate3.support.HibernateDaoSupport; +import org.springframework.stereotype.Repository; + +import luckyweb.seagull.spring.entity.OperationLog; + + + + +@Repository("operationlogDao") +public class OperationLogDaoImpl extends HibernateDaoSupport implements OperationLogDao{ + + @Resource(name = "sessionFactory") + public void setSuperSessionFactory(SessionFactory sessionFactory) { + super.setSessionFactory(sessionFactory); + } + + + @Override + public OperationLog load(int id) throws Exception { + //return (UserInfo)this.getSession().get(UserInfo.class, id); + return (OperationLog) this.getHibernateTemplate().get(OperationLog.class, id); + } + + @Override + public int add(OperationLog oplog) throws Exception { + this.getHibernateTemplate().save(oplog); + return oplog.getId(); + } + + private void whereParameter(OperationLog oplog, Query query) { + if (oplog.getStarttime()!=null&&oplog.getEndtime()!=null + &&!oplog.getStarttime().equals("")&&!oplog.getEndtime().equals("")) { + query.setParameter("starttime", oplog.getStarttime()); + query.setParameter("endtime", oplog.getEndtime()); + } + if (oplog.getProjectid()!=0) { + query.setParameter("projectid", oplog.getProjectid()); + } + if (oplog.getOperationer()!=null&&!oplog.getOperationer().equals("")) { + query.setParameter("operationer", "%"+oplog.getOperationer()+"%"); + } + if (oplog.getOperation_description()!=null&&!oplog.getOperation_description().equals("")) { + query.setParameter("operation_description", "%"+oplog.getOperation_description()+"%"); + } + + } + + @Override + public List findByPage(final String hql, final Object value, final int offset, final int pageSize) { + List list = getHibernateTemplate().executeFind(new HibernateCallback() { + // 实现hibernateCallback接口必须实现的方法 + + public Object doInHibernate(Session session) + throws HibernateException { + // 执行hibernate 分页查询 + Query query= session.createQuery(hql); + whereParameter((OperationLog)value, query); + List result =query + .setFirstResult(offset).setMaxResults(pageSize).list(); + session.close(); + return result; + } + + }); + return list; + } + + + @Override + public int findRows(OperationLog oplog, String hql) { + int s=0; + Session session=this.getSession(true); + try { + Query query=session.createQuery(hql); + whereParameter(oplog, query); + s= Integer.valueOf( + query + .list().get(0) + .toString()); + } catch (Exception e) { + e.printStackTrace(); + }finally{ + session.close(); + } + return s; + } + + @Override + public void delete(String hql) throws Exception { + Session session=this.getSession(true); + try { + session.beginTransaction(); + Query query =session .createQuery(hql); + query.executeUpdate(); + + session.getTransaction().commit(); + } catch (Exception e) { + e.printStackTrace(); + }finally{ + session.close(); + } + } + +} diff --git a/src/main/java/luckyweb/seagull/spring/dao/PlanFlowCheckDao.java b/src/main/java/luckyweb/seagull/spring/dao/PlanFlowCheckDao.java index 8ca4d3f..13aef88 100644 --- a/src/main/java/luckyweb/seagull/spring/dao/PlanFlowCheckDao.java +++ b/src/main/java/luckyweb/seagull/spring/dao/PlanFlowCheckDao.java @@ -1,26 +1,26 @@ -package luckyweb.seagull.spring.dao; - -import java.util.List; - -import org.springframework.transaction.annotation.Transactional; - -import luckyweb.seagull.spring.entity.PlanFlowCheck; - -@Transactional -public interface PlanFlowCheckDao { - public int add(PlanFlowCheck pfc) throws Exception; - - public void modify(PlanFlowCheck pfc) throws Exception; - - public void delete(int id) throws Exception; - - public PlanFlowCheck load(int id) throws Exception; - - public List findByPage(final String hql, final Object value,final int offset, final int pageSize); - - public int findRows(PlanFlowCheck pfc,String hql); - - /*public List findRows(String sql);*/ - - public List list(String hql) throws Exception; -} +package luckyweb.seagull.spring.dao; + +import java.util.List; + +import org.springframework.transaction.annotation.Transactional; + +import luckyweb.seagull.spring.entity.PlanFlowCheck; + +@Transactional +public interface PlanFlowCheckDao { + public int add(PlanFlowCheck pfc) throws Exception; + + public void modify(PlanFlowCheck pfc) throws Exception; + + public void delete(int id) throws Exception; + + public PlanFlowCheck load(int id) throws Exception; + + public List findByPage(final String hql, final Object value,final int offset, final int pageSize); + + public int findRows(PlanFlowCheck pfc,String hql); + + /*public List findRows(String sql);*/ + + public List list(String hql) throws Exception; +} diff --git a/src/main/java/luckyweb/seagull/spring/dao/PlanFlowCheckDaoImpl.java b/src/main/java/luckyweb/seagull/spring/dao/PlanFlowCheckDaoImpl.java index 246d260..e8e6d2f 100644 --- a/src/main/java/luckyweb/seagull/spring/dao/PlanFlowCheckDaoImpl.java +++ b/src/main/java/luckyweb/seagull/spring/dao/PlanFlowCheckDaoImpl.java @@ -1,118 +1,118 @@ -package luckyweb.seagull.spring.dao; - -import java.util.List; - -import javax.annotation.Resource; - -import org.hibernate.HibernateException; -import org.hibernate.Query; -import org.hibernate.Session; -import org.hibernate.SessionFactory; -import org.springframework.orm.hibernate3.HibernateCallback; -import org.springframework.orm.hibernate3.support.HibernateDaoSupport; -import org.springframework.stereotype.Repository; - -import luckyweb.seagull.spring.entity.PlanFlowCheck; - - -@Repository("planflowcheckDao") -public class PlanFlowCheckDaoImpl extends HibernateDaoSupport implements PlanFlowCheckDao{ - - @Resource(name = "sessionFactory") - public void setSuperSessionFactory(SessionFactory sessionFactory) { - super.setSessionFactory(sessionFactory); - } - - - - @Override - public void delete(int id) throws Exception { - PlanFlowCheck pfc = this.load(id); - this.getHibernateTemplate().delete(pfc); - - } - - private void whereParameter(PlanFlowCheck pfc, Query query) { - if (pfc.getId()!=0) { - query.setParameter("id", pfc.getId()); - } - if (pfc.getStatus()!=0) { - query.setParameter("status", pfc.getStatus()); - } - } - - @Override - public List findByPage(final String hql, final Object value, final int offset, final int pageSize) { - // TODO Auto-generated method stub - // 通过一个HibernateCallback 对象来执行查询 - //System.out.println(hql); - List list = getHibernateTemplate().executeFind(new HibernateCallback() { - // 实现hibernateCallback接口必须实现的方法 - - public Object doInHibernate(Session session) - throws HibernateException { - // 执行hibernate 分页查询 - Query query= session.createQuery(hql); - whereParameter((PlanFlowCheck)value, query); - List result =query - .setFirstResult(offset).setMaxResults(pageSize).list(); - session.close(); - return result; - } - - }); - return list; - } - - @Override - public int findRows(PlanFlowCheck pfc, String hql) { - int s=0; - Session session=this.getSession(true); - try { - Query query=session.createQuery(hql); - whereParameter(pfc, query); - s= Integer.valueOf( - query.list().get(0) - .toString()); - } catch (Exception e) { - e.printStackTrace(); - }finally{ - session.close(); - } - return s; - } - - - @Override - public int add(PlanFlowCheck pfc) throws Exception { - try{ - this.getHibernateTemplate().save(pfc); - }catch(Exception e){ - e.printStackTrace(); - } - return pfc.getId(); - } - - - - @Override - public void modify(PlanFlowCheck pfc) throws Exception { - this.getHibernateTemplate().update(pfc); - - } - - @SuppressWarnings("unchecked") - @Override - public List list(String hql) throws Exception { - return this.getHibernateTemplate().find(hql); - } - - - - @Override - public PlanFlowCheck load(int id) throws Exception { - return (PlanFlowCheck) this.getHibernateTemplate().get(PlanFlowCheck.class, id); - //return (FlowCheck) this.getSession().load(FlowCheck.class, id); - } - -} +package luckyweb.seagull.spring.dao; + +import java.util.List; + +import javax.annotation.Resource; + +import org.hibernate.HibernateException; +import org.hibernate.Query; +import org.hibernate.Session; +import org.hibernate.SessionFactory; +import org.springframework.orm.hibernate3.HibernateCallback; +import org.springframework.orm.hibernate3.support.HibernateDaoSupport; +import org.springframework.stereotype.Repository; + +import luckyweb.seagull.spring.entity.PlanFlowCheck; + + +@Repository("planflowcheckDao") +public class PlanFlowCheckDaoImpl extends HibernateDaoSupport implements PlanFlowCheckDao{ + + @Resource(name = "sessionFactory") + public void setSuperSessionFactory(SessionFactory sessionFactory) { + super.setSessionFactory(sessionFactory); + } + + + + @Override + public void delete(int id) throws Exception { + PlanFlowCheck pfc = this.load(id); + this.getHibernateTemplate().delete(pfc); + + } + + private void whereParameter(PlanFlowCheck pfc, Query query) { + if (pfc.getId()!=0) { + query.setParameter("id", pfc.getId()); + } + if (pfc.getStatus()!=0) { + query.setParameter("status", pfc.getStatus()); + } + } + + @Override + public List findByPage(final String hql, final Object value, final int offset, final int pageSize) { + // TODO Auto-generated method stub + // 通过一个HibernateCallback 对象来执行查询 + //System.out.println(hql); + List list = getHibernateTemplate().executeFind(new HibernateCallback() { + // 实现hibernateCallback接口必须实现的方法 + + public Object doInHibernate(Session session) + throws HibernateException { + // 执行hibernate 分页查询 + Query query= session.createQuery(hql); + whereParameter((PlanFlowCheck)value, query); + List result =query + .setFirstResult(offset).setMaxResults(pageSize).list(); + session.close(); + return result; + } + + }); + return list; + } + + @Override + public int findRows(PlanFlowCheck pfc, String hql) { + int s=0; + Session session=this.getSession(true); + try { + Query query=session.createQuery(hql); + whereParameter(pfc, query); + s= Integer.valueOf( + query.list().get(0) + .toString()); + } catch (Exception e) { + e.printStackTrace(); + }finally{ + session.close(); + } + return s; + } + + + @Override + public int add(PlanFlowCheck pfc) throws Exception { + try{ + this.getHibernateTemplate().save(pfc); + }catch(Exception e){ + e.printStackTrace(); + } + return pfc.getId(); + } + + + + @Override + public void modify(PlanFlowCheck pfc) throws Exception { + this.getHibernateTemplate().update(pfc); + + } + + @SuppressWarnings("unchecked") + @Override + public List list(String hql) throws Exception { + return this.getHibernateTemplate().find(hql); + } + + + + @Override + public PlanFlowCheck load(int id) throws Exception { + return (PlanFlowCheck) this.getHibernateTemplate().get(PlanFlowCheck.class, id); + //return (FlowCheck) this.getSession().load(FlowCheck.class, id); + } + +} diff --git a/src/main/java/luckyweb/seagull/spring/dao/ProjectCaseDao.java b/src/main/java/luckyweb/seagull/spring/dao/ProjectCaseDao.java index 258db14..011941d 100644 --- a/src/main/java/luckyweb/seagull/spring/dao/ProjectCaseDao.java +++ b/src/main/java/luckyweb/seagull/spring/dao/ProjectCaseDao.java @@ -1,49 +1,49 @@ -package luckyweb.seagull.spring.dao; - -import java.util.List; - -import org.springframework.transaction.annotation.Propagation; -import org.springframework.transaction.annotation.Transactional; - -import luckyweb.seagull.spring.entity.ProjectCase; - - -@Transactional -public interface ProjectCaseDao { - public int add(ProjectCase projectcase) throws Exception; - - public void modify(ProjectCase projectcase) throws Exception; - - public void modifyState(ProjectCase projectcase) throws Exception; - - public void modifyInfo(ProjectCase projectcase) throws Exception; - - public void delete(int id) throws Exception; - - @Transactional(propagation = Propagation.NOT_SUPPORTED) - public List list(ProjectCase projectcase) throws Exception; - - @Transactional(propagation = Propagation.NOT_SUPPORTED) - public List list(String hql) throws Exception; - - @Transactional(propagation = Propagation.NOT_SUPPORTED) - public List getList(String sql) throws Exception; - - public ProjectCase load(int id) throws Exception; - - public List load(String name, String cmdType, String planPath) - throws Exception; - - public ProjectCase get(int id) throws Exception; - -// public List findByPage(final String hql, final int offset,final int pageSize); -// -// public List findByPage(final String hql, final Object[] values,final int offset, final int pageSize); - - public List findByPage(final String hql, final Object value,final int offset, final int pageSize); - - public int findRows(ProjectCase projectcase,String hql); - - public List findJobsList(); - public String getCaseMaxIndex(String sql) throws Exception ; -} +package luckyweb.seagull.spring.dao; + +import java.util.List; + +import org.springframework.transaction.annotation.Propagation; +import org.springframework.transaction.annotation.Transactional; + +import luckyweb.seagull.spring.entity.ProjectCase; + + +@Transactional +public interface ProjectCaseDao { + public int add(ProjectCase projectcase) throws Exception; + + public void modify(ProjectCase projectcase) throws Exception; + + public void modifyState(ProjectCase projectcase) throws Exception; + + public void modifyInfo(ProjectCase projectcase) throws Exception; + + public void delete(int id) throws Exception; + + @Transactional(propagation = Propagation.NOT_SUPPORTED) + public List list(ProjectCase projectcase) throws Exception; + + @Transactional(propagation = Propagation.NOT_SUPPORTED) + public List list(String hql) throws Exception; + + @Transactional(propagation = Propagation.NOT_SUPPORTED) + public List getList(String sql) throws Exception; + + public ProjectCase load(int id) throws Exception; + + public List load(String name, String cmdType, String planPath) + throws Exception; + + public ProjectCase get(int id) throws Exception; + +// public List findByPage(final String hql, final int offset,final int pageSize); +// +// public List findByPage(final String hql, final Object[] values,final int offset, final int pageSize); + + public List findByPage(final String hql, final Object value,final int offset, final int pageSize); + + public int findRows(ProjectCase projectcase,String hql); + + public List findJobsList(); + public String getCaseMaxIndex(String sql) throws Exception ; +} diff --git a/src/main/java/luckyweb/seagull/spring/dao/ProjectCaseDaoImpl.java b/src/main/java/luckyweb/seagull/spring/dao/ProjectCaseDaoImpl.java index 3c1396c..5c91094 100644 --- a/src/main/java/luckyweb/seagull/spring/dao/ProjectCaseDaoImpl.java +++ b/src/main/java/luckyweb/seagull/spring/dao/ProjectCaseDaoImpl.java @@ -1,220 +1,220 @@ -package luckyweb.seagull.spring.dao; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collection; -import java.util.List; - -import javax.annotation.Resource; - -import org.hibernate.HibernateException; -import org.hibernate.Query; -import org.hibernate.Session; -import org.hibernate.SessionFactory; -import org.springframework.orm.hibernate3.HibernateCallback; -import org.springframework.orm.hibernate3.support.HibernateDaoSupport; -import org.springframework.stereotype.Repository; - -import luckyweb.seagull.spring.entity.ProjectCase; - -@Repository("projectCaseDao") -public class ProjectCaseDaoImpl extends HibernateDaoSupport implements ProjectCaseDao{ - - @Resource(name = "sessionFactory") - public void setSuperSessionFactory(SessionFactory sessionFactory) { - super.setSessionFactory(sessionFactory); - } - - - - @Override - public void delete(int id) throws Exception { - try{ - ProjectCase projectcase = this.load(id); - this.getHibernateTemplate().delete(projectcase); - }catch(Exception e){ - e.printStackTrace(); - } - - } - - private void whereParameter(ProjectCase projectcase, Query query) { - if (projectcase.getProjectid()!=0&&projectcase.getProjectid()!=99) { - query.setParameter("projectid", projectcase.getProjectid()); - } - if (projectcase.getModuleid()!=0&&projectcase.getModuleidarr().length>0) { - Collection collection = new ArrayList(Arrays.asList(projectcase.getModuleidarr())); - query.setParameterList("moduleid", collection); - } - if (null!=projectcase.getSign()&&!"".equals(projectcase.getSign())) { - query.setParameter("sign", "%"+projectcase.getSign()+"%"); - } - if (null!=projectcase.getName()&&!"".equals(projectcase.getName())) { - query.setParameter("name", "%"+projectcase.getName()+"%"); - } - if (null!=projectcase.getOperationer()&&!"".equals(projectcase.getOperationer())) { - query.setParameter("operationer", "%"+projectcase.getOperationer()+"%"); - } - if (null!=projectcase.getRemark()&&!"".equals(projectcase.getRemark())) { - query.setParameter("remark", "%"+projectcase.getRemark()+"%"); - } - } - - @Override - public List findByPage(final String hql, final Object value, final int offset, final int pageSize) { - // TODO Auto-generated method stub - // 通过一个HibernateCallback 对象来执行查询 - //System.out.println(hql); - List list = getHibernateTemplate().executeFind(new HibernateCallback() { - // 实现hibernateCallback接口必须实现的方法 - - public Object doInHibernate(Session session) - throws HibernateException { - // 执行hibernate 分页查询 - Query query= session.createQuery(hql); - whereParameter((ProjectCase)value, query); - List result =query - .setFirstResult(offset).setMaxResults(pageSize).list(); - session.close(); - return result; - } - - }); - return list; - } - - @Override - public int findRows(ProjectCase projectcase, String hql) { - int s=0; - Session session=this.getSession(true); - try { - Query query=session.createQuery(hql); - whereParameter(projectcase, query); - s= Integer.valueOf( - query - .list().get(0) - .toString()); - } catch (Exception e) { - e.printStackTrace(); - }finally{ - session.close(); - } - return s; - } - - - - @Override - public int add(ProjectCase projectcase) throws Exception { - this.getHibernateTemplate().save(projectcase); - return projectcase.getId(); - } - - - - @Override - public void modify(ProjectCase projectcase) throws Exception { - this.getHibernateTemplate().update(projectcase); - - } - - - - @Override - public void modifyState(ProjectCase projectcase) throws Exception { - // TODO Auto-generated method stub - - } - - - - @Override - public void modifyInfo(ProjectCase projectcase) throws Exception { - // TODO Auto-generated method stub - - } - - - - @Override - public List list(ProjectCase projectcase) - throws Exception { - // TODO Auto-generated method stub - return null; - } - - - - @SuppressWarnings("unchecked") - @Override - public List list(String hql) throws Exception { - return this.getHibernateTemplate().find(hql); - } - - - - @Override - public ProjectCase load(int id) throws Exception { - return (ProjectCase) this.getHibernateTemplate().get(ProjectCase.class, id); - } - - - - @Override - public List load(String name, String cmdType, - String planPath) throws Exception { - // TODO Auto-generated method stub - return null; - } - - - - @Override - public ProjectCase get(int id) throws Exception { - // TODO Auto-generated method stub - return null; - } - - - - @Override - public List findJobsList() { - // TODO Auto-generated method stub - return null; - } - - - - @SuppressWarnings("rawtypes") - @Override - public List getList(String hql) throws Exception { - // TODO Auto-generated method stub - List list=null; - Session session=this.getSession(true); - try { - list = session.createQuery(hql).list(); - } catch (Exception e) { - e.printStackTrace(); - }finally{ - session.close(); - } - return list; - } - - @SuppressWarnings("rawtypes") - @Override - public String getCaseMaxIndex(String sql) throws Exception { - // TODO Auto-generated method stub - List list=null; - Session session=this.getSession(true); - try { - list = session.createSQLQuery(sql).list(); - } catch (Exception e) { - e.printStackTrace(); - }finally{ - session.close(); - } - return list.get(0).toString(); - } - -} +package luckyweb.seagull.spring.dao; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import java.util.List; + +import javax.annotation.Resource; + +import org.hibernate.HibernateException; +import org.hibernate.Query; +import org.hibernate.Session; +import org.hibernate.SessionFactory; +import org.springframework.orm.hibernate3.HibernateCallback; +import org.springframework.orm.hibernate3.support.HibernateDaoSupport; +import org.springframework.stereotype.Repository; + +import luckyweb.seagull.spring.entity.ProjectCase; + +@Repository("projectCaseDao") +public class ProjectCaseDaoImpl extends HibernateDaoSupport implements ProjectCaseDao{ + + @Resource(name = "sessionFactory") + public void setSuperSessionFactory(SessionFactory sessionFactory) { + super.setSessionFactory(sessionFactory); + } + + + + @Override + public void delete(int id) throws Exception { + try{ + ProjectCase projectcase = this.load(id); + this.getHibernateTemplate().delete(projectcase); + }catch(Exception e){ + e.printStackTrace(); + } + + } + + private void whereParameter(ProjectCase projectcase, Query query) { + if (projectcase.getProjectid()!=0&&projectcase.getProjectid()!=99) { + query.setParameter("projectid", projectcase.getProjectid()); + } + if (projectcase.getModuleid()!=0&&projectcase.getModuleidarr().length>0) { + Collection collection = new ArrayList(Arrays.asList(projectcase.getModuleidarr())); + query.setParameterList("moduleid", collection); + } + if (null!=projectcase.getSign()&&!"".equals(projectcase.getSign())) { + query.setParameter("sign", "%"+projectcase.getSign()+"%"); + } + if (null!=projectcase.getName()&&!"".equals(projectcase.getName())) { + query.setParameter("name", "%"+projectcase.getName()+"%"); + } + if (null!=projectcase.getOperationer()&&!"".equals(projectcase.getOperationer())) { + query.setParameter("operationer", "%"+projectcase.getOperationer()+"%"); + } + if (null!=projectcase.getRemark()&&!"".equals(projectcase.getRemark())) { + query.setParameter("remark", "%"+projectcase.getRemark()+"%"); + } + } + + @Override + public List findByPage(final String hql, final Object value, final int offset, final int pageSize) { + // TODO Auto-generated method stub + // 通过一个HibernateCallback 对象来执行查询 + //System.out.println(hql); + List list = getHibernateTemplate().executeFind(new HibernateCallback() { + // 实现hibernateCallback接口必须实现的方法 + + public Object doInHibernate(Session session) + throws HibernateException { + // 执行hibernate 分页查询 + Query query= session.createQuery(hql); + whereParameter((ProjectCase)value, query); + List result =query + .setFirstResult(offset).setMaxResults(pageSize).list(); + session.close(); + return result; + } + + }); + return list; + } + + @Override + public int findRows(ProjectCase projectcase, String hql) { + int s=0; + Session session=this.getSession(true); + try { + Query query=session.createQuery(hql); + whereParameter(projectcase, query); + s= Integer.valueOf( + query + .list().get(0) + .toString()); + } catch (Exception e) { + e.printStackTrace(); + }finally{ + session.close(); + } + return s; + } + + + + @Override + public int add(ProjectCase projectcase) throws Exception { + this.getHibernateTemplate().save(projectcase); + return projectcase.getId(); + } + + + + @Override + public void modify(ProjectCase projectcase) throws Exception { + this.getHibernateTemplate().update(projectcase); + + } + + + + @Override + public void modifyState(ProjectCase projectcase) throws Exception { + // TODO Auto-generated method stub + + } + + + + @Override + public void modifyInfo(ProjectCase projectcase) throws Exception { + // TODO Auto-generated method stub + + } + + + + @Override + public List list(ProjectCase projectcase) + throws Exception { + // TODO Auto-generated method stub + return null; + } + + + + @SuppressWarnings("unchecked") + @Override + public List list(String hql) throws Exception { + return this.getHibernateTemplate().find(hql); + } + + + + @Override + public ProjectCase load(int id) throws Exception { + return (ProjectCase) this.getHibernateTemplate().get(ProjectCase.class, id); + } + + + + @Override + public List load(String name, String cmdType, + String planPath) throws Exception { + // TODO Auto-generated method stub + return null; + } + + + + @Override + public ProjectCase get(int id) throws Exception { + // TODO Auto-generated method stub + return null; + } + + + + @Override + public List findJobsList() { + // TODO Auto-generated method stub + return null; + } + + + + @SuppressWarnings("rawtypes") + @Override + public List getList(String hql) throws Exception { + // TODO Auto-generated method stub + List list=null; + Session session=this.getSession(true); + try { + list = session.createQuery(hql).list(); + } catch (Exception e) { + e.printStackTrace(); + }finally{ + session.close(); + } + return list; + } + + @SuppressWarnings("rawtypes") + @Override + public String getCaseMaxIndex(String sql) throws Exception { + // TODO Auto-generated method stub + List list=null; + Session session=this.getSession(true); + try { + list = session.createSQLQuery(sql).list(); + } catch (Exception e) { + e.printStackTrace(); + }finally{ + session.close(); + } + return list.get(0).toString(); + } + +} diff --git a/src/main/java/luckyweb/seagull/spring/dao/ProjectCasestepsDao.java b/src/main/java/luckyweb/seagull/spring/dao/ProjectCasestepsDao.java index f6dfb2c..b355286 100644 --- a/src/main/java/luckyweb/seagull/spring/dao/ProjectCasestepsDao.java +++ b/src/main/java/luckyweb/seagull/spring/dao/ProjectCasestepsDao.java @@ -1,48 +1,48 @@ -package luckyweb.seagull.spring.dao; - -import java.util.List; - -import org.springframework.transaction.annotation.Propagation; -import org.springframework.transaction.annotation.Transactional; - -import luckyweb.seagull.spring.entity.ProjectCasesteps; - - -@Transactional -public interface ProjectCasestepsDao { - public int add(ProjectCasesteps casesteps) throws Exception; - - public void modify(ProjectCasesteps casesteps) throws Exception; - - public void modifyState(ProjectCasesteps casesteps) throws Exception; - - public void modifyInfo(ProjectCasesteps casesteps) throws Exception; - - public void delete(int id) throws Exception; - public void delete(String hql, int id) throws Exception; - @Transactional(propagation = Propagation.NOT_SUPPORTED) - public List list(ProjectCasesteps casesteps) throws Exception; - - @Transactional(propagation = Propagation.NOT_SUPPORTED) - public List list(String hql) throws Exception; - - @Transactional(propagation = Propagation.NOT_SUPPORTED) - public List steps(String sql) throws Exception; - - public ProjectCasesteps load(int id) throws Exception; - - public List load(String name, String cmdType, String planPath) - throws Exception; - - public ProjectCasesteps get(int id) throws Exception; - -// public List findByPage(final String hql, final int offset,final int pageSize); -// -// public List findByPage(final String hql, final Object[] values,final int offset, final int pageSize); - - public List findByPage(final String hql, final Object value,final int offset, final int pageSize); - - public int findRows(ProjectCasesteps casesteps,String hql); - - public List findJobsList(); -} +package luckyweb.seagull.spring.dao; + +import java.util.List; + +import org.springframework.transaction.annotation.Propagation; +import org.springframework.transaction.annotation.Transactional; + +import luckyweb.seagull.spring.entity.ProjectCasesteps; + + +@Transactional +public interface ProjectCasestepsDao { + public int add(ProjectCasesteps casesteps) throws Exception; + + public void modify(ProjectCasesteps casesteps) throws Exception; + + public void modifyState(ProjectCasesteps casesteps) throws Exception; + + public void modifyInfo(ProjectCasesteps casesteps) throws Exception; + + public void delete(int id) throws Exception; + public void delete(String hql, int id) throws Exception; + @Transactional(propagation = Propagation.NOT_SUPPORTED) + public List list(ProjectCasesteps casesteps) throws Exception; + + @Transactional(propagation = Propagation.NOT_SUPPORTED) + public List list(String hql) throws Exception; + + @Transactional(propagation = Propagation.NOT_SUPPORTED) + public List steps(String sql) throws Exception; + + public ProjectCasesteps load(int id) throws Exception; + + public List load(String name, String cmdType, String planPath) + throws Exception; + + public ProjectCasesteps get(int id) throws Exception; + +// public List findByPage(final String hql, final int offset,final int pageSize); +// +// public List findByPage(final String hql, final Object[] values,final int offset, final int pageSize); + + public List findByPage(final String hql, final Object value,final int offset, final int pageSize); + + public int findRows(ProjectCasesteps casesteps,String hql); + + public List findJobsList(); +} diff --git a/src/main/java/luckyweb/seagull/spring/dao/ProjectCasestepsDaoImpl.java b/src/main/java/luckyweb/seagull/spring/dao/ProjectCasestepsDaoImpl.java index 3def3b6..ab87ade 100644 --- a/src/main/java/luckyweb/seagull/spring/dao/ProjectCasestepsDaoImpl.java +++ b/src/main/java/luckyweb/seagull/spring/dao/ProjectCasestepsDaoImpl.java @@ -1,197 +1,197 @@ -package luckyweb.seagull.spring.dao; - -import java.util.List; - -import javax.annotation.Resource; - -import org.hibernate.HibernateException; -import org.hibernate.Query; -import org.hibernate.Session; -import org.hibernate.SessionFactory; -import org.springframework.orm.hibernate3.HibernateCallback; -import org.springframework.orm.hibernate3.support.HibernateDaoSupport; -import org.springframework.stereotype.Repository; - -import luckyweb.seagull.spring.entity.ProjectCasesteps; -import luckyweb.seagull.spring.entity.TestLogdetail; - -@Repository("projectCasestepsDao") -public class ProjectCasestepsDaoImpl extends HibernateDaoSupport implements ProjectCasestepsDao{ - - @Resource(name = "sessionFactory") - public void setSuperSessionFactory(SessionFactory sessionFactory) { - super.setSessionFactory(sessionFactory); - } - - - - @Override - public void delete(int id) throws Exception { - try{ - ProjectCasesteps casesteps = this.load(id); - this.getHibernateTemplate().delete(casesteps); - }catch(Exception e){ - e.printStackTrace(); - } - - } - - @Override - public void delete(String hql, int id) throws Exception { - Session session=this.getSession(true); - session.beginTransaction(); - Query query =session .createQuery(hql); - query.setInteger("caseId", id); - query.executeUpdate(); - - session.getTransaction().commit(); - session.close(); - } - - private void whereParameter(ProjectCasesteps casesteps, Query query) { - if (casesteps.getProjectid()!=0) { - query.setParameter("projectid", casesteps.getProjectid()); - } - } - - @Override - public List findByPage(final String hql, final Object value, final int offset, final int pageSize) { - // TODO Auto-generated method stub - // 通过一个HibernateCallback 对象来执行查询 - //System.out.println(hql); - List list = getHibernateTemplate().executeFind(new HibernateCallback() { - // 实现hibernateCallback接口必须实现的方法 - - public Object doInHibernate(Session session) - throws HibernateException { - // 执行hibernate 分页查询 - Query query= session.createQuery(hql); - whereParameter((ProjectCasesteps)value, query); - List result =query - .setFirstResult(offset).setMaxResults(pageSize).list(); - session.close(); - return result; - } - - }); - return list; - } - - @Override - public int findRows(ProjectCasesteps casesteps, String hql) { - int s=0; - Session session=this.getSession(true); - try { - Query query=session.createQuery(hql); - whereParameter(casesteps, query); - s= Integer.valueOf( - query - .list().get(0) - .toString()); - } catch (Exception e) { - e.printStackTrace(); - }finally{ - session.close(); - } - return s; - } - - - - @Override - public int add(ProjectCasesteps casesteps) throws Exception { - this.getHibernateTemplate().save(casesteps); - return casesteps.getId(); - } - - - - @Override - public void modify(ProjectCasesteps casesteps) throws Exception { - this.getHibernateTemplate().update(casesteps); - - } - - - - @Override - public void modifyState(ProjectCasesteps casesteps) throws Exception { - // TODO Auto-generated method stub - - } - - - - @Override - public void modifyInfo(ProjectCasesteps casesteps) throws Exception { - // TODO Auto-generated method stub - - } - - - - @Override - public List list(ProjectCasesteps casesteps) - throws Exception { - // TODO Auto-generated method stub - return null; - } - - - - @SuppressWarnings("unchecked") - @Override - public List list(String hql) throws Exception { - return this.getHibernateTemplate().find(hql); - } - - - - @Override - public ProjectCasesteps load(int id) throws Exception { - return (ProjectCasesteps) this.getHibernateTemplate().get(ProjectCasesteps.class, id); - //return (ProjectCasesteps) this.getSession().load(ProjectCasesteps.class, id); - } - - - - @Override - public List load(String name, String cmdType, - String planPath) throws Exception { - // TODO Auto-generated method stub - return null; - } - - - - @Override - public ProjectCasesteps get(int id) throws Exception { - // TODO Auto-generated method stub - return null; - } - - - - @Override - public List findJobsList() { - // TODO Auto-generated method stub - return null; - } - - @SuppressWarnings("rawtypes") - @Override - public List steps(String sql) throws Exception { - // TODO Auto-generated method stub - List list=null; - Session session=this.getSession(true); - try { - list = session.createQuery(sql).list(); - } catch (Exception e) { - e.printStackTrace(); - }finally{ - session.close(); - } - return list; - } - -} +package luckyweb.seagull.spring.dao; + +import java.util.List; + +import javax.annotation.Resource; + +import org.hibernate.HibernateException; +import org.hibernate.Query; +import org.hibernate.Session; +import org.hibernate.SessionFactory; +import org.springframework.orm.hibernate3.HibernateCallback; +import org.springframework.orm.hibernate3.support.HibernateDaoSupport; +import org.springframework.stereotype.Repository; + +import luckyweb.seagull.spring.entity.ProjectCasesteps; +import luckyweb.seagull.spring.entity.TestLogdetail; + +@Repository("projectCasestepsDao") +public class ProjectCasestepsDaoImpl extends HibernateDaoSupport implements ProjectCasestepsDao{ + + @Resource(name = "sessionFactory") + public void setSuperSessionFactory(SessionFactory sessionFactory) { + super.setSessionFactory(sessionFactory); + } + + + + @Override + public void delete(int id) throws Exception { + try{ + ProjectCasesteps casesteps = this.load(id); + this.getHibernateTemplate().delete(casesteps); + }catch(Exception e){ + e.printStackTrace(); + } + + } + + @Override + public void delete(String hql, int id) throws Exception { + Session session=this.getSession(true); + session.beginTransaction(); + Query query =session .createQuery(hql); + query.setInteger("caseId", id); + query.executeUpdate(); + + session.getTransaction().commit(); + session.close(); + } + + private void whereParameter(ProjectCasesteps casesteps, Query query) { + if (casesteps.getProjectid()!=0) { + query.setParameter("projectid", casesteps.getProjectid()); + } + } + + @Override + public List findByPage(final String hql, final Object value, final int offset, final int pageSize) { + // TODO Auto-generated method stub + // 通过一个HibernateCallback 对象来执行查询 + //System.out.println(hql); + List list = getHibernateTemplate().executeFind(new HibernateCallback() { + // 实现hibernateCallback接口必须实现的方法 + + public Object doInHibernate(Session session) + throws HibernateException { + // 执行hibernate 分页查询 + Query query= session.createQuery(hql); + whereParameter((ProjectCasesteps)value, query); + List result =query + .setFirstResult(offset).setMaxResults(pageSize).list(); + session.close(); + return result; + } + + }); + return list; + } + + @Override + public int findRows(ProjectCasesteps casesteps, String hql) { + int s=0; + Session session=this.getSession(true); + try { + Query query=session.createQuery(hql); + whereParameter(casesteps, query); + s= Integer.valueOf( + query + .list().get(0) + .toString()); + } catch (Exception e) { + e.printStackTrace(); + }finally{ + session.close(); + } + return s; + } + + + + @Override + public int add(ProjectCasesteps casesteps) throws Exception { + this.getHibernateTemplate().save(casesteps); + return casesteps.getId(); + } + + + + @Override + public void modify(ProjectCasesteps casesteps) throws Exception { + this.getHibernateTemplate().update(casesteps); + + } + + + + @Override + public void modifyState(ProjectCasesteps casesteps) throws Exception { + // TODO Auto-generated method stub + + } + + + + @Override + public void modifyInfo(ProjectCasesteps casesteps) throws Exception { + // TODO Auto-generated method stub + + } + + + + @Override + public List list(ProjectCasesteps casesteps) + throws Exception { + // TODO Auto-generated method stub + return null; + } + + + + @SuppressWarnings("unchecked") + @Override + public List list(String hql) throws Exception { + return this.getHibernateTemplate().find(hql); + } + + + + @Override + public ProjectCasesteps load(int id) throws Exception { + return (ProjectCasesteps) this.getHibernateTemplate().get(ProjectCasesteps.class, id); + //return (ProjectCasesteps) this.getSession().load(ProjectCasesteps.class, id); + } + + + + @Override + public List load(String name, String cmdType, + String planPath) throws Exception { + // TODO Auto-generated method stub + return null; + } + + + + @Override + public ProjectCasesteps get(int id) throws Exception { + // TODO Auto-generated method stub + return null; + } + + + + @Override + public List findJobsList() { + // TODO Auto-generated method stub + return null; + } + + @SuppressWarnings("rawtypes") + @Override + public List steps(String sql) throws Exception { + // TODO Auto-generated method stub + List list=null; + Session session=this.getSession(true); + try { + list = session.createQuery(sql).list(); + } catch (Exception e) { + e.printStackTrace(); + }finally{ + session.close(); + } + return list; + } + +} diff --git a/src/main/java/luckyweb/seagull/spring/dao/ProjectModuleDao.java b/src/main/java/luckyweb/seagull/spring/dao/ProjectModuleDao.java index 7c22527..e19610c 100644 --- a/src/main/java/luckyweb/seagull/spring/dao/ProjectModuleDao.java +++ b/src/main/java/luckyweb/seagull/spring/dao/ProjectModuleDao.java @@ -1,45 +1,45 @@ -package luckyweb.seagull.spring.dao; - -import java.util.List; - -import org.springframework.transaction.annotation.Propagation; -import org.springframework.transaction.annotation.Transactional; - -import luckyweb.seagull.spring.entity.ProjectModule; - - -@Transactional -public interface ProjectModuleDao { - public int add(ProjectModule projectmodule) throws Exception; - - public void modify(ProjectModule projectmodule) throws Exception; - - public void modifyState(ProjectModule projectmodule) throws Exception; - - public void modifyInfo(ProjectModule projectmodule) throws Exception; - - public void delete(ProjectModule projectmodule) throws Exception; - - @Transactional(propagation = Propagation.NOT_SUPPORTED) - public List list(ProjectModule projectmodule) throws Exception; - - @Transactional(propagation = Propagation.NOT_SUPPORTED) - public List list(String hql) throws Exception; - - @Transactional(propagation = Propagation.NOT_SUPPORTED) - public List getList(String sql) throws Exception; - - public ProjectModule load(int id) throws Exception; - - public List load(String name, String cmdType, String planPath) - throws Exception; - - public ProjectModule get(int id) throws Exception; - - public List findByPage(final String hql, final Object value,final int offset, final int pageSize); - - public int findRows(ProjectModule projectmodule,String hql); - - public List findJobsList(); - public String getModuleIdByName(String sql) throws Exception ; -} +package luckyweb.seagull.spring.dao; + +import java.util.List; + +import org.springframework.transaction.annotation.Propagation; +import org.springframework.transaction.annotation.Transactional; + +import luckyweb.seagull.spring.entity.ProjectModule; + + +@Transactional +public interface ProjectModuleDao { + public int add(ProjectModule projectmodule) throws Exception; + + public void modify(ProjectModule projectmodule) throws Exception; + + public void modifyState(ProjectModule projectmodule) throws Exception; + + public void modifyInfo(ProjectModule projectmodule) throws Exception; + + public void delete(ProjectModule projectmodule) throws Exception; + + @Transactional(propagation = Propagation.NOT_SUPPORTED) + public List list(ProjectModule projectmodule) throws Exception; + + @Transactional(propagation = Propagation.NOT_SUPPORTED) + public List list(String hql) throws Exception; + + @Transactional(propagation = Propagation.NOT_SUPPORTED) + public List getList(String sql) throws Exception; + + public ProjectModule load(int id) throws Exception; + + public List load(String name, String cmdType, String planPath) + throws Exception; + + public ProjectModule get(int id) throws Exception; + + public List findByPage(final String hql, final Object value,final int offset, final int pageSize); + + public int findRows(ProjectModule projectmodule,String hql); + + public List findJobsList(); + public String getModuleIdByName(String sql) throws Exception ; +} diff --git a/src/main/java/luckyweb/seagull/spring/dao/ProjectModuleDaoImpl.java b/src/main/java/luckyweb/seagull/spring/dao/ProjectModuleDaoImpl.java index 09f12a9..ee02d46 100644 --- a/src/main/java/luckyweb/seagull/spring/dao/ProjectModuleDaoImpl.java +++ b/src/main/java/luckyweb/seagull/spring/dao/ProjectModuleDaoImpl.java @@ -1,200 +1,200 @@ -package luckyweb.seagull.spring.dao; - -import java.util.List; - -import javax.annotation.Resource; - -import org.hibernate.HibernateException; -import org.hibernate.Query; -import org.hibernate.Session; -import org.hibernate.SessionFactory; -import org.springframework.orm.hibernate3.HibernateCallback; -import org.springframework.orm.hibernate3.support.HibernateDaoSupport; -import org.springframework.stereotype.Repository; - -import luckyweb.seagull.spring.entity.ProjectModule; - -@Repository("projectModuleDao") -public class ProjectModuleDaoImpl extends HibernateDaoSupport implements ProjectModuleDao{ - - @Resource(name = "sessionFactory") - public void setSuperSessionFactory(SessionFactory sessionFactory) { - super.setSessionFactory(sessionFactory); - } - - - - @Override - public void delete(ProjectModule projectmodule) throws Exception { - try{ - this.getHibernateTemplate().delete(projectmodule); - }catch(Exception e){ - e.printStackTrace(); - } - - } - - private void whereParameter(ProjectModule projectmodule, Query query) { - if (projectmodule.getProjectid()!=0&&projectmodule.getProjectid()!=99) { - query.setParameter("projectid", projectmodule.getProjectid()); - } - } - - @Override - public List findByPage(final String hql, final Object value, final int offset, final int pageSize) { - // TODO Auto-generated method stub - // 通过一个HibernateCallback 对象来执行查询 - //System.out.println(hql); - List list = getHibernateTemplate().executeFind(new HibernateCallback() { - // 实现hibernateCallback接口必须实现的方法 - - public Object doInHibernate(Session session) - throws HibernateException { - // 执行hibernate 分页查询 - Query query= session.createQuery(hql); - whereParameter((ProjectModule)value, query); - List result =query - .setFirstResult(offset).setMaxResults(pageSize).list(); - session.close(); - return result; - } - - }); - return list; - } - - @Override - public int findRows(ProjectModule projectmodule, String hql) { - int s=0; - Session session=this.getSession(true); - try { - Query query=session.createQuery(hql); - whereParameter(projectmodule, query); - s= Integer.valueOf( - query - .list().get(0) - .toString()); - } catch (Exception e) { - e.printStackTrace(); - }finally{ - session.close(); - } - return s; - } - - - - @Override - public int add(ProjectModule projectmodule) throws Exception { - this.getHibernateTemplate().save(projectmodule); - return projectmodule.getId(); - } - - - - @Override - public void modify(ProjectModule projectmodule) throws Exception { - this.getHibernateTemplate().update(projectmodule); - - } - - - - @Override - public void modifyState(ProjectModule projectmodule) throws Exception { - // TODO Auto-generated method stub - - } - - - - @Override - public void modifyInfo(ProjectModule projectmodule) throws Exception { - // TODO Auto-generated method stub - - } - - - - @Override - public List list(ProjectModule projectmodule) - throws Exception { - // TODO Auto-generated method stub - return null; - } - - - - @SuppressWarnings("unchecked") - @Override - public List list(String hql) throws Exception { - return this.getHibernateTemplate().find(hql); - } - - - - @Override - public ProjectModule load(int id) throws Exception { - return (ProjectModule) this.getHibernateTemplate().get(ProjectModule.class, id); - } - - - - @Override - public List load(String name, String cmdType, - String planPath) throws Exception { - // TODO Auto-generated method stub - return null; - } - - - - @Override - public ProjectModule get(int id) throws Exception { - // TODO Auto-generated method stub - return null; - } - - - - @Override - public List findJobsList() { - // TODO Auto-generated method stub - return null; - } - - - - @SuppressWarnings("rawtypes") - @Override - public List getList(String hql) throws Exception { - // TODO Auto-generated method stub - List list=null; - Session session=this.getSession(true); - try { - list = session.createQuery(hql).list(); - } catch (Exception e) { - e.printStackTrace(); - }finally{ - session.close(); - } - return list; - } - - @SuppressWarnings("rawtypes") - @Override - public String getModuleIdByName(String sql) throws Exception { - // TODO Auto-generated method stub - List list=null; - Session session=this.getSession(true); - try { - list = session.createSQLQuery(sql).list(); - } catch (Exception e) { - e.printStackTrace(); - }finally{ - session.close(); - } - return list.get(0).toString(); - } - -} +package luckyweb.seagull.spring.dao; + +import java.util.List; + +import javax.annotation.Resource; + +import org.hibernate.HibernateException; +import org.hibernate.Query; +import org.hibernate.Session; +import org.hibernate.SessionFactory; +import org.springframework.orm.hibernate3.HibernateCallback; +import org.springframework.orm.hibernate3.support.HibernateDaoSupport; +import org.springframework.stereotype.Repository; + +import luckyweb.seagull.spring.entity.ProjectModule; + +@Repository("projectModuleDao") +public class ProjectModuleDaoImpl extends HibernateDaoSupport implements ProjectModuleDao{ + + @Resource(name = "sessionFactory") + public void setSuperSessionFactory(SessionFactory sessionFactory) { + super.setSessionFactory(sessionFactory); + } + + + + @Override + public void delete(ProjectModule projectmodule) throws Exception { + try{ + this.getHibernateTemplate().delete(projectmodule); + }catch(Exception e){ + e.printStackTrace(); + } + + } + + private void whereParameter(ProjectModule projectmodule, Query query) { + if (projectmodule.getProjectid()!=0&&projectmodule.getProjectid()!=99) { + query.setParameter("projectid", projectmodule.getProjectid()); + } + } + + @Override + public List findByPage(final String hql, final Object value, final int offset, final int pageSize) { + // TODO Auto-generated method stub + // 通过一个HibernateCallback 对象来执行查询 + //System.out.println(hql); + List list = getHibernateTemplate().executeFind(new HibernateCallback() { + // 实现hibernateCallback接口必须实现的方法 + + public Object doInHibernate(Session session) + throws HibernateException { + // 执行hibernate 分页查询 + Query query= session.createQuery(hql); + whereParameter((ProjectModule)value, query); + List result =query + .setFirstResult(offset).setMaxResults(pageSize).list(); + session.close(); + return result; + } + + }); + return list; + } + + @Override + public int findRows(ProjectModule projectmodule, String hql) { + int s=0; + Session session=this.getSession(true); + try { + Query query=session.createQuery(hql); + whereParameter(projectmodule, query); + s= Integer.valueOf( + query + .list().get(0) + .toString()); + } catch (Exception e) { + e.printStackTrace(); + }finally{ + session.close(); + } + return s; + } + + + + @Override + public int add(ProjectModule projectmodule) throws Exception { + this.getHibernateTemplate().save(projectmodule); + return projectmodule.getId(); + } + + + + @Override + public void modify(ProjectModule projectmodule) throws Exception { + this.getHibernateTemplate().update(projectmodule); + + } + + + + @Override + public void modifyState(ProjectModule projectmodule) throws Exception { + // TODO Auto-generated method stub + + } + + + + @Override + public void modifyInfo(ProjectModule projectmodule) throws Exception { + // TODO Auto-generated method stub + + } + + + + @Override + public List list(ProjectModule projectmodule) + throws Exception { + // TODO Auto-generated method stub + return null; + } + + + + @SuppressWarnings("unchecked") + @Override + public List list(String hql) throws Exception { + return this.getHibernateTemplate().find(hql); + } + + + + @Override + public ProjectModule load(int id) throws Exception { + return (ProjectModule) this.getHibernateTemplate().get(ProjectModule.class, id); + } + + + + @Override + public List load(String name, String cmdType, + String planPath) throws Exception { + // TODO Auto-generated method stub + return null; + } + + + + @Override + public ProjectModule get(int id) throws Exception { + // TODO Auto-generated method stub + return null; + } + + + + @Override + public List findJobsList() { + // TODO Auto-generated method stub + return null; + } + + + + @SuppressWarnings("rawtypes") + @Override + public List getList(String hql) throws Exception { + // TODO Auto-generated method stub + List list=null; + Session session=this.getSession(true); + try { + list = session.createQuery(hql).list(); + } catch (Exception e) { + e.printStackTrace(); + }finally{ + session.close(); + } + return list; + } + + @SuppressWarnings("rawtypes") + @Override + public String getModuleIdByName(String sql) throws Exception { + // TODO Auto-generated method stub + List list=null; + Session session=this.getSession(true); + try { + list = session.createSQLQuery(sql).list(); + } catch (Exception e) { + e.printStackTrace(); + }finally{ + session.close(); + } + return list.get(0).toString(); + } + +} diff --git a/src/main/java/luckyweb/seagull/spring/dao/ProjectPlanCaseDao.java b/src/main/java/luckyweb/seagull/spring/dao/ProjectPlanCaseDao.java index 04680b7..8cb7681 100644 --- a/src/main/java/luckyweb/seagull/spring/dao/ProjectPlanCaseDao.java +++ b/src/main/java/luckyweb/seagull/spring/dao/ProjectPlanCaseDao.java @@ -1,49 +1,49 @@ -package luckyweb.seagull.spring.dao; - -import java.util.List; - -import org.springframework.transaction.annotation.Propagation; -import org.springframework.transaction.annotation.Transactional; - -import luckyweb.seagull.spring.entity.ProjectPlanCase; - - - -@Transactional -public interface ProjectPlanCaseDao { - public int add(ProjectPlanCase projectplancase) throws Exception; - - public void modify(ProjectPlanCase projectplancase) throws Exception; - - public void modifyState(ProjectPlanCase projectplancase) throws Exception; - - public void modifyInfo(ProjectPlanCase projectplancase) throws Exception; - - public void delete(ProjectPlanCase projectplancase) throws Exception; - public void delete(String hql, int id) throws Exception; - @Transactional(propagation = Propagation.NOT_SUPPORTED) - public List list(ProjectPlanCase projectplancase) throws Exception; - - @Transactional(propagation = Propagation.NOT_SUPPORTED) - public List list(String hql) throws Exception; - - @Transactional(propagation = Propagation.NOT_SUPPORTED) - public List getList(String sql) throws Exception; - - public ProjectPlanCase load(int id) throws Exception; - - public List load(String name, String cmdType, String planPath) - throws Exception; - - public ProjectPlanCase get(int id) throws Exception; - -// public List findByPage(final String hql, final int offset,final int pageSize); -// -// public List findByPage(final String hql, final Object[] values,final int offset, final int pageSize); - - public List findByPage(final String hql, final Object value,final int offset, final int pageSize); - - public int findRows(ProjectPlanCase projectplancase,String hql); - - public List findJobsList(); -} +package luckyweb.seagull.spring.dao; + +import java.util.List; + +import org.springframework.transaction.annotation.Propagation; +import org.springframework.transaction.annotation.Transactional; + +import luckyweb.seagull.spring.entity.ProjectPlanCase; + + + +@Transactional +public interface ProjectPlanCaseDao { + public int add(ProjectPlanCase projectplancase) throws Exception; + + public void modify(ProjectPlanCase projectplancase) throws Exception; + + public void modifyState(ProjectPlanCase projectplancase) throws Exception; + + public void modifyInfo(ProjectPlanCase projectplancase) throws Exception; + + public void delete(ProjectPlanCase projectplancase) throws Exception; + public void delete(String hql, int id) throws Exception; + @Transactional(propagation = Propagation.NOT_SUPPORTED) + public List list(ProjectPlanCase projectplancase) throws Exception; + + @Transactional(propagation = Propagation.NOT_SUPPORTED) + public List list(String hql) throws Exception; + + @Transactional(propagation = Propagation.NOT_SUPPORTED) + public List getList(String sql) throws Exception; + + public ProjectPlanCase load(int id) throws Exception; + + public List load(String name, String cmdType, String planPath) + throws Exception; + + public ProjectPlanCase get(int id) throws Exception; + +// public List findByPage(final String hql, final int offset,final int pageSize); +// +// public List findByPage(final String hql, final Object[] values,final int offset, final int pageSize); + + public List findByPage(final String hql, final Object value,final int offset, final int pageSize); + + public int findRows(ProjectPlanCase projectplancase,String hql); + + public List findJobsList(); +} diff --git a/src/main/java/luckyweb/seagull/spring/dao/ProjectPlanCaseDaoImpl.java b/src/main/java/luckyweb/seagull/spring/dao/ProjectPlanCaseDaoImpl.java index cf5437a..83acc44 100644 --- a/src/main/java/luckyweb/seagull/spring/dao/ProjectPlanCaseDaoImpl.java +++ b/src/main/java/luckyweb/seagull/spring/dao/ProjectPlanCaseDaoImpl.java @@ -1,205 +1,205 @@ -package luckyweb.seagull.spring.dao; - -import java.util.List; - -import javax.annotation.Resource; - -import org.hibernate.HibernateException; -import org.hibernate.Query; -import org.hibernate.Session; -import org.hibernate.SessionFactory; -import org.springframework.orm.hibernate3.HibernateCallback; -import org.springframework.orm.hibernate3.support.HibernateDaoSupport; -import org.springframework.stereotype.Repository; - -import luckyweb.seagull.spring.entity.ProjectCasesteps; -import luckyweb.seagull.spring.entity.ProjectPlanCase; - - -@Repository("projectPlanCaseDao") -public class ProjectPlanCaseDaoImpl extends HibernateDaoSupport implements ProjectPlanCaseDao{ - - @Resource(name = "sessionFactory") - public void setSuperSessionFactory(SessionFactory sessionFactory) { - super.setSessionFactory(sessionFactory); - } - - - - @Override - public void delete(ProjectPlanCase projectplancase) throws Exception { - try{ - this.getHibernateTemplate().delete(projectplancase); - }catch(Exception e){ - e.printStackTrace(); - } - - } - - @Override - public void delete(String hql, int id) throws Exception { - Session session=this.getSession(true); - session.beginTransaction(); - Query query =session .createQuery(hql); - query.setInteger("planId", id); - query.executeUpdate(); - - session.getTransaction().commit(); - session.close(); - } - - private void whereParameter(ProjectPlanCase projectplancase, Query query) { - if (projectplancase.getCaseid()!=0) { - query.setParameter("caseid", projectplancase.getCaseid()); - } - if (projectplancase.getPlanid()!=0) { - query.setParameter("planid", projectplancase.getPlanid()); - } - } - - @Override - public List findByPage(final String hql, final Object value, final int offset, final int pageSize) { - // TODO Auto-generated method stub - // 通过一个HibernateCallback 对象来执行查询 - //System.out.println(hql); - List list = getHibernateTemplate().executeFind(new HibernateCallback() { - // 实现hibernateCallback接口必须实现的方法 - - public Object doInHibernate(Session session) - throws HibernateException { - // 执行hibernate 分页查询 - Query query= session.createQuery(hql); - whereParameter((ProjectPlanCase)value, query); - List result =query - .setFirstResult(offset).setMaxResults(pageSize).list(); - session.close(); - return result; - } - - }); - return list; - } - - @Override - public int findRows(ProjectPlanCase projectplancase, String hql) { - int s=0; - Session session=this.getSession(true); - try { - Query query=session.createQuery(hql); - whereParameter(projectplancase, query); - if(0==query.list().size()){ - return 0; - } - s= Integer.valueOf( - query - .list().get(0) - .toString()); - } catch (Exception e) { - e.printStackTrace(); - }finally{ - session.close(); - } - return s; - } - - - - @Override - public int add(ProjectPlanCase projectplancase) throws Exception { - this.getHibernateTemplate().save(projectplancase); - return projectplancase.getId(); - } - - - - @Override - public void modify(ProjectPlanCase projectplancase) throws Exception { - this.getHibernateTemplate().update(projectplancase); - - } - - - - @Override - public void modifyState(ProjectPlanCase projectplancase) throws Exception { - // TODO Auto-generated method stub - - } - - - - @Override - public void modifyInfo(ProjectPlanCase projectplancase) throws Exception { - // TODO Auto-generated method stub - - } - - - - @Override - public List list(ProjectPlanCase projectplancase) - throws Exception { - // TODO Auto-generated method stub - return null; - } - - - - @SuppressWarnings("unchecked") - @Override - public List list(String hql) throws Exception { - return this.getHibernateTemplate().find(hql); - } - - - - @Override - public ProjectPlanCase load(int id) throws Exception { - - return (ProjectPlanCase) this.getHibernateTemplate().get(ProjectPlanCase.class, id); - //return (ProjectCase) this.getSession().load(ProjectCase.class, id); - } - - - - @Override - public List load(String name, String cmdType, - String planPath) throws Exception { - // TODO Auto-generated method stub - return null; - } - - - - @Override - public ProjectPlanCase get(int id) throws Exception { - // TODO Auto-generated method stub - return null; - } - - - - @Override - public List findJobsList() { - // TODO Auto-generated method stub - return null; - } - - - - @SuppressWarnings("rawtypes") - @Override - public List getList(String sql) throws Exception { - // TODO Auto-generated method stub - List count=null; - Session session=this.getSession(true); - try { - count = session.createQuery(sql).list(); - } catch (Exception e) { - e.printStackTrace(); - }finally{ - session.close(); - } - return count; - } -} +package luckyweb.seagull.spring.dao; + +import java.util.List; + +import javax.annotation.Resource; + +import org.hibernate.HibernateException; +import org.hibernate.Query; +import org.hibernate.Session; +import org.hibernate.SessionFactory; +import org.springframework.orm.hibernate3.HibernateCallback; +import org.springframework.orm.hibernate3.support.HibernateDaoSupport; +import org.springframework.stereotype.Repository; + +import luckyweb.seagull.spring.entity.ProjectCasesteps; +import luckyweb.seagull.spring.entity.ProjectPlanCase; + + +@Repository("projectPlanCaseDao") +public class ProjectPlanCaseDaoImpl extends HibernateDaoSupport implements ProjectPlanCaseDao{ + + @Resource(name = "sessionFactory") + public void setSuperSessionFactory(SessionFactory sessionFactory) { + super.setSessionFactory(sessionFactory); + } + + + + @Override + public void delete(ProjectPlanCase projectplancase) throws Exception { + try{ + this.getHibernateTemplate().delete(projectplancase); + }catch(Exception e){ + e.printStackTrace(); + } + + } + + @Override + public void delete(String hql, int id) throws Exception { + Session session=this.getSession(true); + session.beginTransaction(); + Query query =session .createQuery(hql); + query.setInteger("planId", id); + query.executeUpdate(); + + session.getTransaction().commit(); + session.close(); + } + + private void whereParameter(ProjectPlanCase projectplancase, Query query) { + if (projectplancase.getCaseid()!=0) { + query.setParameter("caseid", projectplancase.getCaseid()); + } + if (projectplancase.getPlanid()!=0) { + query.setParameter("planid", projectplancase.getPlanid()); + } + } + + @Override + public List findByPage(final String hql, final Object value, final int offset, final int pageSize) { + // TODO Auto-generated method stub + // 通过一个HibernateCallback 对象来执行查询 + //System.out.println(hql); + List list = getHibernateTemplate().executeFind(new HibernateCallback() { + // 实现hibernateCallback接口必须实现的方法 + + public Object doInHibernate(Session session) + throws HibernateException { + // 执行hibernate 分页查询 + Query query= session.createQuery(hql); + whereParameter((ProjectPlanCase)value, query); + List result =query + .setFirstResult(offset).setMaxResults(pageSize).list(); + session.close(); + return result; + } + + }); + return list; + } + + @Override + public int findRows(ProjectPlanCase projectplancase, String hql) { + int s=0; + Session session=this.getSession(true); + try { + Query query=session.createQuery(hql); + whereParameter(projectplancase, query); + if(0==query.list().size()){ + return 0; + } + s= Integer.valueOf( + query + .list().get(0) + .toString()); + } catch (Exception e) { + e.printStackTrace(); + }finally{ + session.close(); + } + return s; + } + + + + @Override + public int add(ProjectPlanCase projectplancase) throws Exception { + this.getHibernateTemplate().save(projectplancase); + return projectplancase.getId(); + } + + + + @Override + public void modify(ProjectPlanCase projectplancase) throws Exception { + this.getHibernateTemplate().update(projectplancase); + + } + + + + @Override + public void modifyState(ProjectPlanCase projectplancase) throws Exception { + // TODO Auto-generated method stub + + } + + + + @Override + public void modifyInfo(ProjectPlanCase projectplancase) throws Exception { + // TODO Auto-generated method stub + + } + + + + @Override + public List list(ProjectPlanCase projectplancase) + throws Exception { + // TODO Auto-generated method stub + return null; + } + + + + @SuppressWarnings("unchecked") + @Override + public List list(String hql) throws Exception { + return this.getHibernateTemplate().find(hql); + } + + + + @Override + public ProjectPlanCase load(int id) throws Exception { + + return (ProjectPlanCase) this.getHibernateTemplate().get(ProjectPlanCase.class, id); + //return (ProjectCase) this.getSession().load(ProjectCase.class, id); + } + + + + @Override + public List load(String name, String cmdType, + String planPath) throws Exception { + // TODO Auto-generated method stub + return null; + } + + + + @Override + public ProjectPlanCase get(int id) throws Exception { + // TODO Auto-generated method stub + return null; + } + + + + @Override + public List findJobsList() { + // TODO Auto-generated method stub + return null; + } + + + + @SuppressWarnings("rawtypes") + @Override + public List getList(String sql) throws Exception { + // TODO Auto-generated method stub + List count=null; + Session session=this.getSession(true); + try { + count = session.createQuery(sql).list(); + } catch (Exception e) { + e.printStackTrace(); + }finally{ + session.close(); + } + return count; + } +} diff --git a/src/main/java/luckyweb/seagull/spring/dao/ProjectPlanDao.java b/src/main/java/luckyweb/seagull/spring/dao/ProjectPlanDao.java index 669cb4f..e5b7d4b 100644 --- a/src/main/java/luckyweb/seagull/spring/dao/ProjectPlanDao.java +++ b/src/main/java/luckyweb/seagull/spring/dao/ProjectPlanDao.java @@ -1,49 +1,49 @@ -package luckyweb.seagull.spring.dao; - -import java.util.List; - -import org.springframework.transaction.annotation.Propagation; -import org.springframework.transaction.annotation.Transactional; - -import luckyweb.seagull.spring.entity.ProjectPlan; - - - -@Transactional -public interface ProjectPlanDao { - public int add(ProjectPlan projectplan) throws Exception; - - public void modify(ProjectPlan projectplan) throws Exception; - - public void modifyState(ProjectPlan projectplan) throws Exception; - - public void modifyInfo(ProjectPlan projectplan) throws Exception; - - public void delete(ProjectPlan projectplan) throws Exception; - - @Transactional(propagation = Propagation.NOT_SUPPORTED) - public List list(ProjectPlan projectplan) throws Exception; - - @Transactional(propagation = Propagation.NOT_SUPPORTED) - public List list(String hql) throws Exception; - - @Transactional(propagation = Propagation.NOT_SUPPORTED) - public List getList(String sql) throws Exception; - - public ProjectPlan load(int id) throws Exception; - - public List load(String name, String cmdType, String planPath) - throws Exception; - - public ProjectPlan get(int id) throws Exception; - -// public List findByPage(final String hql, final int offset,final int pageSize); -// -// public List findByPage(final String hql, final Object[] values,final int offset, final int pageSize); - - public List findByPage(final String hql, final Object value,final int offset, final int pageSize); - - public int findRows(ProjectPlan projectplan,String hql); - - public List findJobsList(); -} +package luckyweb.seagull.spring.dao; + +import java.util.List; + +import org.springframework.transaction.annotation.Propagation; +import org.springframework.transaction.annotation.Transactional; + +import luckyweb.seagull.spring.entity.ProjectPlan; + + + +@Transactional +public interface ProjectPlanDao { + public int add(ProjectPlan projectplan) throws Exception; + + public void modify(ProjectPlan projectplan) throws Exception; + + public void modifyState(ProjectPlan projectplan) throws Exception; + + public void modifyInfo(ProjectPlan projectplan) throws Exception; + + public void delete(ProjectPlan projectplan) throws Exception; + + @Transactional(propagation = Propagation.NOT_SUPPORTED) + public List list(ProjectPlan projectplan) throws Exception; + + @Transactional(propagation = Propagation.NOT_SUPPORTED) + public List list(String hql) throws Exception; + + @Transactional(propagation = Propagation.NOT_SUPPORTED) + public List getList(String sql) throws Exception; + + public ProjectPlan load(int id) throws Exception; + + public List load(String name, String cmdType, String planPath) + throws Exception; + + public ProjectPlan get(int id) throws Exception; + +// public List findByPage(final String hql, final int offset,final int pageSize); +// +// public List findByPage(final String hql, final Object[] values,final int offset, final int pageSize); + + public List findByPage(final String hql, final Object value,final int offset, final int pageSize); + + public int findRows(ProjectPlan projectplan,String hql); + + public List findJobsList(); +} diff --git a/src/main/java/luckyweb/seagull/spring/dao/ProjectPlanDaoImpl.java b/src/main/java/luckyweb/seagull/spring/dao/ProjectPlanDaoImpl.java index f9412fb..15b671c 100644 --- a/src/main/java/luckyweb/seagull/spring/dao/ProjectPlanDaoImpl.java +++ b/src/main/java/luckyweb/seagull/spring/dao/ProjectPlanDaoImpl.java @@ -1,196 +1,196 @@ -package luckyweb.seagull.spring.dao; - -import java.util.List; - -import javax.annotation.Resource; - -import org.hibernate.HibernateException; -import org.hibernate.Query; -import org.hibernate.Session; -import org.hibernate.SessionFactory; -import org.springframework.orm.hibernate3.HibernateCallback; -import org.springframework.orm.hibernate3.support.HibernateDaoSupport; -import org.springframework.stereotype.Repository; - -import luckyweb.seagull.spring.entity.ProjectPlan; - -@Repository("projectPlanDao") -public class ProjectPlanDaoImpl extends HibernateDaoSupport implements ProjectPlanDao{ - - @Resource(name = "sessionFactory") - public void setSuperSessionFactory(SessionFactory sessionFactory) { - super.setSessionFactory(sessionFactory); - } - - - - @Override - public void delete(ProjectPlan projectplan) throws Exception { - try{ - this.getHibernateTemplate().delete(projectplan); - }catch(Exception e){ - e.printStackTrace(); - } - - } - - private void whereParameter(ProjectPlan projectplan, Query query) { - if (projectplan.getProjectid()!=0&&projectplan.getProjectid()!=99) { - query.setParameter("projectid", projectplan.getProjectid()); - } - if (null!=projectplan.getName()&&!"".equals(projectplan.getName())) { - query.setParameter("name", "%"+projectplan.getName()+"%"); - } - if (null!=projectplan.getOperationer()&&!"".equals(projectplan.getOperationer())) { - query.setParameter("operationer", "%"+projectplan.getOperationer()+"%"); - } - if (null!=projectplan.getRemark()&&!"".equals(projectplan.getRemark())) { - query.setParameter("remark", "%"+projectplan.getRemark()+"%"); - } - } - - @Override - public List findByPage(final String hql, final Object value, final int offset, final int pageSize) { - // TODO Auto-generated method stub - // 通过一个HibernateCallback 对象来执行查询 - //System.out.println(hql); - List list = getHibernateTemplate().executeFind(new HibernateCallback() { - // 实现hibernateCallback接口必须实现的方法 - - public Object doInHibernate(Session session) - throws HibernateException { - // 执行hibernate 分页查询 - Query query= session.createQuery(hql); - whereParameter((ProjectPlan)value, query); - List result =query - .setFirstResult(offset).setMaxResults(pageSize).list(); - session.close(); - return result; - } - - }); - return list; - } - - @Override - public int findRows(ProjectPlan projectplan, String hql) { - int s=0; - Session session=this.getSession(true); - try { - Query query=session.createQuery(hql); - whereParameter(projectplan, query); - s= Integer.valueOf( - query - .list().get(0) - .toString()); - } catch (Exception e) { - e.printStackTrace(); - }finally{ - session.close(); - } - return s; - } - - - - @Override - public int add(ProjectPlan projectplan) throws Exception { - this.getHibernateTemplate().save(projectplan); - return projectplan.getId(); - } - - - - @Override - public void modify(ProjectPlan projectplan) throws Exception { - this.getHibernateTemplate().update(projectplan); - - } - - - - @Override - public void modifyState(ProjectPlan projectplan) throws Exception { - // TODO Auto-generated method stub - - } - - - - @Override - public void modifyInfo(ProjectPlan projectplan) throws Exception { - // TODO Auto-generated method stub - - } - - - - @Override - public List list(ProjectPlan projectplan) - throws Exception { - // TODO Auto-generated method stub - return null; - } - - - - @SuppressWarnings("unchecked") - @Override - public List list(String hql) throws Exception { - return this.getHibernateTemplate().find(hql); - } - - - - @Override - public ProjectPlan load(int id) throws Exception { - - return (ProjectPlan) this.getHibernateTemplate().get(ProjectPlan.class, id); - //return (ProjectCase) this.getSession().load(ProjectCase.class, id); - } - - - - @Override - public List load(String name, String cmdType, - String planPath) throws Exception { - // TODO Auto-generated method stub - return null; - } - - - - @Override - public ProjectPlan get(int id) throws Exception { - // TODO Auto-generated method stub - return null; - } - - - - @Override - public List findJobsList() { - // TODO Auto-generated method stub - return null; - } - - - - @SuppressWarnings("rawtypes") - @Override - public List getList(String sql) throws Exception { - // TODO Auto-generated method stub - List count=null; - Session session=this.getSession(true); - try { - count = session.createQuery(sql).list(); - } catch (Exception e) { - e.printStackTrace(); - }finally{ - session.close(); - } - return count; - } - - -} +package luckyweb.seagull.spring.dao; + +import java.util.List; + +import javax.annotation.Resource; + +import org.hibernate.HibernateException; +import org.hibernate.Query; +import org.hibernate.Session; +import org.hibernate.SessionFactory; +import org.springframework.orm.hibernate3.HibernateCallback; +import org.springframework.orm.hibernate3.support.HibernateDaoSupport; +import org.springframework.stereotype.Repository; + +import luckyweb.seagull.spring.entity.ProjectPlan; + +@Repository("projectPlanDao") +public class ProjectPlanDaoImpl extends HibernateDaoSupport implements ProjectPlanDao{ + + @Resource(name = "sessionFactory") + public void setSuperSessionFactory(SessionFactory sessionFactory) { + super.setSessionFactory(sessionFactory); + } + + + + @Override + public void delete(ProjectPlan projectplan) throws Exception { + try{ + this.getHibernateTemplate().delete(projectplan); + }catch(Exception e){ + e.printStackTrace(); + } + + } + + private void whereParameter(ProjectPlan projectplan, Query query) { + if (projectplan.getProjectid()!=0&&projectplan.getProjectid()!=99) { + query.setParameter("projectid", projectplan.getProjectid()); + } + if (null!=projectplan.getName()&&!"".equals(projectplan.getName())) { + query.setParameter("name", "%"+projectplan.getName()+"%"); + } + if (null!=projectplan.getOperationer()&&!"".equals(projectplan.getOperationer())) { + query.setParameter("operationer", "%"+projectplan.getOperationer()+"%"); + } + if (null!=projectplan.getRemark()&&!"".equals(projectplan.getRemark())) { + query.setParameter("remark", "%"+projectplan.getRemark()+"%"); + } + } + + @Override + public List findByPage(final String hql, final Object value, final int offset, final int pageSize) { + // TODO Auto-generated method stub + // 通过一个HibernateCallback 对象来执行查询 + //System.out.println(hql); + List list = getHibernateTemplate().executeFind(new HibernateCallback() { + // 实现hibernateCallback接口必须实现的方法 + + public Object doInHibernate(Session session) + throws HibernateException { + // 执行hibernate 分页查询 + Query query= session.createQuery(hql); + whereParameter((ProjectPlan)value, query); + List result =query + .setFirstResult(offset).setMaxResults(pageSize).list(); + session.close(); + return result; + } + + }); + return list; + } + + @Override + public int findRows(ProjectPlan projectplan, String hql) { + int s=0; + Session session=this.getSession(true); + try { + Query query=session.createQuery(hql); + whereParameter(projectplan, query); + s= Integer.valueOf( + query + .list().get(0) + .toString()); + } catch (Exception e) { + e.printStackTrace(); + }finally{ + session.close(); + } + return s; + } + + + + @Override + public int add(ProjectPlan projectplan) throws Exception { + this.getHibernateTemplate().save(projectplan); + return projectplan.getId(); + } + + + + @Override + public void modify(ProjectPlan projectplan) throws Exception { + this.getHibernateTemplate().update(projectplan); + + } + + + + @Override + public void modifyState(ProjectPlan projectplan) throws Exception { + // TODO Auto-generated method stub + + } + + + + @Override + public void modifyInfo(ProjectPlan projectplan) throws Exception { + // TODO Auto-generated method stub + + } + + + + @Override + public List list(ProjectPlan projectplan) + throws Exception { + // TODO Auto-generated method stub + return null; + } + + + + @SuppressWarnings("unchecked") + @Override + public List list(String hql) throws Exception { + return this.getHibernateTemplate().find(hql); + } + + + + @Override + public ProjectPlan load(int id) throws Exception { + + return (ProjectPlan) this.getHibernateTemplate().get(ProjectPlan.class, id); + //return (ProjectCase) this.getSession().load(ProjectCase.class, id); + } + + + + @Override + public List load(String name, String cmdType, + String planPath) throws Exception { + // TODO Auto-generated method stub + return null; + } + + + + @Override + public ProjectPlan get(int id) throws Exception { + // TODO Auto-generated method stub + return null; + } + + + + @Override + public List findJobsList() { + // TODO Auto-generated method stub + return null; + } + + + + @SuppressWarnings("rawtypes") + @Override + public List getList(String sql) throws Exception { + // TODO Auto-generated method stub + List count=null; + Session session=this.getSession(true); + try { + count = session.createQuery(sql).list(); + } catch (Exception e) { + e.printStackTrace(); + }finally{ + session.close(); + } + return count; + } + + +} diff --git a/src/main/java/luckyweb/seagull/spring/dao/ProjectProtocolTemplateDao.java b/src/main/java/luckyweb/seagull/spring/dao/ProjectProtocolTemplateDao.java index bf80231..752873e 100644 --- a/src/main/java/luckyweb/seagull/spring/dao/ProjectProtocolTemplateDao.java +++ b/src/main/java/luckyweb/seagull/spring/dao/ProjectProtocolTemplateDao.java @@ -1,23 +1,23 @@ -package luckyweb.seagull.spring.dao; - -import java.util.List; - -import org.springframework.transaction.annotation.Transactional; - -import luckyweb.seagull.spring.entity.ProjectProtocolTemplate; - - -@Transactional -public interface ProjectProtocolTemplateDao { - - public ProjectProtocolTemplate load(int id) throws Exception; - - public int add(ProjectProtocolTemplate ppt) throws Exception; - public void modify(ProjectProtocolTemplate ppt) throws Exception; - public List findByPage(final String hql, final Object value, final int offset, final int pageSize); - - public int findRows(ProjectProtocolTemplate ppt, String hql); - public void delete(String hql) throws Exception; - public void deleteforob(ProjectProtocolTemplate ppt) throws Exception; - public List findstepsparamList(String hql); -} +package luckyweb.seagull.spring.dao; + +import java.util.List; + +import org.springframework.transaction.annotation.Transactional; + +import luckyweb.seagull.spring.entity.ProjectProtocolTemplate; + + +@Transactional +public interface ProjectProtocolTemplateDao { + + public ProjectProtocolTemplate load(int id) throws Exception; + + public int add(ProjectProtocolTemplate ppt) throws Exception; + public void modify(ProjectProtocolTemplate ppt) throws Exception; + public List findByPage(final String hql, final Object value, final int offset, final int pageSize); + + public int findRows(ProjectProtocolTemplate ppt, String hql); + public void delete(String hql) throws Exception; + public void deleteforob(ProjectProtocolTemplate ppt) throws Exception; + public List findstepsparamList(String hql); +} diff --git a/src/main/java/luckyweb/seagull/spring/dao/ProjectProtocolTemplateImpl.java b/src/main/java/luckyweb/seagull/spring/dao/ProjectProtocolTemplateImpl.java index 999b29d..ac6ea90 100644 --- a/src/main/java/luckyweb/seagull/spring/dao/ProjectProtocolTemplateImpl.java +++ b/src/main/java/luckyweb/seagull/spring/dao/ProjectProtocolTemplateImpl.java @@ -1,147 +1,147 @@ -package luckyweb.seagull.spring.dao; - -import java.util.List; - -import javax.annotation.Resource; - -import org.hibernate.HibernateException; -import org.hibernate.Query; -import org.hibernate.Session; -import org.hibernate.SessionFactory; -import org.springframework.orm.hibernate3.HibernateCallback; -import org.springframework.orm.hibernate3.support.HibernateDaoSupport; -import org.springframework.stereotype.Repository; - -import luckyweb.seagull.spring.entity.ProjectPlan; -import luckyweb.seagull.spring.entity.ProjectProtocolTemplate; -import luckyweb.seagull.spring.entity.ProjectTemplateParams; -import luckyweb.seagull.util.StrLib; - - - - -@Repository("projectprotocoltemplateDao") -public class ProjectProtocolTemplateImpl extends HibernateDaoSupport implements ProjectProtocolTemplateDao{ - - @Resource(name = "sessionFactory") - public void setSuperSessionFactory(SessionFactory sessionFactory) { - super.setSessionFactory(sessionFactory); - } - - - @Override - public ProjectProtocolTemplate load(int id) throws Exception { - //return (UserInfo)this.getSession().get(UserInfo.class, id); - return (ProjectProtocolTemplate) this.getHibernateTemplate().get(ProjectProtocolTemplate.class, id); - } - - @Override - public int add(ProjectProtocolTemplate ppt) throws Exception { - this.getHibernateTemplate().save(ppt); - return ppt.getId(); - } - - @Override - public void modify(ProjectProtocolTemplate ppt) throws Exception { - this.getHibernateTemplate().update(ppt); - } - - @Override - public void deleteforob(ProjectProtocolTemplate ppt) throws Exception { - try{ - this.getHibernateTemplate().delete(ppt); - }catch(Exception e){ - e.printStackTrace(); - } - - } - - private void whereParameter(ProjectProtocolTemplate ppt, Query query) { - if (ppt.getProjectid()!=0&&ppt.getProjectid()!=99) { - query.setParameter("projectid", ppt.getProjectid()); - } - if (!StrLib.isEmpty(ppt.getProtocoltype())) { - query.setParameter("protocoltype", ppt.getProtocoltype()); - } - if (ppt.getOperationer()!=null&&!ppt.getOperationer().equals("")) { - query.setParameter("operationer", "%"+ppt.getOperationer()+"%"); - } - if (ppt.getName()!=null&&!ppt.getName().equals("")) { - query.setParameter("name", "%"+ppt.getName()+"%"); - } - if (ppt.getRemark()!=null&&!ppt.getRemark().equals("")) { - query.setParameter("remark", "%"+ppt.getRemark()+"%"); - } - } - - @Override - public List findByPage(final String hql, final Object value, final int offset, final int pageSize) { - List list = getHibernateTemplate().executeFind(new HibernateCallback() { - // 实现hibernateCallback接口必须实现的方法 - - public Object doInHibernate(Session session) - throws HibernateException { - // 执行hibernate 分页查询 - Query query= session.createQuery(hql); - whereParameter((ProjectProtocolTemplate)value, query); - List result =query - .setFirstResult(offset).setMaxResults(pageSize).list(); - session.close(); - return result; - } - - }); - return list; - } - - - @Override - public int findRows(ProjectProtocolTemplate ppt, String hql) { - int s=0; - Session session=this.getSession(true); - try { - Query query=session.createQuery(hql); - whereParameter(ppt, query); - s= Integer.valueOf( - query - .list().get(0) - .toString()); - } catch (Exception e) { - e.printStackTrace(); - }finally{ - session.close(); - } - return s; - } - - @Override - public void delete(String hql) throws Exception { - Session session=this.getSession(true); - try { - session.beginTransaction(); - Query query =session .createQuery(hql); - query.executeUpdate(); - - session.getTransaction().commit(); - } catch (Exception e) { - e.printStackTrace(); - }finally{ - session.close(); - } - } - - @Override - public List findstepsparamList(String hql) { - Session session = this.getSession(true); - List count=null; - try { - count = session.createSQLQuery(hql).list(); - } catch (Exception e) { - e.printStackTrace(); - }finally{ - session.close(); - } - return count; - } - -} +package luckyweb.seagull.spring.dao; + +import java.util.List; + +import javax.annotation.Resource; + +import org.hibernate.HibernateException; +import org.hibernate.Query; +import org.hibernate.Session; +import org.hibernate.SessionFactory; +import org.springframework.orm.hibernate3.HibernateCallback; +import org.springframework.orm.hibernate3.support.HibernateDaoSupport; +import org.springframework.stereotype.Repository; + +import luckyweb.seagull.spring.entity.ProjectPlan; +import luckyweb.seagull.spring.entity.ProjectProtocolTemplate; +import luckyweb.seagull.spring.entity.ProjectTemplateParams; +import luckyweb.seagull.util.StrLib; + + + + +@Repository("projectprotocoltemplateDao") +public class ProjectProtocolTemplateImpl extends HibernateDaoSupport implements ProjectProtocolTemplateDao{ + + @Resource(name = "sessionFactory") + public void setSuperSessionFactory(SessionFactory sessionFactory) { + super.setSessionFactory(sessionFactory); + } + + + @Override + public ProjectProtocolTemplate load(int id) throws Exception { + //return (UserInfo)this.getSession().get(UserInfo.class, id); + return (ProjectProtocolTemplate) this.getHibernateTemplate().get(ProjectProtocolTemplate.class, id); + } + + @Override + public int add(ProjectProtocolTemplate ppt) throws Exception { + this.getHibernateTemplate().save(ppt); + return ppt.getId(); + } + + @Override + public void modify(ProjectProtocolTemplate ppt) throws Exception { + this.getHibernateTemplate().update(ppt); + } + + @Override + public void deleteforob(ProjectProtocolTemplate ppt) throws Exception { + try{ + this.getHibernateTemplate().delete(ppt); + }catch(Exception e){ + e.printStackTrace(); + } + + } + + private void whereParameter(ProjectProtocolTemplate ppt, Query query) { + if (ppt.getProjectid()!=0&&ppt.getProjectid()!=99) { + query.setParameter("projectid", ppt.getProjectid()); + } + if (!StrLib.isEmpty(ppt.getProtocoltype())) { + query.setParameter("protocoltype", ppt.getProtocoltype()); + } + if (ppt.getOperationer()!=null&&!ppt.getOperationer().equals("")) { + query.setParameter("operationer", "%"+ppt.getOperationer()+"%"); + } + if (ppt.getName()!=null&&!ppt.getName().equals("")) { + query.setParameter("name", "%"+ppt.getName()+"%"); + } + if (ppt.getRemark()!=null&&!ppt.getRemark().equals("")) { + query.setParameter("remark", "%"+ppt.getRemark()+"%"); + } + } + + @Override + public List findByPage(final String hql, final Object value, final int offset, final int pageSize) { + List list = getHibernateTemplate().executeFind(new HibernateCallback() { + // 实现hibernateCallback接口必须实现的方法 + + public Object doInHibernate(Session session) + throws HibernateException { + // 执行hibernate 分页查询 + Query query= session.createQuery(hql); + whereParameter((ProjectProtocolTemplate)value, query); + List result =query + .setFirstResult(offset).setMaxResults(pageSize).list(); + session.close(); + return result; + } + + }); + return list; + } + + + @Override + public int findRows(ProjectProtocolTemplate ppt, String hql) { + int s=0; + Session session=this.getSession(true); + try { + Query query=session.createQuery(hql); + whereParameter(ppt, query); + s= Integer.valueOf( + query + .list().get(0) + .toString()); + } catch (Exception e) { + e.printStackTrace(); + }finally{ + session.close(); + } + return s; + } + + @Override + public void delete(String hql) throws Exception { + Session session=this.getSession(true); + try { + session.beginTransaction(); + Query query =session .createQuery(hql); + query.executeUpdate(); + + session.getTransaction().commit(); + } catch (Exception e) { + e.printStackTrace(); + }finally{ + session.close(); + } + } + + @Override + public List findstepsparamList(String hql) { + Session session = this.getSession(true); + List count=null; + try { + count = session.createSQLQuery(hql).list(); + } catch (Exception e) { + e.printStackTrace(); + }finally{ + session.close(); + } + return count; + } + +} diff --git a/src/main/java/luckyweb/seagull/spring/dao/ProjectTemplateParamsDao.java b/src/main/java/luckyweb/seagull/spring/dao/ProjectTemplateParamsDao.java index 783ad97..c0c1520 100644 --- a/src/main/java/luckyweb/seagull/spring/dao/ProjectTemplateParamsDao.java +++ b/src/main/java/luckyweb/seagull/spring/dao/ProjectTemplateParamsDao.java @@ -1,24 +1,24 @@ -package luckyweb.seagull.spring.dao; - -import java.util.List; - -import org.springframework.transaction.annotation.Transactional; - -import luckyweb.seagull.spring.entity.ProjectTemplateParams; - - -@Transactional -public interface ProjectTemplateParamsDao { - - public ProjectTemplateParams load(int id) throws Exception; - - public int add(ProjectTemplateParams ptp) throws Exception; - - public List findByPage(final String hql, final Object value, final int offset, final int pageSize); - - public int findRows(ProjectTemplateParams ptp, String hql); - public void delete(String hql) throws Exception; - public void deleteforob(ProjectTemplateParams ptp) throws Exception; - public void modify(ProjectTemplateParams ptp) throws Exception; - public List getParamsList(String sql) throws Exception; -} +package luckyweb.seagull.spring.dao; + +import java.util.List; + +import org.springframework.transaction.annotation.Transactional; + +import luckyweb.seagull.spring.entity.ProjectTemplateParams; + + +@Transactional +public interface ProjectTemplateParamsDao { + + public ProjectTemplateParams load(int id) throws Exception; + + public int add(ProjectTemplateParams ptp) throws Exception; + + public List findByPage(final String hql, final Object value, final int offset, final int pageSize); + + public int findRows(ProjectTemplateParams ptp, String hql); + public void delete(String hql) throws Exception; + public void deleteforob(ProjectTemplateParams ptp) throws Exception; + public void modify(ProjectTemplateParams ptp) throws Exception; + public List getParamsList(String sql) throws Exception; +} diff --git a/src/main/java/luckyweb/seagull/spring/dao/ProjectTemplateParamsImpl.java b/src/main/java/luckyweb/seagull/spring/dao/ProjectTemplateParamsImpl.java index 4ab1192..0df769b 100644 --- a/src/main/java/luckyweb/seagull/spring/dao/ProjectTemplateParamsImpl.java +++ b/src/main/java/luckyweb/seagull/spring/dao/ProjectTemplateParamsImpl.java @@ -1,139 +1,139 @@ -package luckyweb.seagull.spring.dao; - -import java.util.List; - -import javax.annotation.Resource; - -import org.hibernate.HibernateException; -import org.hibernate.Query; -import org.hibernate.Session; -import org.hibernate.SessionFactory; -import org.springframework.orm.hibernate3.HibernateCallback; -import org.springframework.orm.hibernate3.support.HibernateDaoSupport; -import org.springframework.stereotype.Repository; - -import luckyweb.seagull.spring.entity.ProjectCase; -import luckyweb.seagull.spring.entity.ProjectCasesteps; -import luckyweb.seagull.spring.entity.ProjectPlanCase; -import luckyweb.seagull.spring.entity.ProjectProtocolTemplate; -import luckyweb.seagull.spring.entity.ProjectTemplateParams; - - - - -@Repository("projecttemplateparamsDao") -public class ProjectTemplateParamsImpl extends HibernateDaoSupport implements ProjectTemplateParamsDao{ - - @Resource(name = "sessionFactory") - public void setSuperSessionFactory(SessionFactory sessionFactory) { - super.setSessionFactory(sessionFactory); - } - - - @Override - public ProjectTemplateParams load(int id) throws Exception { - //return (UserInfo)this.getSession().get(UserInfo.class, id); - return (ProjectTemplateParams) this.getHibernateTemplate().get(ProjectTemplateParams.class, id); - } - - @Override - public int add(ProjectTemplateParams ptp) throws Exception { - this.getHibernateTemplate().save(ptp); - return ptp.getId(); - } - - @Override - public void deleteforob(ProjectTemplateParams ptp) throws Exception { - try{ - this.getHibernateTemplate().delete(ptp); - }catch(Exception e){ - e.printStackTrace(); - } - - } - - @Override - public void modify(ProjectTemplateParams ptp) throws Exception { - this.getHibernateTemplate().update(ptp); - - } - - private void whereParameter(ProjectTemplateParams ptp, Query query) { - if (ptp.getTemplateid()!=0) { - query.setParameter("templateid", ptp.getTemplateid()); - } - } - - @Override - public List findByPage(final String hql, final Object value, final int offset, final int pageSize) { - List list = getHibernateTemplate().executeFind(new HibernateCallback() { - // 实现hibernateCallback接口必须实现的方法 - - public Object doInHibernate(Session session) - throws HibernateException { - // 执行hibernate 分页查询 - Query query= session.createQuery(hql); - whereParameter((ProjectTemplateParams)value, query); - List result =query - .setFirstResult(offset).setMaxResults(pageSize).list(); - session.close(); - return result; - } - - }); - return list; - } - - - @Override - public int findRows(ProjectTemplateParams ptp, String hql) { - int s=0; - Session session=this.getSession(true); - try { - Query query=session.createQuery(hql); - whereParameter(ptp, query); - s= Integer.valueOf( - query - .list().get(0) - .toString()); - } catch (Exception e) { - e.printStackTrace(); - }finally{ - session.close(); - } - return s; - } - - @Override - public void delete(String hql) throws Exception { - Session session=this.getSession(true); - try { - session.beginTransaction(); - Query query =session .createQuery(hql); - query.executeUpdate(); - - session.getTransaction().commit(); - } catch (Exception e) { - e.printStackTrace(); - }finally{ - session.close(); - } - } - - @SuppressWarnings("rawtypes") - @Override - public List getParamsList(String sql) throws Exception { - // TODO Auto-generated method stub - List list=null; - Session session=this.getSession(true); - try { - list = session.createQuery(sql).list(); - } catch (Exception e) { - e.printStackTrace(); - }finally{ - session.close(); - } - return list; - } - -} +package luckyweb.seagull.spring.dao; + +import java.util.List; + +import javax.annotation.Resource; + +import org.hibernate.HibernateException; +import org.hibernate.Query; +import org.hibernate.Session; +import org.hibernate.SessionFactory; +import org.springframework.orm.hibernate3.HibernateCallback; +import org.springframework.orm.hibernate3.support.HibernateDaoSupport; +import org.springframework.stereotype.Repository; + +import luckyweb.seagull.spring.entity.ProjectCase; +import luckyweb.seagull.spring.entity.ProjectCasesteps; +import luckyweb.seagull.spring.entity.ProjectPlanCase; +import luckyweb.seagull.spring.entity.ProjectProtocolTemplate; +import luckyweb.seagull.spring.entity.ProjectTemplateParams; + + + + +@Repository("projecttemplateparamsDao") +public class ProjectTemplateParamsImpl extends HibernateDaoSupport implements ProjectTemplateParamsDao{ + + @Resource(name = "sessionFactory") + public void setSuperSessionFactory(SessionFactory sessionFactory) { + super.setSessionFactory(sessionFactory); + } + + + @Override + public ProjectTemplateParams load(int id) throws Exception { + //return (UserInfo)this.getSession().get(UserInfo.class, id); + return (ProjectTemplateParams) this.getHibernateTemplate().get(ProjectTemplateParams.class, id); + } + + @Override + public int add(ProjectTemplateParams ptp) throws Exception { + this.getHibernateTemplate().save(ptp); + return ptp.getId(); + } + + @Override + public void deleteforob(ProjectTemplateParams ptp) throws Exception { + try{ + this.getHibernateTemplate().delete(ptp); + }catch(Exception e){ + e.printStackTrace(); + } + + } + + @Override + public void modify(ProjectTemplateParams ptp) throws Exception { + this.getHibernateTemplate().update(ptp); + + } + + private void whereParameter(ProjectTemplateParams ptp, Query query) { + if (ptp.getTemplateid()!=0) { + query.setParameter("templateid", ptp.getTemplateid()); + } + } + + @Override + public List findByPage(final String hql, final Object value, final int offset, final int pageSize) { + List list = getHibernateTemplate().executeFind(new HibernateCallback() { + // 实现hibernateCallback接口必须实现的方法 + + public Object doInHibernate(Session session) + throws HibernateException { + // 执行hibernate 分页查询 + Query query= session.createQuery(hql); + whereParameter((ProjectTemplateParams)value, query); + List result =query + .setFirstResult(offset).setMaxResults(pageSize).list(); + session.close(); + return result; + } + + }); + return list; + } + + + @Override + public int findRows(ProjectTemplateParams ptp, String hql) { + int s=0; + Session session=this.getSession(true); + try { + Query query=session.createQuery(hql); + whereParameter(ptp, query); + s= Integer.valueOf( + query + .list().get(0) + .toString()); + } catch (Exception e) { + e.printStackTrace(); + }finally{ + session.close(); + } + return s; + } + + @Override + public void delete(String hql) throws Exception { + Session session=this.getSession(true); + try { + session.beginTransaction(); + Query query =session .createQuery(hql); + query.executeUpdate(); + + session.getTransaction().commit(); + } catch (Exception e) { + e.printStackTrace(); + }finally{ + session.close(); + } + } + + @SuppressWarnings("rawtypes") + @Override + public List getParamsList(String sql) throws Exception { + // TODO Auto-generated method stub + List list=null; + Session session=this.getSession(true); + try { + list = session.createQuery(sql).list(); + } catch (Exception e) { + e.printStackTrace(); + }finally{ + session.close(); + } + return list; + } + +} diff --git a/src/main/java/luckyweb/seagull/spring/dao/ProjectVersionDao.java b/src/main/java/luckyweb/seagull/spring/dao/ProjectVersionDao.java index 4a21ca6..d5a869b 100644 --- a/src/main/java/luckyweb/seagull/spring/dao/ProjectVersionDao.java +++ b/src/main/java/luckyweb/seagull/spring/dao/ProjectVersionDao.java @@ -1,51 +1,51 @@ -package luckyweb.seagull.spring.dao; - -import java.util.List; - -import org.springframework.transaction.annotation.Propagation; -import org.springframework.transaction.annotation.Transactional; - -import luckyweb.seagull.spring.entity.ProjectVersion; - -@Transactional -public interface ProjectVersionDao { - public int add(ProjectVersion projectversion) throws Exception; - - public void modify(ProjectVersion projectversion) throws Exception; - - public void modifyState(ProjectVersion projectversion) throws Exception; - - public void modifyInfo(ProjectVersion projectversion) throws Exception; - - public void delete(int id) throws Exception; - - @Transactional(propagation = Propagation.NOT_SUPPORTED) - public List list(ProjectVersion projectversion) throws Exception; - - @Transactional(propagation = Propagation.NOT_SUPPORTED) - public List list(String hql) throws Exception; - - @Transactional(propagation = Propagation.NOT_SUPPORTED) - public List listavgpro(String sql) throws Exception; - - public ProjectVersion load(int id) throws Exception; - - public List load(String name, String cmdType, String planPath) - throws Exception; - - public ProjectVersion get(int id) throws Exception; - -// public List findByPage(final String hql, final int offset,final int pageSize); -// -// public List findByPage(final String hql, final Object[] values,final int offset, final int pageSize); - - public List findByPage(final String hql, final Object value,final int offset, final int pageSize); - - public List findByPagereport(final String hql, final int offset, final int pageSize); - - public int findRows(ProjectVersion projectversion,String hql); - - public int findRowsreport(String hql); - - public List findJobsList(); -} +package luckyweb.seagull.spring.dao; + +import java.util.List; + +import org.springframework.transaction.annotation.Propagation; +import org.springframework.transaction.annotation.Transactional; + +import luckyweb.seagull.spring.entity.ProjectVersion; + +@Transactional +public interface ProjectVersionDao { + public int add(ProjectVersion projectversion) throws Exception; + + public void modify(ProjectVersion projectversion) throws Exception; + + public void modifyState(ProjectVersion projectversion) throws Exception; + + public void modifyInfo(ProjectVersion projectversion) throws Exception; + + public void delete(int id) throws Exception; + + @Transactional(propagation = Propagation.NOT_SUPPORTED) + public List list(ProjectVersion projectversion) throws Exception; + + @Transactional(propagation = Propagation.NOT_SUPPORTED) + public List list(String hql) throws Exception; + + @Transactional(propagation = Propagation.NOT_SUPPORTED) + public List listavgpro(String sql) throws Exception; + + public ProjectVersion load(int id) throws Exception; + + public List load(String name, String cmdType, String planPath) + throws Exception; + + public ProjectVersion get(int id) throws Exception; + +// public List findByPage(final String hql, final int offset,final int pageSize); +// +// public List findByPage(final String hql, final Object[] values,final int offset, final int pageSize); + + public List findByPage(final String hql, final Object value,final int offset, final int pageSize); + + public List findByPagereport(final String hql, final int offset, final int pageSize); + + public int findRows(ProjectVersion projectversion,String hql); + + public int findRowsreport(String hql); + + public List findJobsList(); +} diff --git a/src/main/java/luckyweb/seagull/spring/dao/ProjectVersionDaoImpl.java b/src/main/java/luckyweb/seagull/spring/dao/ProjectVersionDaoImpl.java index b2595f5..5d9eff8 100644 --- a/src/main/java/luckyweb/seagull/spring/dao/ProjectVersionDaoImpl.java +++ b/src/main/java/luckyweb/seagull/spring/dao/ProjectVersionDaoImpl.java @@ -1,239 +1,239 @@ -package luckyweb.seagull.spring.dao; - -import java.util.List; - -import javax.annotation.Resource; - -import org.hibernate.HibernateException; -import org.hibernate.Query; -import org.hibernate.Session; -import org.hibernate.SessionFactory; -import org.springframework.orm.hibernate3.HibernateCallback; -import org.springframework.orm.hibernate3.support.HibernateDaoSupport; -import org.springframework.stereotype.Repository; - -import luckyweb.seagull.spring.entity.ProjectVersion; -import luckyweb.seagull.util.StrLib; - -@Repository("projectversionDao") -public class ProjectVersionDaoImpl extends HibernateDaoSupport implements ProjectVersionDao{ - - @Resource(name = "sessionFactory") - public void setSuperSessionFactory(SessionFactory sessionFactory) { - super.setSessionFactory(sessionFactory); - } - - - - @Override - public void delete(int versionid) throws Exception { - try{ - ProjectVersion projectversion = this.load(versionid); - this.getHibernateTemplate().delete(projectversion); - }catch(Exception e){ - e.printStackTrace(); - } - - } - - private void whereParameter(ProjectVersion projectversion, Query query) { - - if (projectversion.getProjectid()!=0&&projectversion.getProjectid()!=99) { - query.setParameter("projectid", projectversion.getProjectid()); - } - if (!StrLib.isEmpty(projectversion.getStartactually_launchdate())) { - query.setParameter("startactually_launchdate", projectversion.getStartactually_launchdate()); - } - if (!StrLib.isEmpty(projectversion.getEndactually_launchdate())) { - query.setParameter("endactually_launchdate", projectversion.getEndactually_launchdate()); - } - if (!StrLib.isEmpty(projectversion.getVersionnumber())) { - query.setParameter("versionnumber", "%"+projectversion.getVersionnumber().trim()+"%"); - } - if (!StrLib.isEmpty(projectversion.getImprint())) { - query.setParameter("imprint", "%"+projectversion.getImprint().trim()+"%"); - } - } - - @Override - public List findByPage(final String hql, final Object value, final int offset, final int pageSize) { - // TODO Auto-generated method stub - // 通过一个HibernateCallback 对象来执行查询 - //System.out.println(hql); - List list = getHibernateTemplate().executeFind(new HibernateCallback() { - // 实现hibernateCallback接口必须实现的方法 - - public Object doInHibernate(Session session) - throws HibernateException { - // 执行hibernate 分页查询 - Query query= session.createQuery(hql); - whereParameter((ProjectVersion)value, query); - List result =query - .setFirstResult(offset).setMaxResults(pageSize).list(); - session.close(); - return result; - } - - }); - return list; - } - - @Override - public List findByPagereport(final String hql,final int offset, final int pageSize) { - // TODO Auto-generated method stub - // 通过一个HibernateCallback 对象来执行查询 - //System.out.println(hql); - List list = getHibernateTemplate().executeFind(new HibernateCallback() { - // 实现hibernateCallback接口必须实现的方法 - - public Object doInHibernate(Session session) - throws HibernateException { - // 执行hibernate 分页查询 - //Query query= session.createQuery(hql); - Query query= session.createSQLQuery(hql); - List result =query - .setFirstResult(offset).setMaxResults(pageSize).list(); - session.close(); - return result; - } - - }); - return list; - } - - @Override - public int findRows(ProjectVersion projectversion, String hql) { - int s=0; - Session session=this.getSession(true); - try { - Query query=session.createQuery(hql); - whereParameter(projectversion, query); - s= Integer.valueOf( - query - .list().get(0) - .toString()); - } catch (Exception e) { - e.printStackTrace(); - }finally{ - session.close(); - } - return s; - } - - @Override - public int findRowsreport(String hql) { - int s=0; - Session session=this.getSession(true); - try { - /*Query query=session.createQuery(hql);*/ - Query query= session.createSQLQuery(hql); - s= Integer.valueOf( - query.list().size()); - } catch (Exception e) { - e.printStackTrace(); - }finally{ - session.close(); - } - return s; - } - - - @Override - public int add(ProjectVersion projectversion) throws Exception { - this.getHibernateTemplate().save(projectversion); - return projectversion.getVersionid(); - } - - - - @Override - public void modify(ProjectVersion projectversion) throws Exception { - this.getHibernateTemplate().update(projectversion); - - } - - - - @Override - public void modifyState(ProjectVersion projectversion) throws Exception { - // TODO Auto-generated method stub - - } - - - - @Override - public void modifyInfo(ProjectVersion projectversion) throws Exception { - // TODO Auto-generated method stub - - } - - - - @Override - public List list(ProjectVersion projectversion) - throws Exception { - // TODO Auto-generated method stub - return null; - } - - - - @SuppressWarnings("unchecked") - @Override - public List list(String hql) throws Exception { - return this.getHibernateTemplate().find(hql); - } - - - - @Override - public ProjectVersion load(int versionid) throws Exception { - return (ProjectVersion) this.getHibernateTemplate().get(ProjectVersion.class, versionid); - //return (ProjectVersion) this.getSession().load(ProjectVersion.class, versionid); - } - - - - @Override - public List load(String name, String cmdType, - String planPath) throws Exception { - // TODO Auto-generated method stub - return null; - } - - - - @Override - public ProjectVersion get(int id) throws Exception { - // TODO Auto-generated method stub - return null; - } - - - - @Override - public List findJobsList() { - // TODO Auto-generated method stub - return null; - } - - - - @Override - public List listavgpro(String sql) throws Exception { - // TODO Auto-generated method stub -// List list=new ArrayList(); - List count=null; - Session session=this.getSession(true); - try { - count = session.createSQLQuery(sql).list(); - } catch (Exception e) { - e.printStackTrace(); - }finally{ - session.close(); - } - return count; - } - -} +package luckyweb.seagull.spring.dao; + +import java.util.List; + +import javax.annotation.Resource; + +import org.hibernate.HibernateException; +import org.hibernate.Query; +import org.hibernate.Session; +import org.hibernate.SessionFactory; +import org.springframework.orm.hibernate3.HibernateCallback; +import org.springframework.orm.hibernate3.support.HibernateDaoSupport; +import org.springframework.stereotype.Repository; + +import luckyweb.seagull.spring.entity.ProjectVersion; +import luckyweb.seagull.util.StrLib; + +@Repository("projectversionDao") +public class ProjectVersionDaoImpl extends HibernateDaoSupport implements ProjectVersionDao{ + + @Resource(name = "sessionFactory") + public void setSuperSessionFactory(SessionFactory sessionFactory) { + super.setSessionFactory(sessionFactory); + } + + + + @Override + public void delete(int versionid) throws Exception { + try{ + ProjectVersion projectversion = this.load(versionid); + this.getHibernateTemplate().delete(projectversion); + }catch(Exception e){ + e.printStackTrace(); + } + + } + + private void whereParameter(ProjectVersion projectversion, Query query) { + + if (projectversion.getProjectid()!=0&&projectversion.getProjectid()!=99) { + query.setParameter("projectid", projectversion.getProjectid()); + } + if (!StrLib.isEmpty(projectversion.getStartactually_launchdate())) { + query.setParameter("startactually_launchdate", projectversion.getStartactually_launchdate()); + } + if (!StrLib.isEmpty(projectversion.getEndactually_launchdate())) { + query.setParameter("endactually_launchdate", projectversion.getEndactually_launchdate()); + } + if (!StrLib.isEmpty(projectversion.getVersionnumber())) { + query.setParameter("versionnumber", "%"+projectversion.getVersionnumber().trim()+"%"); + } + if (!StrLib.isEmpty(projectversion.getImprint())) { + query.setParameter("imprint", "%"+projectversion.getImprint().trim()+"%"); + } + } + + @Override + public List findByPage(final String hql, final Object value, final int offset, final int pageSize) { + // TODO Auto-generated method stub + // 通过一个HibernateCallback 对象来执行查询 + //System.out.println(hql); + List list = getHibernateTemplate().executeFind(new HibernateCallback() { + // 实现hibernateCallback接口必须实现的方法 + + public Object doInHibernate(Session session) + throws HibernateException { + // 执行hibernate 分页查询 + Query query= session.createQuery(hql); + whereParameter((ProjectVersion)value, query); + List result =query + .setFirstResult(offset).setMaxResults(pageSize).list(); + session.close(); + return result; + } + + }); + return list; + } + + @Override + public List findByPagereport(final String hql,final int offset, final int pageSize) { + // TODO Auto-generated method stub + // 通过一个HibernateCallback 对象来执行查询 + //System.out.println(hql); + List list = getHibernateTemplate().executeFind(new HibernateCallback() { + // 实现hibernateCallback接口必须实现的方法 + + public Object doInHibernate(Session session) + throws HibernateException { + // 执行hibernate 分页查询 + //Query query= session.createQuery(hql); + Query query= session.createSQLQuery(hql); + List result =query + .setFirstResult(offset).setMaxResults(pageSize).list(); + session.close(); + return result; + } + + }); + return list; + } + + @Override + public int findRows(ProjectVersion projectversion, String hql) { + int s=0; + Session session=this.getSession(true); + try { + Query query=session.createQuery(hql); + whereParameter(projectversion, query); + s= Integer.valueOf( + query + .list().get(0) + .toString()); + } catch (Exception e) { + e.printStackTrace(); + }finally{ + session.close(); + } + return s; + } + + @Override + public int findRowsreport(String hql) { + int s=0; + Session session=this.getSession(true); + try { + /*Query query=session.createQuery(hql);*/ + Query query= session.createSQLQuery(hql); + s= Integer.valueOf( + query.list().size()); + } catch (Exception e) { + e.printStackTrace(); + }finally{ + session.close(); + } + return s; + } + + + @Override + public int add(ProjectVersion projectversion) throws Exception { + this.getHibernateTemplate().save(projectversion); + return projectversion.getVersionid(); + } + + + + @Override + public void modify(ProjectVersion projectversion) throws Exception { + this.getHibernateTemplate().update(projectversion); + + } + + + + @Override + public void modifyState(ProjectVersion projectversion) throws Exception { + // TODO Auto-generated method stub + + } + + + + @Override + public void modifyInfo(ProjectVersion projectversion) throws Exception { + // TODO Auto-generated method stub + + } + + + + @Override + public List list(ProjectVersion projectversion) + throws Exception { + // TODO Auto-generated method stub + return null; + } + + + + @SuppressWarnings("unchecked") + @Override + public List list(String hql) throws Exception { + return this.getHibernateTemplate().find(hql); + } + + + + @Override + public ProjectVersion load(int versionid) throws Exception { + return (ProjectVersion) this.getHibernateTemplate().get(ProjectVersion.class, versionid); + //return (ProjectVersion) this.getSession().load(ProjectVersion.class, versionid); + } + + + + @Override + public List load(String name, String cmdType, + String planPath) throws Exception { + // TODO Auto-generated method stub + return null; + } + + + + @Override + public ProjectVersion get(int id) throws Exception { + // TODO Auto-generated method stub + return null; + } + + + + @Override + public List findJobsList() { + // TODO Auto-generated method stub + return null; + } + + + + @Override + public List listavgpro(String sql) throws Exception { + // TODO Auto-generated method stub +// List list=new ArrayList(); + List count=null; + Session session=this.getSession(true); + try { + count = session.createSQLQuery(sql).list(); + } catch (Exception e) { + e.printStackTrace(); + }finally{ + session.close(); + } + return count; + } + +} diff --git a/src/main/java/luckyweb/seagull/spring/dao/ReviewDao.java b/src/main/java/luckyweb/seagull/spring/dao/ReviewDao.java index 3576a38..1b327a2 100644 --- a/src/main/java/luckyweb/seagull/spring/dao/ReviewDao.java +++ b/src/main/java/luckyweb/seagull/spring/dao/ReviewDao.java @@ -1,27 +1,27 @@ -package luckyweb.seagull.spring.dao; - -import java.util.List; - -import org.springframework.transaction.annotation.Propagation; -import org.springframework.transaction.annotation.Transactional; - -import luckyweb.seagull.spring.entity.Review; - -@Transactional -public interface ReviewDao { - public int add(Review review) throws Exception; - - public void modify(Review review) throws Exception; - - public void delete(int id) throws Exception; - - @Transactional(propagation = Propagation.NOT_SUPPORTED) - public List list(Review review) throws Exception; - - public Review get(int id) throws Exception; - - public List findByPage(final String hql, final Object value,final int offset, final int pageSize); - - public int findRows(Review review,String hql); - public void update(String hql) throws Exception; -} +package luckyweb.seagull.spring.dao; + +import java.util.List; + +import org.springframework.transaction.annotation.Propagation; +import org.springframework.transaction.annotation.Transactional; + +import luckyweb.seagull.spring.entity.Review; + +@Transactional +public interface ReviewDao { + public int add(Review review) throws Exception; + + public void modify(Review review) throws Exception; + + public void delete(int id) throws Exception; + + @Transactional(propagation = Propagation.NOT_SUPPORTED) + public List list(Review review) throws Exception; + + public Review get(int id) throws Exception; + + public List findByPage(final String hql, final Object value,final int offset, final int pageSize); + + public int findRows(Review review,String hql); + public void update(String hql) throws Exception; +} diff --git a/src/main/java/luckyweb/seagull/spring/dao/ReviewDaoImpl.java b/src/main/java/luckyweb/seagull/spring/dao/ReviewDaoImpl.java index 937d73b..e30ed67 100644 --- a/src/main/java/luckyweb/seagull/spring/dao/ReviewDaoImpl.java +++ b/src/main/java/luckyweb/seagull/spring/dao/ReviewDaoImpl.java @@ -1,142 +1,142 @@ -package luckyweb.seagull.spring.dao; - -import java.util.List; - -import javax.annotation.Resource; - -import org.hibernate.HibernateException; -import org.hibernate.Query; -import org.hibernate.Session; -import org.hibernate.SessionFactory; -import org.springframework.orm.hibernate3.HibernateCallback; -import org.springframework.orm.hibernate3.support.HibernateDaoSupport; -import org.springframework.stereotype.Repository; - -import luckyweb.seagull.spring.entity.Review; - -@Repository("reviewDao") -public class ReviewDaoImpl extends HibernateDaoSupport implements ReviewDao{ - - @Resource(name = "sessionFactory") - public void setSuperSessionFactory(SessionFactory sessionFactory) { - super.setSessionFactory(sessionFactory); - } - - - - @Override - public void delete(int id) throws Exception { - try{ - Review review = this.get(id); - this.getHibernateTemplate().delete(review); - }catch(Exception e){ - e.printStackTrace(); - } - - } - - @Override - public void update(String hql) throws Exception { - Session session=this.getSession(true); - session.beginTransaction(); - Query query =session .createQuery(hql); - query.executeUpdate(); - - session.getTransaction().commit(); - session.close(); - } - - private void whereParameter(Review review, Query query) { - if (review.getProjectid()!=0) { - query.setParameter("projectid", review.getProjectid()); - } - if (review.getReview_startdate()!=null&&!"".equals(review.getReview_startdate())) { - query.setParameter("review_startdate", review.getReview_startdate()); - } - if (review.getReview_enddate()!=null&&!"".equals(review.getReview_enddate())) { - query.setParameter("review_enddate", review.getReview_enddate()); - } - if (null!=review.getVersion()&&!"".equals(review.getVersion())) { - query.setParameter("version", "%"+review.getVersion()+"%"); - } - if (null!=review.getReview_type()&&!"".equals(review.getReview_type())) { - query.setParameter("review_type", "%"+review.getReview_type()+"%"); - } - if (null!=review.getReview_result()&&!"".equals(review.getReview_result())) { - query.setParameter("review_result", "%"+review.getReview_result()+"%"); - } - } - - @Override - public List findByPage(final String hql, final Object value, final int offset, final int pageSize) { - // TODO Auto-generated method stub - // 通过一个HibernateCallback 对象来执行查询 - //System.out.println(hql); - List list = getHibernateTemplate().executeFind(new HibernateCallback() { - // 实现hibernateCallback接口必须实现的方法 - - public Object doInHibernate(Session session) - throws HibernateException { - // 执行hibernate 分页查询 - Query query= session.createQuery(hql); - whereParameter((Review)value, query); - List result =query - .setFirstResult(offset).setMaxResults(pageSize).list(); - session.close(); - return result; - } - - }); - return list; - } - - @Override - public int findRows(Review review, String hql) { - int s=0; - Session session=this.getSession(true); - try { - Query query=session.createQuery(hql); - whereParameter(review, query); - s= Integer.valueOf( - query - .list().get(0) - .toString()); - } catch (Exception e) { - e.printStackTrace(); - }finally{ - session.close(); - } - return s; - } - - - - @Override - public int add(Review review) throws Exception { - this.getHibernateTemplate().save(review); - return review.getId(); - } - - - - @Override - public void modify(Review review) throws Exception { - this.getHibernateTemplate().update(review); - - } - - - @Override - public List list(Review review) - throws Exception { - // TODO Auto-generated method stub - return null; - } - - @Override - public Review get(int id) throws Exception { - // TODO Auto-generated method stub - return (Review) this.getHibernateTemplate().get(Review.class, id); - } - -} +package luckyweb.seagull.spring.dao; + +import java.util.List; + +import javax.annotation.Resource; + +import org.hibernate.HibernateException; +import org.hibernate.Query; +import org.hibernate.Session; +import org.hibernate.SessionFactory; +import org.springframework.orm.hibernate3.HibernateCallback; +import org.springframework.orm.hibernate3.support.HibernateDaoSupport; +import org.springframework.stereotype.Repository; + +import luckyweb.seagull.spring.entity.Review; + +@Repository("reviewDao") +public class ReviewDaoImpl extends HibernateDaoSupport implements ReviewDao{ + + @Resource(name = "sessionFactory") + public void setSuperSessionFactory(SessionFactory sessionFactory) { + super.setSessionFactory(sessionFactory); + } + + + + @Override + public void delete(int id) throws Exception { + try{ + Review review = this.get(id); + this.getHibernateTemplate().delete(review); + }catch(Exception e){ + e.printStackTrace(); + } + + } + + @Override + public void update(String hql) throws Exception { + Session session=this.getSession(true); + session.beginTransaction(); + Query query =session .createQuery(hql); + query.executeUpdate(); + + session.getTransaction().commit(); + session.close(); + } + + private void whereParameter(Review review, Query query) { + if (review.getProjectid()!=0) { + query.setParameter("projectid", review.getProjectid()); + } + if (review.getReview_startdate()!=null&&!"".equals(review.getReview_startdate())) { + query.setParameter("review_startdate", review.getReview_startdate()); + } + if (review.getReview_enddate()!=null&&!"".equals(review.getReview_enddate())) { + query.setParameter("review_enddate", review.getReview_enddate()); + } + if (null!=review.getVersion()&&!"".equals(review.getVersion())) { + query.setParameter("version", "%"+review.getVersion()+"%"); + } + if (null!=review.getReview_type()&&!"".equals(review.getReview_type())) { + query.setParameter("review_type", "%"+review.getReview_type()+"%"); + } + if (null!=review.getReview_result()&&!"".equals(review.getReview_result())) { + query.setParameter("review_result", "%"+review.getReview_result()+"%"); + } + } + + @Override + public List findByPage(final String hql, final Object value, final int offset, final int pageSize) { + // TODO Auto-generated method stub + // 通过一个HibernateCallback 对象来执行查询 + //System.out.println(hql); + List list = getHibernateTemplate().executeFind(new HibernateCallback() { + // 实现hibernateCallback接口必须实现的方法 + + public Object doInHibernate(Session session) + throws HibernateException { + // 执行hibernate 分页查询 + Query query= session.createQuery(hql); + whereParameter((Review)value, query); + List result =query + .setFirstResult(offset).setMaxResults(pageSize).list(); + session.close(); + return result; + } + + }); + return list; + } + + @Override + public int findRows(Review review, String hql) { + int s=0; + Session session=this.getSession(true); + try { + Query query=session.createQuery(hql); + whereParameter(review, query); + s= Integer.valueOf( + query + .list().get(0) + .toString()); + } catch (Exception e) { + e.printStackTrace(); + }finally{ + session.close(); + } + return s; + } + + + + @Override + public int add(Review review) throws Exception { + this.getHibernateTemplate().save(review); + return review.getId(); + } + + + + @Override + public void modify(Review review) throws Exception { + this.getHibernateTemplate().update(review); + + } + + + @Override + public List list(Review review) + throws Exception { + // TODO Auto-generated method stub + return null; + } + + @Override + public Review get(int id) throws Exception { + // TODO Auto-generated method stub + return (Review) this.getHibernateTemplate().get(Review.class, id); + } + +} diff --git a/src/main/java/luckyweb/seagull/spring/dao/ReviewInfoDao.java b/src/main/java/luckyweb/seagull/spring/dao/ReviewInfoDao.java index 97df7ea..c8a8fbc 100644 --- a/src/main/java/luckyweb/seagull/spring/dao/ReviewInfoDao.java +++ b/src/main/java/luckyweb/seagull/spring/dao/ReviewInfoDao.java @@ -1,29 +1,29 @@ -package luckyweb.seagull.spring.dao; - -import java.util.List; - -import org.springframework.transaction.annotation.Propagation; -import org.springframework.transaction.annotation.Transactional; - -import luckyweb.seagull.spring.entity.ReviewInfo; - - -@Transactional -public interface ReviewInfoDao { - public int add(ReviewInfo reviewinfo) throws Exception; - - public void modify(ReviewInfo reviewinfo) throws Exception; - - public void delete(int id) throws Exception; - - @Transactional(propagation = Propagation.NOT_SUPPORTED) - public List list(ReviewInfo reviewinfo) throws Exception; - - public ReviewInfo get(int id) throws Exception; - - public List findByPage(final String hql, final Object value,final int offset, final int pageSize); - - public int findRows(ReviewInfo reviewinfo,String hql); - - public void update(String hql) throws Exception; -} +package luckyweb.seagull.spring.dao; + +import java.util.List; + +import org.springframework.transaction.annotation.Propagation; +import org.springframework.transaction.annotation.Transactional; + +import luckyweb.seagull.spring.entity.ReviewInfo; + + +@Transactional +public interface ReviewInfoDao { + public int add(ReviewInfo reviewinfo) throws Exception; + + public void modify(ReviewInfo reviewinfo) throws Exception; + + public void delete(int id) throws Exception; + + @Transactional(propagation = Propagation.NOT_SUPPORTED) + public List list(ReviewInfo reviewinfo) throws Exception; + + public ReviewInfo get(int id) throws Exception; + + public List findByPage(final String hql, final Object value,final int offset, final int pageSize); + + public int findRows(ReviewInfo reviewinfo,String hql); + + public void update(String hql) throws Exception; +} diff --git a/src/main/java/luckyweb/seagull/spring/dao/ReviewInfoDaoImpl.java b/src/main/java/luckyweb/seagull/spring/dao/ReviewInfoDaoImpl.java index 915e759..0b3a003 100644 --- a/src/main/java/luckyweb/seagull/spring/dao/ReviewInfoDaoImpl.java +++ b/src/main/java/luckyweb/seagull/spring/dao/ReviewInfoDaoImpl.java @@ -1,129 +1,129 @@ -package luckyweb.seagull.spring.dao; - -import java.util.List; - -import javax.annotation.Resource; - -import org.hibernate.HibernateException; -import org.hibernate.Query; -import org.hibernate.Session; -import org.hibernate.SessionFactory; -import org.springframework.orm.hibernate3.HibernateCallback; -import org.springframework.orm.hibernate3.support.HibernateDaoSupport; -import org.springframework.stereotype.Repository; - -import luckyweb.seagull.spring.entity.ReviewInfo; - -@Repository("reviewInfoDao") -public class ReviewInfoDaoImpl extends HibernateDaoSupport implements ReviewInfoDao{ - - @Resource(name = "sessionFactory") - public void setSuperSessionFactory(SessionFactory sessionFactory) { - super.setSessionFactory(sessionFactory); - } - - - - @Override - public void delete(int id) throws Exception { - try{ - ReviewInfo reviewinfo = this.get(id); - this.getHibernateTemplate().delete(reviewinfo); - }catch(Exception e){ - e.printStackTrace(); - } - - } - - @Override - public void update(String hql) throws Exception { - Session session=this.getSession(true); - session.beginTransaction(); - Query query =session .createQuery(hql); - query.executeUpdate(); - - session.getTransaction().commit(); - session.close(); - } - - private void whereParameter(ReviewInfo reviewinfo, Query query) { - - if (reviewinfo.getReview_id()!=0) { - query.setParameter("review_id", reviewinfo.getReview_id()); - } - - } - - @Override - public List findByPage(final String hql, final Object value, final int offset, final int pageSize) { - // TODO Auto-generated method stub - // 通过一个HibernateCallback 对象来执行查询 - //System.out.println(hql); - List list = getHibernateTemplate().executeFind(new HibernateCallback() { - // 实现hibernateCallback接口必须实现的方法 - - public Object doInHibernate(Session session) - throws HibernateException { - // 执行hibernate 分页查询 - Query query= session.createQuery(hql); - whereParameter((ReviewInfo)value, query); - List result =query - .setFirstResult(offset).setMaxResults(pageSize).list(); - session.close(); - return result; - } - - }); - return list; - } - - @Override - public int findRows(ReviewInfo reviewinfo, String hql) { - int s=0; - Session session=this.getSession(true); - try { - Query query=session.createQuery(hql); - whereParameter(reviewinfo, query); - s= Integer.valueOf( - query - .list().get(0) - .toString()); - } catch (Exception e) { - e.printStackTrace(); - }finally{ - session.close(); - } - return s; - } - - - - @Override - public int add(ReviewInfo reviewinfo) throws Exception { - this.getHibernateTemplate().save(reviewinfo); - return reviewinfo.getId(); - } - - - - @Override - public void modify(ReviewInfo reviewinfo) throws Exception { - this.getHibernateTemplate().update(reviewinfo); - - } - - - @Override - public List list(ReviewInfo reviewinfo) - throws Exception { - // TODO Auto-generated method stub - return null; - } - - @Override - public ReviewInfo get(int id) throws Exception { - // TODO Auto-generated method stub - return (ReviewInfo) this.getHibernateTemplate().get(ReviewInfo.class, id); - } - -} +package luckyweb.seagull.spring.dao; + +import java.util.List; + +import javax.annotation.Resource; + +import org.hibernate.HibernateException; +import org.hibernate.Query; +import org.hibernate.Session; +import org.hibernate.SessionFactory; +import org.springframework.orm.hibernate3.HibernateCallback; +import org.springframework.orm.hibernate3.support.HibernateDaoSupport; +import org.springframework.stereotype.Repository; + +import luckyweb.seagull.spring.entity.ReviewInfo; + +@Repository("reviewInfoDao") +public class ReviewInfoDaoImpl extends HibernateDaoSupport implements ReviewInfoDao{ + + @Resource(name = "sessionFactory") + public void setSuperSessionFactory(SessionFactory sessionFactory) { + super.setSessionFactory(sessionFactory); + } + + + + @Override + public void delete(int id) throws Exception { + try{ + ReviewInfo reviewinfo = this.get(id); + this.getHibernateTemplate().delete(reviewinfo); + }catch(Exception e){ + e.printStackTrace(); + } + + } + + @Override + public void update(String hql) throws Exception { + Session session=this.getSession(true); + session.beginTransaction(); + Query query =session .createQuery(hql); + query.executeUpdate(); + + session.getTransaction().commit(); + session.close(); + } + + private void whereParameter(ReviewInfo reviewinfo, Query query) { + + if (reviewinfo.getReview_id()!=0) { + query.setParameter("review_id", reviewinfo.getReview_id()); + } + + } + + @Override + public List findByPage(final String hql, final Object value, final int offset, final int pageSize) { + // TODO Auto-generated method stub + // 通过一个HibernateCallback 对象来执行查询 + //System.out.println(hql); + List list = getHibernateTemplate().executeFind(new HibernateCallback() { + // 实现hibernateCallback接口必须实现的方法 + + public Object doInHibernate(Session session) + throws HibernateException { + // 执行hibernate 分页查询 + Query query= session.createQuery(hql); + whereParameter((ReviewInfo)value, query); + List result =query + .setFirstResult(offset).setMaxResults(pageSize).list(); + session.close(); + return result; + } + + }); + return list; + } + + @Override + public int findRows(ReviewInfo reviewinfo, String hql) { + int s=0; + Session session=this.getSession(true); + try { + Query query=session.createQuery(hql); + whereParameter(reviewinfo, query); + s= Integer.valueOf( + query + .list().get(0) + .toString()); + } catch (Exception e) { + e.printStackTrace(); + }finally{ + session.close(); + } + return s; + } + + + + @Override + public int add(ReviewInfo reviewinfo) throws Exception { + this.getHibernateTemplate().save(reviewinfo); + return reviewinfo.getId(); + } + + + + @Override + public void modify(ReviewInfo reviewinfo) throws Exception { + this.getHibernateTemplate().update(reviewinfo); + + } + + + @Override + public List list(ReviewInfo reviewinfo) + throws Exception { + // TODO Auto-generated method stub + return null; + } + + @Override + public ReviewInfo get(int id) throws Exception { + // TODO Auto-generated method stub + return (ReviewInfo) this.getHibernateTemplate().get(ReviewInfo.class, id); + } + +} diff --git a/src/main/java/luckyweb/seagull/spring/dao/SecondarySectorDao.java b/src/main/java/luckyweb/seagull/spring/dao/SecondarySectorDao.java index 1f5f7f2..1bb5424 100644 --- a/src/main/java/luckyweb/seagull/spring/dao/SecondarySectorDao.java +++ b/src/main/java/luckyweb/seagull/spring/dao/SecondarySectorDao.java @@ -1,42 +1,42 @@ -package luckyweb.seagull.spring.dao; - -import java.util.List; - -import org.springframework.transaction.annotation.Propagation; -import org.springframework.transaction.annotation.Transactional; - -import luckyweb.seagull.spring.entity.SecondarySector; - -@Transactional -public interface SecondarySectorDao { - public int add(SecondarySector sector) throws Exception; - - public void modify(SecondarySector sector) throws Exception; - - public void modifyState(SecondarySector sector) throws Exception; - - public void modifyInfo(SecondarySector sector) throws Exception; - - public void delete(SecondarySector sector) throws Exception; - - @Transactional(propagation = Propagation.NOT_SUPPORTED) - public List list(SecondarySector sector) throws Exception; - - @Transactional(propagation = Propagation.NOT_SUPPORTED) - public List list() throws Exception; - - public SecondarySector load(int id) throws Exception; - - public List load(String name, String cmdType, String planPath) - throws Exception; - -// public List findByPage(final String hql, final int offset,final int pageSize); -// -// public List findByPage(final String hql, final Object[] values,final int offset, final int pageSize); - - public List findByPage(final String hql, final Object value,final int offset, final int pageSize); - - public int findRows(SecondarySector sector,String hql); - - public List findSectorList() throws Exception ; -} +package luckyweb.seagull.spring.dao; + +import java.util.List; + +import org.springframework.transaction.annotation.Propagation; +import org.springframework.transaction.annotation.Transactional; + +import luckyweb.seagull.spring.entity.SecondarySector; + +@Transactional +public interface SecondarySectorDao { + public int add(SecondarySector sector) throws Exception; + + public void modify(SecondarySector sector) throws Exception; + + public void modifyState(SecondarySector sector) throws Exception; + + public void modifyInfo(SecondarySector sector) throws Exception; + + public void delete(SecondarySector sector) throws Exception; + + @Transactional(propagation = Propagation.NOT_SUPPORTED) + public List list(SecondarySector sector) throws Exception; + + @Transactional(propagation = Propagation.NOT_SUPPORTED) + public List list() throws Exception; + + public SecondarySector load(int id) throws Exception; + + public List load(String name, String cmdType, String planPath) + throws Exception; + +// public List findByPage(final String hql, final int offset,final int pageSize); +// +// public List findByPage(final String hql, final Object[] values,final int offset, final int pageSize); + + public List findByPage(final String hql, final Object value,final int offset, final int pageSize); + + public int findRows(SecondarySector sector,String hql); + + public List findSectorList() throws Exception ; +} diff --git a/src/main/java/luckyweb/seagull/spring/dao/SecondarySectorDaoImpl.java b/src/main/java/luckyweb/seagull/spring/dao/SecondarySectorDaoImpl.java index 3bd42a8..63b6207 100644 --- a/src/main/java/luckyweb/seagull/spring/dao/SecondarySectorDaoImpl.java +++ b/src/main/java/luckyweb/seagull/spring/dao/SecondarySectorDaoImpl.java @@ -1,154 +1,154 @@ -package luckyweb.seagull.spring.dao; - -import java.util.List; - -import javax.annotation.Resource; - -import org.hibernate.HibernateException; -import org.hibernate.Query; -import org.hibernate.Session; -import org.hibernate.SessionFactory; -import org.springframework.orm.hibernate3.HibernateCallback; -import org.springframework.orm.hibernate3.support.HibernateDaoSupport; -import org.springframework.stereotype.Repository; - -import luckyweb.seagull.spring.entity.SecondarySector; -import luckyweb.seagull.util.StrLib; - -@Repository("secondarysectorDao") -public class SecondarySectorDaoImpl extends HibernateDaoSupport implements SecondarySectorDao{ - - @Resource(name = "sessionFactory") - public void setSuperSessionFactory(SessionFactory sessionFactory) { - super.setSessionFactory(sessionFactory); - } - - @Override - public int add(SecondarySector sector) throws Exception { - // TODO Auto-generated method stub - this.getHibernateTemplate().save(sector); - return sector.getSectorid(); - } - - @Override - public void modify(SecondarySector sector) throws Exception { - // TODO Auto-generated method stub - this.getHibernateTemplate().update(sector); - } - - @Override - public void modifyState(SecondarySector sector) throws Exception { - // TODO Auto-generated method stub - - } - - @Override - public void modifyInfo(SecondarySector sector) throws Exception { - // TODO Auto-generated method stub - - } - - @Override - public void delete(SecondarySector sector) throws Exception { - // TODO Auto-generated method stub - this.getHibernateTemplate().delete(sector); - } - - @Override - public List list(SecondarySector sector) throws Exception { - // TODO Auto-generated method stub - @SuppressWarnings("unchecked") - List list = this.getHibernateTemplate().find(" from SecondarySector"); - return list; - } - - @SuppressWarnings("unchecked") - @Override - public List list() throws Exception { - // TODO Auto-generated method stub - return this.getHibernateTemplate().loadAll(SecondarySector.class); - } - - @Override - public SecondarySector load(int id) throws Exception { - // TODO Auto-generated method stub - return (SecondarySector) this.getHibernateTemplate().get(SecondarySector.class, id); - } - - @Override - public List load(String name, String cmdType, - String planPath) throws Exception { - // TODO Auto-generated method stub - return null; - } - - private void whereParameter(SecondarySector ss, Query query) { - - if (!StrLib.isEmpty(ss.getDepartmenthead())) { - query.setParameter("departmenthead", "%"+ss.getDepartmenthead().trim()+"%"); - } - if (!StrLib.isEmpty(ss.getDepartmentname())) { - query.setParameter("departmentname","%"+ss.getDepartmentname().trim()+"%"); - } - - } - - @Override - public List findByPage(final String hql, final Object value, final int offset, final int pageSize) { - // TODO Auto-generated method stub - // 通过一个HibernateCallback 对象来执行查询 - //System.out.println(hql); - List list = getHibernateTemplate().executeFind(new HibernateCallback() { - // 实现hibernateCallback接口必须实现的方法 - - public Object doInHibernate(Session session) - throws HibernateException { - // 执行hibernate 分页查询 - Query query= session.createQuery(hql); - whereParameter((SecondarySector)value, query); - List result =query - .setFirstResult(offset).setMaxResults(pageSize).list(); - session.close(); - return result; - } - - }); - return list; - } - - @Override - public int findRows(SecondarySector sector, String hql) { - int s=0; - Session session=this.getSession(true); - try { - Query query=session.createQuery(hql); - whereParameter(sector, query); - s= Integer.valueOf( - query - .list().get(0) - .toString()); - } catch (Exception e) { - e.printStackTrace(); - }finally{ - session.close(); - } - return s; - } - - @SuppressWarnings("rawtypes") - @Override - public List findSectorList() throws Exception { - // TODO Auto-generated method stub - List list=null; - Session session=this.getSession(true); - try { - list = session.createQuery(" from SecondarySector order by sectorid").list(); - } catch (Exception e) { - e.printStackTrace(); - }finally{ - session.close(); - } - return list; - } - -} +package luckyweb.seagull.spring.dao; + +import java.util.List; + +import javax.annotation.Resource; + +import org.hibernate.HibernateException; +import org.hibernate.Query; +import org.hibernate.Session; +import org.hibernate.SessionFactory; +import org.springframework.orm.hibernate3.HibernateCallback; +import org.springframework.orm.hibernate3.support.HibernateDaoSupport; +import org.springframework.stereotype.Repository; + +import luckyweb.seagull.spring.entity.SecondarySector; +import luckyweb.seagull.util.StrLib; + +@Repository("secondarysectorDao") +public class SecondarySectorDaoImpl extends HibernateDaoSupport implements SecondarySectorDao{ + + @Resource(name = "sessionFactory") + public void setSuperSessionFactory(SessionFactory sessionFactory) { + super.setSessionFactory(sessionFactory); + } + + @Override + public int add(SecondarySector sector) throws Exception { + // TODO Auto-generated method stub + this.getHibernateTemplate().save(sector); + return sector.getSectorid(); + } + + @Override + public void modify(SecondarySector sector) throws Exception { + // TODO Auto-generated method stub + this.getHibernateTemplate().update(sector); + } + + @Override + public void modifyState(SecondarySector sector) throws Exception { + // TODO Auto-generated method stub + + } + + @Override + public void modifyInfo(SecondarySector sector) throws Exception { + // TODO Auto-generated method stub + + } + + @Override + public void delete(SecondarySector sector) throws Exception { + // TODO Auto-generated method stub + this.getHibernateTemplate().delete(sector); + } + + @Override + public List list(SecondarySector sector) throws Exception { + // TODO Auto-generated method stub + @SuppressWarnings("unchecked") + List list = this.getHibernateTemplate().find(" from SecondarySector"); + return list; + } + + @SuppressWarnings("unchecked") + @Override + public List list() throws Exception { + // TODO Auto-generated method stub + return this.getHibernateTemplate().loadAll(SecondarySector.class); + } + + @Override + public SecondarySector load(int id) throws Exception { + // TODO Auto-generated method stub + return (SecondarySector) this.getHibernateTemplate().get(SecondarySector.class, id); + } + + @Override + public List load(String name, String cmdType, + String planPath) throws Exception { + // TODO Auto-generated method stub + return null; + } + + private void whereParameter(SecondarySector ss, Query query) { + + if (!StrLib.isEmpty(ss.getDepartmenthead())) { + query.setParameter("departmenthead", "%"+ss.getDepartmenthead().trim()+"%"); + } + if (!StrLib.isEmpty(ss.getDepartmentname())) { + query.setParameter("departmentname","%"+ss.getDepartmentname().trim()+"%"); + } + + } + + @Override + public List findByPage(final String hql, final Object value, final int offset, final int pageSize) { + // TODO Auto-generated method stub + // 通过一个HibernateCallback 对象来执行查询 + //System.out.println(hql); + List list = getHibernateTemplate().executeFind(new HibernateCallback() { + // 实现hibernateCallback接口必须实现的方法 + + public Object doInHibernate(Session session) + throws HibernateException { + // 执行hibernate 分页查询 + Query query= session.createQuery(hql); + whereParameter((SecondarySector)value, query); + List result =query + .setFirstResult(offset).setMaxResults(pageSize).list(); + session.close(); + return result; + } + + }); + return list; + } + + @Override + public int findRows(SecondarySector sector, String hql) { + int s=0; + Session session=this.getSession(true); + try { + Query query=session.createQuery(hql); + whereParameter(sector, query); + s= Integer.valueOf( + query + .list().get(0) + .toString()); + } catch (Exception e) { + e.printStackTrace(); + }finally{ + session.close(); + } + return s; + } + + @SuppressWarnings("rawtypes") + @Override + public List findSectorList() throws Exception { + // TODO Auto-generated method stub + List list=null; + Session session=this.getSession(true); + try { + list = session.createQuery(" from SecondarySector order by sectorid").list(); + } catch (Exception e) { + e.printStackTrace(); + }finally{ + session.close(); + } + return list; + } + +} diff --git a/src/main/java/luckyweb/seagull/spring/dao/SectorProjectsDao.java b/src/main/java/luckyweb/seagull/spring/dao/SectorProjectsDao.java index 08db2ee..8f865c8 100644 --- a/src/main/java/luckyweb/seagull/spring/dao/SectorProjectsDao.java +++ b/src/main/java/luckyweb/seagull/spring/dao/SectorProjectsDao.java @@ -1,45 +1,45 @@ -package luckyweb.seagull.spring.dao; - -import java.util.List; - -import org.springframework.transaction.annotation.Propagation; -import org.springframework.transaction.annotation.Transactional; - -import luckyweb.seagull.spring.entity.SectorProjects; - -@Transactional -public interface SectorProjectsDao { - public int add(SectorProjects sectorprojects) throws Exception; - - public void modify(SectorProjects sectorprojects) throws Exception; - - public void modifyState(SectorProjects sectorprojects) throws Exception; - - public void modifyInfo(SectorProjects sectorprojects) throws Exception; - - public void delete(SectorProjects sectorprojects) throws Exception; - - @Transactional(propagation = Propagation.NOT_SUPPORTED) - public List list(SectorProjects sectorprojects) throws Exception; - - @Transactional(propagation = Propagation.NOT_SUPPORTED) - public List list() throws Exception; - - public Object findproject(int projectid) throws Exception; - - public List load(String name, String cmdType, String planPath) - throws Exception; - - public int getid(String projectname) throws Exception; - -// public List findByPage(final String hql, final int offset,final int pageSize); -// -// public List findByPage(final String hql, final Object[] values,final int offset, final int pageSize); - - public List findByPage(final String hql, final Object value,final int offset, final int pageSize); - - public int findRows(SectorProjects sectorprojects,String hql); - public SectorProjects load(int projectid) throws Exception; - public int projectrow(String hql); - public List getAllProject(); -} +package luckyweb.seagull.spring.dao; + +import java.util.List; + +import org.springframework.transaction.annotation.Propagation; +import org.springframework.transaction.annotation.Transactional; + +import luckyweb.seagull.spring.entity.SectorProjects; + +@Transactional +public interface SectorProjectsDao { + public int add(SectorProjects sectorprojects) throws Exception; + + public void modify(SectorProjects sectorprojects) throws Exception; + + public void modifyState(SectorProjects sectorprojects) throws Exception; + + public void modifyInfo(SectorProjects sectorprojects) throws Exception; + + public void delete(SectorProjects sectorprojects) throws Exception; + + @Transactional(propagation = Propagation.NOT_SUPPORTED) + public List list(SectorProjects sectorprojects) throws Exception; + + @Transactional(propagation = Propagation.NOT_SUPPORTED) + public List list() throws Exception; + + public Object findproject(int projectid) throws Exception; + + public List load(String name, String cmdType, String planPath) + throws Exception; + + public int getid(String projectname) throws Exception; + +// public List findByPage(final String hql, final int offset,final int pageSize); +// +// public List findByPage(final String hql, final Object[] values,final int offset, final int pageSize); + + public List findByPage(final String hql, final Object value,final int offset, final int pageSize); + + public int findRows(SectorProjects sectorprojects,String hql); + public SectorProjects load(int projectid) throws Exception; + public int projectrow(String hql); + public List getAllProject(); +} diff --git a/src/main/java/luckyweb/seagull/spring/dao/SectorProjectsDaoImpl.java b/src/main/java/luckyweb/seagull/spring/dao/SectorProjectsDaoImpl.java index ea7e19d..f436d8e 100644 --- a/src/main/java/luckyweb/seagull/spring/dao/SectorProjectsDaoImpl.java +++ b/src/main/java/luckyweb/seagull/spring/dao/SectorProjectsDaoImpl.java @@ -1,214 +1,214 @@ -package luckyweb.seagull.spring.dao; - -import java.util.ArrayList; -import java.util.List; - -import javax.annotation.Resource; - -import org.hibernate.HibernateException; -import org.hibernate.Query; -import org.hibernate.Session; -import org.hibernate.SessionFactory; -import org.springframework.orm.hibernate3.HibernateCallback; -import org.springframework.orm.hibernate3.support.HibernateDaoSupport; -import org.springframework.stereotype.Repository; - -import luckyweb.seagull.spring.entity.ProjectVersion; -import luckyweb.seagull.spring.entity.SectorProjects; -import luckyweb.seagull.spring.entity.UserInfo; -import luckyweb.seagull.util.StrLib; - -@Repository("sectorprojectsDao") -public class SectorProjectsDaoImpl extends HibernateDaoSupport implements SectorProjectsDao{ - - @Resource(name = "sessionFactory") - public void setSuperSessionFactory(SessionFactory sessionFactory) { - super.setSessionFactory(sessionFactory); - } - - - - @Override - public void delete(SectorProjects sectorprojects) throws Exception { - // TODO Auto-generated method stub - this.getHibernateTemplate().delete(sectorprojects); - } - - private void whereParameter(SectorProjects sectorprojects, Query query) { - - if (!StrLib.isEmpty(sectorprojects.getProjectname())) { - query.setParameter("projectname", "%"+sectorprojects.getProjectname().trim()+"%"); - } - if (!StrLib.isEmpty(sectorprojects.getProjectmanager())) { - query.setParameter("projectmanager","%"+sectorprojects.getProjectmanager().trim()+"%"); - } - if (!StrLib.isEmpty(sectorprojects.getProjectsign())) { - query.setParameter("projectsign","%"+sectorprojects.getProjectsign().trim()+"%"); - } - } - - @Override - public List findByPage(final String hql, final Object value, final int offset, final int pageSize) { - // TODO Auto-generated method stub - // 通过一个HibernateCallback 对象来执行查询 - //System.out.println(hql); - List list = getHibernateTemplate().executeFind(new HibernateCallback() { - // 实现hibernateCallback接口必须实现的方法 - - public Object doInHibernate(Session session) - throws HibernateException { - // 执行hibernate 分页查询 - Query query= session.createQuery(hql); - whereParameter((SectorProjects)value, query); - List result =query - .setFirstResult(offset).setMaxResults(pageSize).list(); - session.close(); - return result; - } - - }); - return list; - } - - @Override - public int findRows(SectorProjects sectorprojects, String hql) { - int s=0; - Session session=this.getSession(true); - try { - Query query=session.createQuery(hql); - whereParameter(sectorprojects, query); - s= Integer.valueOf( - query - .list().get(0) - .toString()); - } catch (Exception e) { - e.printStackTrace(); - }finally{ - session.close(); - } - return s; - } - - - - @Override - public int add(SectorProjects sectorprojects) throws Exception { - this.getHibernateTemplate().save(sectorprojects); - return sectorprojects.getProjectid(); - } - - - - @Override - public void modify(SectorProjects sectorprojects) throws Exception { - // TODO Auto-generated method stub - this.getHibernateTemplate().update(sectorprojects); - } - - - - @Override - public void modifyState(SectorProjects sectorprojects) throws Exception { - // TODO Auto-generated method stub - - } - - - - @Override - public void modifyInfo(SectorProjects sectorprojects) throws Exception { - // TODO Auto-generated method stub - - } - - - - @Override - public List list(SectorProjects sectorprojects) - throws Exception { - // TODO Auto-generated method stub - return null; - } - - - - @Override - public List list() throws Exception { - // TODO Auto-generated method stub - return null; - } - - - - @Override - public Object findproject(int projectid) throws Exception { - // TODO Auto-generated method stub - Session session = this.getSession(true); - List list = session.createSQLQuery("select * from QA_SECTORPROJECTS where projectid="+projectid).list(); - session.close(); - return list.get(0); - } - - @Override - public int getid(String projectname) throws Exception { - // TODO Auto-generated method stub - int projectid = 0; - Session session = this.getSession(true); - @SuppressWarnings("unchecked") - List list = session.createSQLQuery("select projectid from QA_SECTORPROJECTS where projectname like '%"+projectname+"%'").list(); - if(list.size()!=0&&list.get(0)!=null){ - projectid = Integer.valueOf(list.get(0).toString()); - }else{ - projectid = 99; - } - session.close(); - return projectid; - } - - - - @Override - public List load(String name, String cmdType, - String planPath) throws Exception { - // TODO Auto-generated method stub - return null; - } - - @Override - public SectorProjects load(int projectid) throws Exception { - // TODO Auto-generated method stub - return (SectorProjects) this.getHibernateTemplate().get(SectorProjects.class, projectid); - } - - @Override - public int projectrow(String hql) { -// List list=new ArrayList(); - Session session = this.getSession(true); - int count=0; - try { - count = session.createSQLQuery(hql).list().size(); - } catch (Exception e) { - e.printStackTrace(); - }finally{ - session.close(); - } - return count; - // return this.getHibernateTemplate().find("select id,name,planproj from TestJobs order by id asc "); - } - - @Override - public List getAllProject() { -// List list=new ArrayList(); - Session session = this.getSession(true); - List list = new ArrayList<>(); - try { - list = session.createQuery("from SectorProjects order by projectid asc").list(); - } catch (Exception e) { - e.printStackTrace(); - }finally{ - session.close(); - } - return list; - // return this.getHibernateTemplate().find("select id,name,planproj from TestJobs order by id asc "); - } -} +package luckyweb.seagull.spring.dao; + +import java.util.ArrayList; +import java.util.List; + +import javax.annotation.Resource; + +import org.hibernate.HibernateException; +import org.hibernate.Query; +import org.hibernate.Session; +import org.hibernate.SessionFactory; +import org.springframework.orm.hibernate3.HibernateCallback; +import org.springframework.orm.hibernate3.support.HibernateDaoSupport; +import org.springframework.stereotype.Repository; + +import luckyweb.seagull.spring.entity.ProjectVersion; +import luckyweb.seagull.spring.entity.SectorProjects; +import luckyweb.seagull.spring.entity.UserInfo; +import luckyweb.seagull.util.StrLib; + +@Repository("sectorprojectsDao") +public class SectorProjectsDaoImpl extends HibernateDaoSupport implements SectorProjectsDao{ + + @Resource(name = "sessionFactory") + public void setSuperSessionFactory(SessionFactory sessionFactory) { + super.setSessionFactory(sessionFactory); + } + + + + @Override + public void delete(SectorProjects sectorprojects) throws Exception { + // TODO Auto-generated method stub + this.getHibernateTemplate().delete(sectorprojects); + } + + private void whereParameter(SectorProjects sectorprojects, Query query) { + + if (!StrLib.isEmpty(sectorprojects.getProjectname())) { + query.setParameter("projectname", "%"+sectorprojects.getProjectname().trim()+"%"); + } + if (!StrLib.isEmpty(sectorprojects.getProjectmanager())) { + query.setParameter("projectmanager","%"+sectorprojects.getProjectmanager().trim()+"%"); + } + if (!StrLib.isEmpty(sectorprojects.getProjectsign())) { + query.setParameter("projectsign","%"+sectorprojects.getProjectsign().trim()+"%"); + } + } + + @Override + public List findByPage(final String hql, final Object value, final int offset, final int pageSize) { + // TODO Auto-generated method stub + // 通过一个HibernateCallback 对象来执行查询 + //System.out.println(hql); + List list = getHibernateTemplate().executeFind(new HibernateCallback() { + // 实现hibernateCallback接口必须实现的方法 + + public Object doInHibernate(Session session) + throws HibernateException { + // 执行hibernate 分页查询 + Query query= session.createQuery(hql); + whereParameter((SectorProjects)value, query); + List result =query + .setFirstResult(offset).setMaxResults(pageSize).list(); + session.close(); + return result; + } + + }); + return list; + } + + @Override + public int findRows(SectorProjects sectorprojects, String hql) { + int s=0; + Session session=this.getSession(true); + try { + Query query=session.createQuery(hql); + whereParameter(sectorprojects, query); + s= Integer.valueOf( + query + .list().get(0) + .toString()); + } catch (Exception e) { + e.printStackTrace(); + }finally{ + session.close(); + } + return s; + } + + + + @Override + public int add(SectorProjects sectorprojects) throws Exception { + this.getHibernateTemplate().save(sectorprojects); + return sectorprojects.getProjectid(); + } + + + + @Override + public void modify(SectorProjects sectorprojects) throws Exception { + // TODO Auto-generated method stub + this.getHibernateTemplate().update(sectorprojects); + } + + + + @Override + public void modifyState(SectorProjects sectorprojects) throws Exception { + // TODO Auto-generated method stub + + } + + + + @Override + public void modifyInfo(SectorProjects sectorprojects) throws Exception { + // TODO Auto-generated method stub + + } + + + + @Override + public List list(SectorProjects sectorprojects) + throws Exception { + // TODO Auto-generated method stub + return null; + } + + + + @Override + public List list() throws Exception { + // TODO Auto-generated method stub + return null; + } + + + + @Override + public Object findproject(int projectid) throws Exception { + // TODO Auto-generated method stub + Session session = this.getSession(true); + List list = session.createSQLQuery("select * from QA_SECTORPROJECTS where projectid="+projectid).list(); + session.close(); + return list.get(0); + } + + @Override + public int getid(String projectname) throws Exception { + // TODO Auto-generated method stub + int projectid = 0; + Session session = this.getSession(true); + @SuppressWarnings("unchecked") + List list = session.createSQLQuery("select projectid from QA_SECTORPROJECTS where projectname like '%"+projectname+"%'").list(); + if(list.size()!=0&&list.get(0)!=null){ + projectid = Integer.valueOf(list.get(0).toString()); + }else{ + projectid = 99; + } + session.close(); + return projectid; + } + + + + @Override + public List load(String name, String cmdType, + String planPath) throws Exception { + // TODO Auto-generated method stub + return null; + } + + @Override + public SectorProjects load(int projectid) throws Exception { + // TODO Auto-generated method stub + return (SectorProjects) this.getHibernateTemplate().get(SectorProjects.class, projectid); + } + + @Override + public int projectrow(String hql) { +// List list=new ArrayList(); + Session session = this.getSession(true); + int count=0; + try { + count = session.createSQLQuery(hql).list().size(); + } catch (Exception e) { + e.printStackTrace(); + }finally{ + session.close(); + } + return count; + // return this.getHibernateTemplate().find("select id,name,planproj from TestJobs order by id asc "); + } + + @Override + public List getAllProject() { +// List list=new ArrayList(); + Session session = this.getSession(true); + List list = new ArrayList<>(); + try { + list = session.createQuery("from SectorProjects order by projectid asc").list(); + } catch (Exception e) { + e.printStackTrace(); + }finally{ + session.close(); + } + return list; + // return this.getHibernateTemplate().find("select id,name,planproj from TestJobs order by id asc "); + } +} diff --git a/src/main/java/luckyweb/seagull/spring/dao/TempCasestepDebugDao.java b/src/main/java/luckyweb/seagull/spring/dao/TempCasestepDebugDao.java index b0fb059..2fc7098 100644 --- a/src/main/java/luckyweb/seagull/spring/dao/TempCasestepDebugDao.java +++ b/src/main/java/luckyweb/seagull/spring/dao/TempCasestepDebugDao.java @@ -1,24 +1,24 @@ -package luckyweb.seagull.spring.dao; - -import java.util.List; - -import org.springframework.transaction.annotation.Transactional; - -import luckyweb.seagull.spring.entity.TempCasestepDebug; - - -@Transactional -public interface TempCasestepDebugDao { - - public TempCasestepDebug load(int id) throws Exception; - - public int add(TempCasestepDebug tcd) throws Exception; - - public List findByPage(final String hql, final Object value, final int offset, final int pageSize); - - public int findRows(TempCasestepDebug tcd, String hql); - public void delete(String hql) throws Exception; - public void deleteforob(TempCasestepDebug tcd) throws Exception; - public void modify(TempCasestepDebug tcd) throws Exception; - public List getParamsList(String sql) throws Exception; -} +package luckyweb.seagull.spring.dao; + +import java.util.List; + +import org.springframework.transaction.annotation.Transactional; + +import luckyweb.seagull.spring.entity.TempCasestepDebug; + + +@Transactional +public interface TempCasestepDebugDao { + + public TempCasestepDebug load(int id) throws Exception; + + public int add(TempCasestepDebug tcd) throws Exception; + + public List findByPage(final String hql, final Object value, final int offset, final int pageSize); + + public int findRows(TempCasestepDebug tcd, String hql); + public void delete(String hql) throws Exception; + public void deleteforob(TempCasestepDebug tcd) throws Exception; + public void modify(TempCasestepDebug tcd) throws Exception; + public List getParamsList(String sql) throws Exception; +} diff --git a/src/main/java/luckyweb/seagull/spring/dao/TempCasestepDebugImpl.java b/src/main/java/luckyweb/seagull/spring/dao/TempCasestepDebugImpl.java index cc0d1f3..6880f2e 100644 --- a/src/main/java/luckyweb/seagull/spring/dao/TempCasestepDebugImpl.java +++ b/src/main/java/luckyweb/seagull/spring/dao/TempCasestepDebugImpl.java @@ -1,139 +1,139 @@ -package luckyweb.seagull.spring.dao; - -import java.util.List; - -import javax.annotation.Resource; - -import org.hibernate.HibernateException; -import org.hibernate.Query; -import org.hibernate.Session; -import org.hibernate.SessionFactory; -import org.springframework.orm.hibernate3.HibernateCallback; -import org.springframework.orm.hibernate3.support.HibernateDaoSupport; -import org.springframework.stereotype.Repository; - -import luckyweb.seagull.spring.entity.TempCasestepDebug; -import luckyweb.seagull.util.StrLib; - - - - -@Repository("tempcasestepdebugDao") -public class TempCasestepDebugImpl extends HibernateDaoSupport implements TempCasestepDebugDao{ - - @Resource(name = "sessionFactory") - public void setSuperSessionFactory(SessionFactory sessionFactory) { - super.setSessionFactory(sessionFactory); - } - - - @Override - public TempCasestepDebug load(int id) throws Exception { - //return (UserInfo)this.getSession().get(UserInfo.class, id); - return (TempCasestepDebug) this.getHibernateTemplate().get(TempCasestepDebug.class, id); - } - - @Override - public int add(TempCasestepDebug tcd) throws Exception { - this.getHibernateTemplate().save(tcd); - return tcd.getId(); - } - - @Override - public void deleteforob(TempCasestepDebug tcd) throws Exception { - try{ - this.getHibernateTemplate().delete(tcd); - }catch(Exception e){ - e.printStackTrace(); - } - - } - - @Override - public void modify(TempCasestepDebug tcd) throws Exception { - this.getHibernateTemplate().update(tcd); - - } - - private void whereParameter(TempCasestepDebug tcd, Query query) { - if (!StrLib.isEmpty(tcd.getSign())) { - query.setParameter("sign", tcd.getSign()); - } - if (!StrLib.isEmpty(tcd.getExecutor())) { - query.setParameter("executor", tcd.getExecutor()); - } - } - - @Override - public List findByPage(final String hql, final Object value, final int offset, final int pageSize) { - List list = getHibernateTemplate().executeFind(new HibernateCallback() { - // 实现hibernateCallback接口必须实现的方法 - - public Object doInHibernate(Session session) - throws HibernateException { - // 执行hibernate 分页查询 - Query query= session.createQuery(hql); - whereParameter((TempCasestepDebug)value, query); - List result =query - .setFirstResult(offset).setMaxResults(pageSize).list(); - session.close(); - return result; - } - - }); - return list; - } - - - @Override - public int findRows(TempCasestepDebug tcd, String hql) { - int s=0; - Session session=this.getSession(true); - try { - Query query=session.createQuery(hql); - whereParameter(tcd, query); - s= Integer.valueOf( - query - .list().get(0) - .toString()); - } catch (Exception e) { - e.printStackTrace(); - }finally{ - session.close(); - } - return s; - } - - @Override - public void delete(String hql) throws Exception { - Session session=this.getSession(true); - try { - session.beginTransaction(); - Query query =session .createQuery(hql); - query.executeUpdate(); - - session.getTransaction().commit(); - } catch (Exception e) { - e.printStackTrace(); - }finally{ - session.close(); - } - } - - @SuppressWarnings("rawtypes") - @Override - public List getParamsList(String sql) throws Exception { - // TODO Auto-generated method stub - List list=null; - Session session=this.getSession(true); - try { - list = session.createQuery(sql).list(); - } catch (Exception e) { - e.printStackTrace(); - }finally{ - session.close(); - } - return list; - } - -} +package luckyweb.seagull.spring.dao; + +import java.util.List; + +import javax.annotation.Resource; + +import org.hibernate.HibernateException; +import org.hibernate.Query; +import org.hibernate.Session; +import org.hibernate.SessionFactory; +import org.springframework.orm.hibernate3.HibernateCallback; +import org.springframework.orm.hibernate3.support.HibernateDaoSupport; +import org.springframework.stereotype.Repository; + +import luckyweb.seagull.spring.entity.TempCasestepDebug; +import luckyweb.seagull.util.StrLib; + + + + +@Repository("tempcasestepdebugDao") +public class TempCasestepDebugImpl extends HibernateDaoSupport implements TempCasestepDebugDao{ + + @Resource(name = "sessionFactory") + public void setSuperSessionFactory(SessionFactory sessionFactory) { + super.setSessionFactory(sessionFactory); + } + + + @Override + public TempCasestepDebug load(int id) throws Exception { + //return (UserInfo)this.getSession().get(UserInfo.class, id); + return (TempCasestepDebug) this.getHibernateTemplate().get(TempCasestepDebug.class, id); + } + + @Override + public int add(TempCasestepDebug tcd) throws Exception { + this.getHibernateTemplate().save(tcd); + return tcd.getId(); + } + + @Override + public void deleteforob(TempCasestepDebug tcd) throws Exception { + try{ + this.getHibernateTemplate().delete(tcd); + }catch(Exception e){ + e.printStackTrace(); + } + + } + + @Override + public void modify(TempCasestepDebug tcd) throws Exception { + this.getHibernateTemplate().update(tcd); + + } + + private void whereParameter(TempCasestepDebug tcd, Query query) { + if (!StrLib.isEmpty(tcd.getSign())) { + query.setParameter("sign", tcd.getSign()); + } + if (!StrLib.isEmpty(tcd.getExecutor())) { + query.setParameter("executor", tcd.getExecutor()); + } + } + + @Override + public List findByPage(final String hql, final Object value, final int offset, final int pageSize) { + List list = getHibernateTemplate().executeFind(new HibernateCallback() { + // 实现hibernateCallback接口必须实现的方法 + + public Object doInHibernate(Session session) + throws HibernateException { + // 执行hibernate 分页查询 + Query query= session.createQuery(hql); + whereParameter((TempCasestepDebug)value, query); + List result =query + .setFirstResult(offset).setMaxResults(pageSize).list(); + session.close(); + return result; + } + + }); + return list; + } + + + @Override + public int findRows(TempCasestepDebug tcd, String hql) { + int s=0; + Session session=this.getSession(true); + try { + Query query=session.createQuery(hql); + whereParameter(tcd, query); + s= Integer.valueOf( + query + .list().get(0) + .toString()); + } catch (Exception e) { + e.printStackTrace(); + }finally{ + session.close(); + } + return s; + } + + @Override + public void delete(String hql) throws Exception { + Session session=this.getSession(true); + try { + session.beginTransaction(); + Query query =session .createQuery(hql); + query.executeUpdate(); + + session.getTransaction().commit(); + } catch (Exception e) { + e.printStackTrace(); + }finally{ + session.close(); + } + } + + @SuppressWarnings("rawtypes") + @Override + public List getParamsList(String sql) throws Exception { + // TODO Auto-generated method stub + List list=null; + Session session=this.getSession(true); + try { + list = session.createQuery(sql).list(); + } catch (Exception e) { + e.printStackTrace(); + }finally{ + session.close(); + } + return list; + } + +} diff --git a/src/main/java/luckyweb/seagull/spring/dao/TestCasedetailDao.java b/src/main/java/luckyweb/seagull/spring/dao/TestCasedetailDao.java index 04a30d0..6cd163b 100644 --- a/src/main/java/luckyweb/seagull/spring/dao/TestCasedetailDao.java +++ b/src/main/java/luckyweb/seagull/spring/dao/TestCasedetailDao.java @@ -1,27 +1,27 @@ -package luckyweb.seagull.spring.dao; - -import java.util.List; - -import org.springframework.transaction.annotation.Propagation; -import org.springframework.transaction.annotation.Transactional; - -import luckyweb.seagull.spring.entity.TestCasedetail; - -@Transactional -public interface TestCasedetailDao { - @Transactional(propagation=Propagation.REQUIRED) - public void add(TestCasedetail caseDetail); - - @Transactional(propagation=Propagation.NOT_SUPPORTED) - public List list(TestCasedetail caseDetail); - - public TestCasedetail load(int id); - - - public List findByPage(final String hql, final Object value,final int offset, final int pageSize); - - public int findRows(String hql,TestCasedetail tast); - @Transactional(propagation=Propagation.REQUIRED) - public void delete(String hql,int id) throws Exception; - -} +package luckyweb.seagull.spring.dao; + +import java.util.List; + +import org.springframework.transaction.annotation.Propagation; +import org.springframework.transaction.annotation.Transactional; + +import luckyweb.seagull.spring.entity.TestCasedetail; + +@Transactional +public interface TestCasedetailDao { + @Transactional(propagation=Propagation.REQUIRED) + public void add(TestCasedetail caseDetail); + + @Transactional(propagation=Propagation.NOT_SUPPORTED) + public List list(TestCasedetail caseDetail); + + public TestCasedetail load(int id); + + + public List findByPage(final String hql, final Object value,final int offset, final int pageSize); + + public int findRows(String hql,TestCasedetail tast); + @Transactional(propagation=Propagation.REQUIRED) + public void delete(String hql,int id) throws Exception; + +} diff --git a/src/main/java/luckyweb/seagull/spring/dao/TestCasedetailDaoImpl.java b/src/main/java/luckyweb/seagull/spring/dao/TestCasedetailDaoImpl.java index 6abe918..6b53cdf 100644 --- a/src/main/java/luckyweb/seagull/spring/dao/TestCasedetailDaoImpl.java +++ b/src/main/java/luckyweb/seagull/spring/dao/TestCasedetailDaoImpl.java @@ -1,145 +1,145 @@ -package luckyweb.seagull.spring.dao; - -import java.util.List; - -import javax.annotation.Resource; - -import org.apache.log4j.Logger; -import org.hibernate.HibernateException; -import org.hibernate.Query; -import org.hibernate.Session; -import org.hibernate.SessionFactory; -import org.springframework.orm.hibernate3.HibernateCallback; -import org.springframework.orm.hibernate3.support.HibernateDaoSupport; -import org.springframework.stereotype.Repository; - -import luckyweb.seagull.spring.entity.TestCasedetail; -import luckyweb.seagull.util.StrLib; - -@Repository("casedetailDao") -public class TestCasedetailDaoImpl extends HibernateDaoSupport implements TestCasedetailDao { - private static final Logger logger = Logger.getLogger(TestCasedetailDaoImpl.class); - - - @Resource(name="sessionFactory") - public void setSuperSessionFactory(SessionFactory sessionFactory){ - super.setSessionFactory(sessionFactory); - } - - - @Override - public void add(TestCasedetail caseDetail) { - this.getHibernateTemplate().save(caseDetail); - } - - - @Override - public List list(TestCasedetail caseDetail) { - List list=this.getSession().createQuery(" from TestCasedetail where taskid=?") - .setInteger(0, caseDetail.getTestTaskexcute().getId()) - .list(); - return list; - } - - - - @Override - public TestCasedetail load(int id) { - return (TestCasedetail) this.getHibernateTemplate().get(TestCasedetail.class, id); - } - - - /** - * 使用hql语句进行分页查询 - * - * @param hql - * 需要查询的hql语句 - * @param value - * 如果hql 有一个参数需要传入,value就是传入Hql语句的参数 - * - * @param offset - * 第一条记录索引 - * - * @param pageSize - * 每页需要显示的记录条数 - * @return 当前页的所有记录 - */ - public List findByPage(final String hql, final Object value, - final int offset, final int pageSize) { - // 通过一个HibernateCallback 对象来执行查询 - - List list = getHibernateTemplate().executeFind(new HibernateCallback() { - // 实现hibernateCallback接口必须实现的方法 - - public Object doInHibernate(Session session) - throws HibernateException { - // 执行hibernate 分页查询 - @SuppressWarnings("rawtypes") - List result=null; - try{ - Query query=session.createQuery(hql); - whereParameter((TestCasedetail)value, query); - result = query - .setFirstResult(offset).setMaxResults(pageSize).list(); - - } catch (Exception e) { - e.printStackTrace(); - }finally{ - session.close(); - }return result; - } - - }); - return list; - - } - - private void whereParameter(TestCasedetail caseDetail, Query query) { - if (!StrLib.isEmpty(caseDetail.getStartDate())&&!StrLib.isEmpty(caseDetail.getEndDate())) { - query.setParameter("startDate", caseDetail.getStartDate().trim()); - query.setParameter("endDate", caseDetail.getEndDate().trim()); - }if (caseDetail.getTaskId()!=0) { - query.setParameter("taskId", caseDetail.getTaskId()); - } - if (!StrLib.isEmpty(caseDetail.getCasestatus())) { - query.setParameter("casestatus", caseDetail.getCasestatus().trim()); - } - if (!StrLib.isEmpty(caseDetail.getCaseno())) { - query.setParameter("caseno", "%"+caseDetail.getCaseno().trim()+"%"); - } - if (!StrLib.isEmpty(caseDetail.getCasename())) { - query.setParameter("casename", "%"+caseDetail.getCasename().trim()+"%"); - } - } - - public int findRows(String hql, TestCasedetail caseDetail) { - int s=0; - Session session=this.getSession(true); - try { - Query query=session.createQuery(hql); - whereParameter(caseDetail, query); - s= Integer.valueOf(query.list().get(0).toString()); - } catch (Exception e) { - e.printStackTrace(); - }finally - { - session.close(); - - } - return s; - } - - - @Override - public void delete(String hql, int id) throws Exception { - Session session=this.getSession(true); - session.beginTransaction(); - Query query =session .createQuery(hql); - query.setInteger("taskId", id); - query.executeUpdate(); - - session.getTransaction().commit(); - session.close(); - } - -} +package luckyweb.seagull.spring.dao; + +import java.util.List; + +import javax.annotation.Resource; + +import org.apache.log4j.Logger; +import org.hibernate.HibernateException; +import org.hibernate.Query; +import org.hibernate.Session; +import org.hibernate.SessionFactory; +import org.springframework.orm.hibernate3.HibernateCallback; +import org.springframework.orm.hibernate3.support.HibernateDaoSupport; +import org.springframework.stereotype.Repository; + +import luckyweb.seagull.spring.entity.TestCasedetail; +import luckyweb.seagull.util.StrLib; + +@Repository("casedetailDao") +public class TestCasedetailDaoImpl extends HibernateDaoSupport implements TestCasedetailDao { + private static final Logger logger = Logger.getLogger(TestCasedetailDaoImpl.class); + + + @Resource(name="sessionFactory") + public void setSuperSessionFactory(SessionFactory sessionFactory){ + super.setSessionFactory(sessionFactory); + } + + + @Override + public void add(TestCasedetail caseDetail) { + this.getHibernateTemplate().save(caseDetail); + } + + + @Override + public List list(TestCasedetail caseDetail) { + List list=this.getSession().createQuery(" from TestCasedetail where taskid=?") + .setInteger(0, caseDetail.getTestTaskexcute().getId()) + .list(); + return list; + } + + + + @Override + public TestCasedetail load(int id) { + return (TestCasedetail) this.getHibernateTemplate().get(TestCasedetail.class, id); + } + + + /** + * 使用hql语句进行分页查询 + * + * @param hql + * 需要查询的hql语句 + * @param value + * 如果hql 有一个参数需要传入,value就是传入Hql语句的参数 + * + * @param offset + * 第一条记录索引 + * + * @param pageSize + * 每页需要显示的记录条数 + * @return 当前页的所有记录 + */ + public List findByPage(final String hql, final Object value, + final int offset, final int pageSize) { + // 通过一个HibernateCallback 对象来执行查询 + + List list = getHibernateTemplate().executeFind(new HibernateCallback() { + // 实现hibernateCallback接口必须实现的方法 + + public Object doInHibernate(Session session) + throws HibernateException { + // 执行hibernate 分页查询 + @SuppressWarnings("rawtypes") + List result=null; + try{ + Query query=session.createQuery(hql); + whereParameter((TestCasedetail)value, query); + result = query + .setFirstResult(offset).setMaxResults(pageSize).list(); + + } catch (Exception e) { + e.printStackTrace(); + }finally{ + session.close(); + }return result; + } + + }); + return list; + + } + + private void whereParameter(TestCasedetail caseDetail, Query query) { + if (!StrLib.isEmpty(caseDetail.getStartDate())&&!StrLib.isEmpty(caseDetail.getEndDate())) { + query.setParameter("startDate", caseDetail.getStartDate().trim()); + query.setParameter("endDate", caseDetail.getEndDate().trim()); + }if (caseDetail.getTaskId()!=0) { + query.setParameter("taskId", caseDetail.getTaskId()); + } + if (!StrLib.isEmpty(caseDetail.getCasestatus())) { + query.setParameter("casestatus", caseDetail.getCasestatus().trim()); + } + if (!StrLib.isEmpty(caseDetail.getCaseno())) { + query.setParameter("caseno", "%"+caseDetail.getCaseno().trim()+"%"); + } + if (!StrLib.isEmpty(caseDetail.getCasename())) { + query.setParameter("casename", "%"+caseDetail.getCasename().trim()+"%"); + } + } + + public int findRows(String hql, TestCasedetail caseDetail) { + int s=0; + Session session=this.getSession(true); + try { + Query query=session.createQuery(hql); + whereParameter(caseDetail, query); + s= Integer.valueOf(query.list().get(0).toString()); + } catch (Exception e) { + e.printStackTrace(); + }finally + { + session.close(); + + } + return s; + } + + + @Override + public void delete(String hql, int id) throws Exception { + Session session=this.getSession(true); + session.beginTransaction(); + Query query =session .createQuery(hql); + query.setInteger("taskId", id); + query.executeUpdate(); + + session.getTransaction().commit(); + session.close(); + } + +} diff --git a/src/main/java/luckyweb/seagull/spring/dao/TestClientDao.java b/src/main/java/luckyweb/seagull/spring/dao/TestClientDao.java index f7577da..d8fa0ed 100644 --- a/src/main/java/luckyweb/seagull/spring/dao/TestClientDao.java +++ b/src/main/java/luckyweb/seagull/spring/dao/TestClientDao.java @@ -1,26 +1,26 @@ -package luckyweb.seagull.spring.dao; - -import java.util.List; - -import org.springframework.transaction.annotation.Transactional; - -import luckyweb.seagull.spring.entity.TestClient; - - -@Transactional -public interface TestClientDao { - - public TestClient load(int id) throws Exception; - public int add(TestClient tc) throws Exception; - public void modify(TestClient tc) throws Exception; - public void delete(TestClient tc) throws Exception; - - public int get(String sql) throws Exception; - @SuppressWarnings("rawtypes") - public List findByPage(final String hql, final Object value,final int offset, final int pageSize); - - public int findRows(TestClient tc,String hql); - public int sqlfindRows(String hql); - @SuppressWarnings("rawtypes") - public List listsql(String sql) throws Exception; -} +package luckyweb.seagull.spring.dao; + +import java.util.List; + +import org.springframework.transaction.annotation.Transactional; + +import luckyweb.seagull.spring.entity.TestClient; + + +@Transactional +public interface TestClientDao { + + public TestClient load(int id) throws Exception; + public int add(TestClient tc) throws Exception; + public void modify(TestClient tc) throws Exception; + public void delete(TestClient tc) throws Exception; + + public int get(String sql) throws Exception; + @SuppressWarnings("rawtypes") + public List findByPage(final String hql, final Object value,final int offset, final int pageSize); + + public int findRows(TestClient tc,String hql); + public int sqlfindRows(String hql); + @SuppressWarnings("rawtypes") + public List listsql(String sql) throws Exception; +} diff --git a/src/main/java/luckyweb/seagull/spring/dao/TestClientDaoImpl.java b/src/main/java/luckyweb/seagull/spring/dao/TestClientDaoImpl.java index f0d5aa1..5a0d5df 100644 --- a/src/main/java/luckyweb/seagull/spring/dao/TestClientDaoImpl.java +++ b/src/main/java/luckyweb/seagull/spring/dao/TestClientDaoImpl.java @@ -1,156 +1,156 @@ -package luckyweb.seagull.spring.dao; - -import java.util.ArrayList; -import java.util.List; - -import javax.annotation.Resource; - -import org.hibernate.HibernateException; -import org.hibernate.Query; -import org.hibernate.Session; -import org.hibernate.SessionFactory; -import org.springframework.orm.hibernate3.HibernateCallback; -import org.springframework.orm.hibernate3.support.HibernateDaoSupport; -import org.springframework.stereotype.Repository; - -import luckyweb.seagull.spring.entity.Review; -import luckyweb.seagull.spring.entity.SectorProjects; -import luckyweb.seagull.spring.entity.TestClient; - - - -@Repository("testclientDao") -public class TestClientDaoImpl extends HibernateDaoSupport implements TestClientDao{ - - @Resource(name = "sessionFactory") - public void setSuperSessionFactory(SessionFactory sessionFactory) { - super.setSessionFactory(sessionFactory); - } - - - @Override - public TestClient load(int id) throws Exception { - //return (TestClient)this.getSession().get(TestClient.class, id); - return (TestClient) this.getHibernateTemplate().get(TestClient.class, id); - } - - @Override - public int add(TestClient tc) throws Exception { - this.getHibernateTemplate().save(tc); - return tc.getId(); - } - - @Override - public void modify(TestClient tc) throws Exception { - this.getHibernateTemplate().update(tc); - } - - @Override - public void delete(TestClient tc) throws Exception { - try{ - this.getHibernateTemplate().delete(tc); - }catch(Exception e){ - e.printStackTrace(); - } - - } - - @Override - public int get(String sql) throws Exception { - int id = 0; - Session session = this.getSession(true); - @SuppressWarnings("unchecked") - List count = session.createSQLQuery(sql).list(); - if(count.size()!=0){ - if(count.get(0)!=null){ - id = Integer.valueOf(count.get(0).toString()); - } - } - session.close(); - return id; - } - - private void whereParameter(TestClient tc, Query query) { - if (null!=tc.getClientip()&&!"".equals(tc.getClientip())) { - query.setParameter("clientip", "%"+tc.getClientip()+"%"); - } - if (null!=tc.getName()&&!"".equals(tc.getName())) { - query.setParameter("name", "%"+tc.getName()+"%"); - } - } - - @Override - public List findByPage(final String hql, final Object value, final int offset, final int pageSize) { - // TODO Auto-generated method stub - // 通过一个HibernateCallback 对象来执行查询 - //System.out.println(hql); - List list = getHibernateTemplate().executeFind(new HibernateCallback() { - // 实现hibernateCallback接口必须实现的方法 - - public Object doInHibernate(Session session) - throws HibernateException { - // 执行hibernate 分页查询 - Query query= session.createQuery(hql); - whereParameter((TestClient)value, query); - List result =query - .setFirstResult(offset).setMaxResults(pageSize).list(); - session.close(); - return result; - } - - }); - return list; - } - - @Override - public int findRows(TestClient tc, String hql) { - int s=0; - Session session=this.getSession(true); - try { - Query query=session.createQuery(hql); - whereParameter(tc, query); - s= Integer.valueOf( - query - .list().get(0) - .toString()); - } catch (Exception e) { - e.printStackTrace(); - }finally{ - session.close(); - } - return s; - } - - @Override - public int sqlfindRows(String hql) { - int s=0; - Session session=this.getSession(true); - try { - /*Query query=session.createQuery(hql);*/ - Query query= session.createSQLQuery(hql); - s= Integer.valueOf( - query.list().size()); - } catch (Exception e) { - e.printStackTrace(); - }finally{ - session.close(); - } - return s; - } - - @SuppressWarnings("unchecked") - @Override - public List listsql(String sql) throws Exception { - Session session = this.getSession(true); - List list = new ArrayList<>(); - try { - list = session.createQuery(sql).list(); - } catch (Exception e) { - e.printStackTrace(); - }finally{ - session.close(); - } - return list; - } - -} +package luckyweb.seagull.spring.dao; + +import java.util.ArrayList; +import java.util.List; + +import javax.annotation.Resource; + +import org.hibernate.HibernateException; +import org.hibernate.Query; +import org.hibernate.Session; +import org.hibernate.SessionFactory; +import org.springframework.orm.hibernate3.HibernateCallback; +import org.springframework.orm.hibernate3.support.HibernateDaoSupport; +import org.springframework.stereotype.Repository; + +import luckyweb.seagull.spring.entity.Review; +import luckyweb.seagull.spring.entity.SectorProjects; +import luckyweb.seagull.spring.entity.TestClient; + + + +@Repository("testclientDao") +public class TestClientDaoImpl extends HibernateDaoSupport implements TestClientDao{ + + @Resource(name = "sessionFactory") + public void setSuperSessionFactory(SessionFactory sessionFactory) { + super.setSessionFactory(sessionFactory); + } + + + @Override + public TestClient load(int id) throws Exception { + //return (TestClient)this.getSession().get(TestClient.class, id); + return (TestClient) this.getHibernateTemplate().get(TestClient.class, id); + } + + @Override + public int add(TestClient tc) throws Exception { + this.getHibernateTemplate().save(tc); + return tc.getId(); + } + + @Override + public void modify(TestClient tc) throws Exception { + this.getHibernateTemplate().update(tc); + } + + @Override + public void delete(TestClient tc) throws Exception { + try{ + this.getHibernateTemplate().delete(tc); + }catch(Exception e){ + e.printStackTrace(); + } + + } + + @Override + public int get(String sql) throws Exception { + int id = 0; + Session session = this.getSession(true); + @SuppressWarnings("unchecked") + List count = session.createSQLQuery(sql).list(); + if(count.size()!=0){ + if(count.get(0)!=null){ + id = Integer.valueOf(count.get(0).toString()); + } + } + session.close(); + return id; + } + + private void whereParameter(TestClient tc, Query query) { + if (null!=tc.getClientip()&&!"".equals(tc.getClientip())) { + query.setParameter("clientip", "%"+tc.getClientip()+"%"); + } + if (null!=tc.getName()&&!"".equals(tc.getName())) { + query.setParameter("name", "%"+tc.getName()+"%"); + } + } + + @Override + public List findByPage(final String hql, final Object value, final int offset, final int pageSize) { + // TODO Auto-generated method stub + // 通过一个HibernateCallback 对象来执行查询 + //System.out.println(hql); + List list = getHibernateTemplate().executeFind(new HibernateCallback() { + // 实现hibernateCallback接口必须实现的方法 + + public Object doInHibernate(Session session) + throws HibernateException { + // 执行hibernate 分页查询 + Query query= session.createQuery(hql); + whereParameter((TestClient)value, query); + List result =query + .setFirstResult(offset).setMaxResults(pageSize).list(); + session.close(); + return result; + } + + }); + return list; + } + + @Override + public int findRows(TestClient tc, String hql) { + int s=0; + Session session=this.getSession(true); + try { + Query query=session.createQuery(hql); + whereParameter(tc, query); + s= Integer.valueOf( + query + .list().get(0) + .toString()); + } catch (Exception e) { + e.printStackTrace(); + }finally{ + session.close(); + } + return s; + } + + @Override + public int sqlfindRows(String hql) { + int s=0; + Session session=this.getSession(true); + try { + /*Query query=session.createQuery(hql);*/ + Query query= session.createSQLQuery(hql); + s= Integer.valueOf( + query.list().size()); + } catch (Exception e) { + e.printStackTrace(); + }finally{ + session.close(); + } + return s; + } + + @SuppressWarnings("unchecked") + @Override + public List listsql(String sql) throws Exception { + Session session = this.getSession(true); + List list = new ArrayList<>(); + try { + list = session.createQuery(sql).list(); + } catch (Exception e) { + e.printStackTrace(); + }finally{ + session.close(); + } + return list; + } + +} diff --git a/src/main/java/luckyweb/seagull/spring/dao/TestJobsDao.java b/src/main/java/luckyweb/seagull/spring/dao/TestJobsDao.java index 3dc26db..c58d296 100644 --- a/src/main/java/luckyweb/seagull/spring/dao/TestJobsDao.java +++ b/src/main/java/luckyweb/seagull/spring/dao/TestJobsDao.java @@ -1,45 +1,45 @@ -package luckyweb.seagull.spring.dao; - -import java.util.List; - -import org.springframework.transaction.annotation.Propagation; -import org.springframework.transaction.annotation.Transactional; - -import luckyweb.seagull.spring.entity.TestJobs; - -@Transactional -public interface TestJobsDao { - public int add(TestJobs tjob) throws Exception; - - public void modify(TestJobs tjob) throws Exception; - - public void modifyState(TestJobs tjob) throws Exception; - - public void modifyInfo(TestJobs tjob) throws Exception; - - public void delete(int id) throws Exception; - - @Transactional(propagation = Propagation.NOT_SUPPORTED) - public List list(TestJobs tjob) throws Exception; - - @Transactional(propagation = Propagation.NOT_SUPPORTED) - public List list() throws Exception; - - public TestJobs load(int id) throws Exception; - - public List load(String name, String cmdType, String planPath) - throws Exception; - - public TestJobs get(int id) throws Exception; - -// public List findByPage(final String hql, final int offset,final int pageSize); -// -// public List findByPage(final String hql, final Object[] values,final int offset, final int pageSize); - - public List findByPage(final String hql, final Object value,final int offset, final int pageSize); - - public int findRows(TestJobs jobs,String hql); - - public List findJobsList(String hql); - -} +package luckyweb.seagull.spring.dao; + +import java.util.List; + +import org.springframework.transaction.annotation.Propagation; +import org.springframework.transaction.annotation.Transactional; + +import luckyweb.seagull.spring.entity.TestJobs; + +@Transactional +public interface TestJobsDao { + public int add(TestJobs tjob) throws Exception; + + public void modify(TestJobs tjob) throws Exception; + + public void modifyState(TestJobs tjob) throws Exception; + + public void modifyInfo(TestJobs tjob) throws Exception; + + public void delete(int id) throws Exception; + + @Transactional(propagation = Propagation.NOT_SUPPORTED) + public List list(TestJobs tjob) throws Exception; + + @Transactional(propagation = Propagation.NOT_SUPPORTED) + public List list() throws Exception; + + public TestJobs load(int id) throws Exception; + + public List load(String name, String cmdType, String planPath) + throws Exception; + + public TestJobs get(int id) throws Exception; + +// public List findByPage(final String hql, final int offset,final int pageSize); +// +// public List findByPage(final String hql, final Object[] values,final int offset, final int pageSize); + + public List findByPage(final String hql, final Object value,final int offset, final int pageSize); + + public int findRows(TestJobs jobs,String hql); + + public List findJobsList(String hql); + +} diff --git a/src/main/java/luckyweb/seagull/spring/dao/TestJobsDaoImpl.java b/src/main/java/luckyweb/seagull/spring/dao/TestJobsDaoImpl.java index 38dadff..b886558 100644 --- a/src/main/java/luckyweb/seagull/spring/dao/TestJobsDaoImpl.java +++ b/src/main/java/luckyweb/seagull/spring/dao/TestJobsDaoImpl.java @@ -1,352 +1,352 @@ -package luckyweb.seagull.spring.dao; - -import java.sql.SQLException; -import java.util.List; - -import javax.annotation.Resource; - -import org.apache.log4j.Logger; -import org.hibernate.HibernateException; -import org.hibernate.Query; -import org.hibernate.Session; -import org.hibernate.SessionFactory; -import org.quartz.impl.StdSchedulerFactory; -import org.springframework.orm.hibernate3.HibernateCallback; -import org.springframework.orm.hibernate3.support.HibernateDaoSupport; -import org.springframework.stereotype.Repository; - -import luckyweb.seagull.comm.QueueListener; -import luckyweb.seagull.quartz.QuratzJobDataMgr; -import luckyweb.seagull.spring.entity.TestClient; -import luckyweb.seagull.spring.entity.TestJobs; -import luckyweb.seagull.util.StrLib; - -@Repository("testJobsDao") -public class TestJobsDaoImpl extends HibernateDaoSupport implements TestJobsDao { - private static final Logger log = Logger.getLogger(TestJobsDaoImpl.class); - - @Resource(name = "sessionFactory") - public void setSuperSessionFactory(SessionFactory sessionFactory) { - super.setSessionFactory(sessionFactory); - } - - public static boolean isRun = false; - - /** - * 启动 定时任务 ,修改状态为启动 state=1 - * - * @throws Exception - */ - @SuppressWarnings("unchecked") - public static void init(Session session) throws Exception { - QueueListener.gSchedulerFactory = new StdSchedulerFactory(); - QueueListener.sched = QueueListener.gSchedulerFactory.getScheduler(); - - if (isRun == false) { - try { - Query queryproj = session.createQuery("from SectorProjects where projecttype=1 order by projectid asc"); - QueueListener.projlist = queryproj.list();//获取所有项目 - - Query query = session.createQuery("from TestJobs where (tasktype ='D') or (tasktype ='O' and runtime>sysdate()) "); - QueueListener.list = query.list(); - - QueueListener.qa_projlist = session.createQuery("from SectorProjects where projecttype=0 order by projectid asc").list(); - - QueueListener.listen_Clientlist=session.createQuery("from TestClient order by id asc").list(); - //将测试调度任务加入到定时任务中 - QuratzJobDataMgr mgr = new QuratzJobDataMgr(); - for (TestJobs tb : QueueListener.list) { - try{ - mgr.addJobRunTime(tb, tb.getId()); - }catch(Exception e){ - log.error("启动 测试调度定时任务失败:" + e.getMessage()); - System.out.println("任务ID号"+tb.getId()+"启动失败,请检查测试调度任务配置情况,尤其是Cron表达式是否正确!!!!"); - continue; - } - } - //将客户端心跳加入到定时任务中 - for (TestClient tc : QueueListener.listen_Clientlist) { - try{ - mgr.addTestClient(tc, tc.getId()); - }catch(Exception e){ - log.error("启动 客户端心跳检测监听失败:" + e.getMessage()); - System.out.println("任务ID号"+tc.getId()+"启动失败,请检查客户端心跳检测任务配置情况,尤其是Cron表达式是否正确!!!!"); - continue; - } - } - if (QueueListener.list.size() != 0) { - //设置任务的状态为启动 - session.beginTransaction(); - TestJobs tjob = new TestJobs(); - tjob.setState("1"); - Query query2 = session.createQuery("update TestJobs t set t.state = '1' where (tasktype ='D') or (tasktype ='O' and runtime>sysdate() ) "); - query2.executeUpdate(); - session.getTransaction().commit(); - } - isRun = true; - - } catch (Exception e) { - log.error("启动 定时任务失败:" + e.getMessage()); - System.out.println("启动 定时任务失败:" + e.getMessage()); - throw new Exception("启动 定时任务失败:" + e); - }finally{ - session.close(); - } - } - } - - /** - * 关闭 定时任务,修改状态为未启动 state=0 - * - * @throws Exception - */ - public static void stop(Session session) throws Exception { - // QuratzJobDataMgr query = QuratzJobDataMgr.getInstance(); - try { - // Session session=sessionFactory.openSession(); - session.beginTransaction(); - Query query = session.createQuery("update TestJobs t set t.state = '0' where (tasktype ='D') or (tasktype ='O' and to_date(runtime,'yyyy-MM-dd HH24:mi:ss')>sysdate ) "); - query.executeUpdate(); - session.getTransaction().commit(); - } catch (Exception e) { - throw new Exception("关闭 定时任务失败:" + e); - }finally{ - session.close(); - } - } - - @Override - public int add(TestJobs tjob) throws Exception{ - this.getHibernateTemplate().save(tjob); - return tjob.getId(); - } - - @Override - public void modify(TestJobs tjob) throws Exception{ - this.getHibernateTemplate().update(tjob); - //Query query = this.getSession().createQuery("update TestJobs t set t.projPath =?,t.startDate=?,t.startTime=?,t.endDate=?,t.end where id =? "); - //query.executeUpdate(); - - } - - @Override - public void modifyState(TestJobs tjob) throws Exception{ - this.getHibernateTemplate().update(tjob); - } - - @Override - public void delete(int id) throws Exception{ - try{ - TestJobs tjob = this.load(id); - this.getHibernateTemplate().delete(tjob); - }catch(Exception e){ - e.printStackTrace(); - } - } - -// public List list(TestJobs tjob) { -// Session session = this.getSession(); -// String hql = "from TestJobs "; -// hql += where(tjob); -// Query query = session.createQuery(hql); -// whereParameter(tjob, query); -// List list = query.list(); -// return list; -// } - - - @Override - public List list(TestJobs tjob) { - @SuppressWarnings("unchecked") - List list = this.getHibernateTemplate().find(" from TestJobs"); - return list; - } - - @Override - public List list() { - return this.getHibernateTemplate().loadAll(TestJobs.class); - } - - @Override - public TestJobs load(int id) { - return (TestJobs) this.getHibernateTemplate().get(TestJobs.class, id); - } - - /*public List listFenye(TestJobs tjob, int curpage, int pagesize) { - Session session = this.getSession(); - String hql = "from TestJobs "; - hql += where(tjob); - // Query query=session.createQuery(hql); - List list = findOnePage(session, hql, tjob, curpage, pagesize); - return list; - } - - public List findOnePage(Session session, String strHQL, - TestJobs tjob, int offset, int pagesize) { - List lst = null; - try { - Query query = session.createQuery(strHQL); - whereParameter(tjob, query); - if (offset != 0 && pagesize != 0) { - query.setFirstResult((offset - 1) * pagesize); - query.setMaxResults(pagesize); - } - lst = query.list(); - } catch (Exception ex) { - ex.printStackTrace(); - } - return lst; - }*/ - - - private void whereParameter(TestJobs jb, Query query) { - if (!StrLib.isEmpty(jb.getTaskName())) { - query.setParameter("name", "%"+jb.getTaskName().trim()+"%"); - } - if (!StrLib.isEmpty(jb.getPlanproj())) { - query.setParameter("planproj", "%"+jb.getPlanproj().trim()+"%"); - } - if (jb.getProjectid()!=0&&jb.getProjectid()!=99) { - query.setParameter("projectid", jb.getProjectid()); - } - } - - @Override - public TestJobs get(int id) { - return (TestJobs) this.getHibernateTemplate().get(TestJobs.class, id); - } - - @Override - public List load(String name, String cmdType, String planPath) { - Session session=this.getSession(true); - List list=null; - try{ - String hql = " from TestJobs where planName=? and cmdType=? and planPath=?"; - list= (List)session - .createQuery(hql).setString(0, name).setString(1, cmdType) - .setString(2, planPath).list(); - } catch (Exception e) { - e.printStackTrace(); - }finally{ - session.close(); - } - return list; - } - - - @Override - /** - * 修改信息 - */ - public void modifyInfo(TestJobs tjob) { - Session session=this.getSession(true); - try { - session .createQuery( - "update TestJobs set startDate=? ,startTime=?, endDate=?, endTime=?,startTimestr=?,runTime=? where id=? ") - .executeUpdate(); - - } catch (Exception e) { - e.printStackTrace(); - }finally{ - session.close(); - } - } - - - /** - * 使用hql语句进行分页查询 - * - * @param hql - * 需要查询的hql语句 - * @param value - * 如果hql 有一个参数需要传入,value就是传入Hql语句的参数 - * - * @param offset - * 第一条记录索引 - * - * @param pageSize - * 每页需要显示的记录条数 - * @return 当前页的所有记录 - */ - public List findByPage(final String hql, final Object value, - final int offset, final int pageSize) { - // 通过一个HibernateCallback 对象来执行查询 - //System.out.println(hql); - List list = getHibernateTemplate().executeFind(new HibernateCallback() { - // 实现hibernateCallback接口必须实现的方法 - - public Object doInHibernate(Session session) - throws HibernateException { - // 执行hibernate 分页查询 - Query query= session.createQuery(hql); - whereParameter((TestJobs)value, query); - List result =query - .setFirstResult(offset).setMaxResults(pageSize).list(); - session.close(); - return result; - } - - }); - return list; - - } - - - - public int findRows(TestJobs jobs,String hql) { - int s=0; - Session session=this.getSession(true); - try { - Query query=session.createQuery(hql); - whereParameter(jobs, query); - s= Integer.valueOf( - query - .list().get(0) - .toString()); - } catch (Exception e) { - e.printStackTrace(); - }finally{ - session.close(); - } - return s; - } - - public List getListForPage(final String hql, final int offset, - final int lengh) { - log.debug("finding ListForPage"); - try { - List list = getHibernateTemplate().executeFind( - new HibernateCallback() { - public Object doInHibernate(Session session) - throws HibernateException, SQLException { - List list2 = session.createQuery(hql) - .setFirstResult(offset) - .setMaxResults(lengh).list(); - session.close(); - return list2; - } - }); - return list; - } catch (RuntimeException re) { - log.error("find ListForPage failed", re); - throw re; - } - } - - @Override - public List findJobsList(String hql) { -// List list=new ArrayList(); - Session session = this.getSession(true); - List count=null; - try { - count = session.createSQLQuery(hql).list(); - } catch (Exception e) { - e.printStackTrace(); - }finally{ - session.close(); - } - return count; - // return this.getHibernateTemplate().find("select id,name,planproj from TestJobs order by id asc "); - } - +package luckyweb.seagull.spring.dao; + +import java.sql.SQLException; +import java.util.List; + +import javax.annotation.Resource; + +import org.apache.log4j.Logger; +import org.hibernate.HibernateException; +import org.hibernate.Query; +import org.hibernate.Session; +import org.hibernate.SessionFactory; +import org.quartz.impl.StdSchedulerFactory; +import org.springframework.orm.hibernate3.HibernateCallback; +import org.springframework.orm.hibernate3.support.HibernateDaoSupport; +import org.springframework.stereotype.Repository; + +import luckyweb.seagull.comm.QueueListener; +import luckyweb.seagull.quartz.QuratzJobDataMgr; +import luckyweb.seagull.spring.entity.TestClient; +import luckyweb.seagull.spring.entity.TestJobs; +import luckyweb.seagull.util.StrLib; + +@Repository("testJobsDao") +public class TestJobsDaoImpl extends HibernateDaoSupport implements TestJobsDao { + private static final Logger log = Logger.getLogger(TestJobsDaoImpl.class); + + @Resource(name = "sessionFactory") + public void setSuperSessionFactory(SessionFactory sessionFactory) { + super.setSessionFactory(sessionFactory); + } + + public static boolean isRun = false; + + /** + * 启动 定时任务 ,修改状态为启动 state=1 + * + * @throws Exception + */ + @SuppressWarnings("unchecked") + public static void init(Session session) throws Exception { + QueueListener.gSchedulerFactory = new StdSchedulerFactory(); + QueueListener.sched = QueueListener.gSchedulerFactory.getScheduler(); + + if (isRun == false) { + try { + Query queryproj = session.createQuery("from SectorProjects where projecttype=1 order by projectid asc"); + QueueListener.projlist = queryproj.list();//获取所有项目 + + Query query = session.createQuery("from TestJobs where (tasktype ='D') or (tasktype ='O' and runtime>sysdate()) "); + QueueListener.list = query.list(); + + QueueListener.qa_projlist = session.createQuery("from SectorProjects where projecttype=0 order by projectid asc").list(); + + QueueListener.listen_Clientlist=session.createQuery("from TestClient order by id asc").list(); + //将测试调度任务加入到定时任务中 + QuratzJobDataMgr mgr = new QuratzJobDataMgr(); + for (TestJobs tb : QueueListener.list) { + try{ + mgr.addJobRunTime(tb, tb.getId()); + }catch(Exception e){ + log.error("启动 测试调度定时任务失败:" + e.getMessage()); + System.out.println("任务ID号"+tb.getId()+"启动失败,请检查测试调度任务配置情况,尤其是Cron表达式是否正确!!!!"); + continue; + } + } + //将客户端心跳加入到定时任务中 + for (TestClient tc : QueueListener.listen_Clientlist) { + try{ + mgr.addTestClient(tc, tc.getId()); + }catch(Exception e){ + log.error("启动 客户端心跳检测监听失败:" + e.getMessage()); + System.out.println("任务ID号"+tc.getId()+"启动失败,请检查客户端心跳检测任务配置情况,尤其是Cron表达式是否正确!!!!"); + continue; + } + } + if (QueueListener.list.size() != 0) { + //设置任务的状态为启动 + session.beginTransaction(); + TestJobs tjob = new TestJobs(); + tjob.setState("1"); + Query query2 = session.createQuery("update TestJobs t set t.state = '1' where (tasktype ='D') or (tasktype ='O' and runtime>sysdate() ) "); + query2.executeUpdate(); + session.getTransaction().commit(); + } + isRun = true; + + } catch (Exception e) { + log.error("启动 定时任务失败:" + e.getMessage()); + System.out.println("启动 定时任务失败:" + e.getMessage()); + throw new Exception("启动 定时任务失败:" + e); + }finally{ + session.close(); + } + } + } + + /** + * 关闭 定时任务,修改状态为未启动 state=0 + * + * @throws Exception + */ + public static void stop(Session session) throws Exception { + // QuratzJobDataMgr query = QuratzJobDataMgr.getInstance(); + try { + // Session session=sessionFactory.openSession(); + session.beginTransaction(); + Query query = session.createQuery("update TestJobs t set t.state = '0' where (tasktype ='D') or (tasktype ='O' and to_date(runtime,'yyyy-MM-dd HH24:mi:ss')>sysdate ) "); + query.executeUpdate(); + session.getTransaction().commit(); + } catch (Exception e) { + throw new Exception("关闭 定时任务失败:" + e); + }finally{ + session.close(); + } + } + + @Override + public int add(TestJobs tjob) throws Exception{ + this.getHibernateTemplate().save(tjob); + return tjob.getId(); + } + + @Override + public void modify(TestJobs tjob) throws Exception{ + this.getHibernateTemplate().update(tjob); + //Query query = this.getSession().createQuery("update TestJobs t set t.projPath =?,t.startDate=?,t.startTime=?,t.endDate=?,t.end where id =? "); + //query.executeUpdate(); + + } + + @Override + public void modifyState(TestJobs tjob) throws Exception{ + this.getHibernateTemplate().update(tjob); + } + + @Override + public void delete(int id) throws Exception{ + try{ + TestJobs tjob = this.load(id); + this.getHibernateTemplate().delete(tjob); + }catch(Exception e){ + e.printStackTrace(); + } + } + +// public List list(TestJobs tjob) { +// Session session = this.getSession(); +// String hql = "from TestJobs "; +// hql += where(tjob); +// Query query = session.createQuery(hql); +// whereParameter(tjob, query); +// List list = query.list(); +// return list; +// } + + + @Override + public List list(TestJobs tjob) { + @SuppressWarnings("unchecked") + List list = this.getHibernateTemplate().find(" from TestJobs"); + return list; + } + + @Override + public List list() { + return this.getHibernateTemplate().loadAll(TestJobs.class); + } + + @Override + public TestJobs load(int id) { + return (TestJobs) this.getHibernateTemplate().get(TestJobs.class, id); + } + + /*public List listFenye(TestJobs tjob, int curpage, int pagesize) { + Session session = this.getSession(); + String hql = "from TestJobs "; + hql += where(tjob); + // Query query=session.createQuery(hql); + List list = findOnePage(session, hql, tjob, curpage, pagesize); + return list; + } + + public List findOnePage(Session session, String strHQL, + TestJobs tjob, int offset, int pagesize) { + List lst = null; + try { + Query query = session.createQuery(strHQL); + whereParameter(tjob, query); + if (offset != 0 && pagesize != 0) { + query.setFirstResult((offset - 1) * pagesize); + query.setMaxResults(pagesize); + } + lst = query.list(); + } catch (Exception ex) { + ex.printStackTrace(); + } + return lst; + }*/ + + + private void whereParameter(TestJobs jb, Query query) { + if (!StrLib.isEmpty(jb.getTaskName())) { + query.setParameter("name", "%"+jb.getTaskName().trim()+"%"); + } + if (!StrLib.isEmpty(jb.getPlanproj())) { + query.setParameter("planproj", "%"+jb.getPlanproj().trim()+"%"); + } + if (jb.getProjectid()!=0&&jb.getProjectid()!=99) { + query.setParameter("projectid", jb.getProjectid()); + } + } + + @Override + public TestJobs get(int id) { + return (TestJobs) this.getHibernateTemplate().get(TestJobs.class, id); + } + + @Override + public List load(String name, String cmdType, String planPath) { + Session session=this.getSession(true); + List list=null; + try{ + String hql = " from TestJobs where planName=? and cmdType=? and planPath=?"; + list= (List)session + .createQuery(hql).setString(0, name).setString(1, cmdType) + .setString(2, planPath).list(); + } catch (Exception e) { + e.printStackTrace(); + }finally{ + session.close(); + } + return list; + } + + + @Override + /** + * 修改信息 + */ + public void modifyInfo(TestJobs tjob) { + Session session=this.getSession(true); + try { + session .createQuery( + "update TestJobs set startDate=? ,startTime=?, endDate=?, endTime=?,startTimestr=?,runTime=? where id=? ") + .executeUpdate(); + + } catch (Exception e) { + e.printStackTrace(); + }finally{ + session.close(); + } + } + + + /** + * 使用hql语句进行分页查询 + * + * @param hql + * 需要查询的hql语句 + * @param value + * 如果hql 有一个参数需要传入,value就是传入Hql语句的参数 + * + * @param offset + * 第一条记录索引 + * + * @param pageSize + * 每页需要显示的记录条数 + * @return 当前页的所有记录 + */ + public List findByPage(final String hql, final Object value, + final int offset, final int pageSize) { + // 通过一个HibernateCallback 对象来执行查询 + //System.out.println(hql); + List list = getHibernateTemplate().executeFind(new HibernateCallback() { + // 实现hibernateCallback接口必须实现的方法 + + public Object doInHibernate(Session session) + throws HibernateException { + // 执行hibernate 分页查询 + Query query= session.createQuery(hql); + whereParameter((TestJobs)value, query); + List result =query + .setFirstResult(offset).setMaxResults(pageSize).list(); + session.close(); + return result; + } + + }); + return list; + + } + + + + public int findRows(TestJobs jobs,String hql) { + int s=0; + Session session=this.getSession(true); + try { + Query query=session.createQuery(hql); + whereParameter(jobs, query); + s= Integer.valueOf( + query + .list().get(0) + .toString()); + } catch (Exception e) { + e.printStackTrace(); + }finally{ + session.close(); + } + return s; + } + + public List getListForPage(final String hql, final int offset, + final int lengh) { + log.debug("finding ListForPage"); + try { + List list = getHibernateTemplate().executeFind( + new HibernateCallback() { + public Object doInHibernate(Session session) + throws HibernateException, SQLException { + List list2 = session.createQuery(hql) + .setFirstResult(offset) + .setMaxResults(lengh).list(); + session.close(); + return list2; + } + }); + return list; + } catch (RuntimeException re) { + log.error("find ListForPage failed", re); + throw re; + } + } + + @Override + public List findJobsList(String hql) { +// List list=new ArrayList(); + Session session = this.getSession(true); + List count=null; + try { + count = session.createSQLQuery(hql).list(); + } catch (Exception e) { + e.printStackTrace(); + }finally{ + session.close(); + } + return count; + // return this.getHibernateTemplate().find("select id,name,planproj from TestJobs order by id asc "); + } + } \ No newline at end of file diff --git a/src/main/java/luckyweb/seagull/spring/dao/TestLogdetailDao.java b/src/main/java/luckyweb/seagull/spring/dao/TestLogdetailDao.java index f1e6198..9464d37 100644 --- a/src/main/java/luckyweb/seagull/spring/dao/TestLogdetailDao.java +++ b/src/main/java/luckyweb/seagull/spring/dao/TestLogdetailDao.java @@ -1,25 +1,25 @@ -package luckyweb.seagull.spring.dao; - -import java.util.List; - -import org.springframework.transaction.annotation.Propagation; -import org.springframework.transaction.annotation.Transactional; - -import luckyweb.seagull.spring.entity.TestLogdetail; - -@Transactional -public interface TestLogdetailDao { - public void add(TestLogdetail logDetail); - - @Transactional(propagation=Propagation.NOT_SUPPORTED) - public List list(TestLogdetail logDetail); - - public TestLogdetail load(int id); - - public void delete(String hql,int id) throws Exception; - - public List findByPage(final String hql, final Object value,final int offset, final int pageSize); - - public int findRows(String hql,TestLogdetail logs); - -} +package luckyweb.seagull.spring.dao; + +import java.util.List; + +import org.springframework.transaction.annotation.Propagation; +import org.springframework.transaction.annotation.Transactional; + +import luckyweb.seagull.spring.entity.TestLogdetail; + +@Transactional +public interface TestLogdetailDao { + public void add(TestLogdetail logDetail); + + @Transactional(propagation=Propagation.NOT_SUPPORTED) + public List list(TestLogdetail logDetail); + + public TestLogdetail load(int id); + + public void delete(String hql,int id) throws Exception; + + public List findByPage(final String hql, final Object value,final int offset, final int pageSize); + + public int findRows(String hql,TestLogdetail logs); + +} diff --git a/src/main/java/luckyweb/seagull/spring/dao/TestLogdetailDaoImpl.java b/src/main/java/luckyweb/seagull/spring/dao/TestLogdetailDaoImpl.java index 44a01a2..4b9645d 100644 --- a/src/main/java/luckyweb/seagull/spring/dao/TestLogdetailDaoImpl.java +++ b/src/main/java/luckyweb/seagull/spring/dao/TestLogdetailDaoImpl.java @@ -1,116 +1,116 @@ -package luckyweb.seagull.spring.dao; - -import java.util.List; - -import javax.annotation.Resource; - -import org.apache.log4j.Logger; -import org.hibernate.HibernateException; -import org.hibernate.Query; -import org.hibernate.Session; -import org.hibernate.SessionFactory; -import org.springframework.orm.hibernate3.HibernateCallback; -import org.springframework.orm.hibernate3.support.HibernateDaoSupport; -import org.springframework.stereotype.Repository; - -import luckyweb.seagull.spring.entity.TestLogdetail; - -@Repository("logdetailDao") -public class TestLogdetailDaoImpl extends HibernateDaoSupport implements - TestLogdetailDao { - private static final Logger logger = Logger - .getLogger(TestLogdetailDaoImpl.class); - - @Resource(name = "sessionFactory") - public void setSuperSessionFactory(SessionFactory sessionFactory) { - super.setSessionFactory(sessionFactory); - } - - @Override - public void add(TestLogdetail caseDetail) { - this.getHibernateTemplate().save(caseDetail); - } - - @Override - public List list(TestLogdetail log) { - Session session=this.getSession(true); - List list = session.createQuery(" from TestLogdetail where caseid=? order by id asc") - .setInteger(0, log.getCaseid()).list(); - session.close(); - return list; - } - - @Override - public TestLogdetail load(int id) { - return (TestLogdetail) this.getHibernateTemplate().get(TestLogdetail.class, id); - - } - - @Override - public void delete(String hql, int id) throws Exception { - Session session=this.getSession(true); - session.beginTransaction(); - Query query =session .createQuery(hql).setInteger("taskId", id); - query.executeUpdate(); - session.getTransaction().commit(); - session.close(); - } - - /* - * 使用hql语句进行分页查询 - * - * @param hql 需要查询的hql语句 - * - * @param offset 第一条记录索引 - * - * @param pageSize 每页需要显示的记录条数 - * - * @return 当前页的所有记录 - */ - public List findByPage(final String hql, final Object value, - final int offset, final int pageSize) { - // 通过一个HibernateCallback 对象来执行查询 - //System.out.println(hql); - List list = getHibernateTemplate().executeFind(new HibernateCallback() { - // 实现hibernateCallback接口必须实现的方法 - - public Object doInHibernate(Session session) - throws HibernateException { - // 执行hibernate 分页查询 - Query query= session.createQuery(hql); - whereParameter((TestLogdetail)value, query); - List result =query - .setFirstResult(offset).setMaxResults(pageSize).list(); - session.close(); - return result; - } - - }); - return list; - - } - - public int findRows(String hql, TestLogdetail log) { - int s = 0; - Session session = this.getSession(true); - try { - Query query = session.createQuery(hql); - whereParameter(log, query); - s = Integer.valueOf(query.list().get(0).toString()); - } catch (Exception e) { - e.printStackTrace(); - } finally { - session.close(); - } - return s; - } - - private void whereParameter(TestLogdetail log, Query query) { - if (log.getTaskid()!=0) { - query.setParameter("taskid", log.getTaskid()); - } - if (log.getCaseid()!=0) { - query.setParameter("caseid", log.getCaseid()); - } - } -} +package luckyweb.seagull.spring.dao; + +import java.util.List; + +import javax.annotation.Resource; + +import org.apache.log4j.Logger; +import org.hibernate.HibernateException; +import org.hibernate.Query; +import org.hibernate.Session; +import org.hibernate.SessionFactory; +import org.springframework.orm.hibernate3.HibernateCallback; +import org.springframework.orm.hibernate3.support.HibernateDaoSupport; +import org.springframework.stereotype.Repository; + +import luckyweb.seagull.spring.entity.TestLogdetail; + +@Repository("logdetailDao") +public class TestLogdetailDaoImpl extends HibernateDaoSupport implements + TestLogdetailDao { + private static final Logger logger = Logger + .getLogger(TestLogdetailDaoImpl.class); + + @Resource(name = "sessionFactory") + public void setSuperSessionFactory(SessionFactory sessionFactory) { + super.setSessionFactory(sessionFactory); + } + + @Override + public void add(TestLogdetail caseDetail) { + this.getHibernateTemplate().save(caseDetail); + } + + @Override + public List list(TestLogdetail log) { + Session session=this.getSession(true); + List list = session.createQuery(" from TestLogdetail where caseid=? order by id asc") + .setInteger(0, log.getCaseid()).list(); + session.close(); + return list; + } + + @Override + public TestLogdetail load(int id) { + return (TestLogdetail) this.getHibernateTemplate().get(TestLogdetail.class, id); + + } + + @Override + public void delete(String hql, int id) throws Exception { + Session session=this.getSession(true); + session.beginTransaction(); + Query query =session .createQuery(hql).setInteger("taskId", id); + query.executeUpdate(); + session.getTransaction().commit(); + session.close(); + } + + /* + * 使用hql语句进行分页查询 + * + * @param hql 需要查询的hql语句 + * + * @param offset 第一条记录索引 + * + * @param pageSize 每页需要显示的记录条数 + * + * @return 当前页的所有记录 + */ + public List findByPage(final String hql, final Object value, + final int offset, final int pageSize) { + // 通过一个HibernateCallback 对象来执行查询 + //System.out.println(hql); + List list = getHibernateTemplate().executeFind(new HibernateCallback() { + // 实现hibernateCallback接口必须实现的方法 + + public Object doInHibernate(Session session) + throws HibernateException { + // 执行hibernate 分页查询 + Query query= session.createQuery(hql); + whereParameter((TestLogdetail)value, query); + List result =query + .setFirstResult(offset).setMaxResults(pageSize).list(); + session.close(); + return result; + } + + }); + return list; + + } + + public int findRows(String hql, TestLogdetail log) { + int s = 0; + Session session = this.getSession(true); + try { + Query query = session.createQuery(hql); + whereParameter(log, query); + s = Integer.valueOf(query.list().get(0).toString()); + } catch (Exception e) { + e.printStackTrace(); + } finally { + session.close(); + } + return s; + } + + private void whereParameter(TestLogdetail log, Query query) { + if (log.getTaskid()!=0) { + query.setParameter("taskid", log.getTaskid()); + } + if (log.getCaseid()!=0) { + query.setParameter("caseid", log.getCaseid()); + } + } +} diff --git a/src/main/java/luckyweb/seagull/spring/dao/TestTastExcuteDao.java b/src/main/java/luckyweb/seagull/spring/dao/TestTastExcuteDao.java index 21288af..10c6263 100644 --- a/src/main/java/luckyweb/seagull/spring/dao/TestTastExcuteDao.java +++ b/src/main/java/luckyweb/seagull/spring/dao/TestTastExcuteDao.java @@ -1,34 +1,34 @@ -package luckyweb.seagull.spring.dao; - -import java.util.List; - -import org.springframework.transaction.annotation.Propagation; -import org.springframework.transaction.annotation.Transactional; - -import luckyweb.seagull.spring.entity.TestTaskexcute; - - -public interface TestTastExcuteDao { - public void add(TestTaskexcute tjob); - - @Transactional(propagation=Propagation.NOT_SUPPORTED) - public List list(TestTaskexcute tjob); - - public TestTaskexcute load(int id); - - public TestTaskexcute get(int id); - - - public List findByPage(final String hql, final Object value,final int offset, final int pageSize); - - public int findRows(String hql,TestTaskexcute tast); - - public List findTastList(String sql); - - public void delete(int id) throws Exception; - - public List listtastinfo(String sql) throws Exception; - - public void delete_forjobid(String hql, int jobid) throws Exception; - -} +package luckyweb.seagull.spring.dao; + +import java.util.List; + +import org.springframework.transaction.annotation.Propagation; +import org.springframework.transaction.annotation.Transactional; + +import luckyweb.seagull.spring.entity.TestTaskexcute; + + +public interface TestTastExcuteDao { + public void add(TestTaskexcute tjob); + + @Transactional(propagation=Propagation.NOT_SUPPORTED) + public List list(TestTaskexcute tjob); + + public TestTaskexcute load(int id); + + public TestTaskexcute get(int id); + + + public List findByPage(final String hql, final Object value,final int offset, final int pageSize); + + public int findRows(String hql,TestTaskexcute tast); + + public List findTastList(String sql); + + public void delete(int id) throws Exception; + + public List listtastinfo(String sql) throws Exception; + + public void delete_forjobid(String hql, int jobid) throws Exception; + +} diff --git a/src/main/java/luckyweb/seagull/spring/dao/TestTastExcuteDaoImpl.java b/src/main/java/luckyweb/seagull/spring/dao/TestTastExcuteDaoImpl.java index 2058501..5a8ee94 100644 --- a/src/main/java/luckyweb/seagull/spring/dao/TestTastExcuteDaoImpl.java +++ b/src/main/java/luckyweb/seagull/spring/dao/TestTastExcuteDaoImpl.java @@ -1,231 +1,231 @@ -package luckyweb.seagull.spring.dao; - -import java.util.List; - -import javax.annotation.Resource; - -import org.apache.log4j.Logger; -import org.hibernate.HibernateException; -import org.hibernate.Query; -import org.hibernate.Session; -import org.hibernate.SessionFactory; -import org.springframework.orm.hibernate3.HibernateCallback; -import org.springframework.orm.hibernate3.support.HibernateDaoSupport; -import org.springframework.stereotype.Repository; - -import luckyweb.seagull.spring.entity.Accident; -import luckyweb.seagull.spring.entity.TestTaskexcute; -import luckyweb.seagull.util.StrLib; - -@Repository("tastExcuteDao") -public class TestTastExcuteDaoImpl extends HibernateDaoSupport implements - TestTastExcuteDao { - private static final Logger log = Logger - .getLogger(TestTastExcuteDaoImpl.class); - - @Resource(name = "sessionFactory") - public void setSuperSessionFactory(SessionFactory sessionFactory) { - super.setSessionFactory(sessionFactory); - } - - @Override - public void add(TestTaskexcute tast) { - this.getHibernateTemplate().save(tast); - } - - @Override - public List list(TestTaskexcute tast) { - List list = null; - Session session = this.getSession(true); - try { - list = session - .createQuery( - "from TestTastexcute where jobid=? order by asc ") - .setInteger(0, tast.getTestJob().getId()).list(); - } catch (Exception e) { - e.printStackTrace(); - } finally { - session.close(); - } - return list; - } - - @Override - public TestTaskexcute load(int id) { -/* return (TestTastexcute) this.getSession() - .load(TestTastexcute.class, id);*/ - return (TestTaskexcute) this.getHibernateTemplate().get(TestTaskexcute.class, id); - } - - @Override - public TestTaskexcute get(int id) { -// return (TestTastexcute) this.getSession().get(TestTastexcute.class, id); - return (TestTaskexcute) this.getHibernateTemplate().get(TestTaskexcute.class, id); - } - - /* - * 使用hql语句进行分页查询 - * - * @param hql 需要查询的hql语句 - * - * @param offset 第一条记录索引 - * - * @param pageSize 每页需要显示的记录条数 - * - * @return 当前页的所有记录 - */ - public List findByPage(final TestTaskexcute tast, final String hql, - final int offset, final int pageSize) { - // 通过一个HibernateCallback 对象来执行查询 - - List list = getHibernateTemplate().executeFind(new HibernateCallback() { - // 实现hibernateCallback接口必须实现的方法 - - public Object doInHibernate(Session session) - throws HibernateException { - // 执行hibernate 分页查询 - List result = null; - try { - result = session.createQuery(hql) - .setInteger(0, tast.getTestJob().getId()) - .setFirstResult(offset).setMaxResults(pageSize) - .list(); - } catch (Exception e) { - e.printStackTrace(); - } finally { - session.close(); - } - return result; - } - - }); - return list; - - } - - /** - * 使用hql语句进行分页查询 - * - * @param hql - * 需要查询的hql语句 - * @param value - * 如果hql 有一个参数需要传入,value就是传入Hql语句的参数 - * - * @param offset - * 第一条记录索引 - * - * @param pageSize - * 每页需要显示的记录条数 - * @return 当前页的所有记录 - */ - public List findByPage(final String hql, final Object value, - final int offset, final int pageSize) { - // 通过一个HibernateCallback 对象来执行查询 - - List list = getHibernateTemplate().executeFind(new HibernateCallback() { - // 实现hibernateCallback接口必须实现的方法 - - public Object doInHibernate(Session session) - throws HibernateException { - // 执行hibernate 分页查询 - List result = null; - try { - Query query = session.createQuery(hql); - whereParameter((TestTaskexcute) value, query); - result = query.setFirstResult(offset) - .setMaxResults(pageSize).list(); - - } catch (Exception e) { - e.printStackTrace(); - } finally { - session.close(); - } - return result; - } - - }); - return list; - - } - - public int findRows(String hql, TestTaskexcute tast) { - int s = 0; - Session session = this.getSession(true); - try { - Query query = session.createQuery(hql); - whereParameter(tast, query); - s = Integer.valueOf(query.list().get(0).toString()); - } catch (Exception e) { - e.printStackTrace(); - } finally { - session.close(); - } - return s; - } - - @SuppressWarnings({ "unchecked", "rawtypes" }) - @Override - public List findTastList(String sql) { - Session session = this.getSession(true); - List tastlist = session.createSQLQuery(sql).list(); - session.close(); - return tastlist; - } - - private void whereParameter(TestTaskexcute tast, Query query) { - if (!StrLib.isEmpty(tast.getStartDate())) { - query.setParameter(0, tast.getStartDate()); - } - if (!StrLib.isEmpty(tast.getStartDate())) { - query.setParameter(1, tast.getEndDate()); - } - if (tast.getJobid() != 0) { - query.setParameter("jobId", tast.getJobid()); - } - if (!StrLib.isEmpty(tast.getTaskId())) { - query.setParameter("taskId", "%" + tast.getTaskId().trim() + "%"); - } - if (!StrLib.isEmpty(tast.getTaskStatus()) ) { - query.setParameter("taskStatus", tast.getTaskStatus()); - } - } - - @Override - public void delete(int id) throws Exception { - TestTaskexcute tast = this.get(id); - this.getHibernateTemplate().delete(tast); - } - - @Override - public List listtastinfo(String sql) throws Exception { - // TODO Auto-generated method stub - Session session = this.getSession(true); - List count = session.createSQLQuery(sql).list(); - session.close(); - return count; - } - - @Override - public void delete_forjobid(String hql, int jobid) throws Exception { - Session session=this.getSession(true); - session.beginTransaction(); - Query query =session .createQuery(hql); - query.setInteger("jobId", jobid); - query.executeUpdate(); - - session.getTransaction().commit(); - session.close(); - } - - /* - * public List getListForPage(final String hql, final int - * offset, final int lengh) { log.debug("finding ListForPage"); try { List - * list = getHibernateTemplate().executeFind( new HibernateCallback() { - * public Object doInHibernate(Session session) throws HibernateException, - * SQLException { List list2 = session.createQuery(hql) .setInteger(0, val) - * .setFirstResult(offset) .setMaxResults(lengh).list(); return list2; } }); - * return list; } catch (RuntimeException re) { - * log.error("find ListForPage failed", re); throw re; } } - */ - -} +package luckyweb.seagull.spring.dao; + +import java.util.List; + +import javax.annotation.Resource; + +import org.apache.log4j.Logger; +import org.hibernate.HibernateException; +import org.hibernate.Query; +import org.hibernate.Session; +import org.hibernate.SessionFactory; +import org.springframework.orm.hibernate3.HibernateCallback; +import org.springframework.orm.hibernate3.support.HibernateDaoSupport; +import org.springframework.stereotype.Repository; + +import luckyweb.seagull.spring.entity.Accident; +import luckyweb.seagull.spring.entity.TestTaskexcute; +import luckyweb.seagull.util.StrLib; + +@Repository("tastExcuteDao") +public class TestTastExcuteDaoImpl extends HibernateDaoSupport implements + TestTastExcuteDao { + private static final Logger log = Logger + .getLogger(TestTastExcuteDaoImpl.class); + + @Resource(name = "sessionFactory") + public void setSuperSessionFactory(SessionFactory sessionFactory) { + super.setSessionFactory(sessionFactory); + } + + @Override + public void add(TestTaskexcute tast) { + this.getHibernateTemplate().save(tast); + } + + @Override + public List list(TestTaskexcute tast) { + List list = null; + Session session = this.getSession(true); + try { + list = session + .createQuery( + "from TestTastexcute where jobid=? order by asc ") + .setInteger(0, tast.getTestJob().getId()).list(); + } catch (Exception e) { + e.printStackTrace(); + } finally { + session.close(); + } + return list; + } + + @Override + public TestTaskexcute load(int id) { +/* return (TestTastexcute) this.getSession() + .load(TestTastexcute.class, id);*/ + return (TestTaskexcute) this.getHibernateTemplate().get(TestTaskexcute.class, id); + } + + @Override + public TestTaskexcute get(int id) { +// return (TestTastexcute) this.getSession().get(TestTastexcute.class, id); + return (TestTaskexcute) this.getHibernateTemplate().get(TestTaskexcute.class, id); + } + + /* + * 使用hql语句进行分页查询 + * + * @param hql 需要查询的hql语句 + * + * @param offset 第一条记录索引 + * + * @param pageSize 每页需要显示的记录条数 + * + * @return 当前页的所有记录 + */ + public List findByPage(final TestTaskexcute tast, final String hql, + final int offset, final int pageSize) { + // 通过一个HibernateCallback 对象来执行查询 + + List list = getHibernateTemplate().executeFind(new HibernateCallback() { + // 实现hibernateCallback接口必须实现的方法 + + public Object doInHibernate(Session session) + throws HibernateException { + // 执行hibernate 分页查询 + List result = null; + try { + result = session.createQuery(hql) + .setInteger(0, tast.getTestJob().getId()) + .setFirstResult(offset).setMaxResults(pageSize) + .list(); + } catch (Exception e) { + e.printStackTrace(); + } finally { + session.close(); + } + return result; + } + + }); + return list; + + } + + /** + * 使用hql语句进行分页查询 + * + * @param hql + * 需要查询的hql语句 + * @param value + * 如果hql 有一个参数需要传入,value就是传入Hql语句的参数 + * + * @param offset + * 第一条记录索引 + * + * @param pageSize + * 每页需要显示的记录条数 + * @return 当前页的所有记录 + */ + public List findByPage(final String hql, final Object value, + final int offset, final int pageSize) { + // 通过一个HibernateCallback 对象来执行查询 + + List list = getHibernateTemplate().executeFind(new HibernateCallback() { + // 实现hibernateCallback接口必须实现的方法 + + public Object doInHibernate(Session session) + throws HibernateException { + // 执行hibernate 分页查询 + List result = null; + try { + Query query = session.createQuery(hql); + whereParameter((TestTaskexcute) value, query); + result = query.setFirstResult(offset) + .setMaxResults(pageSize).list(); + + } catch (Exception e) { + e.printStackTrace(); + } finally { + session.close(); + } + return result; + } + + }); + return list; + + } + + public int findRows(String hql, TestTaskexcute tast) { + int s = 0; + Session session = this.getSession(true); + try { + Query query = session.createQuery(hql); + whereParameter(tast, query); + s = Integer.valueOf(query.list().get(0).toString()); + } catch (Exception e) { + e.printStackTrace(); + } finally { + session.close(); + } + return s; + } + + @SuppressWarnings({ "unchecked", "rawtypes" }) + @Override + public List findTastList(String sql) { + Session session = this.getSession(true); + List tastlist = session.createSQLQuery(sql).list(); + session.close(); + return tastlist; + } + + private void whereParameter(TestTaskexcute tast, Query query) { + if (!StrLib.isEmpty(tast.getStartDate())) { + query.setParameter(0, tast.getStartDate()); + } + if (!StrLib.isEmpty(tast.getStartDate())) { + query.setParameter(1, tast.getEndDate()); + } + if (tast.getJobid() != 0) { + query.setParameter("jobId", tast.getJobid()); + } + if (!StrLib.isEmpty(tast.getTaskId())) { + query.setParameter("taskId", "%" + tast.getTaskId().trim() + "%"); + } + if (!StrLib.isEmpty(tast.getTaskStatus()) ) { + query.setParameter("taskStatus", tast.getTaskStatus()); + } + } + + @Override + public void delete(int id) throws Exception { + TestTaskexcute tast = this.get(id); + this.getHibernateTemplate().delete(tast); + } + + @Override + public List listtastinfo(String sql) throws Exception { + // TODO Auto-generated method stub + Session session = this.getSession(true); + List count = session.createSQLQuery(sql).list(); + session.close(); + return count; + } + + @Override + public void delete_forjobid(String hql, int jobid) throws Exception { + Session session=this.getSession(true); + session.beginTransaction(); + Query query =session .createQuery(hql); + query.setInteger("jobId", jobid); + query.executeUpdate(); + + session.getTransaction().commit(); + session.close(); + } + + /* + * public List getListForPage(final String hql, final int + * offset, final int lengh) { log.debug("finding ListForPage"); try { List + * list = getHibernateTemplate().executeFind( new HibernateCallback() { + * public Object doInHibernate(Session session) throws HibernateException, + * SQLException { List list2 = session.createQuery(hql) .setInteger(0, val) + * .setFirstResult(offset) .setMaxResults(lengh).list(); return list2; } }); + * return list; } catch (RuntimeException re) { + * log.error("find ListForPage failed", re); throw re; } } + */ + +} diff --git a/src/main/java/luckyweb/seagull/spring/dao/UserAuthorityDao.java b/src/main/java/luckyweb/seagull/spring/dao/UserAuthorityDao.java index 02a2594..c108908 100644 --- a/src/main/java/luckyweb/seagull/spring/dao/UserAuthorityDao.java +++ b/src/main/java/luckyweb/seagull/spring/dao/UserAuthorityDao.java @@ -1,17 +1,17 @@ -package luckyweb.seagull.spring.dao; - -import java.util.List; - -import org.springframework.transaction.annotation.Transactional; - -import luckyweb.seagull.spring.entity.UserAuthority; - - -@Transactional -public interface UserAuthorityDao { - - public UserAuthority load(int id) throws Exception; - public List listall() throws Exception; - public List get(String sql) throws Exception; - -} +package luckyweb.seagull.spring.dao; + +import java.util.List; + +import org.springframework.transaction.annotation.Transactional; + +import luckyweb.seagull.spring.entity.UserAuthority; + + +@Transactional +public interface UserAuthorityDao { + + public UserAuthority load(int id) throws Exception; + public List listall() throws Exception; + public List get(String sql) throws Exception; + +} diff --git a/src/main/java/luckyweb/seagull/spring/dao/UserAuthorityDaoImpl.java b/src/main/java/luckyweb/seagull/spring/dao/UserAuthorityDaoImpl.java index 7e84055..1f7ec32 100644 --- a/src/main/java/luckyweb/seagull/spring/dao/UserAuthorityDaoImpl.java +++ b/src/main/java/luckyweb/seagull/spring/dao/UserAuthorityDaoImpl.java @@ -1,48 +1,48 @@ -package luckyweb.seagull.spring.dao; - -import java.util.List; - -import javax.annotation.Resource; - -import org.hibernate.Session; -import org.hibernate.SessionFactory; -import org.springframework.orm.hibernate3.support.HibernateDaoSupport; -import org.springframework.stereotype.Repository; - -import luckyweb.seagull.spring.entity.UserAuthority; - - - - -@Repository("userauthorityDao") -public class UserAuthorityDaoImpl extends HibernateDaoSupport implements UserAuthorityDao{ - - @Resource(name = "sessionFactory") - public void setSuperSessionFactory(SessionFactory sessionFactory) { - super.setSessionFactory(sessionFactory); - } - - - @Override - public UserAuthority load(int id) throws Exception { - //return (UserInfo)this.getSession().get(UserInfo.class, id); - return (UserAuthority) this.getHibernateTemplate().get(UserAuthority.class, id); - } - - @SuppressWarnings("unchecked") - @Override - public List listall() throws Exception { - // TODO Auto-generated method stub - return this.getHibernateTemplate().loadAll(UserAuthority.class); - } - - @Override - public List get(String sql) throws Exception { - Session session = this.getSession(true); - @SuppressWarnings("unchecked") - List ob = session.createSQLQuery(sql).list(); - session.close(); - return ob; - } - -} +package luckyweb.seagull.spring.dao; + +import java.util.List; + +import javax.annotation.Resource; + +import org.hibernate.Session; +import org.hibernate.SessionFactory; +import org.springframework.orm.hibernate3.support.HibernateDaoSupport; +import org.springframework.stereotype.Repository; + +import luckyweb.seagull.spring.entity.UserAuthority; + + + + +@Repository("userauthorityDao") +public class UserAuthorityDaoImpl extends HibernateDaoSupport implements UserAuthorityDao{ + + @Resource(name = "sessionFactory") + public void setSuperSessionFactory(SessionFactory sessionFactory) { + super.setSessionFactory(sessionFactory); + } + + + @Override + public UserAuthority load(int id) throws Exception { + //return (UserInfo)this.getSession().get(UserInfo.class, id); + return (UserAuthority) this.getHibernateTemplate().get(UserAuthority.class, id); + } + + @SuppressWarnings("unchecked") + @Override + public List listall() throws Exception { + // TODO Auto-generated method stub + return this.getHibernateTemplate().loadAll(UserAuthority.class); + } + + @Override + public List get(String sql) throws Exception { + Session session = this.getSession(true); + @SuppressWarnings("unchecked") + List ob = session.createSQLQuery(sql).list(); + session.close(); + return ob; + } + +} diff --git a/src/main/java/luckyweb/seagull/spring/dao/UserInfoDao.java b/src/main/java/luckyweb/seagull/spring/dao/UserInfoDao.java index 5112ce7..9faec29 100644 --- a/src/main/java/luckyweb/seagull/spring/dao/UserInfoDao.java +++ b/src/main/java/luckyweb/seagull/spring/dao/UserInfoDao.java @@ -1,26 +1,26 @@ -package luckyweb.seagull.spring.dao; - -import java.util.List; - -import org.springframework.transaction.annotation.Transactional; - -import luckyweb.seagull.spring.entity.UserInfo; - - -@Transactional -public interface UserInfoDao { - - public UserInfo load(int id) throws Exception; - public int add(UserInfo userinfo) throws Exception; - public void modify(UserInfo userinfo) throws Exception; - public void delete(int id) throws Exception; - - public int get(String sql) throws Exception; - @SuppressWarnings("rawtypes") - public List findByPage(final String hql, final Object value,final int offset, final int pageSize); - - public int findRows(UserInfo userinfo,String hql); - public int sqlfindRows(String hql); - @SuppressWarnings("rawtypes") - public List listsql(String sql) throws Exception; -} +package luckyweb.seagull.spring.dao; + +import java.util.List; + +import org.springframework.transaction.annotation.Transactional; + +import luckyweb.seagull.spring.entity.UserInfo; + + +@Transactional +public interface UserInfoDao { + + public UserInfo load(int id) throws Exception; + public int add(UserInfo userinfo) throws Exception; + public void modify(UserInfo userinfo) throws Exception; + public void delete(int id) throws Exception; + + public int get(String sql) throws Exception; + @SuppressWarnings("rawtypes") + public List findByPage(final String hql, final Object value,final int offset, final int pageSize); + + public int findRows(UserInfo userinfo,String hql); + public int sqlfindRows(String hql); + @SuppressWarnings("rawtypes") + public List listsql(String sql) throws Exception; +} diff --git a/src/main/java/luckyweb/seagull/spring/dao/UserInfoDaoImpl.java b/src/main/java/luckyweb/seagull/spring/dao/UserInfoDaoImpl.java index d8eaae7..1d69f02 100644 --- a/src/main/java/luckyweb/seagull/spring/dao/UserInfoDaoImpl.java +++ b/src/main/java/luckyweb/seagull/spring/dao/UserInfoDaoImpl.java @@ -1,155 +1,155 @@ -package luckyweb.seagull.spring.dao; - -import java.util.List; - -import javax.annotation.Resource; - -import org.hibernate.HibernateException; -import org.hibernate.Query; -import org.hibernate.Session; -import org.hibernate.SessionFactory; -import org.springframework.orm.hibernate3.HibernateCallback; -import org.springframework.orm.hibernate3.support.HibernateDaoSupport; -import org.springframework.stereotype.Repository; - -import luckyweb.seagull.spring.entity.Review; -import luckyweb.seagull.spring.entity.UserInfo; - - - -@Repository("userinfoDao") -public class UserInfoDaoImpl extends HibernateDaoSupport implements UserInfoDao{ - - @Resource(name = "sessionFactory") - public void setSuperSessionFactory(SessionFactory sessionFactory) { - super.setSessionFactory(sessionFactory); - } - - - @Override - public UserInfo load(int id) throws Exception { - //return (UserInfo)this.getSession().get(UserInfo.class, id); - return (UserInfo) this.getHibernateTemplate().get(UserInfo.class, id); - } - - @Override - public int add(UserInfo userinfo) throws Exception { - this.getHibernateTemplate().save(userinfo); - return userinfo.getId(); - } - - @Override - public void modify(UserInfo userinfo) throws Exception { - this.getHibernateTemplate().update(userinfo); - } - - @Override - public void delete(int id) throws Exception { - try{ - UserInfo userinfo = this.load(id); - this.getHibernateTemplate().delete(userinfo); - }catch(Exception e){ - e.printStackTrace(); - } - - } - - @Override - public int get(String sql) throws Exception { - int id = 0; - Session session = this.getSession(true); - @SuppressWarnings("unchecked") - List count = session.createSQLQuery(sql).list(); - if(count.size()!=0){ - if(count.get(0)!=null){ - id = Integer.valueOf(count.get(0).toString()); - } - } - session.close(); - return id; - } - - private void whereParameter(UserInfo userinfo, Query query) { - if (null!=userinfo.getUsercode()&&!"".equals(userinfo.getUsercode())) { - query.setParameter("usercode", "%"+userinfo.getUsercode()+"%"); - } - if (null!=userinfo.getUsername()&&!"".equals(userinfo.getUsername())) { - query.setParameter("username", "%"+userinfo.getUsername()+"%"); - } - } - - @Override - public List findByPage(final String hql, final Object value, final int offset, final int pageSize) { - // TODO Auto-generated method stub - // 通过一个HibernateCallback 对象来执行查询 - //System.out.println(hql); - List list = getHibernateTemplate().executeFind(new HibernateCallback() { - // 实现hibernateCallback接口必须实现的方法 - - public Object doInHibernate(Session session) - throws HibernateException { - // 执行hibernate 分页查询 - Query query= session.createQuery(hql); - whereParameter((UserInfo)value, query); - List result =query - .setFirstResult(offset).setMaxResults(pageSize).list(); - session.close(); - return result; - } - - }); - return list; - } - - @Override - public int findRows(UserInfo userinfo, String hql) { - int s=0; - Session session=this.getSession(true); - try { - Query query=session.createQuery(hql); - whereParameter(userinfo, query); - s= Integer.valueOf( - query - .list().get(0) - .toString()); - } catch (Exception e) { - e.printStackTrace(); - }finally{ - session.close(); - } - return s; - } - - @Override - public int sqlfindRows(String hql) { - int s=0; - Session session=this.getSession(true); - try { - /*Query query=session.createQuery(hql);*/ - Query query= session.createSQLQuery(hql); - s= Integer.valueOf( - query.list().size()); - } catch (Exception e) { - e.printStackTrace(); - }finally{ - session.close(); - } - return s; - } - - @SuppressWarnings("rawtypes") - @Override - public List listsql(String sql) throws Exception { - List count=null; - Session session=this.getSession(true); - try { - count = session.createSQLQuery(sql).list(); - } catch (Exception e) { - e.printStackTrace(); - }finally{ - session.close(); - } - return count; - } - -} +package luckyweb.seagull.spring.dao; + +import java.util.List; + +import javax.annotation.Resource; + +import org.hibernate.HibernateException; +import org.hibernate.Query; +import org.hibernate.Session; +import org.hibernate.SessionFactory; +import org.springframework.orm.hibernate3.HibernateCallback; +import org.springframework.orm.hibernate3.support.HibernateDaoSupport; +import org.springframework.stereotype.Repository; + +import luckyweb.seagull.spring.entity.Review; +import luckyweb.seagull.spring.entity.UserInfo; + + + +@Repository("userinfoDao") +public class UserInfoDaoImpl extends HibernateDaoSupport implements UserInfoDao{ + + @Resource(name = "sessionFactory") + public void setSuperSessionFactory(SessionFactory sessionFactory) { + super.setSessionFactory(sessionFactory); + } + + + @Override + public UserInfo load(int id) throws Exception { + //return (UserInfo)this.getSession().get(UserInfo.class, id); + return (UserInfo) this.getHibernateTemplate().get(UserInfo.class, id); + } + + @Override + public int add(UserInfo userinfo) throws Exception { + this.getHibernateTemplate().save(userinfo); + return userinfo.getId(); + } + + @Override + public void modify(UserInfo userinfo) throws Exception { + this.getHibernateTemplate().update(userinfo); + } + + @Override + public void delete(int id) throws Exception { + try{ + UserInfo userinfo = this.load(id); + this.getHibernateTemplate().delete(userinfo); + }catch(Exception e){ + e.printStackTrace(); + } + + } + + @Override + public int get(String sql) throws Exception { + int id = 0; + Session session = this.getSession(true); + @SuppressWarnings("unchecked") + List count = session.createSQLQuery(sql).list(); + if(count.size()!=0){ + if(count.get(0)!=null){ + id = Integer.valueOf(count.get(0).toString()); + } + } + session.close(); + return id; + } + + private void whereParameter(UserInfo userinfo, Query query) { + if (null!=userinfo.getUsercode()&&!"".equals(userinfo.getUsercode())) { + query.setParameter("usercode", "%"+userinfo.getUsercode()+"%"); + } + if (null!=userinfo.getUsername()&&!"".equals(userinfo.getUsername())) { + query.setParameter("username", "%"+userinfo.getUsername()+"%"); + } + } + + @Override + public List findByPage(final String hql, final Object value, final int offset, final int pageSize) { + // TODO Auto-generated method stub + // 通过一个HibernateCallback 对象来执行查询 + //System.out.println(hql); + List list = getHibernateTemplate().executeFind(new HibernateCallback() { + // 实现hibernateCallback接口必须实现的方法 + + public Object doInHibernate(Session session) + throws HibernateException { + // 执行hibernate 分页查询 + Query query= session.createQuery(hql); + whereParameter((UserInfo)value, query); + List result =query + .setFirstResult(offset).setMaxResults(pageSize).list(); + session.close(); + return result; + } + + }); + return list; + } + + @Override + public int findRows(UserInfo userinfo, String hql) { + int s=0; + Session session=this.getSession(true); + try { + Query query=session.createQuery(hql); + whereParameter(userinfo, query); + s= Integer.valueOf( + query + .list().get(0) + .toString()); + } catch (Exception e) { + e.printStackTrace(); + }finally{ + session.close(); + } + return s; + } + + @Override + public int sqlfindRows(String hql) { + int s=0; + Session session=this.getSession(true); + try { + /*Query query=session.createQuery(hql);*/ + Query query= session.createSQLQuery(hql); + s= Integer.valueOf( + query.list().size()); + } catch (Exception e) { + e.printStackTrace(); + }finally{ + session.close(); + } + return s; + } + + @SuppressWarnings("rawtypes") + @Override + public List listsql(String sql) throws Exception { + List count=null; + Session session=this.getSession(true); + try { + count = session.createSQLQuery(sql).list(); + } catch (Exception e) { + e.printStackTrace(); + }finally{ + session.close(); + } + return count; + } + +} diff --git a/src/main/java/luckyweb/seagull/spring/dao/UserRoleDao.java b/src/main/java/luckyweb/seagull/spring/dao/UserRoleDao.java index c8ddc96..e9c3d91 100644 --- a/src/main/java/luckyweb/seagull/spring/dao/UserRoleDao.java +++ b/src/main/java/luckyweb/seagull/spring/dao/UserRoleDao.java @@ -1,20 +1,20 @@ -package luckyweb.seagull.spring.dao; - -import java.util.List; - -import org.springframework.transaction.annotation.Transactional; - -import luckyweb.seagull.spring.entity.UserRole; - - -@Transactional -public interface UserRoleDao { - - public UserRole load(int id) throws Exception; - public List listall() throws Exception; - public List get(String sql) throws Exception; - public int add(UserRole userrole) throws Exception; - public void modify(UserRole userrole) throws Exception; - public void delete(int id) throws Exception; - -} +package luckyweb.seagull.spring.dao; + +import java.util.List; + +import org.springframework.transaction.annotation.Transactional; + +import luckyweb.seagull.spring.entity.UserRole; + + +@Transactional +public interface UserRoleDao { + + public UserRole load(int id) throws Exception; + public List listall() throws Exception; + public List get(String sql) throws Exception; + public int add(UserRole userrole) throws Exception; + public void modify(UserRole userrole) throws Exception; + public void delete(int id) throws Exception; + +} diff --git a/src/main/java/luckyweb/seagull/spring/dao/UserRoleDaoImpl.java b/src/main/java/luckyweb/seagull/spring/dao/UserRoleDaoImpl.java index dc955b3..57f99e4 100644 --- a/src/main/java/luckyweb/seagull/spring/dao/UserRoleDaoImpl.java +++ b/src/main/java/luckyweb/seagull/spring/dao/UserRoleDaoImpl.java @@ -1,69 +1,69 @@ -package luckyweb.seagull.spring.dao; - -import java.util.List; - -import javax.annotation.Resource; - -import org.hibernate.Session; -import org.hibernate.SessionFactory; -import org.springframework.orm.hibernate3.support.HibernateDaoSupport; -import org.springframework.stereotype.Repository; - -import luckyweb.seagull.spring.entity.UserInfo; -import luckyweb.seagull.spring.entity.UserRole; - - - -@Repository("userroleDao") -public class UserRoleDaoImpl extends HibernateDaoSupport implements UserRoleDao{ - - @Resource(name = "sessionFactory") - public void setSuperSessionFactory(SessionFactory sessionFactory) { - super.setSessionFactory(sessionFactory); - } - - - @Override - public UserRole load(int id) throws Exception { - //return (UserInfo)this.getSession().get(UserInfo.class, id); - return (UserRole) this.getHibernateTemplate().get(UserRole.class, id); - } - - @SuppressWarnings("unchecked") - @Override - public List listall() throws Exception { - // TODO Auto-generated method stub - return this.getHibernateTemplate().loadAll(UserRole.class); - } - - @Override - public List get(String sql) throws Exception { - Session session = this.getSession(true); - @SuppressWarnings("unchecked") - List ob = session.createSQLQuery(sql).list(); - session.close(); - return ob; - } - - @Override - public int add(UserRole userrole) throws Exception { - this.getHibernateTemplate().save(userrole); - return userrole.getId(); - } - - @Override - public void modify(UserRole userrole) throws Exception { - this.getHibernateTemplate().update(userrole); - } - - @Override - public void delete(int id) throws Exception { - try{ - UserRole userrole = this.load(id); - this.getHibernateTemplate().delete(userrole); - }catch(Exception e){ - e.printStackTrace(); - } - - } -} +package luckyweb.seagull.spring.dao; + +import java.util.List; + +import javax.annotation.Resource; + +import org.hibernate.Session; +import org.hibernate.SessionFactory; +import org.springframework.orm.hibernate3.support.HibernateDaoSupport; +import org.springframework.stereotype.Repository; + +import luckyweb.seagull.spring.entity.UserInfo; +import luckyweb.seagull.spring.entity.UserRole; + + + +@Repository("userroleDao") +public class UserRoleDaoImpl extends HibernateDaoSupport implements UserRoleDao{ + + @Resource(name = "sessionFactory") + public void setSuperSessionFactory(SessionFactory sessionFactory) { + super.setSessionFactory(sessionFactory); + } + + + @Override + public UserRole load(int id) throws Exception { + //return (UserInfo)this.getSession().get(UserInfo.class, id); + return (UserRole) this.getHibernateTemplate().get(UserRole.class, id); + } + + @SuppressWarnings("unchecked") + @Override + public List listall() throws Exception { + // TODO Auto-generated method stub + return this.getHibernateTemplate().loadAll(UserRole.class); + } + + @Override + public List get(String sql) throws Exception { + Session session = this.getSession(true); + @SuppressWarnings("unchecked") + List ob = session.createSQLQuery(sql).list(); + session.close(); + return ob; + } + + @Override + public int add(UserRole userrole) throws Exception { + this.getHibernateTemplate().save(userrole); + return userrole.getId(); + } + + @Override + public void modify(UserRole userrole) throws Exception { + this.getHibernateTemplate().update(userrole); + } + + @Override + public void delete(int id) throws Exception { + try{ + UserRole userrole = this.load(id); + this.getHibernateTemplate().delete(userrole); + }catch(Exception e){ + e.printStackTrace(); + } + + } +} diff --git a/src/main/java/luckyweb/seagull/spring/dao/ZtTaskDao.java b/src/main/java/luckyweb/seagull/spring/dao/ZtTaskDao.java index 89d283f..d5d3985 100644 --- a/src/main/java/luckyweb/seagull/spring/dao/ZtTaskDao.java +++ b/src/main/java/luckyweb/seagull/spring/dao/ZtTaskDao.java @@ -1,26 +1,26 @@ -package luckyweb.seagull.spring.dao; - -import java.util.List; - -import org.springframework.transaction.annotation.Transactional; - -import luckyweb.seagull.spring.entity.ZtTask; - - -@Transactional -public interface ZtTaskDao { - - public ZtTask load(int id) throws Exception; - - public int add(ZtTask zt) throws Exception; - - public void delete(String hql) throws Exception; - - public List findByPage(final String hql, final Object value, final int offset, final int pageSize); - - public int findRows(ZtTask zt, String hql); - - public int findRowsreport(String hql); - - public List findByPagereport(final String hql,final int offset, final int pageSize); -} +package luckyweb.seagull.spring.dao; + +import java.util.List; + +import org.springframework.transaction.annotation.Transactional; + +import luckyweb.seagull.spring.entity.ZtTask; + + +@Transactional +public interface ZtTaskDao { + + public ZtTask load(int id) throws Exception; + + public int add(ZtTask zt) throws Exception; + + public void delete(String hql) throws Exception; + + public List findByPage(final String hql, final Object value, final int offset, final int pageSize); + + public int findRows(ZtTask zt, String hql); + + public int findRowsreport(String hql); + + public List findByPagereport(final String hql,final int offset, final int pageSize); +} diff --git a/src/main/java/luckyweb/seagull/spring/dao/ZtTaskDaoImpl.java b/src/main/java/luckyweb/seagull/spring/dao/ZtTaskDaoImpl.java index b833a3d..36cb1a2 100644 --- a/src/main/java/luckyweb/seagull/spring/dao/ZtTaskDaoImpl.java +++ b/src/main/java/luckyweb/seagull/spring/dao/ZtTaskDaoImpl.java @@ -1,154 +1,154 @@ -package luckyweb.seagull.spring.dao; - -import java.util.List; - -import javax.annotation.Resource; - -import org.hibernate.HibernateException; -import org.hibernate.Query; -import org.hibernate.Session; -import org.hibernate.SessionFactory; -import org.springframework.orm.hibernate3.HibernateCallback; -import org.springframework.orm.hibernate3.support.HibernateDaoSupport; -import org.springframework.stereotype.Repository; - -import luckyweb.seagull.spring.entity.Accident; -import luckyweb.seagull.spring.entity.ProjectVersion; -import luckyweb.seagull.spring.entity.TestJobs; -import luckyweb.seagull.spring.entity.ZtTask; - - - -@Repository("zttaskDao") -public class ZtTaskDaoImpl extends HibernateDaoSupport implements ZtTaskDao{ - - @Resource(name = "sessionFactory") - public void setSuperSessionFactory(SessionFactory sessionFactory) { - super.setSessionFactory(sessionFactory); - } - - - @Override - public ZtTask load(int id) throws Exception { - return (ZtTask) this.getHibernateTemplate().get(ZtTask.class, id); - } - - @Override - public int add(ZtTask zt) throws Exception { - this.getHibernateTemplate().save(zt); - return zt.getId(); - } - - @Override - public void delete(String sql) throws Exception { - Session session=this.getSession(true); - session.beginTransaction(); - Query query =session.createSQLQuery(sql); - query.executeUpdate(); - session.getTransaction().commit(); - session.close(); - } - - private void whereParameter(ZtTask zt, Query query) { - if (zt.getVersionid()!=0) { - query.setParameter("versionid", zt.getVersionid()); - } - if (zt.getDelaystatus()!=0&&!"".equals(zt.getDelaystatus())) { - query.setParameter("delaystatus", zt.getDelaystatus()); - } - if (zt.getVersionname()!=null&&!"".equals(zt.getVersionname())) { - query.setParameter("versionname", "%"+zt.getVersionname()+"%"); - } - if (zt.getFinishedname()!=null&&!"".equals(zt.getFinishedname())) { - query.setParameter("finishedname", "%"+zt.getFinishedname()+"%"); - } - if (zt.getAssstartDate()!=null&&!"".equals(zt.getAssstartDate())) { - query.setParameter("assstartDate", zt.getAssstartDate()+" 00:00:00.0"); - } - if (zt.getAssendDate()!=null&&!"".equals(zt.getAssendDate())) { - query.setParameter("assendDate", zt.getAssendDate()+" 24:59:59.59"); - } - } - - @Override - public List findByPage(final String hql, final Object value, final int offset, final int pageSize) { - // TODO Auto-generated method stub - // 通过一个HibernateCallback 对象来执行查询 - //System.out.println(hql); - List list = getHibernateTemplate().executeFind(new HibernateCallback() { - // 实现hibernateCallback接口必须实现的方法 - - public Object doInHibernate(Session session) - throws HibernateException { - // 执行hibernate 分页查询 - Query query= session.createQuery(hql); - whereParameter((ZtTask)value, query); - List result =query - .setFirstResult(offset).setMaxResults(pageSize).list(); - session.close(); - return result; - } - - }); - return list; - } - - @Override - public int findRows(ZtTask zt, String hql) { - int s=0; - Session session=this.getSession(true); - try { - Query query=session.createQuery(hql); - whereParameter(zt, query); - s= Integer.valueOf( - query - .list().get(0) - .toString()); - } catch (Exception e) { - e.printStackTrace(); - }finally{ - session.close(); - } - return s; - } - - @Override - public int findRowsreport(String hql) { - int s=0; - Session session=this.getSession(true); - try { - /*Query query=session.createQuery(hql);*/ - Query query= session.createSQLQuery(hql); - s= Integer.valueOf( - query.list().size()); - } catch (Exception e) { - e.printStackTrace(); - }finally{ - session.close(); - } - return s; - } - - @Override - public List findByPagereport(final String hql,final int offset, final int pageSize) { - // TODO Auto-generated method stub - // 通过一个HibernateCallback 对象来执行查询 - //System.out.println(hql); - List list = getHibernateTemplate().executeFind(new HibernateCallback() { - // 实现hibernateCallback接口必须实现的方法 - - public Object doInHibernate(Session session) - throws HibernateException { - // 执行hibernate 分页查询 - //Query query= session.createQuery(hql); - Query query= session.createSQLQuery(hql); - List result =query - .setFirstResult(offset).setMaxResults(pageSize).list(); - session.close(); - return result; - } - - }); - return list; - } -} +package luckyweb.seagull.spring.dao; + +import java.util.List; + +import javax.annotation.Resource; + +import org.hibernate.HibernateException; +import org.hibernate.Query; +import org.hibernate.Session; +import org.hibernate.SessionFactory; +import org.springframework.orm.hibernate3.HibernateCallback; +import org.springframework.orm.hibernate3.support.HibernateDaoSupport; +import org.springframework.stereotype.Repository; + +import luckyweb.seagull.spring.entity.Accident; +import luckyweb.seagull.spring.entity.ProjectVersion; +import luckyweb.seagull.spring.entity.TestJobs; +import luckyweb.seagull.spring.entity.ZtTask; + + + +@Repository("zttaskDao") +public class ZtTaskDaoImpl extends HibernateDaoSupport implements ZtTaskDao{ + + @Resource(name = "sessionFactory") + public void setSuperSessionFactory(SessionFactory sessionFactory) { + super.setSessionFactory(sessionFactory); + } + + + @Override + public ZtTask load(int id) throws Exception { + return (ZtTask) this.getHibernateTemplate().get(ZtTask.class, id); + } + + @Override + public int add(ZtTask zt) throws Exception { + this.getHibernateTemplate().save(zt); + return zt.getId(); + } + + @Override + public void delete(String sql) throws Exception { + Session session=this.getSession(true); + session.beginTransaction(); + Query query =session.createSQLQuery(sql); + query.executeUpdate(); + session.getTransaction().commit(); + session.close(); + } + + private void whereParameter(ZtTask zt, Query query) { + if (zt.getVersionid()!=0) { + query.setParameter("versionid", zt.getVersionid()); + } + if (zt.getDelaystatus()!=0&&!"".equals(zt.getDelaystatus())) { + query.setParameter("delaystatus", zt.getDelaystatus()); + } + if (zt.getVersionname()!=null&&!"".equals(zt.getVersionname())) { + query.setParameter("versionname", "%"+zt.getVersionname()+"%"); + } + if (zt.getFinishedname()!=null&&!"".equals(zt.getFinishedname())) { + query.setParameter("finishedname", "%"+zt.getFinishedname()+"%"); + } + if (zt.getAssstartDate()!=null&&!"".equals(zt.getAssstartDate())) { + query.setParameter("assstartDate", zt.getAssstartDate()+" 00:00:00.0"); + } + if (zt.getAssendDate()!=null&&!"".equals(zt.getAssendDate())) { + query.setParameter("assendDate", zt.getAssendDate()+" 24:59:59.59"); + } + } + + @Override + public List findByPage(final String hql, final Object value, final int offset, final int pageSize) { + // TODO Auto-generated method stub + // 通过一个HibernateCallback 对象来执行查询 + //System.out.println(hql); + List list = getHibernateTemplate().executeFind(new HibernateCallback() { + // 实现hibernateCallback接口必须实现的方法 + + public Object doInHibernate(Session session) + throws HibernateException { + // 执行hibernate 分页查询 + Query query= session.createQuery(hql); + whereParameter((ZtTask)value, query); + List result =query + .setFirstResult(offset).setMaxResults(pageSize).list(); + session.close(); + return result; + } + + }); + return list; + } + + @Override + public int findRows(ZtTask zt, String hql) { + int s=0; + Session session=this.getSession(true); + try { + Query query=session.createQuery(hql); + whereParameter(zt, query); + s= Integer.valueOf( + query + .list().get(0) + .toString()); + } catch (Exception e) { + e.printStackTrace(); + }finally{ + session.close(); + } + return s; + } + + @Override + public int findRowsreport(String hql) { + int s=0; + Session session=this.getSession(true); + try { + /*Query query=session.createQuery(hql);*/ + Query query= session.createSQLQuery(hql); + s= Integer.valueOf( + query.list().size()); + } catch (Exception e) { + e.printStackTrace(); + }finally{ + session.close(); + } + return s; + } + + @Override + public List findByPagereport(final String hql,final int offset, final int pageSize) { + // TODO Auto-generated method stub + // 通过一个HibernateCallback 对象来执行查询 + //System.out.println(hql); + List list = getHibernateTemplate().executeFind(new HibernateCallback() { + // 实现hibernateCallback接口必须实现的方法 + + public Object doInHibernate(Session session) + throws HibernateException { + // 执行hibernate 分页查询 + //Query query= session.createQuery(hql); + Query query= session.createSQLQuery(hql); + List result =query + .setFirstResult(offset).setMaxResults(pageSize).list(); + session.close(); + return result; + } + + }); + return list; + } +} diff --git a/src/main/java/luckyweb/seagull/spring/entity/Accident.java b/src/main/java/luckyweb/seagull/spring/entity/Accident.java index 66947aa..4c5b104 100644 --- a/src/main/java/luckyweb/seagull/spring/entity/Accident.java +++ b/src/main/java/luckyweb/seagull/spring/entity/Accident.java @@ -1,198 +1,198 @@ -package luckyweb.seagull.spring.entity; - -import javax.persistence.Entity; - -@Entity(name="accident") -public class Accident implements java.io.Serializable{ - /** - * - */ - private static final long serialVersionUID = 1L; - private int id; - private int projectid; - private String accstatus; - private String eventtime; - private String reporter; - private String reporttime; - private String accdescription; - private String acclevel; - private String causalanalysis; - private String causaltype; - private String consequenceanalysis; - private SectorProjects sectorProjects; - private String correctiveaction; - private String resolutiontime; - private String resolutioner; - private String preventiveaction; - private String preventiver; - private String preventiveplandate; - private String preventiveaccdate; - private String accstarttime; - private String accendtime; - private Long trouble_duration; - private Long impact_time; - private String strtrouble_duration; - private String strimpact_time; - private String filename; - - public String getFilename() { - return filename; - } - public void setFilename(String filename) { - this.filename = filename; - } - public String getStrtrouble_duration() { - return strtrouble_duration; - } - public void setStrtrouble_duration(String strtrouble_duration) { - this.strtrouble_duration = strtrouble_duration; - } - public String getStrimpact_time() { - return strimpact_time; - } - public void setStrimpact_time(String strimpact_time) { - this.strimpact_time = strimpact_time; - } - - public Long getTrouble_duration() { - return trouble_duration; - } - public void setTrouble_duration(Long trouble_duration) { - this.trouble_duration = trouble_duration; - } - public Long getImpact_time() { - return impact_time; - } - public void setImpact_time(Long impact_time) { - this.impact_time = impact_time; - } - - public String getAccstarttime() { - return accstarttime; - } - public void setAccstarttime(String accstarttime) { - this.accstarttime = accstarttime; - } - public String getAccendtime() { - return accendtime; - } - public void setAccendtime(String accendtime) { - this.accendtime = accendtime; - } - - public int getId() { - return id; - } - public void setId(int id) { - this.id = id; - } - public int getProjectid() { - return projectid; - } - public void setProjectid(int projectid) { - this.projectid = projectid; - } - public String getAccstatus() { - return accstatus; - } - public void setAccstatus(String accstatus) { - this.accstatus = accstatus; - } - public String getEventtime() { - return eventtime; - } - public void setEventtime(String eventtime) { - this.eventtime = eventtime; - } - public String getReporter() { - return reporter; - } - public void setReporter(String reporter) { - this.reporter = reporter; - } - public String getReporttime() { - return reporttime; - } - public void setReporttime(String reporttime) { - this.reporttime = reporttime; - } - public String getAccdescription() { - return accdescription; - } - public void setAccdescription(String accdescription) { - this.accdescription = accdescription; - } - public String getAcclevel() { - return acclevel; - } - public void setAcclevel(String acclevel) { - this.acclevel = acclevel; - } - public String getCausalanalysis() { - return causalanalysis; - } - public void setCausalanalysis(String causalanalysis) { - this.causalanalysis = causalanalysis; - } - public String getCausaltype() { - return causaltype; - } - public void setCausaltype(String causaltype) { - this.causaltype = causaltype; - } - public String getConsequenceanalysis() { - return consequenceanalysis; - } - public void setConsequenceanalysis(String consequenceanalysis) { - this.consequenceanalysis = consequenceanalysis; - } - public SectorProjects getSectorProjects() { - return sectorProjects; - } - public void setSectorProjects(SectorProjects sectorProjects) { - this.sectorProjects = sectorProjects; - } - public String getCorrectiveaction() { - return correctiveaction; - } - public void setCorrectiveaction(String correctiveaction) { - this.correctiveaction = correctiveaction; - } - public String getResolutiontime() { - return resolutiontime; - } - public void setResolutiontime(String resolutiontime) { - this.resolutiontime = resolutiontime; - } - public String getResolutioner() { - return resolutioner; - } - public void setResolutioner(String resolutioner) { - this.resolutioner = resolutioner; - } - public String getPreventiveaction() { - return preventiveaction; - } - public void setPreventiveaction(String preventiveaction) { - this.preventiveaction = preventiveaction; - } - public String getPreventiver() { - return preventiver; - } - public void setPreventiver(String preventiver) { - this.preventiver = preventiver; - } - public String getPreventiveplandate() { - return preventiveplandate; - } - public void setPreventiveplandate(String preventiveplandate) { - this.preventiveplandate = preventiveplandate; - } - public String getPreventiveaccdate() { - return preventiveaccdate; - } - public void setPreventiveaccdate(String preventiveaccdate) { - this.preventiveaccdate = preventiveaccdate; - } - -} +package luckyweb.seagull.spring.entity; + +import javax.persistence.Entity; + +@Entity(name="accident") +public class Accident implements java.io.Serializable{ + /** + * + */ + private static final long serialVersionUID = 1L; + private int id; + private int projectid; + private String accstatus; + private String eventtime; + private String reporter; + private String reporttime; + private String accdescription; + private String acclevel; + private String causalanalysis; + private String causaltype; + private String consequenceanalysis; + private SectorProjects sectorProjects; + private String correctiveaction; + private String resolutiontime; + private String resolutioner; + private String preventiveaction; + private String preventiver; + private String preventiveplandate; + private String preventiveaccdate; + private String accstarttime; + private String accendtime; + private Long trouble_duration; + private Long impact_time; + private String strtrouble_duration; + private String strimpact_time; + private String filename; + + public String getFilename() { + return filename; + } + public void setFilename(String filename) { + this.filename = filename; + } + public String getStrtrouble_duration() { + return strtrouble_duration; + } + public void setStrtrouble_duration(String strtrouble_duration) { + this.strtrouble_duration = strtrouble_duration; + } + public String getStrimpact_time() { + return strimpact_time; + } + public void setStrimpact_time(String strimpact_time) { + this.strimpact_time = strimpact_time; + } + + public Long getTrouble_duration() { + return trouble_duration; + } + public void setTrouble_duration(Long trouble_duration) { + this.trouble_duration = trouble_duration; + } + public Long getImpact_time() { + return impact_time; + } + public void setImpact_time(Long impact_time) { + this.impact_time = impact_time; + } + + public String getAccstarttime() { + return accstarttime; + } + public void setAccstarttime(String accstarttime) { + this.accstarttime = accstarttime; + } + public String getAccendtime() { + return accendtime; + } + public void setAccendtime(String accendtime) { + this.accendtime = accendtime; + } + + public int getId() { + return id; + } + public void setId(int id) { + this.id = id; + } + public int getProjectid() { + return projectid; + } + public void setProjectid(int projectid) { + this.projectid = projectid; + } + public String getAccstatus() { + return accstatus; + } + public void setAccstatus(String accstatus) { + this.accstatus = accstatus; + } + public String getEventtime() { + return eventtime; + } + public void setEventtime(String eventtime) { + this.eventtime = eventtime; + } + public String getReporter() { + return reporter; + } + public void setReporter(String reporter) { + this.reporter = reporter; + } + public String getReporttime() { + return reporttime; + } + public void setReporttime(String reporttime) { + this.reporttime = reporttime; + } + public String getAccdescription() { + return accdescription; + } + public void setAccdescription(String accdescription) { + this.accdescription = accdescription; + } + public String getAcclevel() { + return acclevel; + } + public void setAcclevel(String acclevel) { + this.acclevel = acclevel; + } + public String getCausalanalysis() { + return causalanalysis; + } + public void setCausalanalysis(String causalanalysis) { + this.causalanalysis = causalanalysis; + } + public String getCausaltype() { + return causaltype; + } + public void setCausaltype(String causaltype) { + this.causaltype = causaltype; + } + public String getConsequenceanalysis() { + return consequenceanalysis; + } + public void setConsequenceanalysis(String consequenceanalysis) { + this.consequenceanalysis = consequenceanalysis; + } + public SectorProjects getSectorProjects() { + return sectorProjects; + } + public void setSectorProjects(SectorProjects sectorProjects) { + this.sectorProjects = sectorProjects; + } + public String getCorrectiveaction() { + return correctiveaction; + } + public void setCorrectiveaction(String correctiveaction) { + this.correctiveaction = correctiveaction; + } + public String getResolutiontime() { + return resolutiontime; + } + public void setResolutiontime(String resolutiontime) { + this.resolutiontime = resolutiontime; + } + public String getResolutioner() { + return resolutioner; + } + public void setResolutioner(String resolutioner) { + this.resolutioner = resolutioner; + } + public String getPreventiveaction() { + return preventiveaction; + } + public void setPreventiveaction(String preventiveaction) { + this.preventiveaction = preventiveaction; + } + public String getPreventiver() { + return preventiver; + } + public void setPreventiver(String preventiver) { + this.preventiver = preventiver; + } + public String getPreventiveplandate() { + return preventiveplandate; + } + public void setPreventiveplandate(String preventiveplandate) { + this.preventiveplandate = preventiveplandate; + } + public String getPreventiveaccdate() { + return preventiveaccdate; + } + public void setPreventiveaccdate(String preventiveaccdate) { + this.preventiveaccdate = preventiveaccdate; + } + +} diff --git a/src/main/java/luckyweb/seagull/spring/entity/Barchart3.java b/src/main/java/luckyweb/seagull/spring/entity/Barchart3.java index abf7eb7..55d6cbf 100644 --- a/src/main/java/luckyweb/seagull/spring/entity/Barchart3.java +++ b/src/main/java/luckyweb/seagull/spring/entity/Barchart3.java @@ -1,46 +1,46 @@ -package luckyweb.seagull.spring.entity; - -import java.util.Map; - -import javax.persistence.Entity; - -@Entity(name="barchart3") -public class Barchart3 implements java.io.Serializable{ - - private static final long serialVersionUID = 1L; - private String type; - private Map markPoint; - private Map markLine; - private String name; - private double[] data; - public String getName() { - return name; - } - public void setName(String name) { - this.name = name; - } - public double[] getData() { - return data; - } - public void setData(double[] data) { - this.data = data; - } - public String getType() { - return type; - } - public void setType(String type) { - this.type = type; - } - public Map getMarkPoint() { - return markPoint; - } - public void setMarkPoint(Map markPoint) { - this.markPoint = markPoint; - } - public Map getMarkLine() { - return markLine; - } - public void setMarkLine(Map markLine) { - this.markLine = markLine; - } -} +package luckyweb.seagull.spring.entity; + +import java.util.Map; + +import javax.persistence.Entity; + +@Entity(name="barchart3") +public class Barchart3 implements java.io.Serializable{ + + private static final long serialVersionUID = 1L; + private String type; + private Map markPoint; + private Map markLine; + private String name; + private double[] data; + public String getName() { + return name; + } + public void setName(String name) { + this.name = name; + } + public double[] getData() { + return data; + } + public void setData(double[] data) { + this.data = data; + } + public String getType() { + return type; + } + public void setType(String type) { + this.type = type; + } + public Map getMarkPoint() { + return markPoint; + } + public void setMarkPoint(Map markPoint) { + this.markPoint = markPoint; + } + public Map getMarkLine() { + return markLine; + } + public void setMarkLine(Map markLine) { + this.markLine = markLine; + } +} diff --git a/src/main/java/luckyweb/seagull/spring/entity/Barchart4.java b/src/main/java/luckyweb/seagull/spring/entity/Barchart4.java index 9724e41..f3f8c1e 100644 --- a/src/main/java/luckyweb/seagull/spring/entity/Barchart4.java +++ b/src/main/java/luckyweb/seagull/spring/entity/Barchart4.java @@ -1,47 +1,47 @@ -package luckyweb.seagull.spring.entity; - -import java.util.Map; - -import javax.persistence.Entity; - -@Entity(name="barchart3") -public class Barchart4 implements java.io.Serializable{ - - private static final long serialVersionUID = 1L; - private String type; - private String stack; - private Map itemStyle; - private String name; - private double[] data; - public String getType() { - return type; - } - public void setType(String type) { - this.type = type; - } - public String getStack() { - return stack; - } - public void setStack(String stack) { - this.stack = stack; - } - public Map getItemStyle() { - return itemStyle; - } - public void setItemStyle(Map itemStyle) { - this.itemStyle = itemStyle; - } - public String getName() { - return name; - } - public void setName(String name) { - this.name = name; - } - public double[] getData() { - return data; - } - public void setData(double[] data) { - this.data = data; - } - -} +package luckyweb.seagull.spring.entity; + +import java.util.Map; + +import javax.persistence.Entity; + +@Entity(name="barchart3") +public class Barchart4 implements java.io.Serializable{ + + private static final long serialVersionUID = 1L; + private String type; + private String stack; + private Map itemStyle; + private String name; + private double[] data; + public String getType() { + return type; + } + public void setType(String type) { + this.type = type; + } + public String getStack() { + return stack; + } + public void setStack(String stack) { + this.stack = stack; + } + public Map getItemStyle() { + return itemStyle; + } + public void setItemStyle(Map itemStyle) { + this.itemStyle = itemStyle; + } + public String getName() { + return name; + } + public void setName(String name) { + this.name = name; + } + public double[] getData() { + return data; + } + public void setData(double[] data) { + this.data = data; + } + +} diff --git a/src/main/java/luckyweb/seagull/spring/entity/FlowCheck.java b/src/main/java/luckyweb/seagull/spring/entity/FlowCheck.java index 30b9dce..c99ed68 100644 --- a/src/main/java/luckyweb/seagull/spring/entity/FlowCheck.java +++ b/src/main/java/luckyweb/seagull/spring/entity/FlowCheck.java @@ -1,126 +1,126 @@ -package luckyweb.seagull.spring.entity; - -import javax.persistence.Entity; - -@Entity(name="flowCheck") -public class FlowCheck implements java.io.Serializable{ - /** - * - */ - private static final long serialVersionUID = 1L; - private int id; - private int checkid; - private int projectid; - private String projectphase; - private String phasenode; - private String checkentry; - private String checkresult; - private String checkdate; - private String checkdescriptions; - private String stateupdate; - private String updatedate; - private String remark; - private SectorProjects sectorProjects; - private String checkstartdate; - private String checkenddate; - private String versionnum; - - public String getVersionnum() { - return versionnum; - } - public void setVersionnum(String versionnum) { - this.versionnum = versionnum; - } - public String getCheckstartdate() { - return checkstartdate; - } - public void setCheckstartdate(String checkstartdate) { - this.checkstartdate = checkstartdate; - } - public String getCheckenddate() { - return checkenddate; - } - public void setCheckenddate(String checkenddate) { - this.checkenddate = checkenddate; - } - - public int getId() { - return id; - } - public void setId(int id) { - this.id = id; - } - public int getCheckid() { - return checkid; - } - public void setCheckid(int checkid) { - this.checkid = checkid; - } - public int getProjectid() { - return projectid; - } - public void setProjectid(int projectid) { - this.projectid = projectid; - } - public String getProjectphase() { - return projectphase; - } - public void setProjectphase(String projectphase) { - this.projectphase = projectphase; - } - public String getPhasenode() { - return phasenode; - } - public void setPhasenode(String phasenode) { - this.phasenode = phasenode; - } - public String getCheckentry() { - return checkentry; - } - public void setCheckentry(String checkentry) { - this.checkentry = checkentry; - } - public String getCheckresult() { - return checkresult; - } - public void setCheckresult(String checkresult) { - this.checkresult = checkresult; - } - public String getCheckdate() { - return checkdate; - } - public void setCheckdate(String checkdate) { - this.checkdate = checkdate; - } - public String getCheckdescriptions() { - return checkdescriptions; - } - public void setCheckdescriptions(String checkdescriptions) { - this.checkdescriptions = checkdescriptions; - } - public String getStateupdate() { - return stateupdate; - } - public void setStateupdate(String stateupdate) { - this.stateupdate = stateupdate; - } - public String getUpdatedate() { - return updatedate; - } - public void setUpdatedate(String updatedate) { - this.updatedate = updatedate; - } - public String getRemark() { - return remark; - } - public void setRemark(String remark) { - this.remark = remark; - } - public SectorProjects getSectorProjects() { - return sectorProjects; - } - public void setSectorProjects(SectorProjects sectorProjects) { - this.sectorProjects = sectorProjects; - } - -} +package luckyweb.seagull.spring.entity; + +import javax.persistence.Entity; + +@Entity(name="flowCheck") +public class FlowCheck implements java.io.Serializable{ + /** + * + */ + private static final long serialVersionUID = 1L; + private int id; + private int checkid; + private int projectid; + private String projectphase; + private String phasenode; + private String checkentry; + private String checkresult; + private String checkdate; + private String checkdescriptions; + private String stateupdate; + private String updatedate; + private String remark; + private SectorProjects sectorProjects; + private String checkstartdate; + private String checkenddate; + private String versionnum; + + public String getVersionnum() { + return versionnum; + } + public void setVersionnum(String versionnum) { + this.versionnum = versionnum; + } + public String getCheckstartdate() { + return checkstartdate; + } + public void setCheckstartdate(String checkstartdate) { + this.checkstartdate = checkstartdate; + } + public String getCheckenddate() { + return checkenddate; + } + public void setCheckenddate(String checkenddate) { + this.checkenddate = checkenddate; + } + + public int getId() { + return id; + } + public void setId(int id) { + this.id = id; + } + public int getCheckid() { + return checkid; + } + public void setCheckid(int checkid) { + this.checkid = checkid; + } + public int getProjectid() { + return projectid; + } + public void setProjectid(int projectid) { + this.projectid = projectid; + } + public String getProjectphase() { + return projectphase; + } + public void setProjectphase(String projectphase) { + this.projectphase = projectphase; + } + public String getPhasenode() { + return phasenode; + } + public void setPhasenode(String phasenode) { + this.phasenode = phasenode; + } + public String getCheckentry() { + return checkentry; + } + public void setCheckentry(String checkentry) { + this.checkentry = checkentry; + } + public String getCheckresult() { + return checkresult; + } + public void setCheckresult(String checkresult) { + this.checkresult = checkresult; + } + public String getCheckdate() { + return checkdate; + } + public void setCheckdate(String checkdate) { + this.checkdate = checkdate; + } + public String getCheckdescriptions() { + return checkdescriptions; + } + public void setCheckdescriptions(String checkdescriptions) { + this.checkdescriptions = checkdescriptions; + } + public String getStateupdate() { + return stateupdate; + } + public void setStateupdate(String stateupdate) { + this.stateupdate = stateupdate; + } + public String getUpdatedate() { + return updatedate; + } + public void setUpdatedate(String updatedate) { + this.updatedate = updatedate; + } + public String getRemark() { + return remark; + } + public void setRemark(String remark) { + this.remark = remark; + } + public SectorProjects getSectorProjects() { + return sectorProjects; + } + public void setSectorProjects(SectorProjects sectorProjects) { + this.sectorProjects = sectorProjects; + } + +} diff --git a/src/main/java/luckyweb/seagull/spring/entity/FlowInfo.java b/src/main/java/luckyweb/seagull/spring/entity/FlowInfo.java index 29d51e5..acfb24d 100644 --- a/src/main/java/luckyweb/seagull/spring/entity/FlowInfo.java +++ b/src/main/java/luckyweb/seagull/spring/entity/FlowInfo.java @@ -1,70 +1,70 @@ -package luckyweb.seagull.spring.entity; - -import javax.persistence.Entity; - -@Entity(name="flowInfo") -public class FlowInfo implements java.io.Serializable{ - /** - * - */ - private static final long serialVersionUID = 1L; - private int id; - private int phaseid; - private String phasename; - private int phasenodeid; - private String phasenodename; - private int checkentryid; - private String checkentry; - private String remark; - - public int getId() { - return id; - } - public void setId(int id) { - this.id = id; - } - public int getPhaseid() { - return phaseid; - } - public void setPhaseid(int phaseid) { - this.phaseid = phaseid; - } - public String getPhasename() { - return phasename; - } - public void setPhasename(String phasename) { - this.phasename = phasename; - } - public int getPhasenodeid() { - return phasenodeid; - } - public void setPhasenodeid(int phasenodeid) { - this.phasenodeid = phasenodeid; - } - public String getPhasenodename() { - return phasenodename; - } - public void setPhasenodename(String phasenodename) { - this.phasenodename = phasenodename; - } - public int getCheckentryid() { - return checkentryid; - } - public void setCheckentryid(int checkentryid) { - this.checkentryid = checkentryid; - } - public String getCheckentry() { - return checkentry; - } - public void setCheckentry(String checkentry) { - this.checkentry = checkentry; - } - public String getRemark() { - return remark; - } - public void setRemark(String remark) { - this.remark = remark; - } - - -} +package luckyweb.seagull.spring.entity; + +import javax.persistence.Entity; + +@Entity(name="flowInfo") +public class FlowInfo implements java.io.Serializable{ + /** + * + */ + private static final long serialVersionUID = 1L; + private int id; + private int phaseid; + private String phasename; + private int phasenodeid; + private String phasenodename; + private int checkentryid; + private String checkentry; + private String remark; + + public int getId() { + return id; + } + public void setId(int id) { + this.id = id; + } + public int getPhaseid() { + return phaseid; + } + public void setPhaseid(int phaseid) { + this.phaseid = phaseid; + } + public String getPhasename() { + return phasename; + } + public void setPhasename(String phasename) { + this.phasename = phasename; + } + public int getPhasenodeid() { + return phasenodeid; + } + public void setPhasenodeid(int phasenodeid) { + this.phasenodeid = phasenodeid; + } + public String getPhasenodename() { + return phasenodename; + } + public void setPhasenodename(String phasenodename) { + this.phasenodename = phasenodename; + } + public int getCheckentryid() { + return checkentryid; + } + public void setCheckentryid(int checkentryid) { + this.checkentryid = checkentryid; + } + public String getCheckentry() { + return checkentry; + } + public void setCheckentry(String checkentry) { + this.checkentry = checkentry; + } + public String getRemark() { + return remark; + } + public void setRemark(String remark) { + this.remark = remark; + } + + +} diff --git a/src/main/java/luckyweb/seagull/spring/entity/OperationLog.java b/src/main/java/luckyweb/seagull/spring/entity/OperationLog.java index b3d349d..8e582bb 100644 --- a/src/main/java/luckyweb/seagull/spring/entity/OperationLog.java +++ b/src/main/java/luckyweb/seagull/spring/entity/OperationLog.java @@ -1,85 +1,85 @@ -package luckyweb.seagull.spring.entity; - -import javax.persistence.Entity; - -@Entity(name="operationLog") -public class OperationLog implements java.io.Serializable{ - /** - * - */ - private static final long serialVersionUID = 1L; - private int id = 0; - private String tablename; - private int tableid; - private int projectid; - private String operation_time; - private String operationer; - private String operation_description; - private String starttime; - private String endtime; - private SectorProjects sectorProjects; - - public SectorProjects getSectorProjects() { - return sectorProjects; - } - public void setSectorProjects(SectorProjects sectorProjects) { - this.sectorProjects = sectorProjects; - } - public String getStarttime() { - return starttime; - } - public void setStarttime(String starttime) { - this.starttime = starttime; - } - public String getEndtime() { - return endtime; - } - public void setEndtime(String endtime) { - this.endtime = endtime; - } - - public int getProjectid() { - return projectid; - } - public void setProjectid(int projectid) { - this.projectid = projectid; - } - - public int getId() { - return id; - } - public void setId(int id) { - this.id = id; - } - public String getTablename() { - return tablename; - } - public void setTablename(String tablename) { - this.tablename = tablename; - } - public int getTableid() { - return tableid; - } - public void setTableid(int tableid) { - this.tableid = tableid; - } - public String getOperation_time() { - return operation_time; - } - public void setOperation_time(String operation_time) { - this.operation_time = operation_time; - } - public String getOperationer() { - return operationer; - } - public void setOperationer(String operationer) { - this.operationer = operationer; - } - public String getOperation_description() { - return operation_description; - } - public void setOperation_description(String operation_description) { - this.operation_description = operation_description; - } - -} +package luckyweb.seagull.spring.entity; + +import javax.persistence.Entity; + +@Entity(name="operationLog") +public class OperationLog implements java.io.Serializable{ + /** + * + */ + private static final long serialVersionUID = 1L; + private int id = 0; + private String tablename; + private int tableid; + private int projectid; + private String operation_time; + private String operationer; + private String operation_description; + private String starttime; + private String endtime; + private SectorProjects sectorProjects; + + public SectorProjects getSectorProjects() { + return sectorProjects; + } + public void setSectorProjects(SectorProjects sectorProjects) { + this.sectorProjects = sectorProjects; + } + public String getStarttime() { + return starttime; + } + public void setStarttime(String starttime) { + this.starttime = starttime; + } + public String getEndtime() { + return endtime; + } + public void setEndtime(String endtime) { + this.endtime = endtime; + } + + public int getProjectid() { + return projectid; + } + public void setProjectid(int projectid) { + this.projectid = projectid; + } + + public int getId() { + return id; + } + public void setId(int id) { + this.id = id; + } + public String getTablename() { + return tablename; + } + public void setTablename(String tablename) { + this.tablename = tablename; + } + public int getTableid() { + return tableid; + } + public void setTableid(int tableid) { + this.tableid = tableid; + } + public String getOperation_time() { + return operation_time; + } + public void setOperation_time(String operation_time) { + this.operation_time = operation_time; + } + public String getOperationer() { + return operationer; + } + public void setOperationer(String operationer) { + this.operationer = operationer; + } + public String getOperation_description() { + return operation_description; + } + public void setOperation_description(String operation_description) { + this.operation_description = operation_description; + } + +} diff --git a/src/main/java/luckyweb/seagull/spring/entity/PieLasagna.java b/src/main/java/luckyweb/seagull/spring/entity/PieLasagna.java index 388a4fa..56ce750 100644 --- a/src/main/java/luckyweb/seagull/spring/entity/PieLasagna.java +++ b/src/main/java/luckyweb/seagull/spring/entity/PieLasagna.java @@ -1,25 +1,25 @@ -package luckyweb.seagull.spring.entity; - -import javax.persistence.Entity; - -@Entity(name="pielasagna") -public class PieLasagna implements java.io.Serializable{ - - private static final long serialVersionUID = 1L; - private String name; - private double value; - - public String getName() { - return name; - } - public void setName(String name) { - this.name = name; - } - public double getValue() { - return value; - } - public void setValue(double value) { - this.value = value; - } - -} +package luckyweb.seagull.spring.entity; + +import javax.persistence.Entity; + +@Entity(name="pielasagna") +public class PieLasagna implements java.io.Serializable{ + + private static final long serialVersionUID = 1L; + private String name; + private double value; + + public String getName() { + return name; + } + public void setName(String name) { + this.name = name; + } + public double getValue() { + return value; + } + public void setValue(double value) { + this.value = value; + } + +} diff --git a/src/main/java/luckyweb/seagull/spring/entity/Piechart5.java b/src/main/java/luckyweb/seagull/spring/entity/Piechart5.java index 0678056..bd2d2a4 100644 --- a/src/main/java/luckyweb/seagull/spring/entity/Piechart5.java +++ b/src/main/java/luckyweb/seagull/spring/entity/Piechart5.java @@ -1,21 +1,21 @@ -package luckyweb.seagull.spring.entity; - -import java.util.Map; - -import javax.persistence.Entity; - -@Entity(name="barchart3") -public class Piechart5 implements java.io.Serializable{ - - private static final long serialVersionUID = 1L; - private String type; - private String center[]; - private String radius; - private String x; - private String itemStyle; - private Map markPoint; - private Map markLine; - private String name; - private double[] data; - -} +package luckyweb.seagull.spring.entity; + +import java.util.Map; + +import javax.persistence.Entity; + +@Entity(name="barchart3") +public class Piechart5 implements java.io.Serializable{ + + private static final long serialVersionUID = 1L; + private String type; + private String center[]; + private String radius; + private String x; + private String itemStyle; + private Map markPoint; + private Map markLine; + private String name; + private double[] data; + +} diff --git a/src/main/java/luckyweb/seagull/spring/entity/PlanFlowCheck.java b/src/main/java/luckyweb/seagull/spring/entity/PlanFlowCheck.java index 1e3c18f..dda0501 100644 --- a/src/main/java/luckyweb/seagull/spring/entity/PlanFlowCheck.java +++ b/src/main/java/luckyweb/seagull/spring/entity/PlanFlowCheck.java @@ -1,77 +1,77 @@ -package luckyweb.seagull.spring.entity; - -import javax.persistence.Entity; - -@Entity(name="planflowCheck") -public class PlanFlowCheck implements java.io.Serializable{ - /** - * - */ - private static final long serialVersionUID = 1L; - private int id; - private int projectid; - private String versionnum; - private String checkentryid; - private String plandate; - private int status; - private String checkphase; - private String checknode; - - public String getCheckphase() { - return checkphase; - } - public void setCheckphase(String checkphase) { - this.checkphase = checkphase; - } - public String getChecknode() { - return checknode; - } - public void setChecknode(String checknode) { - this.checknode = checknode; - } - private SectorProjects sectorProjects; - - public SectorProjects getSectorProjects() { - return sectorProjects; - } - public void setSectorProjects(SectorProjects sectorProjects) { - this.sectorProjects = sectorProjects; - } - public int getId() { - return id; - } - public void setId(int id) { - this.id = id; - } - public int getProjectid() { - return projectid; - } - public void setProjectid(int projectid) { - this.projectid = projectid; - } - public String getVersionnum() { - return versionnum; - } - public void setVersionnum(String versionnum) { - this.versionnum = versionnum; - } - public String getCheckentryid() { - return checkentryid; - } - public void setCheckentryid(String checkentryid) { - this.checkentryid = checkentryid; - } - public String getPlandate() { - return plandate; - } - public void setPlandate(String plandate) { - this.plandate = plandate; - } - public int getStatus() { - return status; - } - public void setStatus(int status) { - this.status = status; - } - -} +package luckyweb.seagull.spring.entity; + +import javax.persistence.Entity; + +@Entity(name="planflowCheck") +public class PlanFlowCheck implements java.io.Serializable{ + /** + * + */ + private static final long serialVersionUID = 1L; + private int id; + private int projectid; + private String versionnum; + private String checkentryid; + private String plandate; + private int status; + private String checkphase; + private String checknode; + + public String getCheckphase() { + return checkphase; + } + public void setCheckphase(String checkphase) { + this.checkphase = checkphase; + } + public String getChecknode() { + return checknode; + } + public void setChecknode(String checknode) { + this.checknode = checknode; + } + private SectorProjects sectorProjects; + + public SectorProjects getSectorProjects() { + return sectorProjects; + } + public void setSectorProjects(SectorProjects sectorProjects) { + this.sectorProjects = sectorProjects; + } + public int getId() { + return id; + } + public void setId(int id) { + this.id = id; + } + public int getProjectid() { + return projectid; + } + public void setProjectid(int projectid) { + this.projectid = projectid; + } + public String getVersionnum() { + return versionnum; + } + public void setVersionnum(String versionnum) { + this.versionnum = versionnum; + } + public String getCheckentryid() { + return checkentryid; + } + public void setCheckentryid(String checkentryid) { + this.checkentryid = checkentryid; + } + public String getPlandate() { + return plandate; + } + public void setPlandate(String plandate) { + this.plandate = plandate; + } + public int getStatus() { + return status; + } + public void setStatus(int status) { + this.status = status; + } + +} diff --git a/src/main/java/luckyweb/seagull/spring/entity/ProjectCase.java b/src/main/java/luckyweb/seagull/spring/entity/ProjectCase.java index bc2b7a6..6352cc1 100644 --- a/src/main/java/luckyweb/seagull/spring/entity/ProjectCase.java +++ b/src/main/java/luckyweb/seagull/spring/entity/ProjectCase.java @@ -1,120 +1,120 @@ -package luckyweb.seagull.spring.entity; - -import javax.persistence.Entity; - -@Entity(name="projectCase") -public class ProjectCase implements java.io.Serializable{ - /** - * - */ - private static final long serialVersionUID = 1L; - private int id; - private String sign; - private String name; - private int projectid; - private int moduleid; - private Integer[] moduleidarr; - private String modulename; - private int projectindex; - private String projectname; - private String remark; - private int casetype; - private String time; - private String operationer; - private int priority; - private int checktype; - - - public Integer[] getModuleidarr() { - return moduleidarr; - } - public void setModuleidarr(Integer[] moduleidarr) { - this.moduleidarr = moduleidarr; - } - public String getModulename() { - return modulename; - } - public void setModulename(String modulename) { - this.modulename = modulename; - } - public int getModuleid() { - return moduleid; - } - public void setModuleid(int moduleid) { - this.moduleid = moduleid; - } - public int getProjectindex() { - return projectindex; - } - public void setProjectindex(int projectindex) { - this.projectindex = projectindex; - } - public int getChecktype() { - return checktype; - } - public void setChecktype(int checktype) { - this.checktype = checktype; - } - public int getPriority() { - return priority; - } - public void setPriority(int priority) { - this.priority = priority; - } - public String getProjectname() { - return projectname; - } - public void setProjectname(String projectname) { - this.projectname = projectname; - } - public int getId() { - return id; - } - public void setId(int id) { - this.id = id; - } - public String getSign() { - return sign; - } - public void setSign(String sign) { - this.sign = sign; - } - public String getName() { - return name; - } - public void setName(String name) { - this.name = name; - } - public int getProjectid() { - return projectid; - } - public void setProjectid(int projectid) { - this.projectid = projectid; - } - public String getRemark() { - return remark; - } - public void setRemark(String remark) { - this.remark = remark; - } - public int getCasetype() { - return casetype; - } - public void setCasetype(int casetype) { - this.casetype = casetype; - } - public String getTime() { - return time; - } - public void setTime(String time) { - this.time = time; - } - public String getOperationer() { - return operationer; - } - public void setOperationer(String operationer) { - this.operationer = operationer; - } - - -} +package luckyweb.seagull.spring.entity; + +import javax.persistence.Entity; + +@Entity(name="projectCase") +public class ProjectCase implements java.io.Serializable{ + /** + * + */ + private static final long serialVersionUID = 1L; + private int id; + private String sign; + private String name; + private int projectid; + private int moduleid; + private Integer[] moduleidarr; + private String modulename; + private int projectindex; + private String projectname; + private String remark; + private int casetype; + private String time; + private String operationer; + private int priority; + private int checktype; + + + public Integer[] getModuleidarr() { + return moduleidarr; + } + public void setModuleidarr(Integer[] moduleidarr) { + this.moduleidarr = moduleidarr; + } + public String getModulename() { + return modulename; + } + public void setModulename(String modulename) { + this.modulename = modulename; + } + public int getModuleid() { + return moduleid; + } + public void setModuleid(int moduleid) { + this.moduleid = moduleid; + } + public int getProjectindex() { + return projectindex; + } + public void setProjectindex(int projectindex) { + this.projectindex = projectindex; + } + public int getChecktype() { + return checktype; + } + public void setChecktype(int checktype) { + this.checktype = checktype; + } + public int getPriority() { + return priority; + } + public void setPriority(int priority) { + this.priority = priority; + } + public String getProjectname() { + return projectname; + } + public void setProjectname(String projectname) { + this.projectname = projectname; + } + public int getId() { + return id; + } + public void setId(int id) { + this.id = id; + } + public String getSign() { + return sign; + } + public void setSign(String sign) { + this.sign = sign; + } + public String getName() { + return name; + } + public void setName(String name) { + this.name = name; + } + public int getProjectid() { + return projectid; + } + public void setProjectid(int projectid) { + this.projectid = projectid; + } + public String getRemark() { + return remark; + } + public void setRemark(String remark) { + this.remark = remark; + } + public int getCasetype() { + return casetype; + } + public void setCasetype(int casetype) { + this.casetype = casetype; + } + public String getTime() { + return time; + } + public void setTime(String time) { + this.time = time; + } + public String getOperationer() { + return operationer; + } + public void setOperationer(String operationer) { + this.operationer = operationer; + } + + +} diff --git a/src/main/java/luckyweb/seagull/spring/entity/ProjectCasesteps.java b/src/main/java/luckyweb/seagull/spring/entity/ProjectCasesteps.java index 742ab3d..a356edb 100644 --- a/src/main/java/luckyweb/seagull/spring/entity/ProjectCasesteps.java +++ b/src/main/java/luckyweb/seagull/spring/entity/ProjectCasesteps.java @@ -1,104 +1,104 @@ -package luckyweb.seagull.spring.entity; - -import javax.persistence.Entity; - -@Entity(name="projectCasesteps") -public class ProjectCasesteps implements java.io.Serializable{ - /** - * - */ - private static final long serialVersionUID = 1L; - private int id; - private String path; - private String operation; - private String parameters; - private String action; - private int caseid; - private int stepnum; - private String expectedresult; - private int projectid; - private int steptype; - private String time; - private String operationer; - private String remark; - public int getId() { - return id; - } - public void setId(int id) { - this.id = id; - } - - public String getPath() { - return path; - } - public void setPath(String path) { - this.path = path; - } - public String getOperation() { - return operation; - } - public void setOperation(String operation) { - this.operation = operation; - } - public String getParameters() { - return parameters; - } - public void setParameters(String parameters) { - this.parameters = parameters; - } - public String getAction() { - return action; - } - public void setAction(String action) { - this.action = action; - } - public int getCaseid() { - return caseid; - } - public void setCaseid(int caseid) { - this.caseid = caseid; - } - public int getStepnum() { - return stepnum; - } - public void setStepnum(int stepnum) { - this.stepnum = stepnum; - } - public String getExpectedresult() { - return expectedresult; - } - public void setExpectedresult(String expectedresult) { - this.expectedresult = expectedresult; - } - public int getProjectid() { - return projectid; - } - public void setProjectid(int projectid) { - this.projectid = projectid; - } - public int getSteptype() { - return steptype; - } - public void setSteptype(int steptype) { - this.steptype = steptype; - } - public String getTime() { - return time; - } - public void setTime(String time) { - this.time = time; - } - public String getOperationer() { - return operationer; - } - public void setOperationer(String operationer) { - this.operationer = operationer; - } - public String getRemark() { - return remark; - } - public void setRemark(String remark) { - this.remark = remark; - } - -} +package luckyweb.seagull.spring.entity; + +import javax.persistence.Entity; + +@Entity(name="projectCasesteps") +public class ProjectCasesteps implements java.io.Serializable{ + /** + * + */ + private static final long serialVersionUID = 1L; + private int id; + private String path; + private String operation; + private String parameters; + private String action; + private int caseid; + private int stepnum; + private String expectedresult; + private int projectid; + private int steptype; + private String time; + private String operationer; + private String remark; + public int getId() { + return id; + } + public void setId(int id) { + this.id = id; + } + + public String getPath() { + return path; + } + public void setPath(String path) { + this.path = path; + } + public String getOperation() { + return operation; + } + public void setOperation(String operation) { + this.operation = operation; + } + public String getParameters() { + return parameters; + } + public void setParameters(String parameters) { + this.parameters = parameters; + } + public String getAction() { + return action; + } + public void setAction(String action) { + this.action = action; + } + public int getCaseid() { + return caseid; + } + public void setCaseid(int caseid) { + this.caseid = caseid; + } + public int getStepnum() { + return stepnum; + } + public void setStepnum(int stepnum) { + this.stepnum = stepnum; + } + public String getExpectedresult() { + return expectedresult; + } + public void setExpectedresult(String expectedresult) { + this.expectedresult = expectedresult; + } + public int getProjectid() { + return projectid; + } + public void setProjectid(int projectid) { + this.projectid = projectid; + } + public int getSteptype() { + return steptype; + } + public void setSteptype(int steptype) { + this.steptype = steptype; + } + public String getTime() { + return time; + } + public void setTime(String time) { + this.time = time; + } + public String getOperationer() { + return operationer; + } + public void setOperationer(String operationer) { + this.operationer = operationer; + } + public String getRemark() { + return remark; + } + public void setRemark(String remark) { + this.remark = remark; + } + +} diff --git a/src/main/java/luckyweb/seagull/spring/entity/ProjectModule.java b/src/main/java/luckyweb/seagull/spring/entity/ProjectModule.java index 0ddd1ee..3f6e1e2 100644 --- a/src/main/java/luckyweb/seagull/spring/entity/ProjectModule.java +++ b/src/main/java/luckyweb/seagull/spring/entity/ProjectModule.java @@ -1,48 +1,48 @@ -package luckyweb.seagull.spring.entity; - -import javax.persistence.Entity; - -@Entity(name="projectModule") -public class ProjectModule implements java.io.Serializable{ - /** - * - */ - private static final long serialVersionUID = 1L; - private int id; - private int projectid; - private int mprojectid; - private String modulename; - private int pid; - - public int getMprojectid() { - return mprojectid; - } - public void setMprojectid(int mprojectid) { - this.mprojectid = mprojectid; - } - public int getId() { - return id; - } - public void setId(int id) { - this.id = id; - } - public int getProjectid() { - return projectid; - } - public void setProjectid(int projectid) { - this.projectid = projectid; - } - public String getModulename() { - return modulename; - } - public void setModulename(String modulename) { - this.modulename = modulename; - } - public int getPid() { - return pid; - } - public void setPid(int pid) { - this.pid = pid; - } - -} +package luckyweb.seagull.spring.entity; + +import javax.persistence.Entity; + +@Entity(name="projectModule") +public class ProjectModule implements java.io.Serializable{ + /** + * + */ + private static final long serialVersionUID = 1L; + private int id; + private int projectid; + private int mprojectid; + private String modulename; + private int pid; + + public int getMprojectid() { + return mprojectid; + } + public void setMprojectid(int mprojectid) { + this.mprojectid = mprojectid; + } + public int getId() { + return id; + } + public void setId(int id) { + this.id = id; + } + public int getProjectid() { + return projectid; + } + public void setProjectid(int projectid) { + this.projectid = projectid; + } + public String getModulename() { + return modulename; + } + public void setModulename(String modulename) { + this.modulename = modulename; + } + public int getPid() { + return pid; + } + public void setPid(int pid) { + this.pid = pid; + } + +} diff --git a/src/main/java/luckyweb/seagull/spring/entity/ProjectModuleJson.java b/src/main/java/luckyweb/seagull/spring/entity/ProjectModuleJson.java index c59e405..481a56d 100644 --- a/src/main/java/luckyweb/seagull/spring/entity/ProjectModuleJson.java +++ b/src/main/java/luckyweb/seagull/spring/entity/ProjectModuleJson.java @@ -1,33 +1,33 @@ -package luckyweb.seagull.spring.entity; - -import javax.persistence.Entity; - -@Entity(name="projectModuleJson") -public class ProjectModuleJson implements java.io.Serializable{ - /** - * - */ - private static final long serialVersionUID = 1L; - private int id; - private String name; - private boolean isParent; - public int getId() { - return id; - } - public void setId(int id) { - this.id = id; - } - public String getName() { - return name; - } - public void setName(String name) { - this.name = name; - } - public boolean isParent() { - return isParent; - } - public void setisParent(boolean isParent) { - this.isParent = isParent; - } - -} +package luckyweb.seagull.spring.entity; + +import javax.persistence.Entity; + +@Entity(name="projectModuleJson") +public class ProjectModuleJson implements java.io.Serializable{ + /** + * + */ + private static final long serialVersionUID = 1L; + private int id; + private String name; + private boolean isParent; + public int getId() { + return id; + } + public void setId(int id) { + this.id = id; + } + public String getName() { + return name; + } + public void setName(String name) { + this.name = name; + } + public boolean isParent() { + return isParent; + } + public void setisParent(boolean isParent) { + this.isParent = isParent; + } + +} diff --git a/src/main/java/luckyweb/seagull/spring/entity/ProjectPlan.java b/src/main/java/luckyweb/seagull/spring/entity/ProjectPlan.java index 27a4107..aac0757 100644 --- a/src/main/java/luckyweb/seagull/spring/entity/ProjectPlan.java +++ b/src/main/java/luckyweb/seagull/spring/entity/ProjectPlan.java @@ -1,69 +1,69 @@ -package luckyweb.seagull.spring.entity; - -import javax.persistence.Entity; - -@Entity(name="projectPlan") -public class ProjectPlan implements java.io.Serializable{ - /** - * - */ - private static final long serialVersionUID = 1L; - private int id; - private int projectid; - private String name; - private int casecount; - private String remark; - private String time; - private String operationer; - private String projectname; - - public String getProjectname() { - return projectname; - } - public void setProjectname(String projectname) { - this.projectname = projectname; - } - public int getId() { - return id; - } - public void setId(int id) { - this.id = id; - } - public int getProjectid() { - return projectid; - } - public void setProjectid(int projectid) { - this.projectid = projectid; - } - public String getName() { - return name; - } - public void setName(String name) { - this.name = name; - } - public int getCasecount() { - return casecount; - } - public void setCasecount(int casecount) { - this.casecount = casecount; - } - public String getRemark() { - return remark; - } - public void setRemark(String remark) { - this.remark = remark; - } - public String getTime() { - return time; - } - public void setTime(String time) { - this.time = time; - } - public String getOperationer() { - return operationer; - } - public void setOperationer(String operationer) { - this.operationer = operationer; - } - -} +package luckyweb.seagull.spring.entity; + +import javax.persistence.Entity; + +@Entity(name="projectPlan") +public class ProjectPlan implements java.io.Serializable{ + /** + * + */ + private static final long serialVersionUID = 1L; + private int id; + private int projectid; + private String name; + private int casecount; + private String remark; + private String time; + private String operationer; + private String projectname; + + public String getProjectname() { + return projectname; + } + public void setProjectname(String projectname) { + this.projectname = projectname; + } + public int getId() { + return id; + } + public void setId(int id) { + this.id = id; + } + public int getProjectid() { + return projectid; + } + public void setProjectid(int projectid) { + this.projectid = projectid; + } + public String getName() { + return name; + } + public void setName(String name) { + this.name = name; + } + public int getCasecount() { + return casecount; + } + public void setCasecount(int casecount) { + this.casecount = casecount; + } + public String getRemark() { + return remark; + } + public void setRemark(String remark) { + this.remark = remark; + } + public String getTime() { + return time; + } + public void setTime(String time) { + this.time = time; + } + public String getOperationer() { + return operationer; + } + public void setOperationer(String operationer) { + this.operationer = operationer; + } + +} diff --git a/src/main/java/luckyweb/seagull/spring/entity/ProjectPlanCase.java b/src/main/java/luckyweb/seagull/spring/entity/ProjectPlanCase.java index 1408402..6d01d2c 100644 --- a/src/main/java/luckyweb/seagull/spring/entity/ProjectPlanCase.java +++ b/src/main/java/luckyweb/seagull/spring/entity/ProjectPlanCase.java @@ -1,42 +1,42 @@ -package luckyweb.seagull.spring.entity; - -import javax.persistence.Entity; - -@Entity(name="projectPlanCase") -public class ProjectPlanCase implements java.io.Serializable{ - /** - * - */ - private static final long serialVersionUID = 1L; - private int id; - private int caseid; - private int planid; - private int priority; - - public int getPriority() { - return priority; - } - public void setPriority(int priority) { - this.priority = priority; - } - public int getId() { - return id; - } - public void setId(int id) { - this.id = id; - } - public int getCaseid() { - return caseid; - } - public void setCaseid(int caseid) { - this.caseid = caseid; - } - public int getPlanid() { - return planid; - } - public void setPlanid(int planid) { - this.planid = planid; - } - - -} +package luckyweb.seagull.spring.entity; + +import javax.persistence.Entity; + +@Entity(name="projectPlanCase") +public class ProjectPlanCase implements java.io.Serializable{ + /** + * + */ + private static final long serialVersionUID = 1L; + private int id; + private int caseid; + private int planid; + private int priority; + + public int getPriority() { + return priority; + } + public void setPriority(int priority) { + this.priority = priority; + } + public int getId() { + return id; + } + public void setId(int id) { + this.id = id; + } + public int getCaseid() { + return caseid; + } + public void setCaseid(int caseid) { + this.caseid = caseid; + } + public int getPlanid() { + return planid; + } + public void setPlanid(int planid) { + this.planid = planid; + } + + +} diff --git a/src/main/java/luckyweb/seagull/spring/entity/ProjectProtocolTemplate.java b/src/main/java/luckyweb/seagull/spring/entity/ProjectProtocolTemplate.java index 9674b13..0385ceb 100644 --- a/src/main/java/luckyweb/seagull/spring/entity/ProjectProtocolTemplate.java +++ b/src/main/java/luckyweb/seagull/spring/entity/ProjectProtocolTemplate.java @@ -1,85 +1,85 @@ -package luckyweb.seagull.spring.entity; - -import javax.persistence.Entity; - -@Entity(name="projectProtocolTemplate") -public class ProjectProtocolTemplate implements java.io.Serializable{ - /** - * - */ - private static final long serialVersionUID = 1L; - private int id; - private int projectid; - private String name; - private String protocoltype; - private String contentencoding; - private int connecttimeout; - private String time; - private String operationer; - private String remark; - private String projectname; - - - public String getProjectname() { - return projectname; - } - public void setProjectname(String projectname) { - this.projectname = projectname; - } - public String getRemark() { - return remark; - } - public void setRemark(String remark) { - this.remark = remark; - } - public int getId() { - return id; - } - public void setId(int id) { - this.id = id; - } - public int getProjectid() { - return projectid; - } - public void setProjectid(int projectid) { - this.projectid = projectid; - } - public String getName() { - return name; - } - public void setName(String name) { - this.name = name; - } - public String getProtocoltype() { - return protocoltype; - } - public void setProtocoltype(String protocoltype) { - this.protocoltype = protocoltype; - } - public String getContentencoding() { - return contentencoding; - } - public void setContentencoding(String contentencoding) { - this.contentencoding = contentencoding; - } - public int getConnecttimeout() { - return connecttimeout; - } - public void setConnecttimeout(int connecttimeout) { - this.connecttimeout = connecttimeout; - } - public String getTime() { - return time; - } - public void setTime(String time) { - this.time = time; - } - public String getOperationer() { - return operationer; - } - public void setOperationer(String operationer) { - this.operationer = operationer; - } - - -} +package luckyweb.seagull.spring.entity; + +import javax.persistence.Entity; + +@Entity(name="projectProtocolTemplate") +public class ProjectProtocolTemplate implements java.io.Serializable{ + /** + * + */ + private static final long serialVersionUID = 1L; + private int id; + private int projectid; + private String name; + private String protocoltype; + private String contentencoding; + private int connecttimeout; + private String time; + private String operationer; + private String remark; + private String projectname; + + + public String getProjectname() { + return projectname; + } + public void setProjectname(String projectname) { + this.projectname = projectname; + } + public String getRemark() { + return remark; + } + public void setRemark(String remark) { + this.remark = remark; + } + public int getId() { + return id; + } + public void setId(int id) { + this.id = id; + } + public int getProjectid() { + return projectid; + } + public void setProjectid(int projectid) { + this.projectid = projectid; + } + public String getName() { + return name; + } + public void setName(String name) { + this.name = name; + } + public String getProtocoltype() { + return protocoltype; + } + public void setProtocoltype(String protocoltype) { + this.protocoltype = protocoltype; + } + public String getContentencoding() { + return contentencoding; + } + public void setContentencoding(String contentencoding) { + this.contentencoding = contentencoding; + } + public int getConnecttimeout() { + return connecttimeout; + } + public void setConnecttimeout(int connecttimeout) { + this.connecttimeout = connecttimeout; + } + public String getTime() { + return time; + } + public void setTime(String time) { + this.time = time; + } + public String getOperationer() { + return operationer; + } + public void setOperationer(String operationer) { + this.operationer = operationer; + } + + +} diff --git a/src/main/java/luckyweb/seagull/spring/entity/ProjectTemplateParams.java b/src/main/java/luckyweb/seagull/spring/entity/ProjectTemplateParams.java index 4522e71..d5875e6 100644 --- a/src/main/java/luckyweb/seagull/spring/entity/ProjectTemplateParams.java +++ b/src/main/java/luckyweb/seagull/spring/entity/ProjectTemplateParams.java @@ -1,41 +1,41 @@ -package luckyweb.seagull.spring.entity; - -import javax.persistence.Entity; - -@Entity(name="projectTemplateParams") -public class ProjectTemplateParams implements java.io.Serializable{ - /** - * - */ - private static final long serialVersionUID = 1L; - private int id; - private int templateid; - private String paramname; - private String param; - public int getId() { - return id; - } - public void setId(int id) { - this.id = id; - } - public int getTemplateid() { - return templateid; - } - public void setTemplateid(int templateid) { - this.templateid = templateid; - } - public String getParamname() { - return paramname; - } - public void setParamname(String paramname) { - this.paramname = paramname; - } - public String getParam() { - return param; - } - public void setParam(String param) { - this.param = param; - } - - -} +package luckyweb.seagull.spring.entity; + +import javax.persistence.Entity; + +@Entity(name="projectTemplateParams") +public class ProjectTemplateParams implements java.io.Serializable{ + /** + * + */ + private static final long serialVersionUID = 1L; + private int id; + private int templateid; + private String paramname; + private String param; + public int getId() { + return id; + } + public void setId(int id) { + this.id = id; + } + public int getTemplateid() { + return templateid; + } + public void setTemplateid(int templateid) { + this.templateid = templateid; + } + public String getParamname() { + return paramname; + } + public void setParamname(String paramname) { + this.paramname = paramname; + } + public String getParam() { + return param; + } + public void setParam(String param) { + this.param = param; + } + + +} diff --git a/src/main/java/luckyweb/seagull/spring/entity/ProjectVersion.java b/src/main/java/luckyweb/seagull/spring/entity/ProjectVersion.java index 87e7b71..75060ff 100644 --- a/src/main/java/luckyweb/seagull/spring/entity/ProjectVersion.java +++ b/src/main/java/luckyweb/seagull/spring/entity/ProjectVersion.java @@ -1,368 +1,368 @@ -package luckyweb.seagull.spring.entity; - -import javax.persistence.Entity; - -@Entity(name="projectVersion") -public class ProjectVersion implements java.io.Serializable{ - /** - * - */ - private static final long serialVersionUID = 1L; - private int versionid; - private String versionnumber; - private String plan_launchdate; - private String actually_launchdate; - private String startactually_launchdate; - private String endactually_launchdate; - private String plan_devstart; - private String plan_devend; - private String actually_devstart; - private String actually_devend; - private String plan_teststart; - private String plan_testend; - private String actually_teststart; - private String actually_testend; - private int plan_demand; - private int actually_demand; - private int codestandard_zd; - private int codestandard_yz; - private int codestandard_zy; - private double codeline; - private int testcasenum; - private int changetestingreturn; - private String dev_member; - private String test_member; - private String human_cost; - private String human_costdev; - private String human_costtest; - private String per_dev; - private String per_test; - private String code_DI; - private String qualityreview; - private String imprint; - private String remark; - private int projectid; - private String devtime_deviation; - private String devdelay_days; - private String testtime_deviation; - private String testdelay_days; - private String protime_deviation; - private String prodelay_days; - private int bug_zm; - private int bug_yz; - private int bug_yb; - private int bug_ts; - private int versiontype; - private double perdemand; - private String zt_versionlink; - private SectorProjects sectorProjects; - - public String getZt_versionlink() { - return zt_versionlink; - } - - public void setZt_versionlink(String zt_versionlink) { - this.zt_versionlink = zt_versionlink; - } - - public double getPerdemand() { - return perdemand; - } - - public void setPerdemand(double perdemand) { - this.perdemand = perdemand; - } - public int getVersiontype() { - return versiontype; - } - public void setVersiontype(int versiontype) { - this.versiontype = versiontype; - } - - public int getBug_zm() { - return bug_zm; - } - public void setBug_zm(int bug_zm) { - this.bug_zm = bug_zm; - } - public int getBug_yz() { - return bug_yz; - } - public void setBug_yz(int bug_yz) { - this.bug_yz = bug_yz; - } - public int getBug_yb() { - return bug_yb; - } - public void setBug_yb(int bug_yb) { - this.bug_yb = bug_yb; - } - public int getBug_ts() { - return bug_ts; - } - public void setBug_ts(int bug_ts) { - this.bug_ts = bug_ts; - } - - public String getStartactually_launchdate() { - return startactually_launchdate; - } - public void setStartactually_launchdate(String startactually_launchdate) { - this.startactually_launchdate = startactually_launchdate; - } - public String getEndactually_launchdate() { - return endactually_launchdate; - } - public void setEndactually_launchdate(String endactually_launchdate) { - this.endactually_launchdate = endactually_launchdate; - } - - public String getProtime_deviation() { - return protime_deviation; - } - public void setProtime_deviation(String protime_deviation) { - this.protime_deviation = protime_deviation; - } - public String getProdelay_days() { - return prodelay_days; - } - public void setProdelay_days(String prodelay_days) { - this.prodelay_days = prodelay_days; - } - - public String getDevtime_deviation() { - return devtime_deviation; - } - public void setDevtime_deviation(String devtime_deviation) { - this.devtime_deviation = devtime_deviation; - } - public String getDevdelay_days() { - return devdelay_days; - } - public void setDevdelay_days(String devdelay_days) { - this.devdelay_days = devdelay_days; - } - public String getTesttime_deviation() { - return testtime_deviation; - } - public void setTesttime_deviation(String testtime_deviation) { - this.testtime_deviation = testtime_deviation; - } - public String getTestdelay_days() { - return testdelay_days; - } - public void setTestdelay_days(String testdelay_days) { - this.testdelay_days = testdelay_days; - } - - public int getVersionid() { - return versionid; - } - public void setVersionid(int versionid) { - this.versionid = versionid; - } - public String getVersionnumber() { - return versionnumber; - } - public void setVersionnumber(String versionnumber) { - this.versionnumber = versionnumber; - } - public String getPlan_launchdate() { - return plan_launchdate; - } - public void setPlan_launchdate(String plan_launchdate) { - this.plan_launchdate = plan_launchdate; - } - public String getActually_launchdate() { - return actually_launchdate; - } - public void setActually_launchdate(String actually_launchdate) { - this.actually_launchdate = actually_launchdate; - } - public String getImprint() { - return imprint; - } - public void setImprint(String imprint) { - this.imprint = imprint; - } - public String getRemark() { - return remark; - } - public void setRemark(String remark) { - this.remark = remark; - } - public int getProjectid() { - return projectid; - } - public void setProjectid(int projectid) { - this.projectid = projectid; - } - public SectorProjects getSectorProjects() { - return sectorProjects; - } - public void setSectorProjects(SectorProjects sectorProjects) { - this.sectorProjects = sectorProjects; - } - public int getPlan_demand() { - return plan_demand; - } - public void setPlan_demand(int plan_demand) { - this.plan_demand = plan_demand; - } - public int getActually_demand() { - return actually_demand; - } - public void setActually_demand(int actually_demand) { - this.actually_demand = actually_demand; - } - - public int getCodestandard_zd() { - return codestandard_zd; - } - - public void setCodestandard_zd(int codestandard_zd) { - this.codestandard_zd = codestandard_zd; - } - - public int getCodestandard_yz() { - return codestandard_yz; - } - - public void setCodestandard_yz(int codestandard_yz) { - this.codestandard_yz = codestandard_yz; - } - - public int getCodestandard_zy() { - return codestandard_zy; - } - - public void setCodestandard_zy(int codestandard_zy) { - this.codestandard_zy = codestandard_zy; - } - - public double getCodeline() { - return codeline; - } - public void setCodeline(double codeline) { - this.codeline = codeline; - } - public int getTestcasenum() { - return testcasenum; - } - public void setTestcasenum(int testcasenum) { - this.testcasenum = testcasenum; - } - public int getChangetestingreturn() { - return changetestingreturn; - } - public void setChangetestingreturn(int changetestingreturn) { - this.changetestingreturn = changetestingreturn; - } - public String getDev_member() { - return dev_member; - } - public void setDev_member(String dev_member) { - this.dev_member = dev_member; - } - public String getTest_member() { - return test_member; - } - public void setTest_member(String test_member) { - this.test_member = test_member; - } - public String getHuman_cost() { - return human_cost; - } - public void setHuman_cost(String human_cost) { - this.human_cost = human_cost; - } - public String getPer_dev() { - return per_dev; - } - public void setPer_dev(String per_dev) { - this.per_dev = per_dev; - } - public String getPer_test() { - return per_test; - } - public void setPer_test(String per_test) { - this.per_test = per_test; - } - public String getCode_DI() { - return code_DI; - } - public void setCode_DI(String code_DI) { - this.code_DI = code_DI; - } - public String getQualityreview() { - return qualityreview; - } - public void setQualityreview(String qualityreview) { - this.qualityreview = qualityreview; - } - public String getPlan_devstart() { - return plan_devstart; - } - public void setPlan_devstart(String plan_devstart) { - this.plan_devstart = plan_devstart; - } - public String getPlan_devend() { - return plan_devend; - } - public void setPlan_devend(String plan_devend) { - this.plan_devend = plan_devend; - } - public String getActually_devstart() { - return actually_devstart; - } - public void setActually_devstart(String actually_devstart) { - this.actually_devstart = actually_devstart; - } - public String getActually_devend() { - return actually_devend; - } - public void setActually_devend(String actually_devend) { - this.actually_devend = actually_devend; - } - public String getPlan_teststart() { - return plan_teststart; - } - public void setPlan_teststart(String plan_teststart) { - this.plan_teststart = plan_teststart; - } - public String getPlan_testend() { - return plan_testend; - } - public void setPlan_testend(String plan_testend) { - this.plan_testend = plan_testend; - } - public String getActually_teststart() { - return actually_teststart; - } - public void setActually_teststart(String actually_teststart) { - this.actually_teststart = actually_teststart; - } - public String getActually_testend() { - return actually_testend; - } - public void setActually_testend(String actually_testend) { - this.actually_testend = actually_testend; - } - - public String getHuman_costdev() { - return human_costdev; - } - - public void setHuman_costdev(String human_costdev) { - this.human_costdev = human_costdev; - } - - public String getHuman_costtest() { - return human_costtest; - } - - public void setHuman_costtest(String human_costtest) { - this.human_costtest = human_costtest; - } - -} +package luckyweb.seagull.spring.entity; + +import javax.persistence.Entity; + +@Entity(name="projectVersion") +public class ProjectVersion implements java.io.Serializable{ + /** + * + */ + private static final long serialVersionUID = 1L; + private int versionid; + private String versionnumber; + private String plan_launchdate; + private String actually_launchdate; + private String startactually_launchdate; + private String endactually_launchdate; + private String plan_devstart; + private String plan_devend; + private String actually_devstart; + private String actually_devend; + private String plan_teststart; + private String plan_testend; + private String actually_teststart; + private String actually_testend; + private int plan_demand; + private int actually_demand; + private int codestandard_zd; + private int codestandard_yz; + private int codestandard_zy; + private double codeline; + private int testcasenum; + private int changetestingreturn; + private String dev_member; + private String test_member; + private String human_cost; + private String human_costdev; + private String human_costtest; + private String per_dev; + private String per_test; + private String code_DI; + private String qualityreview; + private String imprint; + private String remark; + private int projectid; + private String devtime_deviation; + private String devdelay_days; + private String testtime_deviation; + private String testdelay_days; + private String protime_deviation; + private String prodelay_days; + private int bug_zm; + private int bug_yz; + private int bug_yb; + private int bug_ts; + private int versiontype; + private double perdemand; + private String zt_versionlink; + private SectorProjects sectorProjects; + + public String getZt_versionlink() { + return zt_versionlink; + } + + public void setZt_versionlink(String zt_versionlink) { + this.zt_versionlink = zt_versionlink; + } + + public double getPerdemand() { + return perdemand; + } + + public void setPerdemand(double perdemand) { + this.perdemand = perdemand; + } + public int getVersiontype() { + return versiontype; + } + public void setVersiontype(int versiontype) { + this.versiontype = versiontype; + } + + public int getBug_zm() { + return bug_zm; + } + public void setBug_zm(int bug_zm) { + this.bug_zm = bug_zm; + } + public int getBug_yz() { + return bug_yz; + } + public void setBug_yz(int bug_yz) { + this.bug_yz = bug_yz; + } + public int getBug_yb() { + return bug_yb; + } + public void setBug_yb(int bug_yb) { + this.bug_yb = bug_yb; + } + public int getBug_ts() { + return bug_ts; + } + public void setBug_ts(int bug_ts) { + this.bug_ts = bug_ts; + } + + public String getStartactually_launchdate() { + return startactually_launchdate; + } + public void setStartactually_launchdate(String startactually_launchdate) { + this.startactually_launchdate = startactually_launchdate; + } + public String getEndactually_launchdate() { + return endactually_launchdate; + } + public void setEndactually_launchdate(String endactually_launchdate) { + this.endactually_launchdate = endactually_launchdate; + } + + public String getProtime_deviation() { + return protime_deviation; + } + public void setProtime_deviation(String protime_deviation) { + this.protime_deviation = protime_deviation; + } + public String getProdelay_days() { + return prodelay_days; + } + public void setProdelay_days(String prodelay_days) { + this.prodelay_days = prodelay_days; + } + + public String getDevtime_deviation() { + return devtime_deviation; + } + public void setDevtime_deviation(String devtime_deviation) { + this.devtime_deviation = devtime_deviation; + } + public String getDevdelay_days() { + return devdelay_days; + } + public void setDevdelay_days(String devdelay_days) { + this.devdelay_days = devdelay_days; + } + public String getTesttime_deviation() { + return testtime_deviation; + } + public void setTesttime_deviation(String testtime_deviation) { + this.testtime_deviation = testtime_deviation; + } + public String getTestdelay_days() { + return testdelay_days; + } + public void setTestdelay_days(String testdelay_days) { + this.testdelay_days = testdelay_days; + } + + public int getVersionid() { + return versionid; + } + public void setVersionid(int versionid) { + this.versionid = versionid; + } + public String getVersionnumber() { + return versionnumber; + } + public void setVersionnumber(String versionnumber) { + this.versionnumber = versionnumber; + } + public String getPlan_launchdate() { + return plan_launchdate; + } + public void setPlan_launchdate(String plan_launchdate) { + this.plan_launchdate = plan_launchdate; + } + public String getActually_launchdate() { + return actually_launchdate; + } + public void setActually_launchdate(String actually_launchdate) { + this.actually_launchdate = actually_launchdate; + } + public String getImprint() { + return imprint; + } + public void setImprint(String imprint) { + this.imprint = imprint; + } + public String getRemark() { + return remark; + } + public void setRemark(String remark) { + this.remark = remark; + } + public int getProjectid() { + return projectid; + } + public void setProjectid(int projectid) { + this.projectid = projectid; + } + public SectorProjects getSectorProjects() { + return sectorProjects; + } + public void setSectorProjects(SectorProjects sectorProjects) { + this.sectorProjects = sectorProjects; + } + public int getPlan_demand() { + return plan_demand; + } + public void setPlan_demand(int plan_demand) { + this.plan_demand = plan_demand; + } + public int getActually_demand() { + return actually_demand; + } + public void setActually_demand(int actually_demand) { + this.actually_demand = actually_demand; + } + + public int getCodestandard_zd() { + return codestandard_zd; + } + + public void setCodestandard_zd(int codestandard_zd) { + this.codestandard_zd = codestandard_zd; + } + + public int getCodestandard_yz() { + return codestandard_yz; + } + + public void setCodestandard_yz(int codestandard_yz) { + this.codestandard_yz = codestandard_yz; + } + + public int getCodestandard_zy() { + return codestandard_zy; + } + + public void setCodestandard_zy(int codestandard_zy) { + this.codestandard_zy = codestandard_zy; + } + + public double getCodeline() { + return codeline; + } + public void setCodeline(double codeline) { + this.codeline = codeline; + } + public int getTestcasenum() { + return testcasenum; + } + public void setTestcasenum(int testcasenum) { + this.testcasenum = testcasenum; + } + public int getChangetestingreturn() { + return changetestingreturn; + } + public void setChangetestingreturn(int changetestingreturn) { + this.changetestingreturn = changetestingreturn; + } + public String getDev_member() { + return dev_member; + } + public void setDev_member(String dev_member) { + this.dev_member = dev_member; + } + public String getTest_member() { + return test_member; + } + public void setTest_member(String test_member) { + this.test_member = test_member; + } + public String getHuman_cost() { + return human_cost; + } + public void setHuman_cost(String human_cost) { + this.human_cost = human_cost; + } + public String getPer_dev() { + return per_dev; + } + public void setPer_dev(String per_dev) { + this.per_dev = per_dev; + } + public String getPer_test() { + return per_test; + } + public void setPer_test(String per_test) { + this.per_test = per_test; + } + public String getCode_DI() { + return code_DI; + } + public void setCode_DI(String code_DI) { + this.code_DI = code_DI; + } + public String getQualityreview() { + return qualityreview; + } + public void setQualityreview(String qualityreview) { + this.qualityreview = qualityreview; + } + public String getPlan_devstart() { + return plan_devstart; + } + public void setPlan_devstart(String plan_devstart) { + this.plan_devstart = plan_devstart; + } + public String getPlan_devend() { + return plan_devend; + } + public void setPlan_devend(String plan_devend) { + this.plan_devend = plan_devend; + } + public String getActually_devstart() { + return actually_devstart; + } + public void setActually_devstart(String actually_devstart) { + this.actually_devstart = actually_devstart; + } + public String getActually_devend() { + return actually_devend; + } + public void setActually_devend(String actually_devend) { + this.actually_devend = actually_devend; + } + public String getPlan_teststart() { + return plan_teststart; + } + public void setPlan_teststart(String plan_teststart) { + this.plan_teststart = plan_teststart; + } + public String getPlan_testend() { + return plan_testend; + } + public void setPlan_testend(String plan_testend) { + this.plan_testend = plan_testend; + } + public String getActually_teststart() { + return actually_teststart; + } + public void setActually_teststart(String actually_teststart) { + this.actually_teststart = actually_teststart; + } + public String getActually_testend() { + return actually_testend; + } + public void setActually_testend(String actually_testend) { + this.actually_testend = actually_testend; + } + + public String getHuman_costdev() { + return human_costdev; + } + + public void setHuman_costdev(String human_costdev) { + this.human_costdev = human_costdev; + } + + public String getHuman_costtest() { + return human_costtest; + } + + public void setHuman_costtest(String human_costtest) { + this.human_costtest = human_costtest; + } + +} diff --git a/src/main/java/luckyweb/seagull/spring/entity/Review.java b/src/main/java/luckyweb/seagull/spring/entity/Review.java index 9df8c17..681137c 100644 --- a/src/main/java/luckyweb/seagull/spring/entity/Review.java +++ b/src/main/java/luckyweb/seagull/spring/entity/Review.java @@ -1,118 +1,118 @@ -package luckyweb.seagull.spring.entity; - -import javax.persistence.Entity; - -@Entity(name="review") -public class Review implements java.io.Serializable{ - /** - * - */ - private static final long serialVersionUID = 1L; - private int id; - private int projectid; - private String version; - private String review_type; - private String review_date; - private int bug_num; - private int repair_num; - private String confirm_date; - private String review_object; - private String review_result; - private SectorProjects sectorProjects; - private String result_Confirmor; - private String remark; - private String review_startdate; - private String review_enddate; - - public String getReview_startdate() { - return review_startdate; - } - public void setReview_startdate(String review_startdate) { - this.review_startdate = review_startdate; - } - public String getReview_enddate() { - return review_enddate; - } - public void setReview_enddate(String review_enddate) { - this.review_enddate = review_enddate; - } - public int getId() { - return id; - } - public void setId(int id) { - this.id = id; - } - public int getProjectid() { - return projectid; - } - public void setProjectid(int projectid) { - this.projectid = projectid; - } - public String getVersion() { - return version; - } - public void setVersion(String version) { - this.version = version; - } - public String getReview_type() { - return review_type; - } - public void setReview_type(String review_type) { - this.review_type = review_type; - } - public String getReview_date() { - return review_date; - } - public void setReview_date(String review_date) { - this.review_date = review_date; - } - public int getBug_num() { - return bug_num; - } - public void setBug_num(int bug_num) { - this.bug_num = bug_num; - } - public int getRepair_num() { - return repair_num; - } - public void setRepair_num(int repair_num) { - this.repair_num = repair_num; - } - public String getConfirm_date() { - return confirm_date; - } - public void setConfirm_date(String confirm_date) { - this.confirm_date = confirm_date; - } - public String getReview_object() { - return review_object; - } - public void setReview_object(String review_object) { - this.review_object = review_object; - } - public String getReview_result() { - return review_result; - } - public void setReview_result(String review_result) { - this.review_result = review_result; - } - public SectorProjects getSectorProjects() { - return sectorProjects; - } - public void setSectorProjects(SectorProjects sectorProjects) { - this.sectorProjects = sectorProjects; - } - public String getResult_Confirmor() { - return result_Confirmor; - } - public void setResult_Confirmor(String result_Confirmor) { - this.result_Confirmor = result_Confirmor; - } - public String getRemark() { - return remark; - } - public void setRemark(String remark) { - this.remark = remark; - } - -} +package luckyweb.seagull.spring.entity; + +import javax.persistence.Entity; + +@Entity(name="review") +public class Review implements java.io.Serializable{ + /** + * + */ + private static final long serialVersionUID = 1L; + private int id; + private int projectid; + private String version; + private String review_type; + private String review_date; + private int bug_num; + private int repair_num; + private String confirm_date; + private String review_object; + private String review_result; + private SectorProjects sectorProjects; + private String result_Confirmor; + private String remark; + private String review_startdate; + private String review_enddate; + + public String getReview_startdate() { + return review_startdate; + } + public void setReview_startdate(String review_startdate) { + this.review_startdate = review_startdate; + } + public String getReview_enddate() { + return review_enddate; + } + public void setReview_enddate(String review_enddate) { + this.review_enddate = review_enddate; + } + public int getId() { + return id; + } + public void setId(int id) { + this.id = id; + } + public int getProjectid() { + return projectid; + } + public void setProjectid(int projectid) { + this.projectid = projectid; + } + public String getVersion() { + return version; + } + public void setVersion(String version) { + this.version = version; + } + public String getReview_type() { + return review_type; + } + public void setReview_type(String review_type) { + this.review_type = review_type; + } + public String getReview_date() { + return review_date; + } + public void setReview_date(String review_date) { + this.review_date = review_date; + } + public int getBug_num() { + return bug_num; + } + public void setBug_num(int bug_num) { + this.bug_num = bug_num; + } + public int getRepair_num() { + return repair_num; + } + public void setRepair_num(int repair_num) { + this.repair_num = repair_num; + } + public String getConfirm_date() { + return confirm_date; + } + public void setConfirm_date(String confirm_date) { + this.confirm_date = confirm_date; + } + public String getReview_object() { + return review_object; + } + public void setReview_object(String review_object) { + this.review_object = review_object; + } + public String getReview_result() { + return review_result; + } + public void setReview_result(String review_result) { + this.review_result = review_result; + } + public SectorProjects getSectorProjects() { + return sectorProjects; + } + public void setSectorProjects(SectorProjects sectorProjects) { + this.sectorProjects = sectorProjects; + } + public String getResult_Confirmor() { + return result_Confirmor; + } + public void setResult_Confirmor(String result_Confirmor) { + this.result_Confirmor = result_Confirmor; + } + public String getRemark() { + return remark; + } + public void setRemark(String remark) { + this.remark = remark; + } + +} diff --git a/src/main/java/luckyweb/seagull/spring/entity/ReviewInfo.java b/src/main/java/luckyweb/seagull/spring/entity/ReviewInfo.java index 6a59501..29a94ae 100644 --- a/src/main/java/luckyweb/seagull/spring/entity/ReviewInfo.java +++ b/src/main/java/luckyweb/seagull/spring/entity/ReviewInfo.java @@ -1,127 +1,127 @@ -package luckyweb.seagull.spring.entity; - -import javax.persistence.Entity; - -@Entity(name="reviewInfo") -public class ReviewInfo implements java.io.Serializable{ - /** - * - */ - private static final long serialVersionUID = 1L; - private int id; - private int review_id; - private String bug_description; - private String status; - private String duty_officer; - private String confirm_date; - private int projectid; - private String version; - private String review_type; - private String review_date; - private String review_object; - private String review_result; - private String remark; - private String corrective; - private String result_Confirmor; - private String projectname; - - - public String getProjectname() { - return projectname; - } - public void setProjectname(String projectname) { - this.projectname = projectname; - } - public String getResult_Confirmor() { - return result_Confirmor; - } - public void setResult_Confirmor(String result_Confirmor) { - this.result_Confirmor = result_Confirmor; - } - public String getReview_result() { - return review_result; - } - public void setReview_result(String review_result) { - this.review_result = review_result; - } - public String getCorrective() { - return corrective; - } - public void setCorrective(String corrective) { - this.corrective = corrective; - } - public String getRemark() { - return remark; - } - public void setRemark(String remark) { - this.remark = remark; - } - public String getReview_object() { - return review_object; - } - public void setReview_object(String review_object) { - this.review_object = review_object; - } - public int getProjectid() { - return projectid; - } - public void setProjectid(int projectid) { - this.projectid = projectid; - } - public String getVersion() { - return version; - } - public void setVersion(String version) { - this.version = version; - } - public String getReview_type() { - return review_type; - } - public void setReview_type(String review_type) { - this.review_type = review_type; - } - public String getReview_date() { - return review_date; - } - public void setReview_date(String review_date) { - this.review_date = review_date; - } - public int getId() { - return id; - } - public void setId(int id) { - this.id = id; - } - public int getReview_id() { - return review_id; - } - public void setReview_id(int review_id) { - this.review_id = review_id; - } - public String getBug_description() { - return bug_description; - } - public void setBug_description(String bug_description) { - this.bug_description = bug_description; - } - public String getStatus() { - return status; - } - public void setStatus(String status) { - this.status = status; - } - public String getDuty_officer() { - return duty_officer; - } - public void setDuty_officer(String duty_officer) { - this.duty_officer = duty_officer; - } - public String getConfirm_date() { - return confirm_date; - } - public void setConfirm_date(String confirm_date) { - this.confirm_date = confirm_date; - } - - -} +package luckyweb.seagull.spring.entity; + +import javax.persistence.Entity; + +@Entity(name="reviewInfo") +public class ReviewInfo implements java.io.Serializable{ + /** + * + */ + private static final long serialVersionUID = 1L; + private int id; + private int review_id; + private String bug_description; + private String status; + private String duty_officer; + private String confirm_date; + private int projectid; + private String version; + private String review_type; + private String review_date; + private String review_object; + private String review_result; + private String remark; + private String corrective; + private String result_Confirmor; + private String projectname; + + + public String getProjectname() { + return projectname; + } + public void setProjectname(String projectname) { + this.projectname = projectname; + } + public String getResult_Confirmor() { + return result_Confirmor; + } + public void setResult_Confirmor(String result_Confirmor) { + this.result_Confirmor = result_Confirmor; + } + public String getReview_result() { + return review_result; + } + public void setReview_result(String review_result) { + this.review_result = review_result; + } + public String getCorrective() { + return corrective; + } + public void setCorrective(String corrective) { + this.corrective = corrective; + } + public String getRemark() { + return remark; + } + public void setRemark(String remark) { + this.remark = remark; + } + public String getReview_object() { + return review_object; + } + public void setReview_object(String review_object) { + this.review_object = review_object; + } + public int getProjectid() { + return projectid; + } + public void setProjectid(int projectid) { + this.projectid = projectid; + } + public String getVersion() { + return version; + } + public void setVersion(String version) { + this.version = version; + } + public String getReview_type() { + return review_type; + } + public void setReview_type(String review_type) { + this.review_type = review_type; + } + public String getReview_date() { + return review_date; + } + public void setReview_date(String review_date) { + this.review_date = review_date; + } + public int getId() { + return id; + } + public void setId(int id) { + this.id = id; + } + public int getReview_id() { + return review_id; + } + public void setReview_id(int review_id) { + this.review_id = review_id; + } + public String getBug_description() { + return bug_description; + } + public void setBug_description(String bug_description) { + this.bug_description = bug_description; + } + public String getStatus() { + return status; + } + public void setStatus(String status) { + this.status = status; + } + public String getDuty_officer() { + return duty_officer; + } + public void setDuty_officer(String duty_officer) { + this.duty_officer = duty_officer; + } + public String getConfirm_date() { + return confirm_date; + } + public void setConfirm_date(String confirm_date) { + this.confirm_date = confirm_date; + } + + +} diff --git a/src/main/java/luckyweb/seagull/spring/entity/SecondarySector.java b/src/main/java/luckyweb/seagull/spring/entity/SecondarySector.java index 313c310..a8763be 100644 --- a/src/main/java/luckyweb/seagull/spring/entity/SecondarySector.java +++ b/src/main/java/luckyweb/seagull/spring/entity/SecondarySector.java @@ -1,35 +1,35 @@ -package luckyweb.seagull.spring.entity; - -import javax.persistence.Entity; -import javax.persistence.Table; - -@Entity(name="secondarySector") -public class SecondarySector implements java.io.Serializable{ - /** - * - */ - private static final long serialVersionUID = 1L; - private int sectorid; - private String departmenthead; - private String departmentname; - - public int getSectorid() { - return sectorid; - } - public void setSectorid(int sectorid) { - this.sectorid = sectorid; - } - public String getDepartmenthead() { - return departmenthead; - } - public void setDepartmenthead(String departmenthead) { - this.departmenthead = departmenthead; - } - public String getDepartmentname() { - return departmentname; - } - public void setDepartmentname(String departmentname) { - this.departmentname = departmentname; - } - -} +package luckyweb.seagull.spring.entity; + +import javax.persistence.Entity; +import javax.persistence.Table; + +@Entity(name="secondarySector") +public class SecondarySector implements java.io.Serializable{ + /** + * + */ + private static final long serialVersionUID = 1L; + private int sectorid; + private String departmenthead; + private String departmentname; + + public int getSectorid() { + return sectorid; + } + public void setSectorid(int sectorid) { + this.sectorid = sectorid; + } + public String getDepartmenthead() { + return departmenthead; + } + public void setDepartmenthead(String departmenthead) { + this.departmenthead = departmenthead; + } + public String getDepartmentname() { + return departmentname; + } + public void setDepartmentname(String departmentname) { + this.departmentname = departmentname; + } + +} diff --git a/src/main/java/luckyweb/seagull/spring/entity/SectorProjects.java b/src/main/java/luckyweb/seagull/spring/entity/SectorProjects.java index 09bad27..33739ff 100644 --- a/src/main/java/luckyweb/seagull/spring/entity/SectorProjects.java +++ b/src/main/java/luckyweb/seagull/spring/entity/SectorProjects.java @@ -1,69 +1,69 @@ -package luckyweb.seagull.spring.entity; - -import javax.persistence.Entity; - -@Entity(name="sectorProjects") -public class SectorProjects implements java.io.Serializable{ - /** - * - */ - private static final long serialVersionUID = 1L; - private int projectid; - private String projectname; - private String projectmanager; - private int sectorid; - private int projecttype; - private String projectsign; - private String departmenthead; - private String departmentname; - - public String getDepartmenthead() { - return departmenthead; - } - public void setDepartmenthead(String departmenthead) { - this.departmenthead = departmenthead; - } - public String getDepartmentname() { - return departmentname; - } - public void setDepartmentname(String departmentname) { - this.departmentname = departmentname; - } - public String getProjectsign() { - return projectsign; - } - public void setProjectsign(String projectsign) { - this.projectsign = projectsign; - } - public int getProjecttype() { - return projecttype; - } - public void setProjecttype(int projecttype) { - this.projecttype = projecttype; - } - public int getProjectid() { - return projectid; - } - public void setProjectid(int projectid) { - this.projectid = projectid; - } - public String getProjectname() { - return projectname; - } - public void setProjectname(String projectname) { - this.projectname = projectname; - } - public String getProjectmanager() { - return projectmanager; - } - public void setProjectmanager(String projectmanager) { - this.projectmanager = projectmanager; - } - public int getSectorid() { - return sectorid; - } - public void setSectorid(int sectorid) { - this.sectorid = sectorid; - } - -} +package luckyweb.seagull.spring.entity; + +import javax.persistence.Entity; + +@Entity(name="sectorProjects") +public class SectorProjects implements java.io.Serializable{ + /** + * + */ + private static final long serialVersionUID = 1L; + private int projectid; + private String projectname; + private String projectmanager; + private int sectorid; + private int projecttype; + private String projectsign; + private String departmenthead; + private String departmentname; + + public String getDepartmenthead() { + return departmenthead; + } + public void setDepartmenthead(String departmenthead) { + this.departmenthead = departmenthead; + } + public String getDepartmentname() { + return departmentname; + } + public void setDepartmentname(String departmentname) { + this.departmentname = departmentname; + } + public String getProjectsign() { + return projectsign; + } + public void setProjectsign(String projectsign) { + this.projectsign = projectsign; + } + public int getProjecttype() { + return projecttype; + } + public void setProjecttype(int projecttype) { + this.projecttype = projecttype; + } + public int getProjectid() { + return projectid; + } + public void setProjectid(int projectid) { + this.projectid = projectid; + } + public String getProjectname() { + return projectname; + } + public void setProjectname(String projectname) { + this.projectname = projectname; + } + public String getProjectmanager() { + return projectmanager; + } + public void setProjectmanager(String projectmanager) { + this.projectmanager = projectmanager; + } + public int getSectorid() { + return sectorid; + } + public void setSectorid(int sectorid) { + this.sectorid = sectorid; + } + +} diff --git a/src/main/java/luckyweb/seagull/spring/entity/TempCasestepDebug.java b/src/main/java/luckyweb/seagull/spring/entity/TempCasestepDebug.java index 4c5b216..822532a 100644 --- a/src/main/java/luckyweb/seagull/spring/entity/TempCasestepDebug.java +++ b/src/main/java/luckyweb/seagull/spring/entity/TempCasestepDebug.java @@ -1,49 +1,49 @@ -package luckyweb.seagull.spring.entity; - -import javax.persistence.Entity; - -@Entity(name="tempCasestepDebug") -public class TempCasestepDebug implements java.io.Serializable{ - /** - * - */ - private static final long serialVersionUID = 1L; - private int id; - private String sign; - private String executor; - private String loglevel; - private String detail; - - public String getLoglevel() { - return loglevel; - } - public void setLoglevel(String loglevel) { - this.loglevel = loglevel; - } - public int getId() { - return id; - } - public void setId(int id) { - this.id = id; - } - public String getSign() { - return sign; - } - public void setSign(String sign) { - this.sign = sign; - } - public String getExecutor() { - return executor; - } - public void setExecutor(String executor) { - this.executor = executor; - } - public String getDetail() { - return detail; - } - public void setDetail(String detail) { - this.detail = detail; - } - - -} +package luckyweb.seagull.spring.entity; + +import javax.persistence.Entity; + +@Entity(name="tempCasestepDebug") +public class TempCasestepDebug implements java.io.Serializable{ + /** + * + */ + private static final long serialVersionUID = 1L; + private int id; + private String sign; + private String executor; + private String loglevel; + private String detail; + + public String getLoglevel() { + return loglevel; + } + public void setLoglevel(String loglevel) { + this.loglevel = loglevel; + } + public int getId() { + return id; + } + public void setId(int id) { + this.id = id; + } + public String getSign() { + return sign; + } + public void setSign(String sign) { + this.sign = sign; + } + public String getExecutor() { + return executor; + } + public void setExecutor(String executor) { + this.executor = executor; + } + public String getDetail() { + return detail; + } + public void setDetail(String detail) { + this.detail = detail; + } + + +} diff --git a/src/main/java/luckyweb/seagull/spring/entity/TestCasedetail.java b/src/main/java/luckyweb/seagull/spring/entity/TestCasedetail.java index d2c7299..a25b572 100644 --- a/src/main/java/luckyweb/seagull/spring/entity/TestCasedetail.java +++ b/src/main/java/luckyweb/seagull/spring/entity/TestCasedetail.java @@ -1,160 +1,160 @@ -package luckyweb.seagull.spring.entity; - -// default package -// Generated 2015-4-21 15:55:06 by Hibernate Tools 3.2.2.GA - -import java.sql.Timestamp; - -import javax.persistence.Entity; - -/** - * TestCasedetail generated by hbm2java - */ -@Entity(name="testCasedetail") -public class TestCasedetail implements java.io.Serializable { - - /** - * - */ - private static final long serialVersionUID = 1L; - private int id; - private TestTaskexcute testTaskexcute=new TestTaskexcute(); - private String caseno; - private String caseversion; - private Timestamp casetime; - private String casename; - private String casestatus; - private String casestatus_str; - private String projName; - - private String startDate; - private String endDate; - private String beforeDate; - - - public String getEndDate() { - return endDate; - } - - public void setEndDate(String endDate) { - this.endDate = endDate; - } - - public String getBeforeDate() { - return beforeDate; - } - - public void setBeforeDate(String beforeDate) { - this.beforeDate = beforeDate; - } - - public String getStartDate() { - return startDate; - } - - public String getProjName() { - return projName; - } - - public void setProjName(String projName) { - this.projName = projName; - } - - public void setStartDate(String startDate) { - this.startDate = startDate; - } - - public String getCasestatus_str() { - return casestatus_str; - } - - public void setCasestatus_str(String casestatus_str) { - this.casestatus_str = casestatus_str; - } - - private int taskId; - - - public int getTaskId() { - return taskId; - } - - public void setTaskId(int taskId) { - this.taskId = taskId; - } - - public TestCasedetail() { - } - - public TestCasedetail(int id, TestTaskexcute testTaskexcute, - String caseno, String caseversion, - Timestamp casetime, String casename, String casestatus) { - this.id = id; - this.testTaskexcute = testTaskexcute; - this.caseno = caseno; - this.caseversion = caseversion; - this.casetime = casetime; - this.casename = casename; - this.casestatus = casestatus; - } - - public int getId() { - return this.id; - } - - public void setId(int id) { - this.id = id; - } - - public TestTaskexcute getTestTaskexcute() { - return this.testTaskexcute; - } - - public void setTestTaskexcute(TestTaskexcute testTaskexcute) { - this.testTaskexcute = testTaskexcute; - } - - - public String getCaseno() { - return caseno; - } - - public void setCaseno(String caseno) { - this.caseno = caseno; - } - - public String getCaseversion() { - return this.caseversion; - } - - public void setCaseversion(String caseversion) { - this.caseversion = caseversion; - } - - public Timestamp getCasetime() { - return this.casetime; - } - - public void setCasetime(Timestamp casetime) { - this.casetime = casetime; - } - - public String getCasename() { - return this.casename; - } - - public void setCasename(String casename) { - this.casename = casename; - } - - public String getCasestatus() { - return this.casestatus; - } - - public void setCasestatus(String casestatus) { - this.casestatus = casestatus; - } - - - -} +package luckyweb.seagull.spring.entity; + +// default package +// Generated 2015-4-21 15:55:06 by Hibernate Tools 3.2.2.GA + +import java.sql.Timestamp; + +import javax.persistence.Entity; + +/** + * TestCasedetail generated by hbm2java + */ +@Entity(name="testCasedetail") +public class TestCasedetail implements java.io.Serializable { + + /** + * + */ + private static final long serialVersionUID = 1L; + private int id; + private TestTaskexcute testTaskexcute=new TestTaskexcute(); + private String caseno; + private String caseversion; + private Timestamp casetime; + private String casename; + private String casestatus; + private String casestatus_str; + private String projName; + + private String startDate; + private String endDate; + private String beforeDate; + + + public String getEndDate() { + return endDate; + } + + public void setEndDate(String endDate) { + this.endDate = endDate; + } + + public String getBeforeDate() { + return beforeDate; + } + + public void setBeforeDate(String beforeDate) { + this.beforeDate = beforeDate; + } + + public String getStartDate() { + return startDate; + } + + public String getProjName() { + return projName; + } + + public void setProjName(String projName) { + this.projName = projName; + } + + public void setStartDate(String startDate) { + this.startDate = startDate; + } + + public String getCasestatus_str() { + return casestatus_str; + } + + public void setCasestatus_str(String casestatus_str) { + this.casestatus_str = casestatus_str; + } + + private int taskId; + + + public int getTaskId() { + return taskId; + } + + public void setTaskId(int taskId) { + this.taskId = taskId; + } + + public TestCasedetail() { + } + + public TestCasedetail(int id, TestTaskexcute testTaskexcute, + String caseno, String caseversion, + Timestamp casetime, String casename, String casestatus) { + this.id = id; + this.testTaskexcute = testTaskexcute; + this.caseno = caseno; + this.caseversion = caseversion; + this.casetime = casetime; + this.casename = casename; + this.casestatus = casestatus; + } + + public int getId() { + return this.id; + } + + public void setId(int id) { + this.id = id; + } + + public TestTaskexcute getTestTaskexcute() { + return this.testTaskexcute; + } + + public void setTestTaskexcute(TestTaskexcute testTaskexcute) { + this.testTaskexcute = testTaskexcute; + } + + + public String getCaseno() { + return caseno; + } + + public void setCaseno(String caseno) { + this.caseno = caseno; + } + + public String getCaseversion() { + return this.caseversion; + } + + public void setCaseversion(String caseversion) { + this.caseversion = caseversion; + } + + public Timestamp getCasetime() { + return this.casetime; + } + + public void setCasetime(Timestamp casetime) { + this.casetime = casetime; + } + + public String getCasename() { + return this.casename; + } + + public void setCasename(String casename) { + this.casename = casename; + } + + public String getCasestatus() { + return this.casestatus; + } + + public void setCasestatus(String casestatus) { + this.casestatus = casestatus; + } + + + +} diff --git a/src/main/java/luckyweb/seagull/spring/entity/TestClient.java b/src/main/java/luckyweb/seagull/spring/entity/TestClient.java index 2400e5a..65d3337 100644 --- a/src/main/java/luckyweb/seagull/spring/entity/TestClient.java +++ b/src/main/java/luckyweb/seagull/spring/entity/TestClient.java @@ -1,76 +1,76 @@ -package luckyweb.seagull.spring.entity; - -import javax.persistence.Entity; - -@Entity(name="testclient") -public class TestClient implements java.io.Serializable{ - /** - * - */ - private static final long serialVersionUID = 1L; - private int id; - private String clientip; - private String name; - private String projectper; - private String projectpername; - private int status; - private int checkinterval; - private String clientpath; - private String remark; - - public String getClientpath() { - return clientpath; - } - public void setClientpath(String clientpath) { - this.clientpath = clientpath; - } - public String getProjectpername() { - return projectpername; - } - public void setProjectpername(String projectpername) { - this.projectpername = projectpername; - } - public int getCheckinterval() { - return checkinterval; - } - public void setCheckinterval(int checkinterval) { - this.checkinterval = checkinterval; - } - public int getStatus() { - return status; - } - public void setStatus(int status) { - this.status = status; - } - public int getId() { - return id; - } - public void setId(int id) { - this.id = id; - } - public String getClientip() { - return clientip; - } - public void setClientip(String clientip) { - this.clientip = clientip; - } - public String getName() { - return name; - } - public void setName(String name) { - this.name = name; - } - public String getProjectper() { - return projectper; - } - public void setProjectper(String projectper) { - this.projectper = projectper; - } - public String getRemark() { - return remark; - } - public void setRemark(String remark) { - this.remark = remark; - } - -} +package luckyweb.seagull.spring.entity; + +import javax.persistence.Entity; + +@Entity(name="testclient") +public class TestClient implements java.io.Serializable{ + /** + * + */ + private static final long serialVersionUID = 1L; + private int id; + private String clientip; + private String name; + private String projectper; + private String projectpername; + private int status; + private int checkinterval; + private String clientpath; + private String remark; + + public String getClientpath() { + return clientpath; + } + public void setClientpath(String clientpath) { + this.clientpath = clientpath; + } + public String getProjectpername() { + return projectpername; + } + public void setProjectpername(String projectpername) { + this.projectpername = projectpername; + } + public int getCheckinterval() { + return checkinterval; + } + public void setCheckinterval(int checkinterval) { + this.checkinterval = checkinterval; + } + public int getStatus() { + return status; + } + public void setStatus(int status) { + this.status = status; + } + public int getId() { + return id; + } + public void setId(int id) { + this.id = id; + } + public String getClientip() { + return clientip; + } + public void setClientip(String clientip) { + this.clientip = clientip; + } + public String getName() { + return name; + } + public void setName(String name) { + this.name = name; + } + public String getProjectper() { + return projectper; + } + public void setProjectper(String projectper) { + this.projectper = projectper; + } + public String getRemark() { + return remark; + } + public void setRemark(String remark) { + this.remark = remark; + } + +} diff --git a/src/main/java/luckyweb/seagull/spring/entity/TestJobs.java b/src/main/java/luckyweb/seagull/spring/entity/TestJobs.java index 5c7c6fc..0f7f814 100644 --- a/src/main/java/luckyweb/seagull/spring/entity/TestJobs.java +++ b/src/main/java/luckyweb/seagull/spring/entity/TestJobs.java @@ -1,345 +1,345 @@ -package luckyweb.seagull.spring.entity; - -import java.sql.Timestamp; - -import javax.persistence.Entity; -import javax.persistence.Table; - -@Entity -@Table(name = "TestJobs") -public class TestJobs implements java.io.Serializable { - - /** - * - */ - private static final long serialVersionUID = 1L; - private int id; - private String taskName; - private String startDate; - private String startTime; - private String endDate; - private String endTime; - private Timestamp runTime; - private String remark; - - private String planproj; - private String state; - private String state_str; - private int threadCount;// 线程数 - private int time;// 自定义时间 - private String timeType; - - private String isSendMail;// 是否发送邮件 - private String emailer;// 收件人 - private String testlinkname; - - private String isbuilding;// 是否构建 - private String buildname;// 构建在JENKINS中的名称 - - private String isrestart;// 是否重 - private String restartcomm;// 构建在JENKINS中的名称 - private int extype; // 0:接口自动化 1:WebDriver自动化 - private Integer browsertype; // 0:ie 1:火狐 2:谷歌 3:Edge - private Integer timeout; // 任务超时时间 单位:分钟 - private String clientip; // 客户端IP - private String clientpath; // 客户端测试驱动桩路径 - private Integer projecttype; // 项目类型 0testlink 1系统内项目 - private Integer projectid; // 系统内项目ID - private Integer planid; // 系统内项目关联计划ID - private String taskType; - private String startTimestr; - private String endTimestr; - private Timestamp createTime; - private String noEndDate; - - public String getClientpath() { - return clientpath; - } - - public void setClientpath(String clientpath) { - this.clientpath = clientpath; - } - - public Integer getProjecttype() { - return projecttype; - } - - public void setProjecttype(Integer projecttype) { - this.projecttype = projecttype; - } - - public Integer getProjectid() { - return projectid; - } - - public void setProjectid(Integer projectid) { - this.projectid = projectid; - } - - public Integer getPlanid() { - return planid; - } - - public void setPlanid(Integer planid) { - this.planid = planid; - } - - public String getClientip() { - return clientip; - } - - public void setClientip(String clientip) { - this.clientip = clientip; - } - - public Integer getTimeout() { - return timeout; - } - - public void setTimeout(Integer timeout) { - this.timeout = timeout; - } - - public Integer getBrowsertype() { - return browsertype; - } - - public void setBrowsertype(Integer browsertype) { - this.browsertype = browsertype; - } - - public int getExtype() { - return extype; - } - - public void setExtype(int extype) { - this.extype = extype; - } - - public String getIsrestart() { - return isrestart; - } - - public void setIsrestart(String isrestart) { - this.isrestart = isrestart; - } - - public String getRestartcomm() { - return restartcomm; - } - - public void setRestartcomm(String restartcomm) { - this.restartcomm = restartcomm; - } - - public String getIsbuilding() { - return isbuilding; - } - - public void setIsbuilding(String isbuilding) { - this.isbuilding = isbuilding; - } - - public String getBuildname() { - return buildname; - } - - public void setBuildname(String buildname) { - this.buildname = buildname; - } - - public int getThreadCount() { - return threadCount; - } - - public void setThreadCount(int threadCount) { - this.threadCount = threadCount; - } - - public String getTestlinkname() { - return testlinkname; - } - - public void setTestlinkname(String testlinkname) { - this.testlinkname = testlinkname; - } - - public String getIsSendMail() { - return isSendMail; - } - - public void setIsSendMail(String isSendMail) { - this.isSendMail = isSendMail; - } - - public String getEmailer() { - return emailer; - } - - public void setEmailer(String emailer) { - this.emailer = emailer; - } - - public String getTimeType() { - return timeType; - } - - public void setTimeType(String timeType) { - this.timeType = timeType; - } - - public int getTime() { - return time; - } - - public void setTime(int time) { - this.time = time; - } - - public String getState_str() { - return state_str; - } - - public void setState_str(String state_str) { - this.state_str = state_str; - } - - private boolean showRun = true; - - public TestJobs() { - } - - public int getId() { - return id; - } - - public void setId(int id) { - this.id = id; - } - - // @NotEmpty(message="任务名称不能为空") - public String getTaskName() { - return taskName; - } - - public void setTaskName(String taskName) { - this.taskName = taskName; - } - - // @NotEmpty(message="开始日期的时间格式应为:yyyy-MM-dd") - // @DateTimeFormat(pattern="yyyy-MM-dd") - public String getStartDate() { - return startDate; - } - - public void setStartDate(String startDate) { - this.startDate = startDate; - } - - // @NotEmpty(message="开始时间的时间格式应为:HH:mm:ss") - // @DateTimeFormat(pattern="HH:mm:ss") - public String getStartTime() { - return startTime; - } - - public void setStartTime(String startTime) { - this.startTime = startTime; - } - - public String getEndDate() { - return endDate; - } - - public void setEndDate(String endDate) { - this.endDate = endDate; - } - - public String getEndTime() { - return endTime; - } - - public void setEndTime(String endTime) { - this.endTime = endTime; - } - - public Timestamp getRunTime() { - return runTime; - } - - public void setRunTime(Timestamp runTime) { - this.runTime = runTime; - } - - public String getRemark() { - return remark; - } - - public void setRemark(String remark) { - this.remark = remark; - } - - public String getPlanproj() { - return planproj; - } - - public void setPlanproj(String planproj) { - this.planproj = planproj; - } - - public String getState() { - return state; - } - - public void setState(String state) { - this.state = state; - } - - public String getTaskType() { - return taskType; - } - - public void setTaskType(String taskType) { - this.taskType = taskType; - } - - public String getStartTimestr() { - return startTimestr; - } - - public void setStartTimestr(String startTimestr) { - this.startTimestr = startTimestr; - } - - public String getEndTimestr() { - return endTimestr; - } - - public void setEndTimestr(String endTimestr) { - this.endTimestr = endTimestr; - } - - public Timestamp getCreateTime() { - return createTime; - } - - public void setCreateTime(Timestamp createTime) { - this.createTime = createTime; - } - - public String getNoEndDate() { - return noEndDate; - } - - public void setNoEndDate(String noEndDate) { - this.noEndDate = noEndDate; - } - - public boolean isShowRun() { - return showRun; - } - - public void setShowRun(boolean showRun) { - this.showRun = showRun; - } - -} +package luckyweb.seagull.spring.entity; + +import java.sql.Timestamp; + +import javax.persistence.Entity; +import javax.persistence.Table; + +@Entity +@Table(name = "TestJobs") +public class TestJobs implements java.io.Serializable { + + /** + * + */ + private static final long serialVersionUID = 1L; + private int id; + private String taskName; + private String startDate; + private String startTime; + private String endDate; + private String endTime; + private Timestamp runTime; + private String remark; + + private String planproj; + private String state; + private String state_str; + private int threadCount;// 线程数 + private int time;// 自定义时间 + private String timeType; + + private String isSendMail;// 是否发送邮件 + private String emailer;// 收件人 + private String testlinkname; + + private String isbuilding;// 是否构建 + private String buildname;// 构建在JENKINS中的名称 + + private String isrestart;// 是否重 + private String restartcomm;// 构建在JENKINS中的名称 + private int extype; // 0:接口自动化 1:WebDriver自动化 + private Integer browsertype; // 0:ie 1:火狐 2:谷歌 3:Edge + private Integer timeout; // 任务超时时间 单位:分钟 + private String clientip; // 客户端IP + private String clientpath; // 客户端测试驱动桩路径 + private Integer projecttype; // 项目类型 0testlink 1系统内项目 + private Integer projectid; // 系统内项目ID + private Integer planid; // 系统内项目关联计划ID + private String taskType; + private String startTimestr; + private String endTimestr; + private Timestamp createTime; + private String noEndDate; + + public String getClientpath() { + return clientpath; + } + + public void setClientpath(String clientpath) { + this.clientpath = clientpath; + } + + public Integer getProjecttype() { + return projecttype; + } + + public void setProjecttype(Integer projecttype) { + this.projecttype = projecttype; + } + + public Integer getProjectid() { + return projectid; + } + + public void setProjectid(Integer projectid) { + this.projectid = projectid; + } + + public Integer getPlanid() { + return planid; + } + + public void setPlanid(Integer planid) { + this.planid = planid; + } + + public String getClientip() { + return clientip; + } + + public void setClientip(String clientip) { + this.clientip = clientip; + } + + public Integer getTimeout() { + return timeout; + } + + public void setTimeout(Integer timeout) { + this.timeout = timeout; + } + + public Integer getBrowsertype() { + return browsertype; + } + + public void setBrowsertype(Integer browsertype) { + this.browsertype = browsertype; + } + + public int getExtype() { + return extype; + } + + public void setExtype(int extype) { + this.extype = extype; + } + + public String getIsrestart() { + return isrestart; + } + + public void setIsrestart(String isrestart) { + this.isrestart = isrestart; + } + + public String getRestartcomm() { + return restartcomm; + } + + public void setRestartcomm(String restartcomm) { + this.restartcomm = restartcomm; + } + + public String getIsbuilding() { + return isbuilding; + } + + public void setIsbuilding(String isbuilding) { + this.isbuilding = isbuilding; + } + + public String getBuildname() { + return buildname; + } + + public void setBuildname(String buildname) { + this.buildname = buildname; + } + + public int getThreadCount() { + return threadCount; + } + + public void setThreadCount(int threadCount) { + this.threadCount = threadCount; + } + + public String getTestlinkname() { + return testlinkname; + } + + public void setTestlinkname(String testlinkname) { + this.testlinkname = testlinkname; + } + + public String getIsSendMail() { + return isSendMail; + } + + public void setIsSendMail(String isSendMail) { + this.isSendMail = isSendMail; + } + + public String getEmailer() { + return emailer; + } + + public void setEmailer(String emailer) { + this.emailer = emailer; + } + + public String getTimeType() { + return timeType; + } + + public void setTimeType(String timeType) { + this.timeType = timeType; + } + + public int getTime() { + return time; + } + + public void setTime(int time) { + this.time = time; + } + + public String getState_str() { + return state_str; + } + + public void setState_str(String state_str) { + this.state_str = state_str; + } + + private boolean showRun = true; + + public TestJobs() { + } + + public int getId() { + return id; + } + + public void setId(int id) { + this.id = id; + } + + // @NotEmpty(message="任务名称不能为空") + public String getTaskName() { + return taskName; + } + + public void setTaskName(String taskName) { + this.taskName = taskName; + } + + // @NotEmpty(message="开始日期的时间格式应为:yyyy-MM-dd") + // @DateTimeFormat(pattern="yyyy-MM-dd") + public String getStartDate() { + return startDate; + } + + public void setStartDate(String startDate) { + this.startDate = startDate; + } + + // @NotEmpty(message="开始时间的时间格式应为:HH:mm:ss") + // @DateTimeFormat(pattern="HH:mm:ss") + public String getStartTime() { + return startTime; + } + + public void setStartTime(String startTime) { + this.startTime = startTime; + } + + public String getEndDate() { + return endDate; + } + + public void setEndDate(String endDate) { + this.endDate = endDate; + } + + public String getEndTime() { + return endTime; + } + + public void setEndTime(String endTime) { + this.endTime = endTime; + } + + public Timestamp getRunTime() { + return runTime; + } + + public void setRunTime(Timestamp runTime) { + this.runTime = runTime; + } + + public String getRemark() { + return remark; + } + + public void setRemark(String remark) { + this.remark = remark; + } + + public String getPlanproj() { + return planproj; + } + + public void setPlanproj(String planproj) { + this.planproj = planproj; + } + + public String getState() { + return state; + } + + public void setState(String state) { + this.state = state; + } + + public String getTaskType() { + return taskType; + } + + public void setTaskType(String taskType) { + this.taskType = taskType; + } + + public String getStartTimestr() { + return startTimestr; + } + + public void setStartTimestr(String startTimestr) { + this.startTimestr = startTimestr; + } + + public String getEndTimestr() { + return endTimestr; + } + + public void setEndTimestr(String endTimestr) { + this.endTimestr = endTimestr; + } + + public Timestamp getCreateTime() { + return createTime; + } + + public void setCreateTime(Timestamp createTime) { + this.createTime = createTime; + } + + public String getNoEndDate() { + return noEndDate; + } + + public void setNoEndDate(String noEndDate) { + this.noEndDate = noEndDate; + } + + public boolean isShowRun() { + return showRun; + } + + public void setShowRun(boolean showRun) { + this.showRun = showRun; + } + +} diff --git a/src/main/java/luckyweb/seagull/spring/entity/TestLogdetail.java b/src/main/java/luckyweb/seagull/spring/entity/TestLogdetail.java index 08b17f7..55b4be9 100644 --- a/src/main/java/luckyweb/seagull/spring/entity/TestLogdetail.java +++ b/src/main/java/luckyweb/seagull/spring/entity/TestLogdetail.java @@ -1,122 +1,122 @@ -package luckyweb.seagull.spring.entity; - -// default package -// Generated 2015-4-21 15:55:06 by Hibernate Tools 3.2.2.GA - -import java.sql.Timestamp; - -import javax.persistence.Entity; - -/** - * TestLogdetail generated by hbm2java - */ -@Entity(name="testLogdetail") -public class TestLogdetail implements java.io.Serializable { - - /** - * - */ - private static final long serialVersionUID = 1L; - private int logid; - private TestCasedetail testCasedetail=new TestCasedetail(); - private Timestamp logtime; - private String detail; - private String detailShort; - private String step; - private String imgname; - private String logGrade; - private int taskid; - private int caseid; - - public String getImgname() { - return imgname; - } - - public void setImgname(String imgname) { - this.imgname = imgname; - } - - public String getStep() { - return step; - } - - public void setStep(String step) { - this.step = step; - } - - public String getDetailShort() { - return detailShort; - } - - public void setDetailShort(String detailShort) { - this.detailShort = detailShort; - } - - public int getTaskid() { - return taskid; - } - - public void setTaskid(int taskid) { - this.taskid = taskid; - } - - public int getCaseid() { - return caseid; - } - - public void setCaseid(int caseid) { - this.caseid = caseid; - } - - public String getLogGrade() { - return logGrade; - } - - public void setLogGrade(String logGrade) { - this.logGrade = logGrade; - } - - public TestLogdetail() { - } - - public TestLogdetail(int logid, TestCasedetail testCasedetail, - Timestamp logtime, String detail) { - this.logid = logid; - this.testCasedetail = testCasedetail; - this.logtime = logtime; - this.detail = detail; - } - - public int getLogid() { - return this.logid; - } - - public void setLogid(int logid) { - this.logid = logid; - } - - public TestCasedetail getTestCasedetail() { - return this.testCasedetail; - } - - public void setTestCasedetail(TestCasedetail testCasedetail) { - this.testCasedetail = testCasedetail; - } - - public java.sql.Timestamp getLogtime() { - return this.logtime; - } - - public void setLogtime(Timestamp logtime) { - this.logtime = logtime; - } - - public String getDetail() { - return this.detail; - } - - public void setDetail(String detail) { - this.detail = detail; - } - -} +package luckyweb.seagull.spring.entity; + +// default package +// Generated 2015-4-21 15:55:06 by Hibernate Tools 3.2.2.GA + +import java.sql.Timestamp; + +import javax.persistence.Entity; + +/** + * TestLogdetail generated by hbm2java + */ +@Entity(name="testLogdetail") +public class TestLogdetail implements java.io.Serializable { + + /** + * + */ + private static final long serialVersionUID = 1L; + private int logid; + private TestCasedetail testCasedetail=new TestCasedetail(); + private Timestamp logtime; + private String detail; + private String detailShort; + private String step; + private String imgname; + private String logGrade; + private int taskid; + private int caseid; + + public String getImgname() { + return imgname; + } + + public void setImgname(String imgname) { + this.imgname = imgname; + } + + public String getStep() { + return step; + } + + public void setStep(String step) { + this.step = step; + } + + public String getDetailShort() { + return detailShort; + } + + public void setDetailShort(String detailShort) { + this.detailShort = detailShort; + } + + public int getTaskid() { + return taskid; + } + + public void setTaskid(int taskid) { + this.taskid = taskid; + } + + public int getCaseid() { + return caseid; + } + + public void setCaseid(int caseid) { + this.caseid = caseid; + } + + public String getLogGrade() { + return logGrade; + } + + public void setLogGrade(String logGrade) { + this.logGrade = logGrade; + } + + public TestLogdetail() { + } + + public TestLogdetail(int logid, TestCasedetail testCasedetail, + Timestamp logtime, String detail) { + this.logid = logid; + this.testCasedetail = testCasedetail; + this.logtime = logtime; + this.detail = detail; + } + + public int getLogid() { + return this.logid; + } + + public void setLogid(int logid) { + this.logid = logid; + } + + public TestCasedetail getTestCasedetail() { + return this.testCasedetail; + } + + public void setTestCasedetail(TestCasedetail testCasedetail) { + this.testCasedetail = testCasedetail; + } + + public java.sql.Timestamp getLogtime() { + return this.logtime; + } + + public void setLogtime(Timestamp logtime) { + this.logtime = logtime; + } + + public String getDetail() { + return this.detail; + } + + public void setDetail(String detail) { + this.detail = detail; + } + +} diff --git a/src/main/java/luckyweb/seagull/spring/entity/TestTaskexcute.java b/src/main/java/luckyweb/seagull/spring/entity/TestTaskexcute.java index 8d93573..a38b9a8 100644 --- a/src/main/java/luckyweb/seagull/spring/entity/TestTaskexcute.java +++ b/src/main/java/luckyweb/seagull/spring/entity/TestTaskexcute.java @@ -1,200 +1,200 @@ -package luckyweb.seagull.spring.entity; - -import java.sql.Timestamp; - -import javax.persistence.Entity; - -@Entity(name = "testTaskexcute") -public class TestTaskexcute implements java.io.Serializable { - - /** - * - */ - private static final long serialVersionUID = 1L; - private int id; - private String taskId; - private int casetotalCount = 0; - private int casesuccCount = 0; - private int casefailCount = 0; - private int caselockCount = 0; - private int casenoexecCount = 0;// 未执行用例数 - private TestJobs testJob = new TestJobs(); - - private int jobid; - private String caseIsExec; - private Timestamp finishtime; - private String taskStatus; //0 未执行 1执行中 2 成功 4失败 - - private String startDate; - private String endDate; - private String name; - - private String taskName; - - public String getTaskName() { - return taskName; - } - - public void setTaskName(String taskName) { - this.taskName = taskName; - } - - public int getCasenoexecCount() { - return casenoexecCount; - } - - public void setCasenoexecCount(int casenoexecCount) { - this.casenoexecCount = casenoexecCount; - } - - public String getStartDate() { - return startDate; - } - - public void setStartDate(String startDate) { - this.startDate = startDate; - } - - public String getTaskId() { - return taskId; - } - - public void setTaskId(String taskId) { - this.taskId = taskId; - } - - public String getTaskStatus() { - return taskStatus; - } - - public void setTaskStatus(String taskStatus) { - this.taskStatus = taskStatus; - } - - private String taskStatus_str; - - public String getTaskStatus_str() { - return taskStatus_str; - } - - public void setTaskStatus_str(String taskStatus_str) { - this.taskStatus_str = taskStatus_str; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getCaseIsExec() { - return caseIsExec; - } - - public void setCaseIsExec(String caseIsExec) { - this.caseIsExec = caseIsExec; - } - - public String getEndDate() { - return endDate; - } - - public void setEndDate(String endDate) { - this.endDate = endDate; - } - - public Timestamp getFinishtime() { - return finishtime; - } - - public void setFinishtime(Timestamp finishtime) { - this.finishtime = finishtime; - } - - public int getJobid() { - return jobid; - } - - public void setJobid(int jobid) { - this.jobid = jobid; - } - - public TestTaskexcute() { - - } - - public TestTaskexcute(int id, String taskId, int casetotalCount, - int casesuccCount, int casefailCount, int caselockCount, - TestJobs testJob, Timestamp createTime) { - super(); - this.id = id; - this.taskId = taskId; - this.casetotalCount = casetotalCount; - this.casesuccCount = casesuccCount; - this.casefailCount = casefailCount; - this.caselockCount = caselockCount; - this.testJob = testJob; - this.createTime = createTime; - } - - private Timestamp createTime; - - public int getId() { - return id; - } - - public void setId(int id) { - this.id = id; - } - - public int getCasetotalCount() { - return casetotalCount; - } - - public void setCasetotalCount(int casetotalCount) { - this.casetotalCount = casetotalCount; - } - - public int getCasesuccCount() { - return casesuccCount; - } - - public void setCasesuccCount(int casesuccCount) { - this.casesuccCount = casesuccCount; - } - - public int getCasefailCount() { - return casefailCount; - } - - public void setCasefailCount(int casefailCount) { - this.casefailCount = casefailCount; - } - - public int getCaselockCount() { - return caselockCount; - } - - public void setCaselockCount(int caselockCount) { - this.caselockCount = caselockCount; - } - - public TestJobs getTestJob() { - return testJob; - } - - public void setTestJob(TestJobs testJob) { - this.testJob = testJob; - } - - public Timestamp getCreateTime() { - return createTime; - } - - public void setCreateTime(Timestamp createTime) { - this.createTime = createTime; - } - -} +package luckyweb.seagull.spring.entity; + +import java.sql.Timestamp; + +import javax.persistence.Entity; + +@Entity(name = "testTaskexcute") +public class TestTaskexcute implements java.io.Serializable { + + /** + * + */ + private static final long serialVersionUID = 1L; + private int id; + private String taskId; + private int casetotalCount = 0; + private int casesuccCount = 0; + private int casefailCount = 0; + private int caselockCount = 0; + private int casenoexecCount = 0;// 未执行用例数 + private TestJobs testJob = new TestJobs(); + + private int jobid; + private String caseIsExec; + private Timestamp finishtime; + private String taskStatus; //0 未执行 1执行中 2 成功 4失败 + + private String startDate; + private String endDate; + private String name; + + private String taskName; + + public String getTaskName() { + return taskName; + } + + public void setTaskName(String taskName) { + this.taskName = taskName; + } + + public int getCasenoexecCount() { + return casenoexecCount; + } + + public void setCasenoexecCount(int casenoexecCount) { + this.casenoexecCount = casenoexecCount; + } + + public String getStartDate() { + return startDate; + } + + public void setStartDate(String startDate) { + this.startDate = startDate; + } + + public String getTaskId() { + return taskId; + } + + public void setTaskId(String taskId) { + this.taskId = taskId; + } + + public String getTaskStatus() { + return taskStatus; + } + + public void setTaskStatus(String taskStatus) { + this.taskStatus = taskStatus; + } + + private String taskStatus_str; + + public String getTaskStatus_str() { + return taskStatus_str; + } + + public void setTaskStatus_str(String taskStatus_str) { + this.taskStatus_str = taskStatus_str; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getCaseIsExec() { + return caseIsExec; + } + + public void setCaseIsExec(String caseIsExec) { + this.caseIsExec = caseIsExec; + } + + public String getEndDate() { + return endDate; + } + + public void setEndDate(String endDate) { + this.endDate = endDate; + } + + public Timestamp getFinishtime() { + return finishtime; + } + + public void setFinishtime(Timestamp finishtime) { + this.finishtime = finishtime; + } + + public int getJobid() { + return jobid; + } + + public void setJobid(int jobid) { + this.jobid = jobid; + } + + public TestTaskexcute() { + + } + + public TestTaskexcute(int id, String taskId, int casetotalCount, + int casesuccCount, int casefailCount, int caselockCount, + TestJobs testJob, Timestamp createTime) { + super(); + this.id = id; + this.taskId = taskId; + this.casetotalCount = casetotalCount; + this.casesuccCount = casesuccCount; + this.casefailCount = casefailCount; + this.caselockCount = caselockCount; + this.testJob = testJob; + this.createTime = createTime; + } + + private Timestamp createTime; + + public int getId() { + return id; + } + + public void setId(int id) { + this.id = id; + } + + public int getCasetotalCount() { + return casetotalCount; + } + + public void setCasetotalCount(int casetotalCount) { + this.casetotalCount = casetotalCount; + } + + public int getCasesuccCount() { + return casesuccCount; + } + + public void setCasesuccCount(int casesuccCount) { + this.casesuccCount = casesuccCount; + } + + public int getCasefailCount() { + return casefailCount; + } + + public void setCasefailCount(int casefailCount) { + this.casefailCount = casefailCount; + } + + public int getCaselockCount() { + return caselockCount; + } + + public void setCaselockCount(int caselockCount) { + this.caselockCount = caselockCount; + } + + public TestJobs getTestJob() { + return testJob; + } + + public void setTestJob(TestJobs testJob) { + this.testJob = testJob; + } + + public Timestamp getCreateTime() { + return createTime; + } + + public void setCreateTime(Timestamp createTime) { + this.createTime = createTime; + } + +} diff --git a/src/main/java/luckyweb/seagull/spring/entity/UserAuthority.java b/src/main/java/luckyweb/seagull/spring/entity/UserAuthority.java index 6b98834..7c5a0ab 100644 --- a/src/main/java/luckyweb/seagull/spring/entity/UserAuthority.java +++ b/src/main/java/luckyweb/seagull/spring/entity/UserAuthority.java @@ -1,41 +1,41 @@ -package luckyweb.seagull.spring.entity; - -import javax.persistence.Entity; - -@Entity(name="userauthority") -public class UserAuthority implements java.io.Serializable{ - /** - * - */ - private static final long serialVersionUID = 1L; - private int id; - private String module; - private String alias; - private String auth_type; - public int getId() { - return id; - } - public void setId(int id) { - this.id = id; - } - public String getModule() { - return module; - } - public void setModule(String module) { - this.module = module; - } - public String getAlias() { - return alias; - } - public void setAlias(String alias) { - this.alias = alias; - } - public String getAuth_type() { - return auth_type; - } - public void setAuth_type(String auth_type) { - this.auth_type = auth_type; - } - - -} +package luckyweb.seagull.spring.entity; + +import javax.persistence.Entity; + +@Entity(name="userauthority") +public class UserAuthority implements java.io.Serializable{ + /** + * + */ + private static final long serialVersionUID = 1L; + private int id; + private String module; + private String alias; + private String auth_type; + public int getId() { + return id; + } + public void setId(int id) { + this.id = id; + } + public String getModule() { + return module; + } + public void setModule(String module) { + this.module = module; + } + public String getAlias() { + return alias; + } + public void setAlias(String alias) { + this.alias = alias; + } + public String getAuth_type() { + return auth_type; + } + public void setAuth_type(String auth_type) { + this.auth_type = auth_type; + } + + +} diff --git a/src/main/java/luckyweb/seagull/spring/entity/UserInfo.java b/src/main/java/luckyweb/seagull/spring/entity/UserInfo.java index 95f2777..4d04644 100644 --- a/src/main/java/luckyweb/seagull/spring/entity/UserInfo.java +++ b/src/main/java/luckyweb/seagull/spring/entity/UserInfo.java @@ -1,85 +1,85 @@ -package luckyweb.seagull.spring.entity; - -import javax.persistence.Entity; - -@Entity(name="userinfo") -public class UserInfo implements java.io.Serializable{ - /** - * - */ - private static final long serialVersionUID = 1L; - private int id; - private String usercode; - private String password; - private String oldpassword; - private String username; - private int sectorid; - private String role; - private SecondarySector secondarySector; - private int projectid; - private String projectname; - - public String getProjectname() { - return projectname; - } - public void setProjectname(String projectname) { - this.projectname = projectname; - } - public int getProjectid() { - return projectid; - } - public void setProjectid(int projectid) { - this.projectid = projectid; - } - public String getOldpassword() { - return oldpassword; - } - public void setOldpassword(String oldpassword) { - this.oldpassword = oldpassword; - } - public String getRole() { - return role; - } - public void setRole(String role) { - this.role = role; - } - public int getId() { - return id; - } - public void setId(int id) { - this.id = id; - } - public String getUsercode() { - return usercode; - } - public void setUsercode(String usercode) { - this.usercode = usercode; - } - public String getPassword() { - return password; - } - public void setPassword(String password) { - this.password = password; - } - public String getUsername() { - return username; - } - public void setUsername(String username) { - this.username = username; - } - public int getSectorid() { - return sectorid; - } - public void setSectorid(int sectorid) { - this.sectorid = sectorid; - } - public SecondarySector getSecondarySector() { - return secondarySector; - } - public void setSecondarySector(SecondarySector secondarySector) { - this.secondarySector = secondarySector; - } - - - -} +package luckyweb.seagull.spring.entity; + +import javax.persistence.Entity; + +@Entity(name="userinfo") +public class UserInfo implements java.io.Serializable{ + /** + * + */ + private static final long serialVersionUID = 1L; + private int id; + private String usercode; + private String password; + private String oldpassword; + private String username; + private int sectorid; + private String role; + private SecondarySector secondarySector; + private int projectid; + private String projectname; + + public String getProjectname() { + return projectname; + } + public void setProjectname(String projectname) { + this.projectname = projectname; + } + public int getProjectid() { + return projectid; + } + public void setProjectid(int projectid) { + this.projectid = projectid; + } + public String getOldpassword() { + return oldpassword; + } + public void setOldpassword(String oldpassword) { + this.oldpassword = oldpassword; + } + public String getRole() { + return role; + } + public void setRole(String role) { + this.role = role; + } + public int getId() { + return id; + } + public void setId(int id) { + this.id = id; + } + public String getUsercode() { + return usercode; + } + public void setUsercode(String usercode) { + this.usercode = usercode; + } + public String getPassword() { + return password; + } + public void setPassword(String password) { + this.password = password; + } + public String getUsername() { + return username; + } + public void setUsername(String username) { + this.username = username; + } + public int getSectorid() { + return sectorid; + } + public void setSectorid(int sectorid) { + this.sectorid = sectorid; + } + public SecondarySector getSecondarySector() { + return secondarySector; + } + public void setSecondarySector(SecondarySector secondarySector) { + this.secondarySector = secondarySector; + } + + + +} diff --git a/src/main/java/luckyweb/seagull/spring/entity/UserRole.java b/src/main/java/luckyweb/seagull/spring/entity/UserRole.java index dae06b1..d2e0782 100644 --- a/src/main/java/luckyweb/seagull/spring/entity/UserRole.java +++ b/src/main/java/luckyweb/seagull/spring/entity/UserRole.java @@ -1,43 +1,43 @@ -package luckyweb.seagull.spring.entity; - -import javax.persistence.Entity; - -@Entity(name="userrole") -public class UserRole implements java.io.Serializable{ - /** - * - */ - private static final long serialVersionUID = 1L; - private int id; - private String role; - private String permission; - private String opprojectid; - - public String getOpprojectid() { - return opprojectid; - } - public void setOpprojectid(String opprojectid) { - this.opprojectid = opprojectid; - } - public int getId() { - return id; - } - public void setId(int id) { - this.id = id; - } - public String getRole() { - return role; - } - public void setRole(String role) { - this.role = role; - } - public String getPermission() { - return permission; - } - public void setPermission(String permission) { - this.permission = permission; - } - - - -} +package luckyweb.seagull.spring.entity; + +import javax.persistence.Entity; + +@Entity(name="userrole") +public class UserRole implements java.io.Serializable{ + /** + * + */ + private static final long serialVersionUID = 1L; + private int id; + private String role; + private String permission; + private String opprojectid; + + public String getOpprojectid() { + return opprojectid; + } + public void setOpprojectid(String opprojectid) { + this.opprojectid = opprojectid; + } + public int getId() { + return id; + } + public void setId(int id) { + this.id = id; + } + public String getRole() { + return role; + } + public void setRole(String role) { + this.role = role; + } + public String getPermission() { + return permission; + } + public void setPermission(String permission) { + this.permission = permission; + } + + + +} diff --git a/src/main/java/luckyweb/seagull/spring/entity/ZtTask.java b/src/main/java/luckyweb/seagull/spring/entity/ZtTask.java index 8f02cf0..b61d6a1 100644 --- a/src/main/java/luckyweb/seagull/spring/entity/ZtTask.java +++ b/src/main/java/luckyweb/seagull/spring/entity/ZtTask.java @@ -1,106 +1,106 @@ -package luckyweb.seagull.spring.entity; - -import javax.persistence.Entity; - -@Entity(name="zttask") -public class ZtTask implements java.io.Serializable{ - /** - * - */ - private static final long serialVersionUID = 1L; - private int id; - private int versionid; - private String versionname; - private String taskname; - private String assignedDate; - private String assstartDate; - private String assendDate; - private Double estimate; - private Double consumed; - private String finishedby; - private String finishedname; - private String deadline; - private int delaystatus; - - public int getDelaystatus() { - return delaystatus; - } - public void setDelaystatus(int delaystatus) { - this.delaystatus = delaystatus; - } - public int getId() { - return id; - } - public void setId(int id) { - this.id = id; - } - public int getVersionid() { - return versionid; - } - public void setVersionid(int versionid) { - this.versionid = versionid; - } - public String getVersionname() { - return versionname; - } - public void setVersionname(String versionname) { - this.versionname = versionname; - } - - public String getTaskname() { - return taskname; - } - public void setTaskname(String taskname) { - this.taskname = taskname; - } - public String getAssignedDate() { - return assignedDate; - } - public void setAssignedDate(String assignedDate) { - this.assignedDate = assignedDate; - } - public Double getEstimate() { - return estimate; - } - public void setEstimate(Double estimate) { - this.estimate = estimate; - } - public Double getConsumed() { - return consumed; - } - public void setConsumed(Double consumed) { - this.consumed = consumed; - } - - public String getFinishedby() { - return finishedby; - } - public void setFinishedby(String finishedby) { - this.finishedby = finishedby; - } - public String getFinishedname() { - return finishedname; - } - public void setFinishedname(String finishedname) { - this.finishedname = finishedname; - } - public String getDeadline() { - return deadline; - } - public void setDeadline(String deadline) { - this.deadline = deadline; - } - public String getAssstartDate() { - return assstartDate; - } - public void setAssstartDate(String assstartDate) { - this.assstartDate = assstartDate; - } - public String getAssendDate() { - return assendDate; - } - public void setAssendDate(String assendDate) { - this.assendDate = assendDate; - } - -} +package luckyweb.seagull.spring.entity; + +import javax.persistence.Entity; + +@Entity(name="zttask") +public class ZtTask implements java.io.Serializable{ + /** + * + */ + private static final long serialVersionUID = 1L; + private int id; + private int versionid; + private String versionname; + private String taskname; + private String assignedDate; + private String assstartDate; + private String assendDate; + private Double estimate; + private Double consumed; + private String finishedby; + private String finishedname; + private String deadline; + private int delaystatus; + + public int getDelaystatus() { + return delaystatus; + } + public void setDelaystatus(int delaystatus) { + this.delaystatus = delaystatus; + } + public int getId() { + return id; + } + public void setId(int id) { + this.id = id; + } + public int getVersionid() { + return versionid; + } + public void setVersionid(int versionid) { + this.versionid = versionid; + } + public String getVersionname() { + return versionname; + } + public void setVersionname(String versionname) { + this.versionname = versionname; + } + + public String getTaskname() { + return taskname; + } + public void setTaskname(String taskname) { + this.taskname = taskname; + } + public String getAssignedDate() { + return assignedDate; + } + public void setAssignedDate(String assignedDate) { + this.assignedDate = assignedDate; + } + public Double getEstimate() { + return estimate; + } + public void setEstimate(Double estimate) { + this.estimate = estimate; + } + public Double getConsumed() { + return consumed; + } + public void setConsumed(Double consumed) { + this.consumed = consumed; + } + + public String getFinishedby() { + return finishedby; + } + public void setFinishedby(String finishedby) { + this.finishedby = finishedby; + } + public String getFinishedname() { + return finishedname; + } + public void setFinishedname(String finishedname) { + this.finishedname = finishedname; + } + public String getDeadline() { + return deadline; + } + public void setDeadline(String deadline) { + this.deadline = deadline; + } + public String getAssstartDate() { + return assstartDate; + } + public void setAssstartDate(String assstartDate) { + this.assstartDate = assstartDate; + } + public String getAssendDate() { + return assendDate; + } + public void setAssendDate(String assendDate) { + this.assendDate = assendDate; + } + +} diff --git a/src/main/java/luckyweb/seagull/spring/mvc/AccidentController.java b/src/main/java/luckyweb/seagull/spring/mvc/AccidentController.java index 1bb9a39..f315d82 100644 --- a/src/main/java/luckyweb/seagull/spring/mvc/AccidentController.java +++ b/src/main/java/luckyweb/seagull/spring/mvc/AccidentController.java @@ -1,637 +1,637 @@ -package luckyweb.seagull.spring.mvc; - -import java.io.BufferedReader; -import java.io.File; -import java.io.IOException; -import java.io.PrintWriter; -import java.text.DecimalFormat; -import java.text.ParseException; -import java.text.SimpleDateFormat; -import java.util.Date; -import java.util.List; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import javax.validation.Valid; - -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.validation.BindingResult; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestMethod; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.multipart.MultipartFile; - -import luckyweb.seagull.comm.QueueListener; -import luckyweb.seagull.spring.entity.Accident; -import luckyweb.seagull.spring.entity.PieLasagna; -import luckyweb.seagull.spring.entity.SectorProjects; -import luckyweb.seagull.spring.service.AccidentService; -import luckyweb.seagull.spring.service.OperationLogService; -import luckyweb.seagull.spring.service.SectorProjectsService; -import luckyweb.seagull.util.StrLib; -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; - -@Controller -@RequestMapping("/accident") -public class AccidentController { - - @Resource(name = "accidentService") - private AccidentService accidentservice; - - @Resource(name = "sectorprojectsService") - private SectorProjectsService sectorprojectsService; - - @Resource(name = "operationlogService") - private OperationLogService operationlogservice; - - - /** - * - * - * @param tj - * @param model - * @return - * @throws Exception - */ - @RequestMapping(value = "/load.do") - public String load(HttpServletRequest req, Model model) throws Exception { - - try { - int projectid = 99; - - List prolist = QueueListener.qa_projlist; - model.addAttribute("projects", prolist); - model.addAttribute("projectid", projectid); - } catch (Exception e) { - e.printStackTrace(); - model.addAttribute("message", e.getMessage()); - model.addAttribute("url", "/accident/load.do"); - return "error"; - } - return "/jsp/accident/accident"; - } - - @SuppressWarnings("unchecked") - @RequestMapping(value = "/list.do") - private void ajaxGetSellRecord(Integer limit, Integer offset, HttpServletRequest request, - HttpServletResponse response) throws NumberFormatException, Exception { - response.setCharacterEncoding("utf-8"); - PrintWriter pw = response.getWriter(); - String search = request.getParameter("search"); - String projectid = request.getParameter("projectid"); - String startDate = request.getParameter("startDate"); - String endDate = request.getParameter("endDate"); - String accstatus = request.getParameter("accstatus"); - Accident accident = new Accident(); - if (null == offset && null == limit) { - offset = 0; - } - if (null == limit || limit == 0) { - limit = 10; - } - // 得到客户端传递的查询参数 - if (!StrLib.isEmpty(search)) { - accident.setAccdescription(search); - accident.setCausaltype(search); - } - if (accstatus!=null&&!"".equals(accstatus)&&!"00".equals(accstatus)) - { - accident.setAccstatus(accstatus); - } - // 得到客户端传递的查询参数 - if (!StrLib.isEmpty(projectid)&&!"99".equals(projectid)) { - accident.setProjectid(Integer.valueOf(projectid)); - } - - if (!StrLib.isEmpty(startDate)) { - accident.setAccstarttime(startDate+" 00:00:00"); - } - - if (!StrLib.isEmpty(endDate)) { - accident.setAccendtime(endDate+" 23:59:59"); - } - List acclist = accidentservice.findByPage(accident, offset, limit); - - // 转换成json字符串 - String RecordJson = StrLib.listToJson(acclist); - // 得到总记录数 - int total = accidentservice.findRows(accident); - // 需要返回的数据有总记录数和行数据 - JSONObject json = new JSONObject(); - json.put("total", total); - json.put("rows", RecordJson); - pw.print(json.toString()); - } - - /** - * 添加生产事故信息 - * @param tj - * @param br - * @param model - * @param req - * @param rsp - * @return - * @throws Exception - * @Description: - */ - @RequestMapping(value = "/add.do") - public String add(@Valid @ModelAttribute("accident") Accident accident,BindingResult br, Model model, - HttpServletRequest req, HttpServletResponse rsp) throws Exception - { - try - { - rsp.setContentType("text/html;charset=utf-8"); - req.setCharacterEncoding("utf-8"); - - if(!UserLoginController.permissionboolean(req, "acc_1")){ - model.addAttribute("accident", new Accident()); - model.addAttribute("url", "/accident/load.do"); - model.addAttribute("message", "当前用户无权限添加生产事故信息,请联系管理员!"); - return "error"; - } - - String retVal = "/jsp/accident/accident_add"; - if (req.getMethod().equals("POST")) - { - if (br.hasErrors()) - { - return retVal; - } - String message = ""; - - if(accident.getProjectid()==0){ - message = "请选择项目!"; - model.addAttribute("message", message); - model.addAttribute("projects", QueueListener.qa_projlist); - return retVal; - }else{ - if(!UserLoginController.oppidboolean(req, accident.getProjectid())){ - SectorProjects sp=sectorprojectsService.loadob(accident.getProjectid()); - model.addAttribute("accident", new Accident()); - model.addAttribute("url", "/accident/load.do"); - model.addAttribute("message", "当前用户无权限添加项目【"+sp.getProjectname()+"】生产事故信息,请联系管理员!"); - return "error"; - } - } - - if(accident.getEventtime().equals("")){ - message = "请选择事故出现时间!"; - model.addAttribute("message", message); - model.addAttribute("projects", QueueListener.qa_projlist); - return retVal; - } - - if(accident.getReporter().equals("")){ - message = "请填写事故报告人!"; - model.addAttribute("message", message); - model.addAttribute("projects", QueueListener.qa_projlist); - return retVal; - } - - if(accident.getAccstatus().equals("跟踪处理完成")){ - if(accident.getCausaltype().equals("暂未选择")||accident.getCausalanalysis().equals("")){ - message = "跟踪处理完成状态,请选择原因类型或填写原因分析!"; - model.addAttribute("message", message); - model.addAttribute("projects", QueueListener.qa_projlist); - return retVal; - } - if(accident.getResolutiontime().equals("")){ - message = "跟踪处理完成状态,请填写解决时间!"; - model.addAttribute("message", message); - model.addAttribute("projects", QueueListener.qa_projlist); - return retVal; - } - - } - - if(!accident.getEventtime().equals("")&&!accident.getResolutiontime().equals("")){ - accident.setTrouble_duration(interval(accident.getEventtime(),accident.getResolutiontime())); - } - - SectorProjects p = new SectorProjects(); - p.setProjectid(accident.getProjectid()); - accident.setSectorProjects(p); - - int accid = accidentservice.add(accident); - - operationlogservice.add(req, "QA_ACCIDENT", accid, - accident.getProjectid(),"生产事故登记成功!事故等级:"+accident.getAcclevel()+" 事故发生时间:"+accident.getEventtime()); - - model.addAttribute("message", "添加成功"); - model.addAttribute("url", "/accident/load.do"); - return retVal; - - } - model.addAttribute("accident", accident); - model.addAttribute("projects", QueueListener.qa_projlist); - return retVal; - - } - catch (Exception e) - { - model.addAttribute("message", e.getMessage()); - model.addAttribute("url", "/accident/load.do"); - return "error"; - } - - } - - /** - * - * 根据id更新记录 - * @param id - * @param model - * @return - * @throws Exception - */ - @RequestMapping(value = "/update.do") - public String update(@Valid @ModelAttribute("accident") Accident accident, BindingResult br, - Model model, HttpServletRequest req) throws Exception - { - req.setCharacterEncoding("utf-8"); - int id = Integer.valueOf(req.getParameter("id")); - - if(!UserLoginController.permissionboolean(req, "acc_3")){ - model.addAttribute("accident", new Accident()); - model.addAttribute("url", "/accident/load.do"); - model.addAttribute("message", "当前用户无权限修改生产事故信息,请联系管理员!"); - return "error"; - } - - try{ - model.addAttribute("projects", QueueListener.qa_projlist); - String retVal = "/jsp/accident/accident_update"; - if (req.getMethod().equals("POST")) - { - if (br.hasErrors()) - { - return retVal; - } - String message = ""; - - if(accident.getProjectid()==0){ - message = "请选择项目!"; - model.addAttribute("message", message); - return retVal; - } - - if(accident.getAccstatus().equals("跟踪处理完成")){ - if(accident.getCausaltype().equals("暂未选择")||accident.getCausalanalysis().equals("")){ - message = "跟踪处理完成状态,请选择原因类型或填写原因分析!"; - model.addAttribute("message", message); - return retVal; - } - if(accident.getResolutiontime().equals("")){ - message = "跟踪处理完成状态,请填写解决时间!"; - model.addAttribute("message", message); - return retVal; - } - } - - if(!accident.getEventtime().equals("")&&!accident.getResolutiontime().equals("")){ - accident.setTrouble_duration(interval(accident.getEventtime(),accident.getResolutiontime())); - } - - SectorProjects p = new SectorProjects(); - p.setProjectid(accident.getProjectid()); - accident.setSectorProjects(p); - - accidentservice.modify(accident); - - operationlogservice.add(req, "QA_ACCIDENT", id, - accident.getProjectid(),"生产事故信息修改成功!事故等级:"+accident.getAcclevel()+" 事故发生时间:"+accident.getEventtime()); - - - model.addAttribute("message", "修改成功"); - model.addAttribute("url", "/accident/load.do"); - return retVal; - - } - accident = accidentservice.load(id); - accident.setProjectid(accident.getSectorProjects().getProjectid()); - - if(!UserLoginController.oppidboolean(req, accident.getProjectid())){ - SectorProjects sp=sectorprojectsService.loadob(accident.getProjectid()); - model.addAttribute("accident", new Accident()); - model.addAttribute("url", "/accident/load.do"); - model.addAttribute("message", "当前用户无权限修改项目【"+sp.getProjectname()+"】生产事故信息,请联系管理员!"); - return "error"; - } - - model.addAttribute("accident", accident); - return "/jsp/accident/accident_update"; - - } - catch (Exception e) - { - model.addAttribute("message", e.getMessage()); - model.addAttribute("url", "/accident/load.do"); - return "error"; - } - } - - /** - * 删除事故记录 - * - * @param id - * @param model - * @return - * @throws Exception - */ - @RequestMapping(value = "/delete.do") - public void delete(HttpServletRequest req, HttpServletResponse rsp) throws Exception { - try { - rsp.setContentType("text/html;charset=utf-8"); - req.setCharacterEncoding("utf-8"); - PrintWriter pw = rsp.getWriter(); - JSONObject json = new JSONObject(); - if (!UserLoginController.permissionboolean(req, "acc_2")) { - json.put("status", "fail"); - json.put("ms", "删除故障记录失败,权限不足,请联系管理员!"); - } else { - StringBuilder sb = new StringBuilder(); - try (BufferedReader reader = req.getReader();) { - char[] buff = new char[1024]; - int len; - while ((len = reader.read(buff)) != -1) { - sb.append(buff, 0, len); - } - } catch (IOException e) { - e.printStackTrace(); - } - JSONObject jsonObject = JSONObject.fromObject(sb.toString()); - JSONArray jsonarr = JSONArray.fromObject(jsonObject.getString("ids")); - String status="fail"; - String ms="删除故障记录失败!"; - int suc=0; - int fail=0; - for (int i = 0; i < jsonarr.size(); i++) { - int id = Integer.valueOf(jsonarr.get(i).toString()); - Accident accident = accidentservice.load(id); - - if(!UserLoginController.oppidboolean(req, accident.getSectorProjects().getProjectid())){ - fail++; - continue; - } - accidentservice.delete(id); - - operationlogservice.add(req, "QA_ACCIDENT", id, - accident.getSectorProjects().getProjectid(),"生产事故信息删除成功!事故等级:"+accident.getAcclevel()+" 事故发生时间:"+accident.getEventtime()); - suc++; - } - - if(suc>0){ - status="success"; - ms="删除故障记录成功!"; - if(fail>0){ - status="success"; - ms="删除故障记录"+suc+"条成功!"+fail+"条因为无项目权限删除失败!"; - } - } - - json.put("status", status); - json.put("ms", ms); - } - pw.print(json.toString()); - - } catch (Exception e) { - e.printStackTrace(); - } - - } - - /** - * 事故详情 - * - * @param id - * @param model - * @return - * @throws Exception - */ - @RequestMapping(value = "/show.do", method = RequestMethod.GET) - public String show(Model model,HttpServletRequest req) throws Exception - { - int id = Integer.valueOf(req.getParameter("id")); - Accident accident = accidentservice.load(id); - if(accident.getTrouble_duration()!=null){ - accident.setStrtrouble_duration(timecast(accident.getTrouble_duration())); - } - if(accident.getImpact_time()!=null){ - accident.setStrimpact_time(timecast(accident.getImpact_time()*60)); - } - - model.addAttribute("accident", accident); - return "/jsp/accident/accident_show"; - } - - /** - * - * HTML5 饼图 - * @param model - * @param req - * @return - * @throws Exception - * @Description: - */ - @RequestMapping(value = "/piechart_html5.do") - public String pieGroupCausaltype(HttpServletRequest req,Model model) throws Exception - { - String startdate = req.getParameter("pie_startdate");//+" 00:00:00"; - String enddate = req.getParameter("pie_enddate");//+" 23:59:59"; - String type = req.getParameter("type"); - String unit = ""; - String title1 = ""; - int projectid = Integer.valueOf(req.getParameter("projectid")); - -/* String[] columncolor = {"#7B7B7B","#FFE6D9","#796400","#CE0000","#921AFF","#E800E8","#00EC00","#00E3E3", - "#F9F900","#FFA042","#AFAF61","#6FB7B7","#B87070","#9999CC", - "#B766AD","#FF359A","#CA8EFF","#A6A600","#CECEFF","#C4E1E1","#E2C2DE","#FFD2D2","#743A3A","#7E3D76"};*/ - - @SuppressWarnings("unchecked") - List ls = accidentservice.listcausaltype(startdate, enddate, projectid,type); - - PieLasagna[] data = new PieLasagna[ls.size()]; - - //初始化显示数据单位 - if(type.equals("count")){ - unit = " 次"; - title1 = "生产事故原因类型图(按累计次数)"; - } - if(type.equals("sumimpact")){ - unit = " 小时"; - title1 = "生产事故原因类型图(按累计影响时间)"; - } - - //获取数据 - for(int i=0;i=20){ - piechart3D.setColor(columncolor[19]); - }else{ - piechart3D.setColor(columncolor[i]); - }*/ - data[i] = lasagna; - } - - String title; - if (ls.size() != 0) { - String startdatestr = startdate+"至"; - String enddatestr = enddate; - if(startdate==""||startdate==null){ - startdatestr = "初始数据日期至"; - } - if(enddate==""||enddate==null){ - enddatestr = "今天"; - } - title = startdatestr + enddatestr; - } else { - title = "本次查询无可用数据"; - } - - String projectname = "全部项目"; - - if(projectid!=0){ - Object[] aaa = (Object[])sectorprojectsService.load(projectid); - projectname = aaa[1].toString(); - } - - - JSONArray jsondata = JSONArray.fromObject(data); - - req.setAttribute("gdata", jsondata.toString()); - model.addAttribute("title1", title1); - model.addAttribute("title2", title); - model.addAttribute("title3", projectname); - model.addAttribute("unit", unit); - - return "/jsp/echart/echarts_lasagna"; - - } - - public static long interval(String str1,String str2) throws ParseException{ - if(str1.equals("")||str2.equals("")){ - return 0; - } - SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss"); - Date date1 = sdf.parse(str1); - Date date2 = sdf.parse(str2); - long sl=date1.getTime(); - long el=date2.getTime(); - return (el-sl)/1000; - } - - public static String timecast(long second){ - long days = second / (60 * 60 * 24); - long hours = (second % (60 * 60 * 24)) / (60 * 60); - long minutes = (second % (60 * 60)) / (60); - long seconds = (second % (60)); - String str =days + "天" + hours + "小时" + minutes + "分" + seconds + "秒"; - return str; - } - - /** - * 上传 - * - * @param request - * @param response - * @return - * @throws Exception - */ - @RequestMapping(value = "/to_upload.do") - public String to_upload(Model model,HttpServletRequest req, HttpServletResponse response) throws Exception - { - req.setCharacterEncoding("utf-8"); - if(!UserLoginController.permissionboolean(req, "acc_upload")){ - model.addAttribute("message", "当前用户无权限上传事故附件!"); - model.addAttribute("url", "/accident/load.do"); - return "error"; - } - - String id = req.getParameter("id"); - Accident accident=accidentservice.load(Integer.valueOf(id)); - if(!UserLoginController.oppidboolean(req, accident.getProjectid())){ - SectorProjects sp=sectorprojectsService.loadob(accident.getProjectid()); - model.addAttribute("accident", new Accident()); - model.addAttribute("url", "/accident/load.do"); - model.addAttribute("message", "当前用户无权限添加项目【"+sp.getProjectname()+"】生产事故信息,请联系管理员!"); - return "error"; - } - - model.addAttribute("id", id); - return "/jsp/accident/acc_upload"; - } - - /** - * 上传 - * - * @param request - * @param response - * @return - * @throws Exception - */ - @RequestMapping(value = "/upload.do") - public String upload(@RequestParam(value = "file", required = false) MultipartFile file, Model model, - HttpServletRequest request, HttpServletResponse response) throws Exception - { - int id = Integer.valueOf(request.getParameter("id")); - String filetype = file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf("."), - file.getOriginalFilename().length()).toLowerCase(); - if (!filetype.equals(".docx")&&!filetype.equals(".doc")&&!filetype.equals(".pdf")) - { - String message = "只能上传word或是pdf的文件!"; - model.addAttribute("message", message); - return "/jsp/accident/acc_upload"; - } - // 文件目录 - String path = "D:\\website\\TestWeb\\upload\\"; - String pathName = path + id+filetype; - File targetFile = new File(pathName); - if (targetFile.exists()){ - targetFile.deleteOnExit(); - }else{ - targetFile.mkdir(); - } - // 保存 - try - { - file.transferTo(targetFile); - } - catch (Exception e) - { - e.printStackTrace(); - model.addAttribute("message", e.getMessage()); - model.addAttribute("url", "/accident/load.do"); - return "error"; - } - Accident accident = accidentservice.load(id); - accident.setFilename(id+filetype); - accidentservice.modify(accident); - operationlogservice.add(request, "QA_ACCIDENT", id, - accident.getProjectid(),"生产事故附件上传成功!附件名称【"+id+filetype+"】"); - - model.addAttribute("url", "/accident/load.do"); - model.addAttribute("message", "【" + file.getOriginalFilename() + "】文件自动更名为【"+id+filetype+"】上传成功!"); - return "success"; - } - - public static void main(String[] args) throws Exception { - - } - -} +package luckyweb.seagull.spring.mvc; + +import java.io.BufferedReader; +import java.io.File; +import java.io.IOException; +import java.io.PrintWriter; +import java.text.DecimalFormat; +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.List; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import javax.validation.Valid; + +import org.springframework.stereotype.Controller; +import org.springframework.ui.Model; +import org.springframework.validation.BindingResult; +import org.springframework.web.bind.annotation.ModelAttribute; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.multipart.MultipartFile; + +import luckyweb.seagull.comm.QueueListener; +import luckyweb.seagull.spring.entity.Accident; +import luckyweb.seagull.spring.entity.PieLasagna; +import luckyweb.seagull.spring.entity.SectorProjects; +import luckyweb.seagull.spring.service.AccidentService; +import luckyweb.seagull.spring.service.OperationLogService; +import luckyweb.seagull.spring.service.SectorProjectsService; +import luckyweb.seagull.util.StrLib; +import net.sf.json.JSONArray; +import net.sf.json.JSONObject; + +@Controller +@RequestMapping("/accident") +public class AccidentController { + + @Resource(name = "accidentService") + private AccidentService accidentservice; + + @Resource(name = "sectorprojectsService") + private SectorProjectsService sectorprojectsService; + + @Resource(name = "operationlogService") + private OperationLogService operationlogservice; + + + /** + * + * + * @param tj + * @param model + * @return + * @throws Exception + */ + @RequestMapping(value = "/load.do") + public String load(HttpServletRequest req, Model model) throws Exception { + + try { + int projectid = 99; + + List prolist = QueueListener.qa_projlist; + model.addAttribute("projects", prolist); + model.addAttribute("projectid", projectid); + } catch (Exception e) { + e.printStackTrace(); + model.addAttribute("message", e.getMessage()); + model.addAttribute("url", "/accident/load.do"); + return "error"; + } + return "/jsp/accident/accident"; + } + + @SuppressWarnings("unchecked") + @RequestMapping(value = "/list.do") + private void ajaxGetSellRecord(Integer limit, Integer offset, HttpServletRequest request, + HttpServletResponse response) throws NumberFormatException, Exception { + response.setCharacterEncoding("utf-8"); + PrintWriter pw = response.getWriter(); + String search = request.getParameter("search"); + String projectid = request.getParameter("projectid"); + String startDate = request.getParameter("startDate"); + String endDate = request.getParameter("endDate"); + String accstatus = request.getParameter("accstatus"); + Accident accident = new Accident(); + if (null == offset && null == limit) { + offset = 0; + } + if (null == limit || limit == 0) { + limit = 10; + } + // 得到客户端传递的查询参数 + if (!StrLib.isEmpty(search)) { + accident.setAccdescription(search); + accident.setCausaltype(search); + } + if (accstatus!=null&&!"".equals(accstatus)&&!"00".equals(accstatus)) + { + accident.setAccstatus(accstatus); + } + // 得到客户端传递的查询参数 + if (!StrLib.isEmpty(projectid)&&!"99".equals(projectid)) { + accident.setProjectid(Integer.valueOf(projectid)); + } + + if (!StrLib.isEmpty(startDate)) { + accident.setAccstarttime(startDate+" 00:00:00"); + } + + if (!StrLib.isEmpty(endDate)) { + accident.setAccendtime(endDate+" 23:59:59"); + } + List acclist = accidentservice.findByPage(accident, offset, limit); + + // 转换成json字符串 + String RecordJson = StrLib.listToJson(acclist); + // 得到总记录数 + int total = accidentservice.findRows(accident); + // 需要返回的数据有总记录数和行数据 + JSONObject json = new JSONObject(); + json.put("total", total); + json.put("rows", RecordJson); + pw.print(json.toString()); + } + + /** + * 添加生产事故信息 + * @param tj + * @param br + * @param model + * @param req + * @param rsp + * @return + * @throws Exception + * @Description: + */ + @RequestMapping(value = "/add.do") + public String add(@Valid @ModelAttribute("accident") Accident accident,BindingResult br, Model model, + HttpServletRequest req, HttpServletResponse rsp) throws Exception + { + try + { + rsp.setContentType("text/html;charset=utf-8"); + req.setCharacterEncoding("utf-8"); + + if(!UserLoginController.permissionboolean(req, "acc_1")){ + model.addAttribute("accident", new Accident()); + model.addAttribute("url", "/accident/load.do"); + model.addAttribute("message", "当前用户无权限添加生产事故信息,请联系管理员!"); + return "error"; + } + + String retVal = "/jsp/accident/accident_add"; + if (req.getMethod().equals("POST")) + { + if (br.hasErrors()) + { + return retVal; + } + String message = ""; + + if(accident.getProjectid()==0){ + message = "请选择项目!"; + model.addAttribute("message", message); + model.addAttribute("projects", QueueListener.qa_projlist); + return retVal; + }else{ + if(!UserLoginController.oppidboolean(req, accident.getProjectid())){ + SectorProjects sp=sectorprojectsService.loadob(accident.getProjectid()); + model.addAttribute("accident", new Accident()); + model.addAttribute("url", "/accident/load.do"); + model.addAttribute("message", "当前用户无权限添加项目【"+sp.getProjectname()+"】生产事故信息,请联系管理员!"); + return "error"; + } + } + + if(accident.getEventtime().equals("")){ + message = "请选择事故出现时间!"; + model.addAttribute("message", message); + model.addAttribute("projects", QueueListener.qa_projlist); + return retVal; + } + + if(accident.getReporter().equals("")){ + message = "请填写事故报告人!"; + model.addAttribute("message", message); + model.addAttribute("projects", QueueListener.qa_projlist); + return retVal; + } + + if(accident.getAccstatus().equals("跟踪处理完成")){ + if(accident.getCausaltype().equals("暂未选择")||accident.getCausalanalysis().equals("")){ + message = "跟踪处理完成状态,请选择原因类型或填写原因分析!"; + model.addAttribute("message", message); + model.addAttribute("projects", QueueListener.qa_projlist); + return retVal; + } + if(accident.getResolutiontime().equals("")){ + message = "跟踪处理完成状态,请填写解决时间!"; + model.addAttribute("message", message); + model.addAttribute("projects", QueueListener.qa_projlist); + return retVal; + } + + } + + if(!accident.getEventtime().equals("")&&!accident.getResolutiontime().equals("")){ + accident.setTrouble_duration(interval(accident.getEventtime(),accident.getResolutiontime())); + } + + SectorProjects p = new SectorProjects(); + p.setProjectid(accident.getProjectid()); + accident.setSectorProjects(p); + + int accid = accidentservice.add(accident); + + operationlogservice.add(req, "QA_ACCIDENT", accid, + accident.getProjectid(),"生产事故登记成功!事故等级:"+accident.getAcclevel()+" 事故发生时间:"+accident.getEventtime()); + + model.addAttribute("message", "添加成功"); + model.addAttribute("url", "/accident/load.do"); + return retVal; + + } + model.addAttribute("accident", accident); + model.addAttribute("projects", QueueListener.qa_projlist); + return retVal; + + } + catch (Exception e) + { + model.addAttribute("message", e.getMessage()); + model.addAttribute("url", "/accident/load.do"); + return "error"; + } + + } + + /** + * + * 根据id更新记录 + * @param id + * @param model + * @return + * @throws Exception + */ + @RequestMapping(value = "/update.do") + public String update(@Valid @ModelAttribute("accident") Accident accident, BindingResult br, + Model model, HttpServletRequest req) throws Exception + { + req.setCharacterEncoding("utf-8"); + int id = Integer.valueOf(req.getParameter("id")); + + if(!UserLoginController.permissionboolean(req, "acc_3")){ + model.addAttribute("accident", new Accident()); + model.addAttribute("url", "/accident/load.do"); + model.addAttribute("message", "当前用户无权限修改生产事故信息,请联系管理员!"); + return "error"; + } + + try{ + model.addAttribute("projects", QueueListener.qa_projlist); + String retVal = "/jsp/accident/accident_update"; + if (req.getMethod().equals("POST")) + { + if (br.hasErrors()) + { + return retVal; + } + String message = ""; + + if(accident.getProjectid()==0){ + message = "请选择项目!"; + model.addAttribute("message", message); + return retVal; + } + + if(accident.getAccstatus().equals("跟踪处理完成")){ + if(accident.getCausaltype().equals("暂未选择")||accident.getCausalanalysis().equals("")){ + message = "跟踪处理完成状态,请选择原因类型或填写原因分析!"; + model.addAttribute("message", message); + return retVal; + } + if(accident.getResolutiontime().equals("")){ + message = "跟踪处理完成状态,请填写解决时间!"; + model.addAttribute("message", message); + return retVal; + } + } + + if(!accident.getEventtime().equals("")&&!accident.getResolutiontime().equals("")){ + accident.setTrouble_duration(interval(accident.getEventtime(),accident.getResolutiontime())); + } + + SectorProjects p = new SectorProjects(); + p.setProjectid(accident.getProjectid()); + accident.setSectorProjects(p); + + accidentservice.modify(accident); + + operationlogservice.add(req, "QA_ACCIDENT", id, + accident.getProjectid(),"生产事故信息修改成功!事故等级:"+accident.getAcclevel()+" 事故发生时间:"+accident.getEventtime()); + + + model.addAttribute("message", "修改成功"); + model.addAttribute("url", "/accident/load.do"); + return retVal; + + } + accident = accidentservice.load(id); + accident.setProjectid(accident.getSectorProjects().getProjectid()); + + if(!UserLoginController.oppidboolean(req, accident.getProjectid())){ + SectorProjects sp=sectorprojectsService.loadob(accident.getProjectid()); + model.addAttribute("accident", new Accident()); + model.addAttribute("url", "/accident/load.do"); + model.addAttribute("message", "当前用户无权限修改项目【"+sp.getProjectname()+"】生产事故信息,请联系管理员!"); + return "error"; + } + + model.addAttribute("accident", accident); + return "/jsp/accident/accident_update"; + + } + catch (Exception e) + { + model.addAttribute("message", e.getMessage()); + model.addAttribute("url", "/accident/load.do"); + return "error"; + } + } + + /** + * 删除事故记录 + * + * @param id + * @param model + * @return + * @throws Exception + */ + @RequestMapping(value = "/delete.do") + public void delete(HttpServletRequest req, HttpServletResponse rsp) throws Exception { + try { + rsp.setContentType("text/html;charset=utf-8"); + req.setCharacterEncoding("utf-8"); + PrintWriter pw = rsp.getWriter(); + JSONObject json = new JSONObject(); + if (!UserLoginController.permissionboolean(req, "acc_2")) { + json.put("status", "fail"); + json.put("ms", "删除故障记录失败,权限不足,请联系管理员!"); + } else { + StringBuilder sb = new StringBuilder(); + try (BufferedReader reader = req.getReader();) { + char[] buff = new char[1024]; + int len; + while ((len = reader.read(buff)) != -1) { + sb.append(buff, 0, len); + } + } catch (IOException e) { + e.printStackTrace(); + } + JSONObject jsonObject = JSONObject.fromObject(sb.toString()); + JSONArray jsonarr = JSONArray.fromObject(jsonObject.getString("ids")); + String status="fail"; + String ms="删除故障记录失败!"; + int suc=0; + int fail=0; + for (int i = 0; i < jsonarr.size(); i++) { + int id = Integer.valueOf(jsonarr.get(i).toString()); + Accident accident = accidentservice.load(id); + + if(!UserLoginController.oppidboolean(req, accident.getSectorProjects().getProjectid())){ + fail++; + continue; + } + accidentservice.delete(id); + + operationlogservice.add(req, "QA_ACCIDENT", id, + accident.getSectorProjects().getProjectid(),"生产事故信息删除成功!事故等级:"+accident.getAcclevel()+" 事故发生时间:"+accident.getEventtime()); + suc++; + } + + if(suc>0){ + status="success"; + ms="删除故障记录成功!"; + if(fail>0){ + status="success"; + ms="删除故障记录"+suc+"条成功!"+fail+"条因为无项目权限删除失败!"; + } + } + + json.put("status", status); + json.put("ms", ms); + } + pw.print(json.toString()); + + } catch (Exception e) { + e.printStackTrace(); + } + + } + + /** + * 事故详情 + * + * @param id + * @param model + * @return + * @throws Exception + */ + @RequestMapping(value = "/show.do", method = RequestMethod.GET) + public String show(Model model,HttpServletRequest req) throws Exception + { + int id = Integer.valueOf(req.getParameter("id")); + Accident accident = accidentservice.load(id); + if(accident.getTrouble_duration()!=null){ + accident.setStrtrouble_duration(timecast(accident.getTrouble_duration())); + } + if(accident.getImpact_time()!=null){ + accident.setStrimpact_time(timecast(accident.getImpact_time()*60)); + } + + model.addAttribute("accident", accident); + return "/jsp/accident/accident_show"; + } + + /** + * + * HTML5 饼图 + * @param model + * @param req + * @return + * @throws Exception + * @Description: + */ + @RequestMapping(value = "/piechart_html5.do") + public String pieGroupCausaltype(HttpServletRequest req,Model model) throws Exception + { + String startdate = req.getParameter("pie_startdate");//+" 00:00:00"; + String enddate = req.getParameter("pie_enddate");//+" 23:59:59"; + String type = req.getParameter("type"); + String unit = ""; + String title1 = ""; + int projectid = Integer.valueOf(req.getParameter("projectid")); + +/* String[] columncolor = {"#7B7B7B","#FFE6D9","#796400","#CE0000","#921AFF","#E800E8","#00EC00","#00E3E3", + "#F9F900","#FFA042","#AFAF61","#6FB7B7","#B87070","#9999CC", + "#B766AD","#FF359A","#CA8EFF","#A6A600","#CECEFF","#C4E1E1","#E2C2DE","#FFD2D2","#743A3A","#7E3D76"};*/ + + @SuppressWarnings("unchecked") + List ls = accidentservice.listcausaltype(startdate, enddate, projectid,type); + + PieLasagna[] data = new PieLasagna[ls.size()]; + + //初始化显示数据单位 + if(type.equals("count")){ + unit = " 次"; + title1 = "生产事故原因类型图(按累计次数)"; + } + if(type.equals("sumimpact")){ + unit = " 小时"; + title1 = "生产事故原因类型图(按累计影响时间)"; + } + + //获取数据 + for(int i=0;i=20){ + piechart3D.setColor(columncolor[19]); + }else{ + piechart3D.setColor(columncolor[i]); + }*/ + data[i] = lasagna; + } + + String title; + if (ls.size() != 0) { + String startdatestr = startdate+"至"; + String enddatestr = enddate; + if(startdate==""||startdate==null){ + startdatestr = "初始数据日期至"; + } + if(enddate==""||enddate==null){ + enddatestr = "今天"; + } + title = startdatestr + enddatestr; + } else { + title = "本次查询无可用数据"; + } + + String projectname = "全部项目"; + + if(projectid!=0){ + Object[] aaa = (Object[])sectorprojectsService.load(projectid); + projectname = aaa[1].toString(); + } + + + JSONArray jsondata = JSONArray.fromObject(data); + + req.setAttribute("gdata", jsondata.toString()); + model.addAttribute("title1", title1); + model.addAttribute("title2", title); + model.addAttribute("title3", projectname); + model.addAttribute("unit", unit); + + return "/jsp/echart/echarts_lasagna"; + + } + + public static long interval(String str1,String str2) throws ParseException{ + if(str1.equals("")||str2.equals("")){ + return 0; + } + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss"); + Date date1 = sdf.parse(str1); + Date date2 = sdf.parse(str2); + long sl=date1.getTime(); + long el=date2.getTime(); + return (el-sl)/1000; + } + + public static String timecast(long second){ + long days = second / (60 * 60 * 24); + long hours = (second % (60 * 60 * 24)) / (60 * 60); + long minutes = (second % (60 * 60)) / (60); + long seconds = (second % (60)); + String str =days + "天" + hours + "小时" + minutes + "分" + seconds + "秒"; + return str; + } + + /** + * 上传 + * + * @param request + * @param response + * @return + * @throws Exception + */ + @RequestMapping(value = "/to_upload.do") + public String to_upload(Model model,HttpServletRequest req, HttpServletResponse response) throws Exception + { + req.setCharacterEncoding("utf-8"); + if(!UserLoginController.permissionboolean(req, "acc_upload")){ + model.addAttribute("message", "当前用户无权限上传事故附件!"); + model.addAttribute("url", "/accident/load.do"); + return "error"; + } + + String id = req.getParameter("id"); + Accident accident=accidentservice.load(Integer.valueOf(id)); + if(!UserLoginController.oppidboolean(req, accident.getProjectid())){ + SectorProjects sp=sectorprojectsService.loadob(accident.getProjectid()); + model.addAttribute("accident", new Accident()); + model.addAttribute("url", "/accident/load.do"); + model.addAttribute("message", "当前用户无权限添加项目【"+sp.getProjectname()+"】生产事故信息,请联系管理员!"); + return "error"; + } + + model.addAttribute("id", id); + return "/jsp/accident/acc_upload"; + } + + /** + * 上传 + * + * @param request + * @param response + * @return + * @throws Exception + */ + @RequestMapping(value = "/upload.do") + public String upload(@RequestParam(value = "file", required = false) MultipartFile file, Model model, + HttpServletRequest request, HttpServletResponse response) throws Exception + { + int id = Integer.valueOf(request.getParameter("id")); + String filetype = file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf("."), + file.getOriginalFilename().length()).toLowerCase(); + if (!filetype.equals(".docx")&&!filetype.equals(".doc")&&!filetype.equals(".pdf")) + { + String message = "只能上传word或是pdf的文件!"; + model.addAttribute("message", message); + return "/jsp/accident/acc_upload"; + } + // 文件目录 + String path = "D:\\website\\TestWeb\\upload\\"; + String pathName = path + id+filetype; + File targetFile = new File(pathName); + if (targetFile.exists()){ + targetFile.deleteOnExit(); + }else{ + targetFile.mkdir(); + } + // 保存 + try + { + file.transferTo(targetFile); + } + catch (Exception e) + { + e.printStackTrace(); + model.addAttribute("message", e.getMessage()); + model.addAttribute("url", "/accident/load.do"); + return "error"; + } + Accident accident = accidentservice.load(id); + accident.setFilename(id+filetype); + accidentservice.modify(accident); + operationlogservice.add(request, "QA_ACCIDENT", id, + accident.getProjectid(),"生产事故附件上传成功!附件名称【"+id+filetype+"】"); + + model.addAttribute("url", "/accident/load.do"); + model.addAttribute("message", "【" + file.getOriginalFilename() + "】文件自动更名为【"+id+filetype+"】上传成功!"); + return "success"; + } + + public static void main(String[] args) throws Exception { + + } + +} diff --git a/src/main/java/luckyweb/seagull/spring/mvc/AutoTestChartController.java b/src/main/java/luckyweb/seagull/spring/mvc/AutoTestChartController.java index 0aa841f..c2130cb 100644 --- a/src/main/java/luckyweb/seagull/spring/mvc/AutoTestChartController.java +++ b/src/main/java/luckyweb/seagull/spring/mvc/AutoTestChartController.java @@ -1,108 +1,108 @@ -package luckyweb.seagull.spring.mvc; - -import java.util.List; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; - -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.RequestMapping; - -import luckyweb.seagull.spring.entity.TestCasedetail; -import luckyweb.seagull.spring.service.TestTastExcuteService; - -import net.sf.json.JSONArray; - - -@Controller -@RequestMapping("/autoTestChar") -public class AutoTestChartController { - - @Resource(name = "tastExcuteService") - private TestTastExcuteService tastExcuteService; - - public void setTastExcuteService(TestTastExcuteService tastExcuteService) - { - this.tastExcuteService = tastExcuteService; - } - - /** - * - * Job查询 - * @param tj - * @param model - * @return - * @throws Exception - */ - @SuppressWarnings({ "unchecked" }) - @RequestMapping(value = "/chart.do") - public String chart(HttpServletRequest req,Model model) { - try { - List taskinfo = tastExcuteService.listtastinfo(); - - String jobname[] = new String[taskinfo.size()]; - String casetotal[] = new String[taskinfo.size()]; - String casesuc[] = new String[taskinfo.size()]; - String casefail[] = new String[taskinfo.size()]; - String caselock[] = new String[taskinfo.size()]; - String casenoex[] = new String[taskinfo.size()]; - String createtime[] = new String[taskinfo.size()]; - String taskid[] = new String[taskinfo.size()]; - int j=0; - for(int i=0;i taskinfo = tastExcuteService.listtastinfo(); + + String jobname[] = new String[taskinfo.size()]; + String casetotal[] = new String[taskinfo.size()]; + String casesuc[] = new String[taskinfo.size()]; + String casefail[] = new String[taskinfo.size()]; + String caselock[] = new String[taskinfo.size()]; + String casenoex[] = new String[taskinfo.size()]; + String createtime[] = new String[taskinfo.size()]; + String taskid[] = new String[taskinfo.size()]; + int j=0; + for(int i=0;i prolist=sectorprojectsService.getAllProject(); - for(int i=0;i caselist = casedetailService.findByPage(caseDetail, offset, limit); - // 转换成json字符串 - String RecordJson = StrLib.listToJson(caselist); - // 得到总记录数 - int total = casedetailService.findRows(caseDetail); - // 需要返回的数据有总记录数和行数据 - JSONObject json = new JSONObject(); - json.put("total", total); - json.put("rows", RecordJson); - pw.print(json.toString()); - } - - /** - * 根据caseId执行用例 - * - * @param tj - * @param br - * @param model - * @param req - * @param rsp - * @return - * @throws Exception - * @Description: - */ - @RequestMapping(value = "/runCase.do") - public void runCase(HttpServletRequest req, HttpServletResponse rsp) throws Exception { - try { - rsp.setContentType("text/html;charset=utf-8"); - req.setCharacterEncoding("utf-8"); - PrintWriter pw = rsp.getWriter(); - JSONObject json = new JSONObject(); - if (!UserLoginController.permissionboolean(req, "case_ex")) { - json.put("status", "fail"); - json.put("ms", "执行用例失败,权限不足,请联系管理员!"); - } else { - StringBuilder sb = new StringBuilder(); - try (BufferedReader reader = req.getReader();) { - char[] buff = new char[1024]; - int len; - while ((len = reader.read(buff)) != -1) { - sb.append(buff, 0, len); - } - } catch (IOException e) { - e.printStackTrace(); - } - JSONObject jsonObject = JSONObject.fromObject(sb.toString()); - JSONArray jsonarr = JSONArray.fromObject(jsonObject.getString("caseids")); - String status="success"; - String ms="执行任务成功!"; - - TestTaskexcute task=null; - if ("ALLFAIL".equals(jsonarr.get(0).toString())){ - int taskid = Integer.valueOf(jsonarr.get(1).toString()); - task = tastExcuteService.load(taskid); - }else{ - int id = Integer.valueOf(jsonarr.get(0).toString()); - TestCasedetail caseDetail = this.casedetailService.load(id); - task = caseDetail.getTestTaskexcute(); - } - - if (!UserLoginController.oppidboolean(req, task.getTestJob().getProjectid())) { - status = "fail"; - ms = "您没有执行此项目用例的权限!"; - } else { - if (jsonarr.size() == 1) { - int id = Integer.valueOf(jsonarr.get(0).toString()); - TestCasedetail caseDetail = this.casedetailService.load(id); - - QuartzJob qj = new QuartzJob(); - ms = qj.toRunCase(task.getTestJob().getPlanproj(), task.getId(), caseDetail.getCaseno(), - caseDetail.getCaseversion(), task.getTestJob().getClientip(),task.getTestJob().getClientpath()); - operationlogservice.add(req, "TEST_CASEDETAIL", id, - sectorprojectsService.getid(task.getTestJob().getPlanproj()), "自动化用例单条开始执行!任务名称:" - + task.getTaskId() + " 用例编号:" + caseDetail.getCaseno() + " 结果:" + ms); - } else { - String projName; - if ("ALLFAIL".equals(jsonarr.get(0).toString())) { - projName = task.getTestJob().getPlanproj(); - // 批量执行用例 - QuartzJob qj = new QuartzJob(); - ms = qj.toRunCaseBatch(projName, task.getId(), "ALLFAIL", task.getTestJob().getClientip(),task.getTestJob().getClientpath()); - operationlogservice.add(req, "TEST_CASEDETAIL", 0, sectorprojectsService.getid(projName), - "全部非成功自动化用例开始执行!" + " 结果:" + ms); - } else { - StringBuffer caseInfo = new StringBuffer(); - for (int i = 0; i < jsonarr.size(); i++) { - int id = Integer.valueOf(jsonarr.get(i).toString()); - TestCasedetail caseDetail = casedetailService.load(Integer.valueOf(id)); - String ocase = caseDetail.getCaseno() + "%" + caseDetail.getCaseversion(); - caseInfo.append(ocase).append("#"); - } - projName = task.getTestJob().getPlanproj(); - // 批量执行用例 - QuartzJob qj = new QuartzJob(); - ms = qj.toRunCaseBatch(projName, task.getId(), caseInfo.toString(), - task.getTestJob().getClientip(),task.getTestJob().getClientpath()); - - operationlogservice.add(req, "TEST_CASEDETAIL", 0, sectorprojectsService.getid(projName), - "自动化用例批量(非成功)开始执行!" + " 结果:" + ms); - } - } - } - - json.put("status", status); - json.put("ms", ms); - } - pw.print(json.toString()); - - } catch (Exception e) { - e.printStackTrace(); - } - - } - - @RequestMapping(value = "/getTastNameList.do") - public void getTastNameList(TestCasedetail caseDetail, HttpServletRequest req, HttpServletResponse rsp, - Model model) throws Exception - { - req.setCharacterEncoding("utf-8"); - rsp.setContentType("text/html;charset=utf-8"); - PrintWriter pw; - try - { - pw = rsp.getWriter(); - String startDate = req.getParameter("startDate"); - String endDate = req.getParameter("endDate"); - String projid = req.getParameter("projid"); - List tasks = tastExcuteService.findTastList(startDate, projid, endDate); - JSONArray array = JSONArray.fromObject(tasks); - pw.write(array.toString()); - } - catch (IOException e) - { - e.printStackTrace(); - } - } - - public static void main(String[] args) throws UnsupportedEncodingException - { - - } - -} +package luckyweb.seagull.spring.mvc; + +import java.io.BufferedReader; +import java.io.IOException; +import java.io.PrintWriter; +import java.io.UnsupportedEncodingException; +import java.text.SimpleDateFormat; +import java.util.List; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.apache.log4j.Logger; +import org.springframework.stereotype.Controller; +import org.springframework.ui.Model; +import org.springframework.web.bind.annotation.RequestMapping; + +import luckyweb.seagull.quartz.QuartzJob; +import luckyweb.seagull.spring.entity.SectorProjects; +import luckyweb.seagull.spring.entity.TestCasedetail; +import luckyweb.seagull.spring.entity.TestTaskexcute; +import luckyweb.seagull.spring.service.CaseDetailService; +import luckyweb.seagull.spring.service.OperationLogService; +import luckyweb.seagull.spring.service.SectorProjectsService; +import luckyweb.seagull.spring.service.TestTastExcuteService; +import luckyweb.seagull.util.DateLib; +import luckyweb.seagull.util.StrLib; +import net.sf.json.JSONArray; +import net.sf.json.JSONObject; + +@Controller +@RequestMapping("/caseDetail") +public class CasedetailController +{ + private static final Logger log = Logger.getLogger(CasedetailController.class); + + @Resource(name = "casedetailService") + private CaseDetailService casedetailService; + + @Resource(name = "tastExcuteService") + private TestTastExcuteService tastExcuteService; + + @Resource(name = "operationlogService") + private OperationLogService operationlogservice; + + @Resource(name = "sectorprojectsService") + private SectorProjectsService sectorprojectsService; + + /** + * + * + * @param tj + * @param model + * @return + * @throws Exception + */ + @RequestMapping(value = "/load.do") + public String load(HttpServletRequest req, Model model) throws Exception { + try { + String taskId = req.getParameter("taskId"); + String status = req.getParameter("status"); + List prolist=sectorprojectsService.getAllProject(); + for(int i=0;i caselist = casedetailService.findByPage(caseDetail, offset, limit); + // 转换成json字符串 + String RecordJson = StrLib.listToJson(caselist); + // 得到总记录数 + int total = casedetailService.findRows(caseDetail); + // 需要返回的数据有总记录数和行数据 + JSONObject json = new JSONObject(); + json.put("total", total); + json.put("rows", RecordJson); + pw.print(json.toString()); + } + + /** + * 根据caseId执行用例 + * + * @param tj + * @param br + * @param model + * @param req + * @param rsp + * @return + * @throws Exception + * @Description: + */ + @RequestMapping(value = "/runCase.do") + public void runCase(HttpServletRequest req, HttpServletResponse rsp) throws Exception { + try { + rsp.setContentType("text/html;charset=utf-8"); + req.setCharacterEncoding("utf-8"); + PrintWriter pw = rsp.getWriter(); + JSONObject json = new JSONObject(); + if (!UserLoginController.permissionboolean(req, "case_ex")) { + json.put("status", "fail"); + json.put("ms", "执行用例失败,权限不足,请联系管理员!"); + } else { + StringBuilder sb = new StringBuilder(); + try (BufferedReader reader = req.getReader();) { + char[] buff = new char[1024]; + int len; + while ((len = reader.read(buff)) != -1) { + sb.append(buff, 0, len); + } + } catch (IOException e) { + e.printStackTrace(); + } + JSONObject jsonObject = JSONObject.fromObject(sb.toString()); + JSONArray jsonarr = JSONArray.fromObject(jsonObject.getString("caseids")); + String status="success"; + String ms="执行任务成功!"; + + TestTaskexcute task=null; + if ("ALLFAIL".equals(jsonarr.get(0).toString())){ + int taskid = Integer.valueOf(jsonarr.get(1).toString()); + task = tastExcuteService.load(taskid); + }else{ + int id = Integer.valueOf(jsonarr.get(0).toString()); + TestCasedetail caseDetail = this.casedetailService.load(id); + task = caseDetail.getTestTaskexcute(); + } + + if (!UserLoginController.oppidboolean(req, task.getTestJob().getProjectid())) { + status = "fail"; + ms = "您没有执行此项目用例的权限!"; + } else { + if (jsonarr.size() == 1) { + int id = Integer.valueOf(jsonarr.get(0).toString()); + TestCasedetail caseDetail = this.casedetailService.load(id); + + QuartzJob qj = new QuartzJob(); + ms = qj.toRunCase(task.getTestJob().getPlanproj(), task.getId(), caseDetail.getCaseno(), + caseDetail.getCaseversion(), task.getTestJob().getClientip(),task.getTestJob().getClientpath()); + operationlogservice.add(req, "TEST_CASEDETAIL", id, + sectorprojectsService.getid(task.getTestJob().getPlanproj()), "自动化用例单条开始执行!任务名称:" + + task.getTaskId() + " 用例编号:" + caseDetail.getCaseno() + " 结果:" + ms); + } else { + String projName; + if ("ALLFAIL".equals(jsonarr.get(0).toString())) { + projName = task.getTestJob().getPlanproj(); + // 批量执行用例 + QuartzJob qj = new QuartzJob(); + ms = qj.toRunCaseBatch(projName, task.getId(), "ALLFAIL", task.getTestJob().getClientip(),task.getTestJob().getClientpath()); + operationlogservice.add(req, "TEST_CASEDETAIL", 0, sectorprojectsService.getid(projName), + "全部非成功自动化用例开始执行!" + " 结果:" + ms); + } else { + StringBuffer caseInfo = new StringBuffer(); + for (int i = 0; i < jsonarr.size(); i++) { + int id = Integer.valueOf(jsonarr.get(i).toString()); + TestCasedetail caseDetail = casedetailService.load(Integer.valueOf(id)); + String ocase = caseDetail.getCaseno() + "%" + caseDetail.getCaseversion(); + caseInfo.append(ocase).append("#"); + } + projName = task.getTestJob().getPlanproj(); + // 批量执行用例 + QuartzJob qj = new QuartzJob(); + ms = qj.toRunCaseBatch(projName, task.getId(), caseInfo.toString(), + task.getTestJob().getClientip(),task.getTestJob().getClientpath()); + + operationlogservice.add(req, "TEST_CASEDETAIL", 0, sectorprojectsService.getid(projName), + "自动化用例批量(非成功)开始执行!" + " 结果:" + ms); + } + } + } + + json.put("status", status); + json.put("ms", ms); + } + pw.print(json.toString()); + + } catch (Exception e) { + e.printStackTrace(); + } + + } + + @RequestMapping(value = "/getTastNameList.do") + public void getTastNameList(TestCasedetail caseDetail, HttpServletRequest req, HttpServletResponse rsp, + Model model) throws Exception + { + req.setCharacterEncoding("utf-8"); + rsp.setContentType("text/html;charset=utf-8"); + PrintWriter pw; + try + { + pw = rsp.getWriter(); + String startDate = req.getParameter("startDate"); + String endDate = req.getParameter("endDate"); + String projid = req.getParameter("projid"); + List tasks = tastExcuteService.findTastList(startDate, projid, endDate); + JSONArray array = JSONArray.fromObject(tasks); + pw.write(array.toString()); + } + catch (IOException e) + { + e.printStackTrace(); + } + } + + public static void main(String[] args) throws UnsupportedEncodingException + { + + } + +} diff --git a/src/main/java/luckyweb/seagull/spring/mvc/FlowCheckController.java b/src/main/java/luckyweb/seagull/spring/mvc/FlowCheckController.java index 9d12328..fb1a72c 100644 --- a/src/main/java/luckyweb/seagull/spring/mvc/FlowCheckController.java +++ b/src/main/java/luckyweb/seagull/spring/mvc/FlowCheckController.java @@ -1,1036 +1,1036 @@ -package luckyweb.seagull.spring.mvc; - -import java.io.BufferedReader; -import java.io.IOException; -import java.io.PrintWriter; -import java.text.DecimalFormat; -import java.text.SimpleDateFormat; -import java.util.Date; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import javax.validation.Valid; - -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.validation.BindingResult; -import org.springframework.validation.FieldError; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestMethod; - -import luckyweb.seagull.comm.QueueListener; -import luckyweb.seagull.spring.entity.Barchart4; -import luckyweb.seagull.spring.entity.FlowCheck; -import luckyweb.seagull.spring.entity.SectorProjects; -import luckyweb.seagull.spring.service.FlowCheckService; -import luckyweb.seagull.spring.service.FlowInfoService; -import luckyweb.seagull.spring.service.OperationLogService; -import luckyweb.seagull.spring.service.SectorProjectsService; -import luckyweb.seagull.spring.service.UserInfoService; -import luckyweb.seagull.util.StrLib; -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; - -@Controller -@RequestMapping("/flowCheck") -public class FlowCheckController { - - private int allPage; - private int pageSize = 20; - private int allRows; - private int page = 1; - private int offset; - - @Resource(name = "flowcheckService") - private FlowCheckService flowcheckservice; - - @Resource(name = "sectorprojectsService") - private SectorProjectsService sectorprojectsService; - - @Resource(name = "flowinfoService") - private FlowInfoService flowinfoService; - - @Resource(name = "operationlogService") - private OperationLogService operationlogservice; - - @Resource(name = "userinfoService") - private UserInfoService userinfoservice; - - /** - * - * - * @param tj - * @param model - * @return - * @throws Exception - */ - @RequestMapping(value = "/load.do") - public String load(HttpServletRequest req, Model model) throws Exception { - - try { - int projectid = 99; - - List prolist = QueueListener.qa_projlist; - model.addAttribute("projects", prolist); - model.addAttribute("projectid", projectid); - } catch (Exception e) { - e.printStackTrace(); - model.addAttribute("message", e.getMessage()); - model.addAttribute("url", "/flowCheck/load.do"); - return "error"; - } - return "/jsp/flowcheck/flowcheck"; - } - - @SuppressWarnings("unchecked") - @RequestMapping(value = "/list.do") - private void ajaxGetSellRecord(Integer limit, Integer offset, HttpServletRequest request, - HttpServletResponse response) throws NumberFormatException, Exception { - response.setCharacterEncoding("utf-8"); - PrintWriter pw = response.getWriter(); - String search = request.getParameter("search"); - String projectid = request.getParameter("projectid"); - String startDate = request.getParameter("startDate"); - String endDate = request.getParameter("endDate"); - FlowCheck flowcheck = new FlowCheck(); - if (null == offset && null == limit) { - offset = 0; - } - if (null == limit || limit == 0) { - limit = 10; - } - // 得到客户端传递的查询参数 - if (!StrLib.isEmpty(search)) { - flowcheck.setVersionnum(search); - } - // 得到客户端传递的查询参数 - if (!StrLib.isEmpty(projectid)&&!"99".equals(projectid)) { - flowcheck.setProjectid(Integer.valueOf(projectid)); - } - - if (!StrLib.isEmpty(startDate)) { - flowcheck.setCheckstartdate(startDate); - } - - if (!StrLib.isEmpty(endDate)) { - flowcheck.setCheckenddate(endDate); - } - List sssMap = flowcheckservice.findByPage(flowcheck, offset, limit); - JSONArray jsonArr = new JSONArray(); - for(int i=0;i phaselist = flowinfoService.listphaseinfo(); - model.addAttribute("phaselist", phaselist); - model.addAttribute("projectname", projectname); - model.addAttribute("projectid", projectid); - model.addAttribute("checkid", checkid); - model.addAttribute("versionnum", versionnum); - } catch (Exception e) { - e.printStackTrace(); - model.addAttribute("message", e.getMessage()); - model.addAttribute("url", "/flowCheck/load.do"); - return "error"; - } - return "/jsp/flowcheck/flowcheckinfo"; - } - - @SuppressWarnings("unchecked") - @RequestMapping(value = "/listinfo.do") - private void ajaxGetSellRecordinfo(Integer limit, Integer offset, HttpServletRequest request, - HttpServletResponse response) throws NumberFormatException, Exception { - response.setCharacterEncoding("utf-8"); - int projectid = Integer.valueOf(request.getParameter("projectid")); - int checkid = Integer.valueOf(request.getParameter("checkid")); - String versionnum = request.getParameter("versionnum"); - PrintWriter pw = response.getWriter(); - FlowCheck flowcheck = new FlowCheck(); - if (null == offset && null == limit) { - offset = 0; - } - if (null == limit || limit == 0) { - limit = 10; - } - - flowcheck.setCheckid(checkid); - flowcheck.setProjectid(projectid); - flowcheck.setVersionnum(versionnum); - List fclist = flowcheckservice.findByPageTable(flowcheck, offset,limit); - - //取信息表中的中文名,放到MAP,从页面通过key value取出 - List allphase = flowinfoService.listphaseallinfo(); - List allnode = flowinfoService.listnodeallinfo(); - List allentry = flowinfoService.listentryallinfo(); - - for(int i=0;i err=br.getFieldErrors(); - FieldError fe; - String field; - String errorMessage; - for (int i = 0; i < err.size(); i++) { - fe=err.get(i); - field=fe.getField();//得到那个字段验证出错 - errorMessage=fe.getDefaultMessage();//得到错误消息 - System.out.println("错误字段消息:"+field +" : "+errorMessage); - } - // 打印结果 - return retVal; - } - String message = ""; - - if(flowcheck.getProjectid()==0){ - message = "请选择项目!"; - model.addAttribute("message", message); - return retVal; - }else{ - if(!UserLoginController.oppidboolean(req, flowcheck.getProjectid())){ - SectorProjects sp=sectorprojectsService.loadob(flowcheck.getProjectid()); - model.addAttribute("message", "当前用户无权限添加项目【"+sp.getProjectname()+"】的流程检查信息,请联系管理员!"); - return retVal; - } - } - - if(flowcheck.getProjectphase().equals("0")){ - message = "请选择检查项目阶段!"; - model.addAttribute("message", message); - return retVal; - } - - if(flowcheck.getPhasenode().equals("0")){ - message = "请选择检查阶段节点!"; - model.addAttribute("message", message); - return retVal; - } - - if(flowcheck.getCheckentry().equals("0")){ - message = "请选择检查内容!"; - model.addAttribute("message", message); - return retVal; - } - - if(flowcheck.getCheckdate().equals("")){ - message = "请选择检查日期!"; - model.addAttribute("message", message); - return retVal; - } - - int checkid = flowcheckservice.getcheckid(flowcheck.getProjectid()); - - flowcheck.setCheckid(checkid+1); - flowcheck.setVersionnum(flowcheck.getVersionnum()); - flowcheck.setProjectphase(flowcheck.getProjectphase()); - flowcheck.setPhasenode(flowcheck.getPhasenode()); - flowcheck.setCheckentry(flowcheck.getCheckentry()); - flowcheck.setCheckresult(flowcheck.getCheckresult()); - flowcheck.setCheckdate(flowcheck.getCheckdate()); - flowcheck.setCheckdescriptions(flowcheck.getCheckdescriptions()); - flowcheck.setStateupdate(flowcheck.getStateupdate()); - flowcheck.setUpdatedate(flowcheck.getUpdatedate()); - flowcheck.setRemark(flowcheck.getRemark()); - SectorProjects p = new SectorProjects(); - p.setProjectid(flowcheck.getProjectid()); - flowcheck.setSectorProjects(p); - - int id = flowcheckservice.add(flowcheck); - String checkentry = flowinfoService.load(Integer.valueOf(flowcheck.getCheckentry())).getCheckentry(); - operationlogservice.add(req, "QA_FLOWCHECK", id, - flowcheck.getProjectid(),"流程检查信息添加成功(此次检查第一项)!检查结果:"+flowcheck.getCheckresult()+" 检查内容:"+checkentry); - - model.addAttribute("message", "添加成功"); - model.addAttribute("url", "/flowCheck/load.do"); - return retVal; - - }//添加数据 - - @SuppressWarnings("unchecked") - List phaselist = flowinfoService.listphaseinfo(); - model.addAttribute("phaselist", phaselist); - model.addAttribute("projects", QueueListener.qa_projlist); - - model.addAttribute("flowcheck", flowcheck); - return retVal; - - } - catch (Exception e) - { - model.addAttribute("message", e.getMessage()); - model.addAttribute("url", "/flowCheck/load.do"); - return "error"; - } - - } - - /** - * 版本修改 - * @param tj - * @param br - * @param model - * @param req - * @param rsp - * @return - * @throws Exception - * @Description: - */ - @RequestMapping(value = "/update.do") - public String update(@Valid @ModelAttribute("flowcheck") FlowCheck flowcheck, BindingResult br, Model model, - HttpServletRequest req, HttpServletResponse rsp) throws Exception - { - int id = Integer.valueOf(req.getParameter("id")); - - FlowCheck fc = flowcheckservice.load(id); - try - { - rsp.setContentType("text/html;charset=utf-8"); - req.setCharacterEncoding("utf-8"); - - if(!UserLoginController.permissionboolean(req, "fc_3")){ - model.addAttribute("flowcheck", new FlowCheck()); - model.addAttribute("url", "/flowCheck/projectchecklist.do?projectid="+fc.getSectorProjects().getProjectid()+"&checkid="+fc.getCheckid()+"&version="+fc.getVersionnum()); - model.addAttribute("message", "当前用户无权限修改项目检查信息,请联系管理员!"); - return "success"; - } - - String retVal = "/jsp/flowcheck/flowcheck_update"; - if (req.getMethod().equals("POST")) - { - if (br.hasErrors()) - { - List err=br.getFieldErrors(); - FieldError fe; - String field; - String errorMessage; - for (int i = 0; i < err.size(); i++) { - fe=err.get(i); - field=fe.getField();//得到那个字段验证出错 - errorMessage=fe.getDefaultMessage();//得到错误消息 - System.out.println("错误字段消息:"+field +" : "+errorMessage); - } - // 打印结果 - return retVal; - } - String message = ""; - - if(flowcheck.getProjectid()==0){ - message = "请选择项目!"; - model.addAttribute("message", message); - return retVal; - } - - if(flowcheck.getProjectphase().equals("0")){ - message = "请选择检查项目阶段!"; - model.addAttribute("message", message); - return retVal; - } - - if(flowcheck.getPhasenode().equals("0")){ - message = "请选择检查阶段节点!"; - model.addAttribute("message", message); - return retVal; - } - - if(flowcheck.getCheckentry().equals("0")){ - message = "请选择检查内容!"; - model.addAttribute("message", message); - return retVal; - } - - if(flowcheck.getCheckdate().equals("")){ - message = "请选择检查日期!"; - model.addAttribute("message", message); - return retVal; - } - - if(!flowcheck.getStateupdate().equals("0")&&flowcheck.getUpdatedate().equals("")){ - message = "如果你已经更新二次检查结果,请选择更新二次检查日期"; - model.addAttribute("message", message); - return retVal; - } - - flowcheck.setCheckid(fc.getCheckid()); - flowcheck.setVersionnum(fc.getVersionnum()); - flowcheck.setProjectphase(flowcheck.getProjectphase()); - flowcheck.setPhasenode(flowcheck.getPhasenode()); - flowcheck.setCheckentry(flowcheck.getCheckentry()); - flowcheck.setCheckresult(flowcheck.getCheckresult()); - flowcheck.setCheckdate(flowcheck.getCheckdate()); - flowcheck.setCheckdescriptions(flowcheck.getCheckdescriptions()); - - if(!flowcheck.getStateupdate().equals("0")&&!flowcheck.getUpdatedate().equals("")){ - flowcheck.setStateupdate(flowcheck.getStateupdate()); - flowcheck.setUpdatedate(flowcheck.getUpdatedate()); - }else{ - flowcheck.setStateupdate(null); - flowcheck.setUpdatedate(null); - } - - flowcheck.setRemark(flowcheck.getRemark()); - - SectorProjects p = new SectorProjects(); - p.setProjectid(fc.getSectorProjects().getProjectid()); - flowcheck.setSectorProjects(p); - - flowcheck.setId(id); - - flowcheckservice.modify(flowcheck); - String checkentry = flowinfoService.load(Integer.valueOf(flowcheck.getCheckentry())).getCheckentry(); - operationlogservice.add(req, "QA_FLOWCHECK", id, - fc.getSectorProjects().getProjectid(),"流程检查信息修改成功!检查结果:"+flowcheck.getCheckresult()+" 检查内容:"+checkentry); - - model.addAttribute("message", "修改成功"); - model.addAttribute("url", "/flowCheck/load.do"); - return retVal; - - }//添加修改数据 - - if(!UserLoginController.oppidboolean(req, fc.getSectorProjects().getProjectid())){ - SectorProjects sp=sectorprojectsService.loadob(fc.getSectorProjects().getProjectid()); - model.addAttribute("url", "/flowCheck/load.do"); - model.addAttribute("message", "当前用户无权限修改项目【"+sp.getProjectname()+"】的流程检查信息,请联系管理员!"); - return "error"; - } - - @SuppressWarnings("unchecked") - List phaselist = flowinfoService.listphaseinfo(); - @SuppressWarnings("unchecked") - List nodelist = flowinfoService.listnodeinfo(Integer.valueOf(fc.getCheckentry())); - @SuppressWarnings("unchecked") - List entrylist = flowinfoService.listentryinfo(Integer.valueOf(fc.getCheckentry())); - - model.addAttribute("phaselist", phaselist); - model.addAttribute("nodelist", nodelist); - model.addAttribute("entrylist", entrylist); - model.addAttribute("projects", QueueListener.qa_projlist); - - fc.setProjectid(fc.getSectorProjects().getProjectid()); - String projectphase=nodelist.get(0)[0].toString(); - String phasenode=entrylist.get(0)[0].toString(); - fc.setProjectphase(projectphase); - fc.setPhasenode(phasenode); - model.addAttribute("projectid", fc.getSectorProjects().getProjectid()); - model.addAttribute("checkid", fc.getCheckid()); - model.addAttribute("versionnum", fc.getVersionnum()); - model.addAttribute("flowcheck", fc); - return retVal; - - - } - catch (Exception e) - { - model.addAttribute("message", e.getMessage()); - model.addAttribute("url", "/flowCheck/load.do"); - return "error"; - } - - } - - /** - * 删除计划检查记录 - * - * @param id - * @param model - * @return - * @throws Exception - */ - @RequestMapping(value = "/delete.do") - public void delete(HttpServletRequest req, HttpServletResponse rsp) throws Exception { - try { - rsp.setContentType("text/html;charset=utf-8"); - req.setCharacterEncoding("utf-8"); - PrintWriter pw = rsp.getWriter(); - JSONObject json = new JSONObject(); - if (!UserLoginController.permissionboolean(req, "fc_2")) { - json.put("status", "fail"); - json.put("ms", "删除检查记录失败,权限不足,请联系管理员!"); - } else { - StringBuilder sb = new StringBuilder(); - try (BufferedReader reader = req.getReader();) { - char[] buff = new char[1024]; - int len; - while ((len = reader.read(buff)) != -1) { - sb.append(buff, 0, len); - } - } catch (IOException e) { - e.printStackTrace(); - } - JSONObject jsonObject = JSONObject.fromObject(sb.toString()); - JSONArray jsonarr = JSONArray.fromObject(jsonObject.getString("ids")); - - String status="fail"; - String ms="删除流程检查信息失败!"; - int suc=0; - int fail=0; - for (int i = 0; i < jsonarr.size(); i++) { - int id = Integer.valueOf(jsonarr.get(i).toString()); - FlowCheck fc = flowcheckservice.load(id); - - if(!UserLoginController.oppidboolean(req, fc.getSectorProjects().getProjectid())){ - fail++; - continue; - } - flowcheckservice.delete(id); - String checkentry = flowinfoService.load(Integer.valueOf(fc.getCheckentry())).getCheckentry(); - operationlogservice.add(req, "QA_FLOWCHECK", id, - fc.getSectorProjects().getProjectid(),"流程检查信息删除成功!检查结果:"+fc.getCheckresult()+" 检查内容:"+checkentry); - suc++; - } - - if(suc>0){ - status="success"; - ms="删除流程检查信息成功!"; - if(fail>0){ - status="success"; - ms="删除流程检查信息"+suc+"条成功!"+fail+"条因为无项目权限删除失败!"; - } - } - - json.put("status", status); - json.put("ms", ms); - } - pw.print(json.toString()); - - } catch (Exception e) { - e.printStackTrace(); - } - - } - - - /** - * 修改版本号 - * @param tj - * @param br - * @param model - * @param req - * @param rsp - * @return - * @throws Exception - * @Description: - */ - @RequestMapping(value = "/updateversion.do") - public void updateversion(HttpServletRequest req, HttpServletResponse rsp) throws Exception{ -/* String result="更新版本号成功!"; - try{ - if(!UserLoginController.permissionboolean(req, "fc_3")){ - result="当前用户无权限修改项目检查信息,请联系管理员!"; - } - String versionold = req.getParameter("versionold"); - String versionnew = req.getParameter("versionnew"); - int projectid = Integer.valueOf(req.getParameter("projectid")); - flowcheckservice.updateversion(projectid, versionold, versionnew); - }catch(Exception e){ - e.printStackTrace(); - result="更新版本号异常!"; - }finally{ - // 取集合 - rsp.setContentType("text/xml;charset=utf-8"); - JSONObject jsobjcet = new JSONObject(); - jsobjcet.put("result", result); - rsp.getWriter().write(jsobjcet.toString()); - }*/ - - // 更新实体 - JSONObject json = new JSONObject(); - try { - rsp.setContentType("text/html;charset=utf-8"); - req.setCharacterEncoding("utf-8"); - PrintWriter pw = rsp.getWriter(); - - if (!UserLoginController.permissionboolean(req, "fc_3")) { - json.put("status", "fail"); - json.put("ms", "编辑失败,权限不足,请联系管理员!"); - } else { - String versionold = req.getParameter("versionold"); - String versionnew = req.getParameter("versionnew"); - int projectid = Integer.valueOf(req.getParameter("projectid")); - if(!UserLoginController.oppidboolean(req, projectid)){ - json.put("status", "fail"); - json.put("ms", "编辑失败,项目权限不足,请联系管理员!"); - }else{ - flowcheckservice.updateversion(projectid, versionold, versionnew); - - json.put("status", "success"); - json.put("ms", "编辑版本号成功!"); - } - - } - pw.print(json.toString()); - } catch (Exception e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - } - - /** - * 三级联动查询 - * @param tj - * @param br - * @param model - * @param req - * @param rsp - * @return - * @throws Exception - * @Description: - */ - @RequestMapping(value = "/getcheckinfo.do") - public void getcheckinfo(HttpServletRequest req, HttpServletResponse rsp) throws Exception{ - int phaseId = Integer.valueOf(req.getParameter("phaseId")); - int nodeId = Integer.valueOf(req.getParameter("nodeId")); - - List list = null; - if(phaseId==0&&nodeId==0){ - list = flowinfoService.listphaseinfo(); - }else if(phaseId!=0&&nodeId==0){ - list = flowinfoService.listnodeinfo(phaseId); - }else if(phaseId!=0&&nodeId!=0){ - list = flowinfoService.listentryinfo(nodeId); - } - // 取集合 - rsp.setContentType("text/xml;charset=utf-8"); - JSONArray jsonArray = JSONArray.fromObject(list); - JSONObject jsobjcet = new JSONObject(); - jsobjcet.put("data", jsonArray); - - rsp.getWriter().write(jsobjcet.toString()); - } - - - /** - * - * HTML5 柱状图 - * @param model - * @param req - * @return - * @throws Exception - * @Description: - */ - @SuppressWarnings({ "rawtypes", "unchecked" }) - @RequestMapping(value = "/barchart_html5.do") - public String showallProject(HttpServletRequest req,Model model) throws Exception - { - String checkstartdate = req.getParameter("checkstartdate"); - String checkenddate = req.getParameter("checkenddate"); - - if(checkstartdate==null||checkstartdate.equals("")){ - checkstartdate = "0"; - } - if(checkenddate==null||checkenddate.equals("")){ - checkenddate = "9"; - } - - List ls = flowcheckservice.listdateper(checkstartdate, checkenddate); - - String[] columnname = {"检查通过数","检查未通过数"}; - - Barchart4[] data = new Barchart4[columnname.length]; - -/* Map pointMap = new HashMap(); - - Map innerptMap = new HashMap(); - innerptMap.put("type", "max"); - innerptMap.put("name", "最大值"); - - Map innerptMap1 = new HashMap(); - innerptMap1.put("type", "min"); - innerptMap1.put("name", "最小值"); - List datamapList = new ArrayList(); - datamapList.add(innerptMap); - datamapList.add(innerptMap1); - pointMap.put("data", datamapList); - - - Map lineMap = new HashMap(); - - Map innerliMap = new HashMap(); - innerliMap.put("type", "average"); - innerliMap.put("name", "平均值"); - List datamapList1 = new ArrayList(); - datamapList1.add(innerliMap); - lineMap.put("data", datamapList1);*/ - - Map itemStyleMap = new HashMap(); - Map normalMap = new HashMap(); - Map labelMap = new HashMap(); - labelMap.put("show", true); - labelMap.put("position", "insideRight"); - normalMap.put("label", labelMap); - itemStyleMap.put("normal", normalMap); - //获取数据 - for(int i=0;i sssMap = flowcheckservice.reportList(flowcheck, offset, pageSize); - for (int i = 0; i < sssMap.size(); i++) { - Object[] project = (Object[]) sectorprojectsService.load(Integer.valueOf(sssMap.get(i)[0].toString())); - sssMap.get(i)[sssMap.get(i).length - 2] = project[1].toString(); - if (Integer.valueOf(sssMap.get(i)[1].toString()) != 0 - && Integer.valueOf(sssMap.get(i)[2].toString()) != 0) { - sssMap.get(i)[sssMap.get(i).length - 1] = Double.valueOf(new DecimalFormat("#.00").format( - (Double.valueOf(sssMap.get(i)[2].toString()) / Double.valueOf(sssMap.get(i)[1].toString())) - * 100)); - } else { - sssMap.get(i)[sssMap.get(i).length - 1] = 0.00; - } - - } - model.addAttribute("reportlist", sssMap); - - } catch (Exception e) { - e.printStackTrace(); - model.addAttribute("message", e.getMessage()); - model.addAttribute("url", "/flowCheck/load.do"); - return "error"; - } - return "/jsp/flowcheck/flowcheck_report"; - } - - public static void main(String[] args) throws Exception { - // TODO Auto-generated method stub - - } - -} +package luckyweb.seagull.spring.mvc; + +import java.io.BufferedReader; +import java.io.IOException; +import java.io.PrintWriter; +import java.text.DecimalFormat; +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import javax.validation.Valid; + +import org.springframework.stereotype.Controller; +import org.springframework.ui.Model; +import org.springframework.validation.BindingResult; +import org.springframework.validation.FieldError; +import org.springframework.web.bind.annotation.ModelAttribute; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; + +import luckyweb.seagull.comm.QueueListener; +import luckyweb.seagull.spring.entity.Barchart4; +import luckyweb.seagull.spring.entity.FlowCheck; +import luckyweb.seagull.spring.entity.SectorProjects; +import luckyweb.seagull.spring.service.FlowCheckService; +import luckyweb.seagull.spring.service.FlowInfoService; +import luckyweb.seagull.spring.service.OperationLogService; +import luckyweb.seagull.spring.service.SectorProjectsService; +import luckyweb.seagull.spring.service.UserInfoService; +import luckyweb.seagull.util.StrLib; +import net.sf.json.JSONArray; +import net.sf.json.JSONObject; + +@Controller +@RequestMapping("/flowCheck") +public class FlowCheckController { + + private int allPage; + private int pageSize = 20; + private int allRows; + private int page = 1; + private int offset; + + @Resource(name = "flowcheckService") + private FlowCheckService flowcheckservice; + + @Resource(name = "sectorprojectsService") + private SectorProjectsService sectorprojectsService; + + @Resource(name = "flowinfoService") + private FlowInfoService flowinfoService; + + @Resource(name = "operationlogService") + private OperationLogService operationlogservice; + + @Resource(name = "userinfoService") + private UserInfoService userinfoservice; + + /** + * + * + * @param tj + * @param model + * @return + * @throws Exception + */ + @RequestMapping(value = "/load.do") + public String load(HttpServletRequest req, Model model) throws Exception { + + try { + int projectid = 99; + + List prolist = QueueListener.qa_projlist; + model.addAttribute("projects", prolist); + model.addAttribute("projectid", projectid); + } catch (Exception e) { + e.printStackTrace(); + model.addAttribute("message", e.getMessage()); + model.addAttribute("url", "/flowCheck/load.do"); + return "error"; + } + return "/jsp/flowcheck/flowcheck"; + } + + @SuppressWarnings("unchecked") + @RequestMapping(value = "/list.do") + private void ajaxGetSellRecord(Integer limit, Integer offset, HttpServletRequest request, + HttpServletResponse response) throws NumberFormatException, Exception { + response.setCharacterEncoding("utf-8"); + PrintWriter pw = response.getWriter(); + String search = request.getParameter("search"); + String projectid = request.getParameter("projectid"); + String startDate = request.getParameter("startDate"); + String endDate = request.getParameter("endDate"); + FlowCheck flowcheck = new FlowCheck(); + if (null == offset && null == limit) { + offset = 0; + } + if (null == limit || limit == 0) { + limit = 10; + } + // 得到客户端传递的查询参数 + if (!StrLib.isEmpty(search)) { + flowcheck.setVersionnum(search); + } + // 得到客户端传递的查询参数 + if (!StrLib.isEmpty(projectid)&&!"99".equals(projectid)) { + flowcheck.setProjectid(Integer.valueOf(projectid)); + } + + if (!StrLib.isEmpty(startDate)) { + flowcheck.setCheckstartdate(startDate); + } + + if (!StrLib.isEmpty(endDate)) { + flowcheck.setCheckenddate(endDate); + } + List sssMap = flowcheckservice.findByPage(flowcheck, offset, limit); + JSONArray jsonArr = new JSONArray(); + for(int i=0;i phaselist = flowinfoService.listphaseinfo(); + model.addAttribute("phaselist", phaselist); + model.addAttribute("projectname", projectname); + model.addAttribute("projectid", projectid); + model.addAttribute("checkid", checkid); + model.addAttribute("versionnum", versionnum); + } catch (Exception e) { + e.printStackTrace(); + model.addAttribute("message", e.getMessage()); + model.addAttribute("url", "/flowCheck/load.do"); + return "error"; + } + return "/jsp/flowcheck/flowcheckinfo"; + } + + @SuppressWarnings("unchecked") + @RequestMapping(value = "/listinfo.do") + private void ajaxGetSellRecordinfo(Integer limit, Integer offset, HttpServletRequest request, + HttpServletResponse response) throws NumberFormatException, Exception { + response.setCharacterEncoding("utf-8"); + int projectid = Integer.valueOf(request.getParameter("projectid")); + int checkid = Integer.valueOf(request.getParameter("checkid")); + String versionnum = request.getParameter("versionnum"); + PrintWriter pw = response.getWriter(); + FlowCheck flowcheck = new FlowCheck(); + if (null == offset && null == limit) { + offset = 0; + } + if (null == limit || limit == 0) { + limit = 10; + } + + flowcheck.setCheckid(checkid); + flowcheck.setProjectid(projectid); + flowcheck.setVersionnum(versionnum); + List fclist = flowcheckservice.findByPageTable(flowcheck, offset,limit); + + //取信息表中的中文名,放到MAP,从页面通过key value取出 + List allphase = flowinfoService.listphaseallinfo(); + List allnode = flowinfoService.listnodeallinfo(); + List allentry = flowinfoService.listentryallinfo(); + + for(int i=0;i err=br.getFieldErrors(); + FieldError fe; + String field; + String errorMessage; + for (int i = 0; i < err.size(); i++) { + fe=err.get(i); + field=fe.getField();//得到那个字段验证出错 + errorMessage=fe.getDefaultMessage();//得到错误消息 + System.out.println("错误字段消息:"+field +" : "+errorMessage); + } + // 打印结果 + return retVal; + } + String message = ""; + + if(flowcheck.getProjectid()==0){ + message = "请选择项目!"; + model.addAttribute("message", message); + return retVal; + }else{ + if(!UserLoginController.oppidboolean(req, flowcheck.getProjectid())){ + SectorProjects sp=sectorprojectsService.loadob(flowcheck.getProjectid()); + model.addAttribute("message", "当前用户无权限添加项目【"+sp.getProjectname()+"】的流程检查信息,请联系管理员!"); + return retVal; + } + } + + if(flowcheck.getProjectphase().equals("0")){ + message = "请选择检查项目阶段!"; + model.addAttribute("message", message); + return retVal; + } + + if(flowcheck.getPhasenode().equals("0")){ + message = "请选择检查阶段节点!"; + model.addAttribute("message", message); + return retVal; + } + + if(flowcheck.getCheckentry().equals("0")){ + message = "请选择检查内容!"; + model.addAttribute("message", message); + return retVal; + } + + if(flowcheck.getCheckdate().equals("")){ + message = "请选择检查日期!"; + model.addAttribute("message", message); + return retVal; + } + + int checkid = flowcheckservice.getcheckid(flowcheck.getProjectid()); + + flowcheck.setCheckid(checkid+1); + flowcheck.setVersionnum(flowcheck.getVersionnum()); + flowcheck.setProjectphase(flowcheck.getProjectphase()); + flowcheck.setPhasenode(flowcheck.getPhasenode()); + flowcheck.setCheckentry(flowcheck.getCheckentry()); + flowcheck.setCheckresult(flowcheck.getCheckresult()); + flowcheck.setCheckdate(flowcheck.getCheckdate()); + flowcheck.setCheckdescriptions(flowcheck.getCheckdescriptions()); + flowcheck.setStateupdate(flowcheck.getStateupdate()); + flowcheck.setUpdatedate(flowcheck.getUpdatedate()); + flowcheck.setRemark(flowcheck.getRemark()); + SectorProjects p = new SectorProjects(); + p.setProjectid(flowcheck.getProjectid()); + flowcheck.setSectorProjects(p); + + int id = flowcheckservice.add(flowcheck); + String checkentry = flowinfoService.load(Integer.valueOf(flowcheck.getCheckentry())).getCheckentry(); + operationlogservice.add(req, "QA_FLOWCHECK", id, + flowcheck.getProjectid(),"流程检查信息添加成功(此次检查第一项)!检查结果:"+flowcheck.getCheckresult()+" 检查内容:"+checkentry); + + model.addAttribute("message", "添加成功"); + model.addAttribute("url", "/flowCheck/load.do"); + return retVal; + + }//添加数据 + + @SuppressWarnings("unchecked") + List phaselist = flowinfoService.listphaseinfo(); + model.addAttribute("phaselist", phaselist); + model.addAttribute("projects", QueueListener.qa_projlist); + + model.addAttribute("flowcheck", flowcheck); + return retVal; + + } + catch (Exception e) + { + model.addAttribute("message", e.getMessage()); + model.addAttribute("url", "/flowCheck/load.do"); + return "error"; + } + + } + + /** + * 版本修改 + * @param tj + * @param br + * @param model + * @param req + * @param rsp + * @return + * @throws Exception + * @Description: + */ + @RequestMapping(value = "/update.do") + public String update(@Valid @ModelAttribute("flowcheck") FlowCheck flowcheck, BindingResult br, Model model, + HttpServletRequest req, HttpServletResponse rsp) throws Exception + { + int id = Integer.valueOf(req.getParameter("id")); + + FlowCheck fc = flowcheckservice.load(id); + try + { + rsp.setContentType("text/html;charset=utf-8"); + req.setCharacterEncoding("utf-8"); + + if(!UserLoginController.permissionboolean(req, "fc_3")){ + model.addAttribute("flowcheck", new FlowCheck()); + model.addAttribute("url", "/flowCheck/projectchecklist.do?projectid="+fc.getSectorProjects().getProjectid()+"&checkid="+fc.getCheckid()+"&version="+fc.getVersionnum()); + model.addAttribute("message", "当前用户无权限修改项目检查信息,请联系管理员!"); + return "success"; + } + + String retVal = "/jsp/flowcheck/flowcheck_update"; + if (req.getMethod().equals("POST")) + { + if (br.hasErrors()) + { + List err=br.getFieldErrors(); + FieldError fe; + String field; + String errorMessage; + for (int i = 0; i < err.size(); i++) { + fe=err.get(i); + field=fe.getField();//得到那个字段验证出错 + errorMessage=fe.getDefaultMessage();//得到错误消息 + System.out.println("错误字段消息:"+field +" : "+errorMessage); + } + // 打印结果 + return retVal; + } + String message = ""; + + if(flowcheck.getProjectid()==0){ + message = "请选择项目!"; + model.addAttribute("message", message); + return retVal; + } + + if(flowcheck.getProjectphase().equals("0")){ + message = "请选择检查项目阶段!"; + model.addAttribute("message", message); + return retVal; + } + + if(flowcheck.getPhasenode().equals("0")){ + message = "请选择检查阶段节点!"; + model.addAttribute("message", message); + return retVal; + } + + if(flowcheck.getCheckentry().equals("0")){ + message = "请选择检查内容!"; + model.addAttribute("message", message); + return retVal; + } + + if(flowcheck.getCheckdate().equals("")){ + message = "请选择检查日期!"; + model.addAttribute("message", message); + return retVal; + } + + if(!flowcheck.getStateupdate().equals("0")&&flowcheck.getUpdatedate().equals("")){ + message = "如果你已经更新二次检查结果,请选择更新二次检查日期"; + model.addAttribute("message", message); + return retVal; + } + + flowcheck.setCheckid(fc.getCheckid()); + flowcheck.setVersionnum(fc.getVersionnum()); + flowcheck.setProjectphase(flowcheck.getProjectphase()); + flowcheck.setPhasenode(flowcheck.getPhasenode()); + flowcheck.setCheckentry(flowcheck.getCheckentry()); + flowcheck.setCheckresult(flowcheck.getCheckresult()); + flowcheck.setCheckdate(flowcheck.getCheckdate()); + flowcheck.setCheckdescriptions(flowcheck.getCheckdescriptions()); + + if(!flowcheck.getStateupdate().equals("0")&&!flowcheck.getUpdatedate().equals("")){ + flowcheck.setStateupdate(flowcheck.getStateupdate()); + flowcheck.setUpdatedate(flowcheck.getUpdatedate()); + }else{ + flowcheck.setStateupdate(null); + flowcheck.setUpdatedate(null); + } + + flowcheck.setRemark(flowcheck.getRemark()); + + SectorProjects p = new SectorProjects(); + p.setProjectid(fc.getSectorProjects().getProjectid()); + flowcheck.setSectorProjects(p); + + flowcheck.setId(id); + + flowcheckservice.modify(flowcheck); + String checkentry = flowinfoService.load(Integer.valueOf(flowcheck.getCheckentry())).getCheckentry(); + operationlogservice.add(req, "QA_FLOWCHECK", id, + fc.getSectorProjects().getProjectid(),"流程检查信息修改成功!检查结果:"+flowcheck.getCheckresult()+" 检查内容:"+checkentry); + + model.addAttribute("message", "修改成功"); + model.addAttribute("url", "/flowCheck/load.do"); + return retVal; + + }//添加修改数据 + + if(!UserLoginController.oppidboolean(req, fc.getSectorProjects().getProjectid())){ + SectorProjects sp=sectorprojectsService.loadob(fc.getSectorProjects().getProjectid()); + model.addAttribute("url", "/flowCheck/load.do"); + model.addAttribute("message", "当前用户无权限修改项目【"+sp.getProjectname()+"】的流程检查信息,请联系管理员!"); + return "error"; + } + + @SuppressWarnings("unchecked") + List phaselist = flowinfoService.listphaseinfo(); + @SuppressWarnings("unchecked") + List nodelist = flowinfoService.listnodeinfo(Integer.valueOf(fc.getCheckentry())); + @SuppressWarnings("unchecked") + List entrylist = flowinfoService.listentryinfo(Integer.valueOf(fc.getCheckentry())); + + model.addAttribute("phaselist", phaselist); + model.addAttribute("nodelist", nodelist); + model.addAttribute("entrylist", entrylist); + model.addAttribute("projects", QueueListener.qa_projlist); + + fc.setProjectid(fc.getSectorProjects().getProjectid()); + String projectphase=nodelist.get(0)[0].toString(); + String phasenode=entrylist.get(0)[0].toString(); + fc.setProjectphase(projectphase); + fc.setPhasenode(phasenode); + model.addAttribute("projectid", fc.getSectorProjects().getProjectid()); + model.addAttribute("checkid", fc.getCheckid()); + model.addAttribute("versionnum", fc.getVersionnum()); + model.addAttribute("flowcheck", fc); + return retVal; + + + } + catch (Exception e) + { + model.addAttribute("message", e.getMessage()); + model.addAttribute("url", "/flowCheck/load.do"); + return "error"; + } + + } + + /** + * 删除计划检查记录 + * + * @param id + * @param model + * @return + * @throws Exception + */ + @RequestMapping(value = "/delete.do") + public void delete(HttpServletRequest req, HttpServletResponse rsp) throws Exception { + try { + rsp.setContentType("text/html;charset=utf-8"); + req.setCharacterEncoding("utf-8"); + PrintWriter pw = rsp.getWriter(); + JSONObject json = new JSONObject(); + if (!UserLoginController.permissionboolean(req, "fc_2")) { + json.put("status", "fail"); + json.put("ms", "删除检查记录失败,权限不足,请联系管理员!"); + } else { + StringBuilder sb = new StringBuilder(); + try (BufferedReader reader = req.getReader();) { + char[] buff = new char[1024]; + int len; + while ((len = reader.read(buff)) != -1) { + sb.append(buff, 0, len); + } + } catch (IOException e) { + e.printStackTrace(); + } + JSONObject jsonObject = JSONObject.fromObject(sb.toString()); + JSONArray jsonarr = JSONArray.fromObject(jsonObject.getString("ids")); + + String status="fail"; + String ms="删除流程检查信息失败!"; + int suc=0; + int fail=0; + for (int i = 0; i < jsonarr.size(); i++) { + int id = Integer.valueOf(jsonarr.get(i).toString()); + FlowCheck fc = flowcheckservice.load(id); + + if(!UserLoginController.oppidboolean(req, fc.getSectorProjects().getProjectid())){ + fail++; + continue; + } + flowcheckservice.delete(id); + String checkentry = flowinfoService.load(Integer.valueOf(fc.getCheckentry())).getCheckentry(); + operationlogservice.add(req, "QA_FLOWCHECK", id, + fc.getSectorProjects().getProjectid(),"流程检查信息删除成功!检查结果:"+fc.getCheckresult()+" 检查内容:"+checkentry); + suc++; + } + + if(suc>0){ + status="success"; + ms="删除流程检查信息成功!"; + if(fail>0){ + status="success"; + ms="删除流程检查信息"+suc+"条成功!"+fail+"条因为无项目权限删除失败!"; + } + } + + json.put("status", status); + json.put("ms", ms); + } + pw.print(json.toString()); + + } catch (Exception e) { + e.printStackTrace(); + } + + } + + + /** + * 修改版本号 + * @param tj + * @param br + * @param model + * @param req + * @param rsp + * @return + * @throws Exception + * @Description: + */ + @RequestMapping(value = "/updateversion.do") + public void updateversion(HttpServletRequest req, HttpServletResponse rsp) throws Exception{ +/* String result="更新版本号成功!"; + try{ + if(!UserLoginController.permissionboolean(req, "fc_3")){ + result="当前用户无权限修改项目检查信息,请联系管理员!"; + } + String versionold = req.getParameter("versionold"); + String versionnew = req.getParameter("versionnew"); + int projectid = Integer.valueOf(req.getParameter("projectid")); + flowcheckservice.updateversion(projectid, versionold, versionnew); + }catch(Exception e){ + e.printStackTrace(); + result="更新版本号异常!"; + }finally{ + // 取集合 + rsp.setContentType("text/xml;charset=utf-8"); + JSONObject jsobjcet = new JSONObject(); + jsobjcet.put("result", result); + rsp.getWriter().write(jsobjcet.toString()); + }*/ + + // 更新实体 + JSONObject json = new JSONObject(); + try { + rsp.setContentType("text/html;charset=utf-8"); + req.setCharacterEncoding("utf-8"); + PrintWriter pw = rsp.getWriter(); + + if (!UserLoginController.permissionboolean(req, "fc_3")) { + json.put("status", "fail"); + json.put("ms", "编辑失败,权限不足,请联系管理员!"); + } else { + String versionold = req.getParameter("versionold"); + String versionnew = req.getParameter("versionnew"); + int projectid = Integer.valueOf(req.getParameter("projectid")); + if(!UserLoginController.oppidboolean(req, projectid)){ + json.put("status", "fail"); + json.put("ms", "编辑失败,项目权限不足,请联系管理员!"); + }else{ + flowcheckservice.updateversion(projectid, versionold, versionnew); + + json.put("status", "success"); + json.put("ms", "编辑版本号成功!"); + } + + } + pw.print(json.toString()); + } catch (Exception e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + + /** + * 三级联动查询 + * @param tj + * @param br + * @param model + * @param req + * @param rsp + * @return + * @throws Exception + * @Description: + */ + @RequestMapping(value = "/getcheckinfo.do") + public void getcheckinfo(HttpServletRequest req, HttpServletResponse rsp) throws Exception{ + int phaseId = Integer.valueOf(req.getParameter("phaseId")); + int nodeId = Integer.valueOf(req.getParameter("nodeId")); + + List list = null; + if(phaseId==0&&nodeId==0){ + list = flowinfoService.listphaseinfo(); + }else if(phaseId!=0&&nodeId==0){ + list = flowinfoService.listnodeinfo(phaseId); + }else if(phaseId!=0&&nodeId!=0){ + list = flowinfoService.listentryinfo(nodeId); + } + // 取集合 + rsp.setContentType("text/xml;charset=utf-8"); + JSONArray jsonArray = JSONArray.fromObject(list); + JSONObject jsobjcet = new JSONObject(); + jsobjcet.put("data", jsonArray); + + rsp.getWriter().write(jsobjcet.toString()); + } + + + /** + * + * HTML5 柱状图 + * @param model + * @param req + * @return + * @throws Exception + * @Description: + */ + @SuppressWarnings({ "rawtypes", "unchecked" }) + @RequestMapping(value = "/barchart_html5.do") + public String showallProject(HttpServletRequest req,Model model) throws Exception + { + String checkstartdate = req.getParameter("checkstartdate"); + String checkenddate = req.getParameter("checkenddate"); + + if(checkstartdate==null||checkstartdate.equals("")){ + checkstartdate = "0"; + } + if(checkenddate==null||checkenddate.equals("")){ + checkenddate = "9"; + } + + List ls = flowcheckservice.listdateper(checkstartdate, checkenddate); + + String[] columnname = {"检查通过数","检查未通过数"}; + + Barchart4[] data = new Barchart4[columnname.length]; + +/* Map pointMap = new HashMap(); + + Map innerptMap = new HashMap(); + innerptMap.put("type", "max"); + innerptMap.put("name", "最大值"); + + Map innerptMap1 = new HashMap(); + innerptMap1.put("type", "min"); + innerptMap1.put("name", "最小值"); + List datamapList = new ArrayList(); + datamapList.add(innerptMap); + datamapList.add(innerptMap1); + pointMap.put("data", datamapList); + + + Map lineMap = new HashMap(); + + Map innerliMap = new HashMap(); + innerliMap.put("type", "average"); + innerliMap.put("name", "平均值"); + List datamapList1 = new ArrayList(); + datamapList1.add(innerliMap); + lineMap.put("data", datamapList1);*/ + + Map itemStyleMap = new HashMap(); + Map normalMap = new HashMap(); + Map labelMap = new HashMap(); + labelMap.put("show", true); + labelMap.put("position", "insideRight"); + normalMap.put("label", labelMap); + itemStyleMap.put("normal", normalMap); + //获取数据 + for(int i=0;i sssMap = flowcheckservice.reportList(flowcheck, offset, pageSize); + for (int i = 0; i < sssMap.size(); i++) { + Object[] project = (Object[]) sectorprojectsService.load(Integer.valueOf(sssMap.get(i)[0].toString())); + sssMap.get(i)[sssMap.get(i).length - 2] = project[1].toString(); + if (Integer.valueOf(sssMap.get(i)[1].toString()) != 0 + && Integer.valueOf(sssMap.get(i)[2].toString()) != 0) { + sssMap.get(i)[sssMap.get(i).length - 1] = Double.valueOf(new DecimalFormat("#.00").format( + (Double.valueOf(sssMap.get(i)[2].toString()) / Double.valueOf(sssMap.get(i)[1].toString())) + * 100)); + } else { + sssMap.get(i)[sssMap.get(i).length - 1] = 0.00; + } + + } + model.addAttribute("reportlist", sssMap); + + } catch (Exception e) { + e.printStackTrace(); + model.addAttribute("message", e.getMessage()); + model.addAttribute("url", "/flowCheck/load.do"); + return "error"; + } + return "/jsp/flowcheck/flowcheck_report"; + } + + public static void main(String[] args) throws Exception { + // TODO Auto-generated method stub + + } + +} diff --git a/src/main/java/luckyweb/seagull/spring/mvc/LogdetailController.java b/src/main/java/luckyweb/seagull/spring/mvc/LogdetailController.java index 76c0b52..c563e49 100644 --- a/src/main/java/luckyweb/seagull/spring/mvc/LogdetailController.java +++ b/src/main/java/luckyweb/seagull/spring/mvc/LogdetailController.java @@ -1,234 +1,234 @@ -package luckyweb.seagull.spring.mvc; - -import java.io.BufferedOutputStream; -import java.io.BufferedReader; -import java.io.File; -import java.io.FileInputStream; -import java.io.FileNotFoundException; -import java.io.FileOutputStream; -import java.io.IOException; -import java.io.OutputStream; -import java.io.PrintWriter; -import java.rmi.Naming; -import java.text.SimpleDateFormat; -import java.util.Date; -import java.util.List; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.RequestMapping; - -import luckyweb.seagull.spring.entity.ProjectCase; -import luckyweb.seagull.spring.entity.ProjectCasesteps; -import luckyweb.seagull.spring.entity.TestCasedetail; -import luckyweb.seagull.spring.entity.TestLogdetail; -import luckyweb.seagull.spring.entity.TestTaskexcute; -import luckyweb.seagull.spring.service.CaseDetailService; -import luckyweb.seagull.spring.service.LogDetailService; -import luckyweb.seagull.spring.service.ProjectCaseService; -import luckyweb.seagull.spring.service.ProjectCasestepsService; -import luckyweb.seagull.spring.service.TestJobsService; -import luckyweb.seagull.spring.service.TestTastExcuteService; -import luckyweb.seagull.util.StrLib; -import net.sf.json.JSONObject; -import rmi.service.RunService; - -@Controller -@RequestMapping("/logDetail") -public class LogdetailController -{ - - @Resource(name = "logdetailService") - private LogDetailService logdetailService; - - @Resource(name = "casedetailService") - private CaseDetailService casedetailService; - - @Resource(name = "tastExcuteService") - private TestTastExcuteService tastExcuteService; - - @Resource(name = "testJobsService") - private TestJobsService testJobsService; - - @Resource(name = "projectCaseService") - private ProjectCaseService projectcaseservice; - - @Resource(name = "projectCasestepsService") - private ProjectCasestepsService casestepsservice; - - @SuppressWarnings({ "unused", "unchecked" }) - @RequestMapping(value = "/list.do") - private void ajaxGetSellRecord(Integer limit, Integer offset, HttpServletRequest request, - HttpServletResponse response) throws IOException { - response.setCharacterEncoding("utf-8"); - PrintWriter pw = response.getWriter(); - String caseId = request.getParameter("caseId"); - TestLogdetail logDetail = new TestLogdetail(); - // 得到客户端传递的查询参数 - if (!StrLib.isEmpty(caseId)) { - logDetail.setCaseid(Integer.valueOf(caseId)); - } - - List loglist = logdetailService.list(logDetail); - for(int i=0;i steps= casestepsservice.getSteps(pc.getId()); - - String testresult=tld.getDetail().substring(tld.getDetail().lastIndexOf("测试结果:")+5); - for(ProjectCasesteps step:steps){ - if(tld.getStep().equals(String.valueOf(step.getStepnum()))){ - if (null != req.getSession().getAttribute("usercode") - && null != req.getSession().getAttribute("username")) { - String usercode = req.getSession().getAttribute("usercode").toString(); - step.setOperationer(usercode); - pc.setOperationer(usercode); - } - Date currentTime = new Date(); - SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); - String time = formatter.format(currentTime); - - step.setTime(time); - step.setExpectedresult(testresult); - - pc.setTime(time); - - casestepsservice.modify(step); - projectcaseservice.modify(pc); - status="success"; - ms="更新用例【"+pc.getSign()+"】第【"+step.getStepnum()+"】步预期结果成功!"; - break; - } - } - } - } - - json.put("status", status); - json.put("ms", ms); - } - pw.print(json.toString()); - - } catch (Exception e) { - e.printStackTrace(); - } - - } - -} +package luckyweb.seagull.spring.mvc; + +import java.io.BufferedOutputStream; +import java.io.BufferedReader; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.OutputStream; +import java.io.PrintWriter; +import java.rmi.Naming; +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.List; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.RequestMapping; + +import luckyweb.seagull.spring.entity.ProjectCase; +import luckyweb.seagull.spring.entity.ProjectCasesteps; +import luckyweb.seagull.spring.entity.TestCasedetail; +import luckyweb.seagull.spring.entity.TestLogdetail; +import luckyweb.seagull.spring.entity.TestTaskexcute; +import luckyweb.seagull.spring.service.CaseDetailService; +import luckyweb.seagull.spring.service.LogDetailService; +import luckyweb.seagull.spring.service.ProjectCaseService; +import luckyweb.seagull.spring.service.ProjectCasestepsService; +import luckyweb.seagull.spring.service.TestJobsService; +import luckyweb.seagull.spring.service.TestTastExcuteService; +import luckyweb.seagull.util.StrLib; +import net.sf.json.JSONObject; +import rmi.service.RunService; + +@Controller +@RequestMapping("/logDetail") +public class LogdetailController +{ + + @Resource(name = "logdetailService") + private LogDetailService logdetailService; + + @Resource(name = "casedetailService") + private CaseDetailService casedetailService; + + @Resource(name = "tastExcuteService") + private TestTastExcuteService tastExcuteService; + + @Resource(name = "testJobsService") + private TestJobsService testJobsService; + + @Resource(name = "projectCaseService") + private ProjectCaseService projectcaseservice; + + @Resource(name = "projectCasestepsService") + private ProjectCasestepsService casestepsservice; + + @SuppressWarnings({ "unused", "unchecked" }) + @RequestMapping(value = "/list.do") + private void ajaxGetSellRecord(Integer limit, Integer offset, HttpServletRequest request, + HttpServletResponse response) throws IOException { + response.setCharacterEncoding("utf-8"); + PrintWriter pw = response.getWriter(); + String caseId = request.getParameter("caseId"); + TestLogdetail logDetail = new TestLogdetail(); + // 得到客户端传递的查询参数 + if (!StrLib.isEmpty(caseId)) { + logDetail.setCaseid(Integer.valueOf(caseId)); + } + + List loglist = logdetailService.list(logDetail); + for(int i=0;i steps= casestepsservice.getSteps(pc.getId()); + + String testresult=tld.getDetail().substring(tld.getDetail().lastIndexOf("测试结果:")+5); + for(ProjectCasesteps step:steps){ + if(tld.getStep().equals(String.valueOf(step.getStepnum()))){ + if (null != req.getSession().getAttribute("usercode") + && null != req.getSession().getAttribute("username")) { + String usercode = req.getSession().getAttribute("usercode").toString(); + step.setOperationer(usercode); + pc.setOperationer(usercode); + } + Date currentTime = new Date(); + SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + String time = formatter.format(currentTime); + + step.setTime(time); + step.setExpectedresult(testresult); + + pc.setTime(time); + + casestepsservice.modify(step); + projectcaseservice.modify(pc); + status="success"; + ms="更新用例【"+pc.getSign()+"】第【"+step.getStepnum()+"】步预期结果成功!"; + break; + } + } + } + } + + json.put("status", status); + json.put("ms", ms); + } + pw.print(json.toString()); + + } catch (Exception e) { + e.printStackTrace(); + } + + } + +} diff --git a/src/main/java/luckyweb/seagull/spring/mvc/OperationLogController.java b/src/main/java/luckyweb/seagull/spring/mvc/OperationLogController.java index 9f41f16..5ed32e1 100644 --- a/src/main/java/luckyweb/seagull/spring/mvc/OperationLogController.java +++ b/src/main/java/luckyweb/seagull/spring/mvc/OperationLogController.java @@ -1,121 +1,121 @@ -package luckyweb.seagull.spring.mvc; - -import java.io.IOException; -import java.io.PrintWriter; -import java.util.List; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.RequestMapping; - -import luckyweb.seagull.comm.QueueListener; -import luckyweb.seagull.spring.entity.OperationLog; -import luckyweb.seagull.spring.entity.SectorProjects; -import luckyweb.seagull.spring.service.OperationLogService; -import luckyweb.seagull.spring.service.SectorProjectsService; -import luckyweb.seagull.util.DateLib; -import luckyweb.seagull.util.StrLib; -import net.sf.json.JSONObject; - - -@Controller -@RequestMapping("/operationLog") -public class OperationLogController { - - @Resource(name = "operationlogService") - private OperationLogService operationlogservice; - - @Resource(name = "sectorprojectsService") - private SectorProjectsService sectorprojectsService; - - /** - * - * - * @param tj - * @param model - * @return - * @throws Exception - */ - @RequestMapping(value = "/load.do") - public String load(HttpServletRequest req, Model model) throws Exception { - try { - List prolist=sectorprojectsService.getAllProject(); - for(int i=0;i loglist = operationlogservice.findByPage(oplog, offset, limit); - // 转换成json字符串 - String RecordJson = StrLib.listToJson(loglist); - // 得到总记录数 - int total = operationlogservice.findRows(oplog); - // 需要返回的数据有总记录数和行数据 - JSONObject json = new JSONObject(); - json.put("total", total); - json.put("rows", RecordJson); - pw.print(json.toString()); - } - - public static void main(String[] args) throws Exception { - // TODO Auto-generated method stub - } - -} +package luckyweb.seagull.spring.mvc; + +import java.io.IOException; +import java.io.PrintWriter; +import java.util.List; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.springframework.stereotype.Controller; +import org.springframework.ui.Model; +import org.springframework.web.bind.annotation.RequestMapping; + +import luckyweb.seagull.comm.QueueListener; +import luckyweb.seagull.spring.entity.OperationLog; +import luckyweb.seagull.spring.entity.SectorProjects; +import luckyweb.seagull.spring.service.OperationLogService; +import luckyweb.seagull.spring.service.SectorProjectsService; +import luckyweb.seagull.util.DateLib; +import luckyweb.seagull.util.StrLib; +import net.sf.json.JSONObject; + + +@Controller +@RequestMapping("/operationLog") +public class OperationLogController { + + @Resource(name = "operationlogService") + private OperationLogService operationlogservice; + + @Resource(name = "sectorprojectsService") + private SectorProjectsService sectorprojectsService; + + /** + * + * + * @param tj + * @param model + * @return + * @throws Exception + */ + @RequestMapping(value = "/load.do") + public String load(HttpServletRequest req, Model model) throws Exception { + try { + List prolist=sectorprojectsService.getAllProject(); + for(int i=0;i loglist = operationlogservice.findByPage(oplog, offset, limit); + // 转换成json字符串 + String RecordJson = StrLib.listToJson(loglist); + // 得到总记录数 + int total = operationlogservice.findRows(oplog); + // 需要返回的数据有总记录数和行数据 + JSONObject json = new JSONObject(); + json.put("total", total); + json.put("rows", RecordJson); + pw.print(json.toString()); + } + + public static void main(String[] args) throws Exception { + // TODO Auto-generated method stub + } + +} diff --git a/src/main/java/luckyweb/seagull/spring/mvc/PlanFlowCheckController.java b/src/main/java/luckyweb/seagull/spring/mvc/PlanFlowCheckController.java index 6623b52..c5b41a1 100644 --- a/src/main/java/luckyweb/seagull/spring/mvc/PlanFlowCheckController.java +++ b/src/main/java/luckyweb/seagull/spring/mvc/PlanFlowCheckController.java @@ -1,635 +1,635 @@ -package luckyweb.seagull.spring.mvc; - -import java.io.BufferedReader; -import java.io.IOException; -import java.io.PrintWriter; -import java.util.ArrayList; -import java.util.List; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import javax.validation.Valid; - -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.validation.BindingResult; -import org.springframework.validation.FieldError; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; - -import luckyweb.seagull.comm.QueueListener; -import luckyweb.seagull.spring.entity.FlowCheck; -import luckyweb.seagull.spring.entity.FlowInfo; -import luckyweb.seagull.spring.entity.PlanFlowCheck; -import luckyweb.seagull.spring.entity.SectorProjects; -import luckyweb.seagull.spring.service.FlowCheckService; -import luckyweb.seagull.spring.service.FlowInfoService; -import luckyweb.seagull.spring.service.OperationLogService; -import luckyweb.seagull.spring.service.PlanFlowCheckService; -import luckyweb.seagull.util.StrLib; -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; - - -@Controller -@RequestMapping("/planflowCheck") -public class PlanFlowCheckController { - - - - @Resource(name = "planflowcheckService") - private PlanFlowCheckService planflowcheckservice; - - @Resource(name = "flowinfoService") - private FlowInfoService flowinfoService; - - public PlanFlowCheckService getPlanFlowCheckService() { - return planflowcheckservice; - } - - @Resource(name = "operationlogService") - private OperationLogService operationlogservice; - - - @Resource(name = "flowcheckService") - private FlowCheckService flowcheckservice; - - /** - * - * - * @param tj - * @param model - * @return - * @throws Exception - */ - @RequestMapping(value = "/load.do") - public String load(HttpServletRequest req) throws Exception { - return "/jsp/flowcheck/planflowcheck"; - } - - @SuppressWarnings("unchecked") - @RequestMapping(value = "/list.do") - private void ajaxGetSellRecord(Integer limit, Integer offset, HttpServletRequest request, - HttpServletResponse response) throws NumberFormatException, Exception { - response.setCharacterEncoding("utf-8"); - PrintWriter pw = response.getWriter(); - String projectid = request.getParameter("projectid"); - PlanFlowCheck pfcheck = new PlanFlowCheck(); - pfcheck.setStatus(1); - if (null == offset && null == limit) { - offset = 0; - } - if (null == limit || limit == 0) { - limit = 10; - } - - // 得到客户端传递的查询参数 - if (!StrLib.isEmpty(projectid)&&!"99".equals(projectid)) { - pfcheck.setProjectid(Integer.valueOf(projectid)); - } - - List pfclist = planflowcheckservice.findByPage(pfcheck, offset, - limit); - - for(int i=0;i err=br.getFieldErrors(); - FieldError fe; - String field; - String errorMessage; - for (int i = 0; i < err.size(); i++) { - fe=err.get(i); - field=fe.getField();//得到那个字段验证出错 - errorMessage=fe.getDefaultMessage();//得到错误消息 - System.out.println("错误字段消息:"+field +" : "+errorMessage); - } - // 打印结果 - @SuppressWarnings("unchecked") - List phaselist = flowinfoService.listphaseinfo(); - model.addAttribute("phaselist", phaselist); - model.addAttribute("projects", QueueListener.qa_projlist); - model.addAttribute("planflowcheck", planflowcheck); - return retVal; - } - String message = ""; - - if(planflowcheck.getProjectid()==0){ - message = "请选择项目!"; - model.addAttribute("message", message); - @SuppressWarnings("unchecked") - List phaselist = flowinfoService.listphaseinfo(); - model.addAttribute("phaselist", phaselist); - model.addAttribute("projects", QueueListener.qa_projlist); - model.addAttribute("planflowcheck", planflowcheck); - return retVal; - }else{ - if(!UserLoginController.oppidboolean(req, planflowcheck.getProjectid())){ - @SuppressWarnings("unchecked") - List phaselist = flowinfoService.listphaseinfo(); - model.addAttribute("phaselist", phaselist); - model.addAttribute("projects", QueueListener.qa_projlist); - model.addAttribute("planflowcheck", planflowcheck); - model.addAttribute("message", "当前用户无权限添加此项目流程计划检查信息,请联系管理员!"); - return retVal; - } - } - - if(planflowcheck.getCheckentryid().equals("0")){ - message = "请选择检查内容!"; - model.addAttribute("message", message); - @SuppressWarnings("unchecked") - List phaselist = flowinfoService.listphaseinfo(); - model.addAttribute("phaselist", phaselist); - model.addAttribute("projects", QueueListener.qa_projlist); - model.addAttribute("planflowcheck", planflowcheck); - return retVal; - } - - if(planflowcheck.getPlandate().equals("")){ - message = "请选择计划检查日期!"; - model.addAttribute("message", message); - @SuppressWarnings("unchecked") - List phaselist = flowinfoService.listphaseinfo(); - model.addAttribute("phaselist", phaselist); - model.addAttribute("projects", QueueListener.qa_projlist); - model.addAttribute("planflowcheck", planflowcheck); - return retVal; - } - - planflowcheck.setVersionnum(planflowcheck.getVersionnum()); - planflowcheck.setCheckentryid(planflowcheck.getCheckentryid()); - planflowcheck.setPlandate(planflowcheck.getPlandate()); - planflowcheck.setStatus(1); - SectorProjects p = new SectorProjects(); - p.setProjectid(planflowcheck.getProjectid()); - planflowcheck.setSectorProjects(p); - - int id = planflowcheckservice.add(planflowcheck); - String checkentry = flowinfoService.load(Integer.valueOf(planflowcheck.getCheckentryid())).getCheckentry(); - operationlogservice.add(req, "QA_PLANFLOWCHECK", id, - planflowcheck.getProjectid(),"流程检查计划添加成功!计划日期:"+planflowcheck.getPlandate()+" 检查内容:"+checkentry); - - model.addAttribute("message", "添加成功"); - @SuppressWarnings("unchecked") - List phaselist = flowinfoService.listphaseinfo(); - model.addAttribute("phaselist", phaselist); - model.addAttribute("projects", QueueListener.qa_projlist); - model.addAttribute("planflowcheck", planflowcheck); - return retVal; - - }//添加数据 - - @SuppressWarnings("unchecked") - List phaselist = flowinfoService.listphaseinfo(); - model.addAttribute("phaselist", phaselist); - model.addAttribute("projects", QueueListener.qa_projlist); - model.addAttribute("planflowcheck", planflowcheck); - return retVal; - - } - catch (Exception e) - { - model.addAttribute("message", e.getMessage()); - model.addAttribute("url", "/planflowCheck/load.do"); - return "error"; - } - - } - - /** - * 检查计划修改 - * @param tj - * @param br - * @param model - * @param req - * @param rsp - * @return - * @throws Exception - * @Description: - */ - @RequestMapping(value = "/update.do") - public String update(@Valid @ModelAttribute("planflowcheck") PlanFlowCheck planflowcheck, BindingResult br, Model model, - HttpServletRequest req, HttpServletResponse rsp) throws Exception - { - - try - { - rsp.setContentType("text/html;charset=utf-8"); - req.setCharacterEncoding("utf-8"); - - int id = Integer.valueOf(req.getParameter("id")); - PlanFlowCheck pfc = planflowcheckservice.load(id); - if(!UserLoginController.permissionboolean(req, "pfc_3")){ - model.addAttribute("planflowcheck", new PlanFlowCheck()); - model.addAttribute("url", "load.do"); - model.addAttribute("message", "当前用户无权修改项目检查计划,请联系管理员!"); - return "success"; - } - - String retVal = "/jsp/flowcheck/planflowcheck_update"; - if (req.getMethod().equals("POST")) - { - if (br.hasErrors()) - { - List err=br.getFieldErrors(); - FieldError fe; - String field; - String errorMessage; - for (int i = 0; i < err.size(); i++) { - fe=err.get(i); - field=fe.getField();//得到那个字段验证出错 - errorMessage=fe.getDefaultMessage();//得到错误消息 - System.out.println("错误字段消息:"+field +" : "+errorMessage); - } - // 打印结果 - return retVal; - } - String message = ""; - - if(planflowcheck.getProjectid()==0){ - message = "请选择项目!"; - model.addAttribute("message", message); - return retVal; - } - - if(planflowcheck.getCheckentryid().equals("0")){ - message = "请选择检查内容!"; - model.addAttribute("message", message); - return retVal; - } - - if(planflowcheck.getPlandate().equals("")){ - message = "请选择计划检查日期!"; - model.addAttribute("message", message); - return retVal; - } - - planflowcheck.setVersionnum(planflowcheck.getVersionnum()); - planflowcheck.setCheckentryid(planflowcheck.getCheckentryid()); - planflowcheck.setPlandate(planflowcheck.getPlandate()); - planflowcheck.setStatus(1); - SectorProjects p = new SectorProjects(); - p.setProjectid(planflowcheck.getProjectid()); - planflowcheck.setSectorProjects(p); - - planflowcheckservice.modify(planflowcheck); - String checkentry = flowinfoService.load(Integer.valueOf(planflowcheck.getCheckentryid())).getCheckentry(); - operationlogservice.add(req, "QA_PLANFLOWCHECK", id, - planflowcheck.getProjectid(),"流程检查计划修改成功!计划日期:"+planflowcheck.getPlandate()+" 检查内容:"+checkentry); - - model.addAttribute("message", "修改成功"); - model.addAttribute("url", "/planflowCheck/load.do"); - return retVal; - - }//添加数据 - - if(!UserLoginController.oppidboolean(req, pfc.getSectorProjects().getProjectid())){ - model.addAttribute("url", "/planflowCheck/load.do"); - model.addAttribute("message", "当前用户无权限修改此项目的流程检查计划,请联系管理员!"); - return "error"; - } - - @SuppressWarnings("unchecked") - List phaselist = flowinfoService.listphaseinfo(); - @SuppressWarnings("unchecked") - List nodelist = flowinfoService.listnodeinfo(Integer.valueOf(pfc.getCheckentryid())); - @SuppressWarnings("unchecked") - List entrylist = flowinfoService.listentryinfo(Integer.valueOf(pfc.getCheckentryid())); - - model.addAttribute("phaselist", phaselist); - model.addAttribute("nodelist", nodelist); - model.addAttribute("entrylist", entrylist); - - pfc.setProjectid(pfc.getSectorProjects().getProjectid()); - String projectphase=nodelist.get(0)[0].toString(); - String phasenode=entrylist.get(0)[0].toString(); - pfc.setCheckphase(projectphase);; - pfc.setChecknode(phasenode); - - model.addAttribute("projects", QueueListener.qa_projlist); - model.addAttribute("planflowcheck", pfc); - return retVal; - - } - catch (Exception e) - { - model.addAttribute("message", e.getMessage()); - model.addAttribute("url", "/planflowCheck/load.do"); - return "error"; - } - - } - - /** - * 删除计划检查记录 - * - * @param id - * @param model - * @return - * @throws Exception - */ - @RequestMapping(value = "/delete.do") - public void delete(HttpServletRequest req, HttpServletResponse rsp) throws Exception { - try { - rsp.setContentType("text/html;charset=utf-8"); - req.setCharacterEncoding("utf-8"); - PrintWriter pw = rsp.getWriter(); - JSONObject json = new JSONObject(); - if (!UserLoginController.permissionboolean(req, "pfc_2")) { - json.put("status", "fail"); - json.put("ms", "删除检查计划失败,权限不足,请联系管理员!"); - } else { - StringBuilder sb = new StringBuilder(); - try (BufferedReader reader = req.getReader();) { - char[] buff = new char[1024]; - int len; - while ((len = reader.read(buff)) != -1) { - sb.append(buff, 0, len); - } - } catch (IOException e) { - e.printStackTrace(); - } - JSONObject jsonObject = JSONObject.fromObject(sb.toString()); - JSONArray jsonarr = JSONArray.fromObject(jsonObject.getString("ids")); - String status="fail"; - String ms="删除检查计划失败!"; - int suc=0; - int fail=0; - for (int i = 0; i < jsonarr.size(); i++) { - int id = Integer.valueOf(jsonarr.get(i).toString()); - PlanFlowCheck pfc = planflowcheckservice.load(id); - - if(!UserLoginController.oppidboolean(req, pfc.getSectorProjects().getProjectid())){ - fail++; - continue; - } - planflowcheckservice.delete(id); - String checkentry = flowinfoService.load(Integer.valueOf(pfc.getCheckentryid())).getCheckentry(); - operationlogservice.add(req, "QA_PLANFLOWCHECK", id, - pfc.getSectorProjects().getProjectid(),"流程检查计划删除成功!计划日期:"+pfc.getPlandate()+" 检查内容:"+checkentry); - suc++; - } - if(suc>0){ - status="success"; - ms="删除检查计划成功!"; - if(fail>0){ - status="success"; - ms="删除检查计划"+suc+"条成功!"+fail+"条因为无项目权限删除失败!"; - } - } - - json.put("status", status); - json.put("ms", ms); - } - pw.print(json.toString()); - - } catch (Exception e) { - e.printStackTrace(); - } - - } - - - /** - * 检查计划转检查记录 - * @param tj - * @param br - * @param model - * @param req - * @param rsp - * @return - * @throws Exception - * @Description: - */ - @RequestMapping(value = "/tocheck.do") - public String tocheck(@Valid @ModelAttribute("flowcheck") FlowCheck flowcheck,BindingResult br, Model model,HttpServletRequest req, HttpServletResponse rsp) throws Exception - { - rsp.setContentType("text/html;charset=utf-8"); - req.setCharacterEncoding("utf-8"); - - if(!UserLoginController.permissionboolean(req, "fc_tocheck")){ - model.addAttribute("flowcheck", new FlowCheck()); - model.addAttribute("url", "load.do"); - model.addAttribute("message", "当前用户无权限把计划转成检查结果,请联系管理员!"); - return "success"; - } - - try{ - String retVal = "/jsp/flowcheck/planflowcheck_tocheck"; - int id = Integer.valueOf(req.getParameter("id")); - String aaa = req.getParameter("checkid"); - int checkid = Integer.valueOf(req.getParameter("checkid")); - PlanFlowCheck pfc = planflowcheckservice.load(id); - - if (req.getMethod().equals("POST")) - { - if (br.hasErrors()) - { - List err=br.getFieldErrors(); - FieldError fe; - String field; - String errorMessage; - for (int i = 0; i < err.size(); i++) { - fe=err.get(i); - field=fe.getField();//得到那个字段验证出错 - errorMessage=fe.getDefaultMessage();//得到错误消息 - System.out.println("错误字段消息:"+field +" : "+errorMessage); - } - // 打印结果 - return retVal; - } - String message = ""; - - if(flowcheck.getProjectid()==0){ - message = "请选择项目!"; - model.addAttribute("message", message); - return retVal; - } - - if(flowcheck.getProjectphase().equals("0")){ - message = "请选择检查项目阶段!"; - model.addAttribute("message", message); - return retVal; - } - - if(flowcheck.getPhasenode().equals("0")){ - message = "请选择检查阶段节点!"; - model.addAttribute("message", message); - return retVal; - } - - if(flowcheck.getCheckentry().equals("0")){ - message = "请选择检查内容!"; - model.addAttribute("message", message); - return retVal; - } - - if(flowcheck.getCheckdate().equals("")){ - message = "请选择检查日期!"; - model.addAttribute("message", message); - return retVal; - } - - if(checkid==0){ - checkid = flowcheckservice.getcheckid(flowcheck.getProjectid()); - flowcheck.setCheckid(checkid+1); - }else{ - if(!flowcheckservice.determinerecord(flowcheck.getProjectid(), checkid, flowcheck.getCheckentry())){ - message = "你添加的检查内容在当次检查中已存在!"; - model.addAttribute("message", message); - return retVal; - } - flowcheck.setCheckid(checkid); - } - - flowcheck.setVersionnum(flowcheck.getVersionnum()); - flowcheck.setProjectphase(flowcheck.getProjectphase()); - flowcheck.setPhasenode(flowcheck.getPhasenode()); - flowcheck.setCheckentry(flowcheck.getCheckentry()); - flowcheck.setCheckresult(flowcheck.getCheckresult()); - flowcheck.setCheckdate(flowcheck.getCheckdate()); - flowcheck.setCheckdescriptions(flowcheck.getCheckdescriptions()); - flowcheck.setStateupdate(flowcheck.getStateupdate()); - flowcheck.setUpdatedate(flowcheck.getUpdatedate()); - flowcheck.setRemark(flowcheck.getRemark()); - SectorProjects p = new SectorProjects(); - p.setProjectid(flowcheck.getProjectid()); - flowcheck.setSectorProjects(p); - - int addid = flowcheckservice.add(flowcheck); - pfc.setStatus(2); //修改成已转检查记录状态 - planflowcheckservice.modify(pfc); - String checkentry = flowinfoService.load(Integer.valueOf(flowcheck.getCheckentry())).getCheckentry(); - operationlogservice.add(req, "QA_FLOWCHECK", addid, - flowcheck.getProjectid(),"计划转检查结果添加成功!检查结果:"+flowcheck.getCheckresult()+" 检查内容:"+checkentry); - - model.addAttribute("message", "转检查结果成功"); - model.addAttribute("url", "/planflowCheck/load.do"); - return retVal; - - }//添加数据 - - @SuppressWarnings("unchecked") - List phaselist = flowinfoService.listphaseinfo(); - @SuppressWarnings("unchecked") - List nodelist = flowinfoService.listnodeinfo(Integer.valueOf(pfc.getCheckentryid())); - @SuppressWarnings("unchecked") - List entrylist = flowinfoService.listentryinfo(Integer.valueOf(pfc.getCheckentryid())); - - model.addAttribute("phaselist", phaselist); - model.addAttribute("nodelist", nodelist); - model.addAttribute("entrylist", entrylist); - model.addAttribute("projects", QueueListener.qa_projlist); - - flowcheck.setProjectid(pfc.getSectorProjects().getProjectid()); - flowcheck.setCheckdate(pfc.getPlandate()); - if(checkid==0){ //如果插入已有检查,那么版本号自动更改成原有的 - flowcheck.setVersionnum(pfc.getVersionnum()); - }else{ - flowcheck.setVersionnum(flowcheckservice.getversionnum(pfc.getSectorProjects().getProjectid(), checkid)); - } - flowcheck.setProjectphase(pfc.getCheckentryid()); - flowcheck.setPhasenode(pfc.getCheckentryid()); - flowcheck.setCheckentry(pfc.getCheckentryid()); - - model.addAttribute("projectid", pfc.getSectorProjects().getProjectid()); - model.addAttribute("flowcheck", flowcheck); - return retVal; - - }catch(Exception e){ - model.addAttribute("message", e.getMessage()); - model.addAttribute("url", "/planflowCheck/load.do"); - return "error"; - } - } - - /** - * 第几次检查查询 - * @param tj - * @param br - * @param model - * @param req - * @param rsp - * @return - * @throws Exception - * @Description: - */ - @RequestMapping(value = "/getcheckid.do") - public void getcheckinfo(HttpServletRequest req, HttpServletResponse rsp) throws Exception{ - int id = Integer.valueOf(req.getParameter("id")); - int projectid = planflowcheckservice.load(id).getSectorProjects().getProjectid(); - int checkid = flowcheckservice.getcheckid(projectid); - List list = new ArrayList(); - int size; - if(checkid<=5){ - size = checkid; - }else{ - size = 5; - } - for(int i=0;i pfclist = planflowcheckservice.findByPage(pfcheck, offset, + limit); + + for(int i=0;i err=br.getFieldErrors(); + FieldError fe; + String field; + String errorMessage; + for (int i = 0; i < err.size(); i++) { + fe=err.get(i); + field=fe.getField();//得到那个字段验证出错 + errorMessage=fe.getDefaultMessage();//得到错误消息 + System.out.println("错误字段消息:"+field +" : "+errorMessage); + } + // 打印结果 + @SuppressWarnings("unchecked") + List phaselist = flowinfoService.listphaseinfo(); + model.addAttribute("phaselist", phaselist); + model.addAttribute("projects", QueueListener.qa_projlist); + model.addAttribute("planflowcheck", planflowcheck); + return retVal; + } + String message = ""; + + if(planflowcheck.getProjectid()==0){ + message = "请选择项目!"; + model.addAttribute("message", message); + @SuppressWarnings("unchecked") + List phaselist = flowinfoService.listphaseinfo(); + model.addAttribute("phaselist", phaselist); + model.addAttribute("projects", QueueListener.qa_projlist); + model.addAttribute("planflowcheck", planflowcheck); + return retVal; + }else{ + if(!UserLoginController.oppidboolean(req, planflowcheck.getProjectid())){ + @SuppressWarnings("unchecked") + List phaselist = flowinfoService.listphaseinfo(); + model.addAttribute("phaselist", phaselist); + model.addAttribute("projects", QueueListener.qa_projlist); + model.addAttribute("planflowcheck", planflowcheck); + model.addAttribute("message", "当前用户无权限添加此项目流程计划检查信息,请联系管理员!"); + return retVal; + } + } + + if(planflowcheck.getCheckentryid().equals("0")){ + message = "请选择检查内容!"; + model.addAttribute("message", message); + @SuppressWarnings("unchecked") + List phaselist = flowinfoService.listphaseinfo(); + model.addAttribute("phaselist", phaselist); + model.addAttribute("projects", QueueListener.qa_projlist); + model.addAttribute("planflowcheck", planflowcheck); + return retVal; + } + + if(planflowcheck.getPlandate().equals("")){ + message = "请选择计划检查日期!"; + model.addAttribute("message", message); + @SuppressWarnings("unchecked") + List phaselist = flowinfoService.listphaseinfo(); + model.addAttribute("phaselist", phaselist); + model.addAttribute("projects", QueueListener.qa_projlist); + model.addAttribute("planflowcheck", planflowcheck); + return retVal; + } + + planflowcheck.setVersionnum(planflowcheck.getVersionnum()); + planflowcheck.setCheckentryid(planflowcheck.getCheckentryid()); + planflowcheck.setPlandate(planflowcheck.getPlandate()); + planflowcheck.setStatus(1); + SectorProjects p = new SectorProjects(); + p.setProjectid(planflowcheck.getProjectid()); + planflowcheck.setSectorProjects(p); + + int id = planflowcheckservice.add(planflowcheck); + String checkentry = flowinfoService.load(Integer.valueOf(planflowcheck.getCheckentryid())).getCheckentry(); + operationlogservice.add(req, "QA_PLANFLOWCHECK", id, + planflowcheck.getProjectid(),"流程检查计划添加成功!计划日期:"+planflowcheck.getPlandate()+" 检查内容:"+checkentry); + + model.addAttribute("message", "添加成功"); + @SuppressWarnings("unchecked") + List phaselist = flowinfoService.listphaseinfo(); + model.addAttribute("phaselist", phaselist); + model.addAttribute("projects", QueueListener.qa_projlist); + model.addAttribute("planflowcheck", planflowcheck); + return retVal; + + }//添加数据 + + @SuppressWarnings("unchecked") + List phaselist = flowinfoService.listphaseinfo(); + model.addAttribute("phaselist", phaselist); + model.addAttribute("projects", QueueListener.qa_projlist); + model.addAttribute("planflowcheck", planflowcheck); + return retVal; + + } + catch (Exception e) + { + model.addAttribute("message", e.getMessage()); + model.addAttribute("url", "/planflowCheck/load.do"); + return "error"; + } + + } + + /** + * 检查计划修改 + * @param tj + * @param br + * @param model + * @param req + * @param rsp + * @return + * @throws Exception + * @Description: + */ + @RequestMapping(value = "/update.do") + public String update(@Valid @ModelAttribute("planflowcheck") PlanFlowCheck planflowcheck, BindingResult br, Model model, + HttpServletRequest req, HttpServletResponse rsp) throws Exception + { + + try + { + rsp.setContentType("text/html;charset=utf-8"); + req.setCharacterEncoding("utf-8"); + + int id = Integer.valueOf(req.getParameter("id")); + PlanFlowCheck pfc = planflowcheckservice.load(id); + if(!UserLoginController.permissionboolean(req, "pfc_3")){ + model.addAttribute("planflowcheck", new PlanFlowCheck()); + model.addAttribute("url", "load.do"); + model.addAttribute("message", "当前用户无权修改项目检查计划,请联系管理员!"); + return "success"; + } + + String retVal = "/jsp/flowcheck/planflowcheck_update"; + if (req.getMethod().equals("POST")) + { + if (br.hasErrors()) + { + List err=br.getFieldErrors(); + FieldError fe; + String field; + String errorMessage; + for (int i = 0; i < err.size(); i++) { + fe=err.get(i); + field=fe.getField();//得到那个字段验证出错 + errorMessage=fe.getDefaultMessage();//得到错误消息 + System.out.println("错误字段消息:"+field +" : "+errorMessage); + } + // 打印结果 + return retVal; + } + String message = ""; + + if(planflowcheck.getProjectid()==0){ + message = "请选择项目!"; + model.addAttribute("message", message); + return retVal; + } + + if(planflowcheck.getCheckentryid().equals("0")){ + message = "请选择检查内容!"; + model.addAttribute("message", message); + return retVal; + } + + if(planflowcheck.getPlandate().equals("")){ + message = "请选择计划检查日期!"; + model.addAttribute("message", message); + return retVal; + } + + planflowcheck.setVersionnum(planflowcheck.getVersionnum()); + planflowcheck.setCheckentryid(planflowcheck.getCheckentryid()); + planflowcheck.setPlandate(planflowcheck.getPlandate()); + planflowcheck.setStatus(1); + SectorProjects p = new SectorProjects(); + p.setProjectid(planflowcheck.getProjectid()); + planflowcheck.setSectorProjects(p); + + planflowcheckservice.modify(planflowcheck); + String checkentry = flowinfoService.load(Integer.valueOf(planflowcheck.getCheckentryid())).getCheckentry(); + operationlogservice.add(req, "QA_PLANFLOWCHECK", id, + planflowcheck.getProjectid(),"流程检查计划修改成功!计划日期:"+planflowcheck.getPlandate()+" 检查内容:"+checkentry); + + model.addAttribute("message", "修改成功"); + model.addAttribute("url", "/planflowCheck/load.do"); + return retVal; + + }//添加数据 + + if(!UserLoginController.oppidboolean(req, pfc.getSectorProjects().getProjectid())){ + model.addAttribute("url", "/planflowCheck/load.do"); + model.addAttribute("message", "当前用户无权限修改此项目的流程检查计划,请联系管理员!"); + return "error"; + } + + @SuppressWarnings("unchecked") + List phaselist = flowinfoService.listphaseinfo(); + @SuppressWarnings("unchecked") + List nodelist = flowinfoService.listnodeinfo(Integer.valueOf(pfc.getCheckentryid())); + @SuppressWarnings("unchecked") + List entrylist = flowinfoService.listentryinfo(Integer.valueOf(pfc.getCheckentryid())); + + model.addAttribute("phaselist", phaselist); + model.addAttribute("nodelist", nodelist); + model.addAttribute("entrylist", entrylist); + + pfc.setProjectid(pfc.getSectorProjects().getProjectid()); + String projectphase=nodelist.get(0)[0].toString(); + String phasenode=entrylist.get(0)[0].toString(); + pfc.setCheckphase(projectphase);; + pfc.setChecknode(phasenode); + + model.addAttribute("projects", QueueListener.qa_projlist); + model.addAttribute("planflowcheck", pfc); + return retVal; + + } + catch (Exception e) + { + model.addAttribute("message", e.getMessage()); + model.addAttribute("url", "/planflowCheck/load.do"); + return "error"; + } + + } + + /** + * 删除计划检查记录 + * + * @param id + * @param model + * @return + * @throws Exception + */ + @RequestMapping(value = "/delete.do") + public void delete(HttpServletRequest req, HttpServletResponse rsp) throws Exception { + try { + rsp.setContentType("text/html;charset=utf-8"); + req.setCharacterEncoding("utf-8"); + PrintWriter pw = rsp.getWriter(); + JSONObject json = new JSONObject(); + if (!UserLoginController.permissionboolean(req, "pfc_2")) { + json.put("status", "fail"); + json.put("ms", "删除检查计划失败,权限不足,请联系管理员!"); + } else { + StringBuilder sb = new StringBuilder(); + try (BufferedReader reader = req.getReader();) { + char[] buff = new char[1024]; + int len; + while ((len = reader.read(buff)) != -1) { + sb.append(buff, 0, len); + } + } catch (IOException e) { + e.printStackTrace(); + } + JSONObject jsonObject = JSONObject.fromObject(sb.toString()); + JSONArray jsonarr = JSONArray.fromObject(jsonObject.getString("ids")); + String status="fail"; + String ms="删除检查计划失败!"; + int suc=0; + int fail=0; + for (int i = 0; i < jsonarr.size(); i++) { + int id = Integer.valueOf(jsonarr.get(i).toString()); + PlanFlowCheck pfc = planflowcheckservice.load(id); + + if(!UserLoginController.oppidboolean(req, pfc.getSectorProjects().getProjectid())){ + fail++; + continue; + } + planflowcheckservice.delete(id); + String checkentry = flowinfoService.load(Integer.valueOf(pfc.getCheckentryid())).getCheckentry(); + operationlogservice.add(req, "QA_PLANFLOWCHECK", id, + pfc.getSectorProjects().getProjectid(),"流程检查计划删除成功!计划日期:"+pfc.getPlandate()+" 检查内容:"+checkentry); + suc++; + } + if(suc>0){ + status="success"; + ms="删除检查计划成功!"; + if(fail>0){ + status="success"; + ms="删除检查计划"+suc+"条成功!"+fail+"条因为无项目权限删除失败!"; + } + } + + json.put("status", status); + json.put("ms", ms); + } + pw.print(json.toString()); + + } catch (Exception e) { + e.printStackTrace(); + } + + } + + + /** + * 检查计划转检查记录 + * @param tj + * @param br + * @param model + * @param req + * @param rsp + * @return + * @throws Exception + * @Description: + */ + @RequestMapping(value = "/tocheck.do") + public String tocheck(@Valid @ModelAttribute("flowcheck") FlowCheck flowcheck,BindingResult br, Model model,HttpServletRequest req, HttpServletResponse rsp) throws Exception + { + rsp.setContentType("text/html;charset=utf-8"); + req.setCharacterEncoding("utf-8"); + + if(!UserLoginController.permissionboolean(req, "fc_tocheck")){ + model.addAttribute("flowcheck", new FlowCheck()); + model.addAttribute("url", "load.do"); + model.addAttribute("message", "当前用户无权限把计划转成检查结果,请联系管理员!"); + return "success"; + } + + try{ + String retVal = "/jsp/flowcheck/planflowcheck_tocheck"; + int id = Integer.valueOf(req.getParameter("id")); + String aaa = req.getParameter("checkid"); + int checkid = Integer.valueOf(req.getParameter("checkid")); + PlanFlowCheck pfc = planflowcheckservice.load(id); + + if (req.getMethod().equals("POST")) + { + if (br.hasErrors()) + { + List err=br.getFieldErrors(); + FieldError fe; + String field; + String errorMessage; + for (int i = 0; i < err.size(); i++) { + fe=err.get(i); + field=fe.getField();//得到那个字段验证出错 + errorMessage=fe.getDefaultMessage();//得到错误消息 + System.out.println("错误字段消息:"+field +" : "+errorMessage); + } + // 打印结果 + return retVal; + } + String message = ""; + + if(flowcheck.getProjectid()==0){ + message = "请选择项目!"; + model.addAttribute("message", message); + return retVal; + } + + if(flowcheck.getProjectphase().equals("0")){ + message = "请选择检查项目阶段!"; + model.addAttribute("message", message); + return retVal; + } + + if(flowcheck.getPhasenode().equals("0")){ + message = "请选择检查阶段节点!"; + model.addAttribute("message", message); + return retVal; + } + + if(flowcheck.getCheckentry().equals("0")){ + message = "请选择检查内容!"; + model.addAttribute("message", message); + return retVal; + } + + if(flowcheck.getCheckdate().equals("")){ + message = "请选择检查日期!"; + model.addAttribute("message", message); + return retVal; + } + + if(checkid==0){ + checkid = flowcheckservice.getcheckid(flowcheck.getProjectid()); + flowcheck.setCheckid(checkid+1); + }else{ + if(!flowcheckservice.determinerecord(flowcheck.getProjectid(), checkid, flowcheck.getCheckentry())){ + message = "你添加的检查内容在当次检查中已存在!"; + model.addAttribute("message", message); + return retVal; + } + flowcheck.setCheckid(checkid); + } + + flowcheck.setVersionnum(flowcheck.getVersionnum()); + flowcheck.setProjectphase(flowcheck.getProjectphase()); + flowcheck.setPhasenode(flowcheck.getPhasenode()); + flowcheck.setCheckentry(flowcheck.getCheckentry()); + flowcheck.setCheckresult(flowcheck.getCheckresult()); + flowcheck.setCheckdate(flowcheck.getCheckdate()); + flowcheck.setCheckdescriptions(flowcheck.getCheckdescriptions()); + flowcheck.setStateupdate(flowcheck.getStateupdate()); + flowcheck.setUpdatedate(flowcheck.getUpdatedate()); + flowcheck.setRemark(flowcheck.getRemark()); + SectorProjects p = new SectorProjects(); + p.setProjectid(flowcheck.getProjectid()); + flowcheck.setSectorProjects(p); + + int addid = flowcheckservice.add(flowcheck); + pfc.setStatus(2); //修改成已转检查记录状态 + planflowcheckservice.modify(pfc); + String checkentry = flowinfoService.load(Integer.valueOf(flowcheck.getCheckentry())).getCheckentry(); + operationlogservice.add(req, "QA_FLOWCHECK", addid, + flowcheck.getProjectid(),"计划转检查结果添加成功!检查结果:"+flowcheck.getCheckresult()+" 检查内容:"+checkentry); + + model.addAttribute("message", "转检查结果成功"); + model.addAttribute("url", "/planflowCheck/load.do"); + return retVal; + + }//添加数据 + + @SuppressWarnings("unchecked") + List phaselist = flowinfoService.listphaseinfo(); + @SuppressWarnings("unchecked") + List nodelist = flowinfoService.listnodeinfo(Integer.valueOf(pfc.getCheckentryid())); + @SuppressWarnings("unchecked") + List entrylist = flowinfoService.listentryinfo(Integer.valueOf(pfc.getCheckentryid())); + + model.addAttribute("phaselist", phaselist); + model.addAttribute("nodelist", nodelist); + model.addAttribute("entrylist", entrylist); + model.addAttribute("projects", QueueListener.qa_projlist); + + flowcheck.setProjectid(pfc.getSectorProjects().getProjectid()); + flowcheck.setCheckdate(pfc.getPlandate()); + if(checkid==0){ //如果插入已有检查,那么版本号自动更改成原有的 + flowcheck.setVersionnum(pfc.getVersionnum()); + }else{ + flowcheck.setVersionnum(flowcheckservice.getversionnum(pfc.getSectorProjects().getProjectid(), checkid)); + } + flowcheck.setProjectphase(pfc.getCheckentryid()); + flowcheck.setPhasenode(pfc.getCheckentryid()); + flowcheck.setCheckentry(pfc.getCheckentryid()); + + model.addAttribute("projectid", pfc.getSectorProjects().getProjectid()); + model.addAttribute("flowcheck", flowcheck); + return retVal; + + }catch(Exception e){ + model.addAttribute("message", e.getMessage()); + model.addAttribute("url", "/planflowCheck/load.do"); + return "error"; + } + } + + /** + * 第几次检查查询 + * @param tj + * @param br + * @param model + * @param req + * @param rsp + * @return + * @throws Exception + * @Description: + */ + @RequestMapping(value = "/getcheckid.do") + public void getcheckinfo(HttpServletRequest req, HttpServletResponse rsp) throws Exception{ + int id = Integer.valueOf(req.getParameter("id")); + int projectid = planflowcheckservice.load(id).getSectorProjects().getProjectid(); + int checkid = flowcheckservice.getcheckid(projectid); + List list = new ArrayList(); + int size; + if(checkid<=5){ + size = checkid; + }else{ + size = 5; + } + for(int i=0;i listmoduleid=new ArrayList(); - /** - * - * - * @param tj - * @param model - * @return - * @throws Exception - */ - @RequestMapping(value = "/load.do") - public String load(HttpServletRequest req, Model model) throws Exception { - - try { - int projectid = 99; - if (null != req.getSession().getAttribute("usercode") - && null != req.getSession().getAttribute("username")) { - String usercode = req.getSession().getAttribute("usercode").toString(); - UserInfo userinfo = userinfoservice.getUseinfo(usercode); - projectid = userinfo.getProjectid(); - } - - List prolist = QueueListener.qa_projlist; - model.addAttribute("projects", prolist); - model.addAttribute("projectid", projectid); - } catch (Exception e) { - e.printStackTrace(); - model.addAttribute("message", e.getMessage()); - model.addAttribute("url", "/projectCase/load.do"); - return "error"; - } - return "/jsp/plancase/projectcase"; - } - - @RequestMapping(value = "/list.do") - private void ajaxGetSellRecord(Integer limit, Integer offset, HttpServletRequest request, - HttpServletResponse response) throws IOException { - response.setCharacterEncoding("utf-8"); - PrintWriter pw = response.getWriter(); - String search = request.getParameter("search"); - String projectid = request.getParameter("projectid"); - String moduleid = request.getParameter("moduleid"); - ProjectCase projectcase = new ProjectCase(); - if (null == offset && null == limit) { - offset = 0; - } - if (null == limit || limit == 0) { - limit = 10; - } - // 得到客户端传递的查询参数 - if (!StrLib.isEmpty(search)) { - projectcase.setSign(search); - projectcase.setName(search); - projectcase.setOperationer(search); - projectcase.setRemark(search); - } - // 得到客户端传递的查询参数 - if (!StrLib.isEmpty(projectid) && !"99".equals(projectid)) { - projectcase.setProjectid(Integer.valueOf(projectid)); - } - // 得到客户端传递的查询参数 - if (!StrLib.isEmpty(moduleid)) { - projectcase.setModuleid(Integer.valueOf(moduleid)); - if(0!=projectcase.getModuleid()){ - listmoduleid.clear(); - getchildmoduList(projectcase.getProjectid(),projectcase.getModuleid()); - Integer[] moduleidarr=new Integer[listmoduleid.size()+1]; - moduleidarr[0]=projectcase.getModuleid(); - for(int i=0;i projectcases = projectcaseservice.findByPage(projectcase, offset, limit); - List prolist = QueueListener.qa_projlist; - List modulelist = moduleservice.getModuleList(); - for (int i = 0; i < projectcases.size(); i++) { - ProjectCase pcase = projectcases.get(i); - // 更新项目名 - for (SectorProjects projectlist : prolist) { - if (pcase.getProjectid() == projectlist.getProjectid()) { - projectcases.get(i).setProjectname(projectlist.getProjectname()); - } - } - // 更新模块名 - for (ProjectModule module : modulelist) { - if (pcase.getModuleid() == module.getId()) { - projectcases.get(i).setModulename(module.getModulename()); - } - } - - } - // 转换成json字符串 - String RecordJson = StrLib.listToJson(projectcases); - // 得到总记录数 - int total = projectcaseservice.findRows(projectcase); - // 需要返回的数据有总记录数和行数据 - JSONObject json = new JSONObject(); - json.put("total", total); - json.put("rows", RecordJson); - pw.print(json.toString()); - } - - @RequestMapping(value = "/update.do") - public void updatecase(HttpServletRequest req, HttpServletResponse rsp, ProjectCase projectcase) { - // 更新实体 - JSONObject json = new JSONObject(); - try { - rsp.setContentType("text/html;charset=utf-8"); - req.setCharacterEncoding("utf-8"); - PrintWriter pw = rsp.getWriter(); - - if (!UserLoginController.permissionboolean(req, "case_3")) { - json.put("status", "fail"); - json.put("ms", "编辑失败,权限不足,请联系管理员!"); - } else { - if(!UserLoginController.oppidboolean(req, projectcase.getProjectid())){ - json.put("status", "fail"); - json.put("ms", "编辑失败,项目权限不足,请联系管理员!"); - }else{ - if (null != req.getSession().getAttribute("usercode") - && null != req.getSession().getAttribute("username")) { - String usercode = req.getSession().getAttribute("usercode").toString(); - projectcase.setOperationer(usercode); - } - Date currentTime = new Date(); - SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); - String time = formatter.format(currentTime); - projectcase.setTime(time); - - projectcaseservice.modify(projectcase); - operationlogservice.add(req, "PROJECT_CASE", projectcase.getId(), projectcase.getProjectid(), - "编辑用例成功!用例编号:" + projectcase.getSign()); - json.put("status", "success"); - json.put("ms", "编辑成功!"); - } - - } - pw.print(json.toString()); - } catch (Exception e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - } - - /** - * 添加用例 - * - * @param tj - * @param br - * @param model - * @param req - * @param rsp - * @return - * @throws Exception - * @Description: - */ - @RequestMapping(value = "/caseadd.do") - public void add(ProjectCase projectcase, HttpServletRequest req, HttpServletResponse rsp) throws Exception { - try { - rsp.setContentType("text/html;charset=utf-8"); - req.setCharacterEncoding("utf-8"); - PrintWriter pw = rsp.getWriter(); - JSONObject json = new JSONObject(); - if (!UserLoginController.permissionboolean(req, "case_1")) { - json.put("status", "fail"); - json.put("ms", "添加失败,权限不足,请联系管理员!"); - } else { - int copyid = Integer.valueOf(req.getParameter("copyid")); - if(!UserLoginController.oppidboolean(req, projectcase.getProjectid())){ - if(0!=copyid){ - json.put("status", "fail"); - json.put("ms", "复制用例失败,项目权限不足,请联系管理员!"); - }else{ - json.put("status", "fail"); - json.put("ms", "添加用例失败,项目权限不足,请联系管理员!"); - } - }else{ - if (null != req.getSession().getAttribute("usercode") - && null != req.getSession().getAttribute("username")) { - String usercode = req.getSession().getAttribute("usercode").toString(); - projectcase.setOperationer(usercode); - } - - String regEx_space = "\t|\r|\n";// 定义空格回车换行符 - Pattern p_space = Pattern.compile(regEx_space, Pattern.CASE_INSENSITIVE); - Matcher m_space = p_space.matcher(projectcase.getRemark()); - projectcase.setRemark(m_space.replaceAll("")); // 过滤空格回车标签 - - Date currentTime = new Date(); - SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); - String time = formatter.format(currentTime); - projectcase.setTime(time); - - SectorProjects sp = sectorprojectsService.loadob(projectcase.getProjectid()); - String maxindex = projectcaseservice.getCaseMaxIndex(projectcase.getProjectid()); - int index = Integer.valueOf(maxindex) + 1; - projectcase.setSign(sp.getProjectsign() + "-" + index); - projectcase.setProjectindex(index); - int caseid = projectcaseservice.add(projectcase); - operationlogservice.add(req, "PROJECT_CASE", caseid, projectcase.getProjectid(), - "添加用例成功!用例编号:" + projectcase.getSign()); - - String ms="添加用例【"+projectcase.getSign()+"】成功!"; - if(0!=copyid){ - List steps=casestepsservice.getSteps(copyid); - for(ProjectCasesteps step:steps){ - step.setCaseid(caseid); - int stepid=casestepsservice.add(step); - operationlogservice.add(req, "PROJECT_CASESTEPS", stepid, projectcase.getProjectid(), - "复制用例步骤成功!"); - } - ms="复制用例【"+projectcase.getSign()+"】成功!"; - } - - json.put("status", "success"); - json.put("ms", ms); - } - - } - pw.print(json.toString()); - - } catch (Exception e) { - e.printStackTrace(); - } - - } - - /** - * 删除用例 - * - * @param tj - * @param br - * @param model - * @param req - * @param rsp - * @return - * @throws Exception - * @Description: - */ - @RequestMapping(value = "/delete.do") - public void delete(HttpServletRequest req, HttpServletResponse rsp) throws Exception { - try { - rsp.setContentType("text/html;charset=utf-8"); - req.setCharacterEncoding("utf-8"); - PrintWriter pw = rsp.getWriter(); - JSONObject json = new JSONObject(); - if (!UserLoginController.permissionboolean(req, "case_2")) { - json.put("status", "fail"); - json.put("ms", "删除失败,权限不足,请联系管理员!"); - } else { - StringBuilder sb = new StringBuilder(); - try (BufferedReader reader = req.getReader();) { - char[] buff = new char[1024]; - int len; - while ((len = reader.read(buff)) != -1) { - sb.append(buff, 0, len); - } - } catch (IOException e) { - e.printStackTrace(); - } - JSONObject jsonObject = JSONObject.fromObject(sb.toString()); - JSONArray jsonarr = JSONArray.fromObject(jsonObject.getString("caseids")); - - String status="fail"; - String ms="删除用例失败!"; - int suc=0; - int planfail=0; - int proprefail=0; - ProjectPlanCase projectplancase=new ProjectPlanCase(); - for (int i = 0; i < jsonarr.size(); i++) { - int id = Integer.valueOf(jsonarr.get(i).toString()); - projectplancase.setCaseid(id); - int plancase=projectplancaseservice.findRows(projectplancase); - ProjectCase pc = projectcaseservice.load(id); - - if(plancase>0){ - planfail++; - continue; - } - if(!UserLoginController.oppidboolean(req, pc.getProjectid())){ - proprefail++; - continue; - } - casestepsservice.delforcaseid(id); - projectcaseservice.delete(id); - operationlogservice.add(req, "PROJECT_CASE", pc.getId(), pc.getProjectid(), "删除用例成功!"); - suc++; - } - - if(suc>0){ - status="success"; - ms="删除用例成功!"; - if(proprefail>0&&planfail==0){ - status="warning"; - ms="删除用例"+suc+"条成功!"+proprefail+"条因为无项目权限删除失败!"; - }else if(proprefail==0&&planfail>0){ - status="warning"; - ms="删除用例"+suc+"条成功!"+planfail+"条因为在测试计划中无法删除!"; - }else if(proprefail>0&&planfail>0){ - status="warning"; - ms="删除用例"+suc+"条成功!"+planfail+"条因为在测试计划中无法删除!"+proprefail+"条因为无项目权限删除失败!"; - } - } - - json.put("status", status); - json.put("ms", ms); - } - pw.print(json.toString()); - - } catch (Exception e) { - e.printStackTrace(); - } - - } - - @RequestMapping(value = "/cgetcasebysign.do") - public void cgetcasebysign(HttpServletRequest req, HttpServletResponse rsp) { - // 更新实体 - try { - rsp.setContentType("text/html;charset=GBK"); - req.setCharacterEncoding("GBK"); - PrintWriter pw = rsp.getWriter(); - String sign = req.getParameter("sign"); - - ProjectCase pc = projectcaseservice.getCaseBySign(sign); - String jsonStr = JSONObject.fromObject(pc).toString(); - pw.print(jsonStr); - } catch (Exception e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - } - - /** - * 添加用例集 - * - * @param tj - * @param br - * @param model - * @param req - * @param rsp - * @return - * @throws Exception - * @Description: - */ - @RequestMapping(value = "/moduleadd.do") - public void addModule(HttpServletRequest req, HttpServletResponse rsp) throws Exception { - rsp.setContentType("text/html;charset=utf-8"); - req.setCharacterEncoding("utf-8"); - PrintWriter pw = rsp.getWriter(); - JSONObject json = new JSONObject(); - int id=0; - try { - ProjectModule projectmodule = new ProjectModule(); - if (!UserLoginController.permissionboolean(req, "case_1")) { - json.put("status", "fail"); - json.put("ms", "添加失败,权限不足,请联系管理员!"); - } else { - StringBuilder sb = new StringBuilder(); - try (BufferedReader reader = req.getReader();) { - char[] buff = new char[1024]; - int len; - while ((len = reader.read(buff)) != -1) { - sb.append(buff, 0, len); - } - } catch (IOException e) { - e.printStackTrace(); - } - JSONObject jsonObject = JSONObject.fromObject(sb.toString()); - String ms="保存用例集失败!"; - String status="fail"; - int projectid = Integer.valueOf(jsonObject.getString("projectid")); - int pid = Integer.valueOf(jsonObject.getString("pid")); - String oldName = jsonObject.getString("oldName"); - String name = jsonObject.getString("name"); - id = Integer.valueOf(jsonObject.getString("id")); - - if(!UserLoginController.oppidboolean(req, projectid)){ - status="fail"; - ms="项目权限不足,请联系管理员!"; - }else{ - if(id!=0){ - ProjectModule pm=moduleservice.load(id); - if(null!=pm&&pm.getProjectid()==projectid&&pm.getPid()==pid&&pm.getModulename().equals(oldName)){ - pm.setModulename(name); - moduleservice.modify(pm); - operationlogservice.add(req, "PROJECT_MODULE", id, pm.getProjectid(), "编辑用例集成功!"); - ms="编辑用例集成功!"; - status="success"; - } - }else{ - projectmodule.setProjectid(projectid); - projectmodule.setPid(pid); - projectmodule.setModulename(name); - id = moduleservice.add(projectmodule); - operationlogservice.add(req, "PROJECT_MODULE", id, projectmodule.getProjectid(), "新增用例集成功!"); - ms="新增用例集成功!"; - status="success"; - } - } - - json.put("status", status); - json.put("ms", ms); - json.put("id", id); - } - pw.print(json.toString()); - - } catch (Exception e) { - e.printStackTrace(); - json.put("status", "保存用例集出现异常!"); - json.put("ms", "fail"); - pw.print(json.toString()); - } - - } - - /** - * 删除用例集 - * - * @param tj - * @param br - * @param model - * @param req - * @param rsp - * @return - * @throws Exception - * @Description: - */ - @RequestMapping(value = "/moduledel.do") - public void delModule(HttpServletRequest req, HttpServletResponse rsp) throws Exception { - try { - rsp.setContentType("text/html;charset=utf-8"); - req.setCharacterEncoding("utf-8"); - PrintWriter pw = rsp.getWriter(); - JSONObject json = new JSONObject(); - if (!UserLoginController.permissionboolean(req, "case_2")) { - json.put("status", "fail"); - json.put("ms", "删除失败,权限不足,请联系管理员!"); - } else { - StringBuilder sb = new StringBuilder(); - try (BufferedReader reader = req.getReader();) { - char[] buff = new char[1024]; - int len; - while ((len = reader.read(buff)) != -1) { - sb.append(buff, 0, len); - } - } catch (IOException e) { - e.printStackTrace(); - } - JSONObject jsonObject = JSONObject.fromObject(sb.toString()); - - int id = Integer.valueOf(jsonObject.getString("id")); - ProjectModule projectmodule = moduleservice.load(id); - - if(!UserLoginController.oppidboolean(req, projectmodule.getProjectid())){ - json.put("status", "fail"); - json.put("ms", "删除失败,项目权限不足,请联系管理员!"); - }else{ - ProjectCase projectcase = new ProjectCase(); - projectcase.setModuleid(id); - if(0!=projectcase.getModuleid()){ - listmoduleid.clear(); - getchildmoduList(projectcase.getProjectid(),projectcase.getModuleid()); - Integer[] moduleidarr=new Integer[listmoduleid.size()+1]; - moduleidarr[0]=projectcase.getModuleid(); - for(int i=0;i modules = moduleservice.getModuleListByProjectid(projectid, id); - for (ProjectModule projectmodule : modules) { - ProjectModuleJson modulejson = new ProjectModuleJson(); - modulejson.setId(projectmodule.getId()); - modulejson.setName(projectmodule.getModulename()); - boolean isParent = moduleservice.getModuleIsParent(projectmodule.getId()); - modulejson.setisParent(isParent); - jsonarr.add(json.fromObject(modulejson)); - } - } else { - List prolist = QueueListener.qa_projlist; - for (SectorProjects sp : prolist) { - if (sp.getProjectid() == projectid) { - ProjectModuleJson modulejson = new ProjectModuleJson(); - modulejson.setId(0); - modulejson.setName(sp.getProjectname()); - List modules = moduleservice.getModuleListByProjectid(projectid, 0); - if (modules.size() > 0) { - modulejson.setisParent(true); - } else { - modulejson.setisParent(false); - } - - jsonarr.add(json.fromObject(modulejson)); - } - } - } - - String jsonstr = jsonarr.toString().replace("parent", "isParent"); - rsp.getWriter().write(jsonstr); - } - - /** - * 查询项目中的所有测试集 - * - * @param tj - * @param br - * @param model - * @param req - * @param rsp - * @return - * @throws Exception - * @Description: - */ - @RequestMapping(value = "/getmodulealllist.do") - public void getmodulealllist(HttpServletRequest req, HttpServletResponse rsp) throws Exception { - rsp.setContentType("text/html;charset=utf-8"); - req.setCharacterEncoding("utf-8"); - int projectid = Integer.valueOf(req.getParameter("projectid")); - JSONArray jsonarr = new JSONArray(); - List modules = moduleservice.getModuleAllListByProjectid(projectid); - for (ProjectModule projectmodule : modules) { - JSONObject json = new JSONObject(); - json.put("moduleid", projectmodule.getId()); - json.put("name", projectmodule.getModulename()); - jsonarr.add(json); - } - - String jsonstr = jsonarr.toString(); - rsp.getWriter().write(jsonstr); - } - - @RequestMapping(value = "/cpostcase.do") - public void cpostcase(HttpServletRequest req, HttpServletResponse rsp) throws IOException { - // 更新实体 - rsp.setContentType("text/html;charset=GBK"); - req.setCharacterEncoding("GBK"); - PrintWriter pw = rsp.getWriter(); - try { - ProjectCase projectcase = new ProjectCase(); - int moduleid=0; - - String name = req.getParameter("name").replace("BBFFHH", "%"); - String projectid = req.getParameter("projectid"); - String modulename = req.getParameter("modulename"); - String casetype = req.getParameter("casetype"); - String remark = req.getParameter("remark"); - - moduleid=moduleservice.getModuleIdByName(modulename); - - projectcase.setName(name); - projectcase.setProjectid(Integer.valueOf(projectid)); - projectcase.setModuleid(moduleid); - projectcase.setCasetype(Integer.valueOf(casetype)); - projectcase.setRemark(remark); - - Date currentTime = new Date(); - SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); - String time = formatter.format(currentTime); - projectcase.setTime(time); - projectcase.setOperationer("http-post"); - - SectorProjects sp = sectorprojectsService.loadob(projectcase.getProjectid()); - String maxindex = projectcaseservice.getCaseMaxIndex(projectcase.getProjectid()); - int index = Integer.valueOf(maxindex) + 1; - projectcase.setSign(sp.getProjectsign() + "-" + index); - projectcase.setProjectindex(index); - int caseid = projectcaseservice.add(projectcase); - - pw.print(caseid); - } catch (Exception e) { - // TODO Auto-generated catch block - e.printStackTrace(); - pw.print("fail"); - } - } - - /** - * 使用递归查询指定测试ID中的所有子测试集 - * - * @param tj - * @param br - * @param model - * @param req - * @param rsp - * @return - * @throws Exception - * @Description: - */ - private List getchildmoduList(int projectid,int pid){ - List modules = moduleservice.getModuleListByProjectid(projectid, pid); - for(ProjectModule pm: modules){ - listmoduleid.add(pm.getId()); - //递归遍历下一级 - getchildmoduList(projectid,pm.getId()); - } - return listmoduleid; - } - - public static void main(String[] args) throws Exception { - - } - -} +package luckyweb.seagull.spring.mvc; + +import java.io.BufferedReader; +import java.io.IOException; +import java.io.PrintWriter; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.springframework.stereotype.Controller; +import org.springframework.ui.Model; +import org.springframework.web.bind.annotation.RequestMapping; + +import luckyweb.seagull.comm.QueueListener; +import luckyweb.seagull.spring.entity.ProjectCase; +import luckyweb.seagull.spring.entity.ProjectCasesteps; +import luckyweb.seagull.spring.entity.ProjectModule; +import luckyweb.seagull.spring.entity.ProjectModuleJson; +import luckyweb.seagull.spring.entity.ProjectPlanCase; +import luckyweb.seagull.spring.entity.SectorProjects; +import luckyweb.seagull.spring.entity.UserInfo; +import luckyweb.seagull.spring.service.OperationLogService; +import luckyweb.seagull.spring.service.ProjectCaseService; +import luckyweb.seagull.spring.service.ProjectCasestepsService; +import luckyweb.seagull.spring.service.ProjectModuleService; +import luckyweb.seagull.spring.service.ProjectPlanCaseService; +import luckyweb.seagull.spring.service.SectorProjectsService; +import luckyweb.seagull.spring.service.UserInfoService; +import luckyweb.seagull.util.StrLib; +import net.sf.json.JSONArray; +import net.sf.json.JSONObject; + +@Controller +@RequestMapping("/projectCase") +public class ProjectCaseController { + + @Resource(name = "projectCaseService") + private ProjectCaseService projectcaseservice; + + @Resource(name = "projectPlanCaseService") + private ProjectPlanCaseService projectplancaseservice; + + @Resource(name = "projectCasestepsService") + private ProjectCasestepsService casestepsservice; + + @Resource(name = "projectModuleService") + private ProjectModuleService moduleservice; + + @Resource(name = "sectorprojectsService") + private SectorProjectsService sectorprojectsService; + + @Resource(name = "operationlogService") + private OperationLogService operationlogservice; + + @Resource(name = "userinfoService") + private UserInfoService userinfoservice; + + private List listmoduleid=new ArrayList(); + /** + * + * + * @param tj + * @param model + * @return + * @throws Exception + */ + @RequestMapping(value = "/load.do") + public String load(HttpServletRequest req, Model model) throws Exception { + + try { + int projectid = 99; + if (null != req.getSession().getAttribute("usercode") + && null != req.getSession().getAttribute("username")) { + String usercode = req.getSession().getAttribute("usercode").toString(); + UserInfo userinfo = userinfoservice.getUseinfo(usercode); + projectid = userinfo.getProjectid(); + } + + List prolist = QueueListener.qa_projlist; + model.addAttribute("projects", prolist); + model.addAttribute("projectid", projectid); + } catch (Exception e) { + e.printStackTrace(); + model.addAttribute("message", e.getMessage()); + model.addAttribute("url", "/projectCase/load.do"); + return "error"; + } + return "/jsp/plancase/projectcase"; + } + + @RequestMapping(value = "/list.do") + private void ajaxGetSellRecord(Integer limit, Integer offset, HttpServletRequest request, + HttpServletResponse response) throws IOException { + response.setCharacterEncoding("utf-8"); + PrintWriter pw = response.getWriter(); + String search = request.getParameter("search"); + String projectid = request.getParameter("projectid"); + String moduleid = request.getParameter("moduleid"); + ProjectCase projectcase = new ProjectCase(); + if (null == offset && null == limit) { + offset = 0; + } + if (null == limit || limit == 0) { + limit = 10; + } + // 得到客户端传递的查询参数 + if (!StrLib.isEmpty(search)) { + projectcase.setSign(search); + projectcase.setName(search); + projectcase.setOperationer(search); + projectcase.setRemark(search); + } + // 得到客户端传递的查询参数 + if (!StrLib.isEmpty(projectid) && !"99".equals(projectid)) { + projectcase.setProjectid(Integer.valueOf(projectid)); + } + // 得到客户端传递的查询参数 + if (!StrLib.isEmpty(moduleid)) { + projectcase.setModuleid(Integer.valueOf(moduleid)); + if(0!=projectcase.getModuleid()){ + listmoduleid.clear(); + getchildmoduList(projectcase.getProjectid(),projectcase.getModuleid()); + Integer[] moduleidarr=new Integer[listmoduleid.size()+1]; + moduleidarr[0]=projectcase.getModuleid(); + for(int i=0;i projectcases = projectcaseservice.findByPage(projectcase, offset, limit); + List prolist = QueueListener.qa_projlist; + List modulelist = moduleservice.getModuleList(); + for (int i = 0; i < projectcases.size(); i++) { + ProjectCase pcase = projectcases.get(i); + // 更新项目名 + for (SectorProjects projectlist : prolist) { + if (pcase.getProjectid() == projectlist.getProjectid()) { + projectcases.get(i).setProjectname(projectlist.getProjectname()); + } + } + // 更新模块名 + for (ProjectModule module : modulelist) { + if (pcase.getModuleid() == module.getId()) { + projectcases.get(i).setModulename(module.getModulename()); + } + } + + } + // 转换成json字符串 + String RecordJson = StrLib.listToJson(projectcases); + // 得到总记录数 + int total = projectcaseservice.findRows(projectcase); + // 需要返回的数据有总记录数和行数据 + JSONObject json = new JSONObject(); + json.put("total", total); + json.put("rows", RecordJson); + pw.print(json.toString()); + } + + @RequestMapping(value = "/update.do") + public void updatecase(HttpServletRequest req, HttpServletResponse rsp, ProjectCase projectcase) { + // 更新实体 + JSONObject json = new JSONObject(); + try { + rsp.setContentType("text/html;charset=utf-8"); + req.setCharacterEncoding("utf-8"); + PrintWriter pw = rsp.getWriter(); + + if (!UserLoginController.permissionboolean(req, "case_3")) { + json.put("status", "fail"); + json.put("ms", "编辑失败,权限不足,请联系管理员!"); + } else { + if(!UserLoginController.oppidboolean(req, projectcase.getProjectid())){ + json.put("status", "fail"); + json.put("ms", "编辑失败,项目权限不足,请联系管理员!"); + }else{ + if (null != req.getSession().getAttribute("usercode") + && null != req.getSession().getAttribute("username")) { + String usercode = req.getSession().getAttribute("usercode").toString(); + projectcase.setOperationer(usercode); + } + Date currentTime = new Date(); + SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + String time = formatter.format(currentTime); + projectcase.setTime(time); + + projectcaseservice.modify(projectcase); + operationlogservice.add(req, "PROJECT_CASE", projectcase.getId(), projectcase.getProjectid(), + "编辑用例成功!用例编号:" + projectcase.getSign()); + json.put("status", "success"); + json.put("ms", "编辑成功!"); + } + + } + pw.print(json.toString()); + } catch (Exception e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + + /** + * 添加用例 + * + * @param tj + * @param br + * @param model + * @param req + * @param rsp + * @return + * @throws Exception + * @Description: + */ + @RequestMapping(value = "/caseadd.do") + public void add(ProjectCase projectcase, HttpServletRequest req, HttpServletResponse rsp) throws Exception { + try { + rsp.setContentType("text/html;charset=utf-8"); + req.setCharacterEncoding("utf-8"); + PrintWriter pw = rsp.getWriter(); + JSONObject json = new JSONObject(); + if (!UserLoginController.permissionboolean(req, "case_1")) { + json.put("status", "fail"); + json.put("ms", "添加失败,权限不足,请联系管理员!"); + } else { + int copyid = Integer.valueOf(req.getParameter("copyid")); + if(!UserLoginController.oppidboolean(req, projectcase.getProjectid())){ + if(0!=copyid){ + json.put("status", "fail"); + json.put("ms", "复制用例失败,项目权限不足,请联系管理员!"); + }else{ + json.put("status", "fail"); + json.put("ms", "添加用例失败,项目权限不足,请联系管理员!"); + } + }else{ + if (null != req.getSession().getAttribute("usercode") + && null != req.getSession().getAttribute("username")) { + String usercode = req.getSession().getAttribute("usercode").toString(); + projectcase.setOperationer(usercode); + } + + String regEx_space = "\t|\r|\n";// 定义空格回车换行符 + Pattern p_space = Pattern.compile(regEx_space, Pattern.CASE_INSENSITIVE); + Matcher m_space = p_space.matcher(projectcase.getRemark()); + projectcase.setRemark(m_space.replaceAll("")); // 过滤空格回车标签 + + Date currentTime = new Date(); + SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + String time = formatter.format(currentTime); + projectcase.setTime(time); + + SectorProjects sp = sectorprojectsService.loadob(projectcase.getProjectid()); + String maxindex = projectcaseservice.getCaseMaxIndex(projectcase.getProjectid()); + int index = Integer.valueOf(maxindex) + 1; + projectcase.setSign(sp.getProjectsign() + "-" + index); + projectcase.setProjectindex(index); + int caseid = projectcaseservice.add(projectcase); + operationlogservice.add(req, "PROJECT_CASE", caseid, projectcase.getProjectid(), + "添加用例成功!用例编号:" + projectcase.getSign()); + + String ms="添加用例【"+projectcase.getSign()+"】成功!"; + if(0!=copyid){ + List steps=casestepsservice.getSteps(copyid); + for(ProjectCasesteps step:steps){ + step.setCaseid(caseid); + int stepid=casestepsservice.add(step); + operationlogservice.add(req, "PROJECT_CASESTEPS", stepid, projectcase.getProjectid(), + "复制用例步骤成功!"); + } + ms="复制用例【"+projectcase.getSign()+"】成功!"; + } + + json.put("status", "success"); + json.put("ms", ms); + } + + } + pw.print(json.toString()); + + } catch (Exception e) { + e.printStackTrace(); + } + + } + + /** + * 删除用例 + * + * @param tj + * @param br + * @param model + * @param req + * @param rsp + * @return + * @throws Exception + * @Description: + */ + @RequestMapping(value = "/delete.do") + public void delete(HttpServletRequest req, HttpServletResponse rsp) throws Exception { + try { + rsp.setContentType("text/html;charset=utf-8"); + req.setCharacterEncoding("utf-8"); + PrintWriter pw = rsp.getWriter(); + JSONObject json = new JSONObject(); + if (!UserLoginController.permissionboolean(req, "case_2")) { + json.put("status", "fail"); + json.put("ms", "删除失败,权限不足,请联系管理员!"); + } else { + StringBuilder sb = new StringBuilder(); + try (BufferedReader reader = req.getReader();) { + char[] buff = new char[1024]; + int len; + while ((len = reader.read(buff)) != -1) { + sb.append(buff, 0, len); + } + } catch (IOException e) { + e.printStackTrace(); + } + JSONObject jsonObject = JSONObject.fromObject(sb.toString()); + JSONArray jsonarr = JSONArray.fromObject(jsonObject.getString("caseids")); + + String status="fail"; + String ms="删除用例失败!"; + int suc=0; + int planfail=0; + int proprefail=0; + ProjectPlanCase projectplancase=new ProjectPlanCase(); + for (int i = 0; i < jsonarr.size(); i++) { + int id = Integer.valueOf(jsonarr.get(i).toString()); + projectplancase.setCaseid(id); + int plancase=projectplancaseservice.findRows(projectplancase); + ProjectCase pc = projectcaseservice.load(id); + + if(plancase>0){ + planfail++; + continue; + } + if(!UserLoginController.oppidboolean(req, pc.getProjectid())){ + proprefail++; + continue; + } + casestepsservice.delforcaseid(id); + projectcaseservice.delete(id); + operationlogservice.add(req, "PROJECT_CASE", pc.getId(), pc.getProjectid(), "删除用例成功!"); + suc++; + } + + if(suc>0){ + status="success"; + ms="删除用例成功!"; + if(proprefail>0&&planfail==0){ + status="warning"; + ms="删除用例"+suc+"条成功!"+proprefail+"条因为无项目权限删除失败!"; + }else if(proprefail==0&&planfail>0){ + status="warning"; + ms="删除用例"+suc+"条成功!"+planfail+"条因为在测试计划中无法删除!"; + }else if(proprefail>0&&planfail>0){ + status="warning"; + ms="删除用例"+suc+"条成功!"+planfail+"条因为在测试计划中无法删除!"+proprefail+"条因为无项目权限删除失败!"; + } + } + + json.put("status", status); + json.put("ms", ms); + } + pw.print(json.toString()); + + } catch (Exception e) { + e.printStackTrace(); + } + + } + + @RequestMapping(value = "/cgetcasebysign.do") + public void cgetcasebysign(HttpServletRequest req, HttpServletResponse rsp) { + // 更新实体 + try { + rsp.setContentType("text/html;charset=GBK"); + req.setCharacterEncoding("GBK"); + PrintWriter pw = rsp.getWriter(); + String sign = req.getParameter("sign"); + + ProjectCase pc = projectcaseservice.getCaseBySign(sign); + String jsonStr = JSONObject.fromObject(pc).toString(); + pw.print(jsonStr); + } catch (Exception e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + + /** + * 添加用例集 + * + * @param tj + * @param br + * @param model + * @param req + * @param rsp + * @return + * @throws Exception + * @Description: + */ + @RequestMapping(value = "/moduleadd.do") + public void addModule(HttpServletRequest req, HttpServletResponse rsp) throws Exception { + rsp.setContentType("text/html;charset=utf-8"); + req.setCharacterEncoding("utf-8"); + PrintWriter pw = rsp.getWriter(); + JSONObject json = new JSONObject(); + int id=0; + try { + ProjectModule projectmodule = new ProjectModule(); + if (!UserLoginController.permissionboolean(req, "case_1")) { + json.put("status", "fail"); + json.put("ms", "添加失败,权限不足,请联系管理员!"); + } else { + StringBuilder sb = new StringBuilder(); + try (BufferedReader reader = req.getReader();) { + char[] buff = new char[1024]; + int len; + while ((len = reader.read(buff)) != -1) { + sb.append(buff, 0, len); + } + } catch (IOException e) { + e.printStackTrace(); + } + JSONObject jsonObject = JSONObject.fromObject(sb.toString()); + String ms="保存用例集失败!"; + String status="fail"; + int projectid = Integer.valueOf(jsonObject.getString("projectid")); + int pid = Integer.valueOf(jsonObject.getString("pid")); + String oldName = jsonObject.getString("oldName"); + String name = jsonObject.getString("name"); + id = Integer.valueOf(jsonObject.getString("id")); + + if(!UserLoginController.oppidboolean(req, projectid)){ + status="fail"; + ms="项目权限不足,请联系管理员!"; + }else{ + if(id!=0){ + ProjectModule pm=moduleservice.load(id); + if(null!=pm&&pm.getProjectid()==projectid&&pm.getPid()==pid&&pm.getModulename().equals(oldName)){ + pm.setModulename(name); + moduleservice.modify(pm); + operationlogservice.add(req, "PROJECT_MODULE", id, pm.getProjectid(), "编辑用例集成功!"); + ms="编辑用例集成功!"; + status="success"; + } + }else{ + projectmodule.setProjectid(projectid); + projectmodule.setPid(pid); + projectmodule.setModulename(name); + id = moduleservice.add(projectmodule); + operationlogservice.add(req, "PROJECT_MODULE", id, projectmodule.getProjectid(), "新增用例集成功!"); + ms="新增用例集成功!"; + status="success"; + } + } + + json.put("status", status); + json.put("ms", ms); + json.put("id", id); + } + pw.print(json.toString()); + + } catch (Exception e) { + e.printStackTrace(); + json.put("status", "保存用例集出现异常!"); + json.put("ms", "fail"); + pw.print(json.toString()); + } + + } + + /** + * 删除用例集 + * + * @param tj + * @param br + * @param model + * @param req + * @param rsp + * @return + * @throws Exception + * @Description: + */ + @RequestMapping(value = "/moduledel.do") + public void delModule(HttpServletRequest req, HttpServletResponse rsp) throws Exception { + try { + rsp.setContentType("text/html;charset=utf-8"); + req.setCharacterEncoding("utf-8"); + PrintWriter pw = rsp.getWriter(); + JSONObject json = new JSONObject(); + if (!UserLoginController.permissionboolean(req, "case_2")) { + json.put("status", "fail"); + json.put("ms", "删除失败,权限不足,请联系管理员!"); + } else { + StringBuilder sb = new StringBuilder(); + try (BufferedReader reader = req.getReader();) { + char[] buff = new char[1024]; + int len; + while ((len = reader.read(buff)) != -1) { + sb.append(buff, 0, len); + } + } catch (IOException e) { + e.printStackTrace(); + } + JSONObject jsonObject = JSONObject.fromObject(sb.toString()); + + int id = Integer.valueOf(jsonObject.getString("id")); + ProjectModule projectmodule = moduleservice.load(id); + + if(!UserLoginController.oppidboolean(req, projectmodule.getProjectid())){ + json.put("status", "fail"); + json.put("ms", "删除失败,项目权限不足,请联系管理员!"); + }else{ + ProjectCase projectcase = new ProjectCase(); + projectcase.setModuleid(id); + if(0!=projectcase.getModuleid()){ + listmoduleid.clear(); + getchildmoduList(projectcase.getProjectid(),projectcase.getModuleid()); + Integer[] moduleidarr=new Integer[listmoduleid.size()+1]; + moduleidarr[0]=projectcase.getModuleid(); + for(int i=0;i modules = moduleservice.getModuleListByProjectid(projectid, id); + for (ProjectModule projectmodule : modules) { + ProjectModuleJson modulejson = new ProjectModuleJson(); + modulejson.setId(projectmodule.getId()); + modulejson.setName(projectmodule.getModulename()); + boolean isParent = moduleservice.getModuleIsParent(projectmodule.getId()); + modulejson.setisParent(isParent); + jsonarr.add(json.fromObject(modulejson)); + } + } else { + List prolist = QueueListener.qa_projlist; + for (SectorProjects sp : prolist) { + if (sp.getProjectid() == projectid) { + ProjectModuleJson modulejson = new ProjectModuleJson(); + modulejson.setId(0); + modulejson.setName(sp.getProjectname()); + List modules = moduleservice.getModuleListByProjectid(projectid, 0); + if (modules.size() > 0) { + modulejson.setisParent(true); + } else { + modulejson.setisParent(false); + } + + jsonarr.add(json.fromObject(modulejson)); + } + } + } + + String jsonstr = jsonarr.toString().replace("parent", "isParent"); + rsp.getWriter().write(jsonstr); + } + + /** + * 查询项目中的所有测试集 + * + * @param tj + * @param br + * @param model + * @param req + * @param rsp + * @return + * @throws Exception + * @Description: + */ + @RequestMapping(value = "/getmodulealllist.do") + public void getmodulealllist(HttpServletRequest req, HttpServletResponse rsp) throws Exception { + rsp.setContentType("text/html;charset=utf-8"); + req.setCharacterEncoding("utf-8"); + int projectid = Integer.valueOf(req.getParameter("projectid")); + JSONArray jsonarr = new JSONArray(); + List modules = moduleservice.getModuleAllListByProjectid(projectid); + for (ProjectModule projectmodule : modules) { + JSONObject json = new JSONObject(); + json.put("moduleid", projectmodule.getId()); + json.put("name", projectmodule.getModulename()); + jsonarr.add(json); + } + + String jsonstr = jsonarr.toString(); + rsp.getWriter().write(jsonstr); + } + + @RequestMapping(value = "/cpostcase.do") + public void cpostcase(HttpServletRequest req, HttpServletResponse rsp) throws IOException { + // 更新实体 + rsp.setContentType("text/html;charset=GBK"); + req.setCharacterEncoding("GBK"); + PrintWriter pw = rsp.getWriter(); + try { + ProjectCase projectcase = new ProjectCase(); + int moduleid=0; + + String name = req.getParameter("name").replace("BBFFHH", "%"); + String projectid = req.getParameter("projectid"); + String modulename = req.getParameter("modulename"); + String casetype = req.getParameter("casetype"); + String remark = req.getParameter("remark"); + + moduleid=moduleservice.getModuleIdByName(modulename); + + projectcase.setName(name); + projectcase.setProjectid(Integer.valueOf(projectid)); + projectcase.setModuleid(moduleid); + projectcase.setCasetype(Integer.valueOf(casetype)); + projectcase.setRemark(remark); + + Date currentTime = new Date(); + SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + String time = formatter.format(currentTime); + projectcase.setTime(time); + projectcase.setOperationer("http-post"); + + SectorProjects sp = sectorprojectsService.loadob(projectcase.getProjectid()); + String maxindex = projectcaseservice.getCaseMaxIndex(projectcase.getProjectid()); + int index = Integer.valueOf(maxindex) + 1; + projectcase.setSign(sp.getProjectsign() + "-" + index); + projectcase.setProjectindex(index); + int caseid = projectcaseservice.add(projectcase); + + pw.print(caseid); + } catch (Exception e) { + // TODO Auto-generated catch block + e.printStackTrace(); + pw.print("fail"); + } + } + + /** + * 使用递归查询指定测试ID中的所有子测试集 + * + * @param tj + * @param br + * @param model + * @param req + * @param rsp + * @return + * @throws Exception + * @Description: + */ + private List getchildmoduList(int projectid,int pid){ + List modules = moduleservice.getModuleListByProjectid(projectid, pid); + for(ProjectModule pm: modules){ + listmoduleid.add(pm.getId()); + //递归遍历下一级 + getchildmoduList(projectid,pm.getId()); + } + return listmoduleid; + } + + public static void main(String[] args) throws Exception { + + } + +} diff --git a/src/main/java/luckyweb/seagull/spring/mvc/ProjectCasestepsController.java b/src/main/java/luckyweb/seagull/spring/mvc/ProjectCasestepsController.java index dac67fb..67a7e5b 100644 --- a/src/main/java/luckyweb/seagull/spring/mvc/ProjectCasestepsController.java +++ b/src/main/java/luckyweb/seagull/spring/mvc/ProjectCasestepsController.java @@ -1,562 +1,562 @@ -package luckyweb.seagull.spring.mvc; - -import java.io.BufferedReader; -import java.io.IOException; -import java.io.PrintWriter; -import java.rmi.Naming; -import java.rmi.RemoteException; -import java.text.SimpleDateFormat; -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import javax.validation.Valid; - -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.validation.BindingResult; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; - -import luckyweb.seagull.spring.entity.ProjectCase; -import luckyweb.seagull.spring.entity.ProjectCasesteps; -import luckyweb.seagull.spring.entity.SectorProjects; -import luckyweb.seagull.spring.entity.TempCasestepDebug; -import luckyweb.seagull.spring.entity.TestClient; -import luckyweb.seagull.spring.service.OperationLogService; -import luckyweb.seagull.spring.service.ProjectCaseService; -import luckyweb.seagull.spring.service.ProjectCasestepsService; -import luckyweb.seagull.spring.service.SectorProjectsService; -import luckyweb.seagull.spring.service.TempCasestepDebugService; -import luckyweb.seagull.spring.service.TestClientService; -import luckyweb.seagull.spring.service.UserInfoService; -import luckyweb.seagull.util.StrLib; -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; -import net.sf.json.JsonConfig; -import rmi.service.RunService; - -@Controller -@RequestMapping("/projectCasesteps") -public class ProjectCasestepsController { - - @Resource(name = "projectCaseService") - private ProjectCaseService projectcaseservice; - - @Resource(name = "projectCasestepsService") - private ProjectCasestepsService casestepsservice; - - @Resource(name = "tempcasestepdebugService") - private TempCasestepDebugService tempdebugservice; - - @Resource(name = "sectorprojectsService") - private SectorProjectsService sectorprojectsService; - - @Resource(name = "operationlogService") - private OperationLogService operationlogservice; - - @Resource(name = "userinfoService") - private UserInfoService userinfoservice; - - @Resource(name = "testclientService") - private TestClientService tcservice; - - /** - * 添加步骤 - * - * @param tj - * @param br - * @param model - * @param req - * @param rsp - * @return - * @throws Exception - * @Description: - */ - @RequestMapping(value = "/stepadd.do") - public String add(@Valid @ModelAttribute("casesteps") ProjectCasesteps casesteps, BindingResult br, Model model, - HttpServletRequest req, HttpServletResponse rsp) throws Exception { - try { - rsp.setContentType("text/html;charset=utf-8"); - req.setCharacterEncoding("utf-8"); - - if (!UserLoginController.permissionboolean(req, "case_step")) { - model.addAttribute("casesteps", new ProjectCasesteps()); - model.addAttribute("url", "/projectCase/load.do"); - model.addAttribute("message", "当前用户无权限管理用例步骤,请联系管理员!"); - return "success"; - } - - String caseid = req.getParameter("caseid"); - ProjectCase prcase = null; - if (!StrLib.isEmpty(caseid) && !"0".equals(caseid)) { - prcase = projectcaseservice.load(Integer.valueOf(caseid)); - } - - if(!UserLoginController.oppidboolean(req, prcase.getProjectid())){ - SectorProjects sp=sectorprojectsService.loadob(prcase.getProjectid()); - model.addAttribute("url", "/projectCase/load.do"); - model.addAttribute("message", "当前用户无权限管理项目【"+sp.getProjectname()+"】用例步骤,请联系管理员!"); - return "error"; - } - - String retVal = "/jsp/plancase/step_add"; - List steps = casestepsservice.getSteps(Integer.valueOf(caseid)); - if (steps.size() == 0) { - ProjectCasesteps step = new ProjectCasesteps(); - step.setPath(""); - step.setOperation(""); - step.setParameters(""); - step.setAction(""); - step.setCaseid(Integer.valueOf(caseid)); - step.setStepnum(1); - step.setExpectedresult(""); - step.setProjectid(prcase.getProjectid()); - step.setSteptype(prcase.getCasetype()); - step.setRemark(""); - steps.add(step); - } - - model.addAttribute("casesign", prcase.getSign()); - model.addAttribute("casename", prcase.getName()); - model.addAttribute("casetype", prcase.getCasetype()); - model.addAttribute("caseid", caseid); - model.addAttribute("projectid", prcase.getProjectid()); - model.addAttribute("steps", steps); - List iplist = tcservice.getClientListForProid(prcase.getProjectid()); - for(TestClient tc:iplist){ - if(tc.getStatus()==0){ - tc.setProjectper("【"+tc.getName()+"】"+tc.getClientip()+" 状态正常"); - }else if(tc.getStatus()==1){ - tc.setProjectper("【"+tc.getName()+"】"+tc.getClientip()+" 状态异常"); - }else{ - tc.setProjectper("【"+tc.getName()+"】"+tc.getClientip()+" 状态未知"); - } - } - model.addAttribute("iplist", iplist); - return retVal; - - } catch (Exception e) { - System.out.println(e); - model.addAttribute("message", e.getMessage()); - model.addAttribute("url", "/projectCase/load.do"); - return "error"; - } - - } - - /** - * - * - * @param tj - * @param model - * @return - * @throws Exception - */ - - @RequestMapping(value = "/editsteps.do") - private void editsteps(HttpServletRequest request, HttpServletResponse response) throws Exception { - response.setContentType("text/html;charset=utf-8"); - request.setCharacterEncoding("utf-8"); - PrintWriter pw = response.getWriter(); - StringBuilder sb = new StringBuilder(); - JSONObject json = new JSONObject(); - if (!UserLoginController.permissionboolean(request, "case_step")) { - json.put("status", "fail"); - json.put("ms", "编辑失败,权限不足,请联系管理员!"); - } else { - try (BufferedReader reader = request.getReader();) { - char[] buff = new char[1024]; - int len; - while ((len = reader.read(buff)) != -1) { - sb.append(buff, 0, len); - } - } catch (IOException e) { - e.printStackTrace(); - } - String jsonstr = sb.toString().substring(1, sb.toString().length() - 1); - jsonstr = jsonstr.replace("\\\"", "\""); - jsonstr = jsonstr.replace("undefined", "0"); - - JSONArray jsonarr = JSONArray.fromObject(jsonstr); - List list = JSONArray.toList(jsonarr, new ProjectCasesteps(), new JsonConfig());// 参数1为要转换的JSONArray数据,参数2为要转换的目标数据,即List盛装的数据 - String usercode = ""; - if (null != request.getSession().getAttribute("usercode") - && null != request.getSession().getAttribute("username")) { - usercode = request.getSession().getAttribute("usercode").toString(); - } - Date currentTime = new Date(); - SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); - String time = formatter.format(currentTime); - ProjectCase projectcase = new ProjectCase(); - for (int i = 0; i < list.size(); i++) { - ProjectCasesteps step = (ProjectCasesteps) list.get(i); - if (i == 0) { - casestepsservice.delforcaseid(step.getCaseid()); - projectcase = projectcaseservice.load(step.getCaseid()); - } - step.setOperationer(usercode); - step.setTime(time); - step.setOperation(step.getOperation().replaceAll(""", "\"")); - step.setPath(step.getPath().replaceAll(""", "\"")); - step.setParameters(step.getParameters().replaceAll(""", "\"")); - step.setAction(step.getAction().replaceAll(""", "\"")); - step.setExpectedresult(step.getExpectedresult().replaceAll(""", "\"")); - step.setRemark(step.getRemark().replaceAll(""", "\"")); - casestepsservice.add(step); - - projectcase.setOperationer(usercode); - projectcase.setTime(time); - projectcaseservice.modify(projectcase); - } - json.put("status", "success"); - json.put("ms", "编辑步骤成功!"); - } - pw.print(json.toString()); - } - - /** - * - * - * @param tj - * @param model - * @return - * @throws Exception - */ - - @RequestMapping(value = "/list.do") - private void ajaxGetSellRecord(HttpServletRequest request, HttpServletResponse response) throws IOException { - response.setCharacterEncoding("utf-8"); - PrintWriter pw = response.getWriter(); - String strParentID = request.getParameter("strParentID"); - int caseid = 0; - if (!StrLib.isEmpty(strParentID)) { - caseid = Integer.valueOf(strParentID); - } - List casesteps = new ArrayList(); - try { - casesteps = casestepsservice.getSteps(caseid); - } catch (Exception e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - // 转换成json字符串 - String RecordJson = StrLib.listToJson(casesteps); - pw.print(RecordJson); - } - - @RequestMapping(value = "/update.do") - public void updatestep(HttpServletRequest req, HttpServletResponse rsp, ProjectCasesteps casesteps) { - // 更新实体 - try { - rsp.setContentType("text/html;charset=utf-8"); - req.setCharacterEncoding("utf-8"); - PrintWriter pw = rsp.getWriter(); - StringBuilder sb = new StringBuilder(); - JSONObject json = new JSONObject(); - if (!UserLoginController.permissionboolean(req, "case_step")) { - json.put("status", "fail"); - json.put("ms", "编辑失败,权限不足,请联系管理员!"); - } else { - ProjectCase projectcase = new ProjectCase(); - if (null != req.getSession().getAttribute("usercode") - && null != req.getSession().getAttribute("username")) { - String usercode = req.getSession().getAttribute("usercode").toString(); - casesteps.setOperationer(usercode); - projectcase = projectcaseservice.load(casesteps.getCaseid()); - projectcase.setOperationer(usercode); - } - if(!UserLoginController.oppidboolean(req, projectcase.getProjectid())){ - json.put("status", "fail"); - json.put("ms", "编辑失败,项目权限不足,请联系管理员!"); - }else{ - Date currentTime = new Date(); - SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); - String time = formatter.format(currentTime); - casesteps.setTime(time); - - casestepsservice.modify(casesteps); - - projectcase.setTime(time); - projectcaseservice.modify(projectcase); - - json.put("status", "success"); - json.put("ms", "编辑步骤成功!"); - } - - } - pw.print(json.toString()); - } catch (Exception e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - } - - /** - * - * - * @param tj - * @param model - * @return - * @throws Exception - */ - - @RequestMapping(value = "/debugcase.do") - private void debugCase(HttpServletRequest request, HttpServletResponse response) throws IOException { - response.setCharacterEncoding("utf-8"); - PrintWriter pw = response.getWriter(); - JSONObject json = new JSONObject(); - String casesign = request.getParameter("casesign"); - String clientip = request.getParameter("clientip"); - String clientpath = request.getParameter("clientpath"); - String status="error"; - String ms="调试用例启动失败!"; - try { - if (null != request.getSession().getAttribute("usercode") - && null != request.getSession().getAttribute("username")) { - String usercode = request.getSession().getAttribute("usercode").toString(); - - tempdebugservice.delete(casesign, usercode); - - // 调用远程对象,注意RMI路径与接口必须与服务器配置一致 - RunService service = (RunService) Naming.lookup("rmi://" + clientip + ":6633/RunService"); - String result = service.webdebugcase(casesign, usercode,clientpath); - - status="success"; - ms=result; - }else{ - status="fail"; - ms="检测到用户未登录,请重新登录!"; - } - } catch (RemoteException e) { - // TODO Auto-generated catch block - ms="远程链接异常,请检查客户端!"; - } catch (Exception e) { - // TODO Auto-generated catch block - e.printStackTrace(); - }finally{ - json.put("status", status); - json.put("ms", ms); - - pw.print(json.toString()); - } - - } - - /** - * - * - * @param tj - * @param model - * @return - * @throws Exception - */ - - @RequestMapping(value = "/refreshlog.do") - private void refreshDebugLog(HttpServletRequest request, HttpServletResponse response) throws IOException { - response.setCharacterEncoding("utf-8"); - PrintWriter pw = response.getWriter(); - JSONObject json = new JSONObject(); - String casesign = request.getParameter("casesign"); - String status="error"; - String ms="获取调试日志失败!"; - try { - if (null != request.getSession().getAttribute("usercode") - && null != request.getSession().getAttribute("username")) { - String usercode = request.getSession().getAttribute("usercode").toString(); - - List tcdlist=tempdebugservice.getList(casesign, usercode); - ms=""; - for(TempCasestepDebug tcd:tcdlist){ - ms=ms+tcd.getLoglevel()+": "+tcd.getDetail()+"
"; - } - - if(null!=tcdlist&&tcdlist.size()>1){ - String lastloglevel=tcdlist.get(tcdlist.size()-1).getLoglevel(); - if(lastloglevel.indexOf("over")>-1){ - status="info"; - }else{ - status="success"; - } - }else{ - status="success"; - } - - - }else{ - status="fail"; - ms="检测到用户未登录,请重新登录!"; - } - } catch (Exception e) { - // TODO Auto-generated catch block - status="fail"; - ms="刷新日志出现异常!"; - e.printStackTrace(); - } - json.put("status", status); - json.put("ms", ms); - - pw.print(json.toString()); - } - - - @RequestMapping(value = "/cgetStepsByCase.do") - public void cgetStepsByCase(HttpServletRequest req, HttpServletResponse rsp) { - // 更新实体 - try { - rsp.setContentType("text/html;charset=GBK"); - req.setCharacterEncoding("GBK"); - PrintWriter pw = rsp.getWriter(); - JSONObject json = new JSONObject(); - String caseid = req.getParameter("caseid"); - - List steps = casestepsservice.getSteps(Integer.valueOf(caseid)); - - // 转换成json字符串 - String RecordJson = StrLib.listToJson(steps); - - // 需要返回的数据有总记录数和行数据 - json.put("steps", RecordJson); - pw.print(json.toString()); - } catch (Exception e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - } - - @RequestMapping(value = "/cpoststep.do") - public void cpoststep(HttpServletRequest req, HttpServletResponse rsp) throws IOException { - // 更新实体 - rsp.setContentType("text/html;charset=GBK"); - req.setCharacterEncoding("GBK"); - PrintWriter pw = rsp.getWriter(); - try { - ProjectCasesteps steps = new ProjectCasesteps(); - - String path = req.getParameter("path"); - if (null != path) { - path = path.replace("DHDHDH", "="); - } - String operation = req.getParameter("operation"); - String parameters = req.getParameter("parameters"); - if (null != parameters) { - parameters = parameters.replace("BBFFHH", "%"); - } - String action = req.getParameter("action"); - String caseid = req.getParameter("caseid"); - String stepnum = req.getParameter("stepnum"); - String expectedresult = req.getParameter("expectedresult"); - if (null != expectedresult) { - expectedresult = expectedresult.replace("BBFFHH", "%"); - } - String projectid = req.getParameter("projectid"); - String steptype = req.getParameter("steptype"); - steps.setPath(path); - steps.setOperation(operation); - steps.setParameters(parameters); - steps.setAction(action); - steps.setCaseid(Integer.valueOf(caseid)); - steps.setStepnum(Integer.valueOf(stepnum)); - steps.setExpectedresult(expectedresult); - steps.setProjectid(Integer.valueOf(projectid)); - steps.setSteptype(Integer.valueOf(steptype)); - - Date currentTime = new Date(); - SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); - String time = formatter.format(currentTime); - steps.setTime(time); - steps.setOperationer("http-post"); - - int stepid = casestepsservice.add(steps); - - pw.print(stepid); - } catch (Exception e) { - // TODO Auto-generated catch block - e.printStackTrace(); - pw.print("fail"); - } - } - - @RequestMapping(value = "/cUpdateStepExpectedResults.do") - public void cUpdateStepExpectedResults(HttpServletRequest req, HttpServletResponse rsp) { - try { - rsp.setContentType("text/html;charset=GBK"); - req.setCharacterEncoding("GBK"); - PrintWriter pw = rsp.getWriter(); - String caseno = req.getParameter("caseno"); - String stepnum = req.getParameter("stepnum"); - String expectedresults = req.getParameter("expectedresults"); - expectedresults = expectedresults.replace("BBFFHH", "%"); - expectedresults = expectedresults.replace("DHDHDH", "="); - expectedresults = expectedresults.replace("ANDAND", "&"); - - String result = "更新用例【" + caseno + "】第【" + stepnum + "】步失败,预期结果【" + expectedresults + "】"; - ProjectCase pc = projectcaseservice.getCaseBySign(caseno); - List steps = casestepsservice.getSteps(pc.getId()); - - for (ProjectCasesteps step : steps) { - if (stepnum.equals(String.valueOf(step.getStepnum()))) { - Date currentTime = new Date(); - SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); - String time = formatter.format(currentTime); - - step.setTime(time); - step.setOperationer("http-post"); - step.setExpectedresult(expectedresults); - - pc.setTime(time); - pc.setOperationer("http-post"); - - casestepsservice.modify(step); - projectcaseservice.modify(pc); - result = "更新用例【" + caseno + "】第【" + stepnum + "】步成功,预期结果【" + expectedresults + "】"; - break; - } - } - pw.print(result); - } catch (Exception e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - } - - @RequestMapping(value = "/cPostDebugLog.do") - public void cPostDebugLog(HttpServletRequest req, HttpServletResponse rsp) { - // 更新实体 - try { - rsp.setContentType("text/html;charset=GBK"); - req.setCharacterEncoding("GBK"); - PrintWriter pw = rsp.getWriter(); - String sign = req.getParameter("sign"); - String executor = req.getParameter("executor"); - String loglevel = req.getParameter("loglevel"); - String detail = req.getParameter("detail"); - sign = sign.replace("BBFFHH", "%"); - sign = sign.replace("DHDHDH", "="); - sign = sign.replace("ANDAND", "&"); - detail = detail.replace("BBFFHH", "%"); - detail = detail.replace("DHDHDH", "="); - detail = detail.replace("ANDAND", "&"); - - TempCasestepDebug tcd = new TempCasestepDebug(); - tcd.setSign(sign); - tcd.setExecutor(executor); - tcd.setLoglevel(loglevel); - tcd.setDetail(detail); - int id = tempdebugservice.add(tcd); - - pw.print(id); - } catch (Exception e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - } - - public static void main(String[] args) throws Exception { - - } - -} +package luckyweb.seagull.spring.mvc; + +import java.io.BufferedReader; +import java.io.IOException; +import java.io.PrintWriter; +import java.rmi.Naming; +import java.rmi.RemoteException; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import javax.validation.Valid; + +import org.springframework.stereotype.Controller; +import org.springframework.ui.Model; +import org.springframework.validation.BindingResult; +import org.springframework.web.bind.annotation.ModelAttribute; +import org.springframework.web.bind.annotation.RequestMapping; + +import luckyweb.seagull.spring.entity.ProjectCase; +import luckyweb.seagull.spring.entity.ProjectCasesteps; +import luckyweb.seagull.spring.entity.SectorProjects; +import luckyweb.seagull.spring.entity.TempCasestepDebug; +import luckyweb.seagull.spring.entity.TestClient; +import luckyweb.seagull.spring.service.OperationLogService; +import luckyweb.seagull.spring.service.ProjectCaseService; +import luckyweb.seagull.spring.service.ProjectCasestepsService; +import luckyweb.seagull.spring.service.SectorProjectsService; +import luckyweb.seagull.spring.service.TempCasestepDebugService; +import luckyweb.seagull.spring.service.TestClientService; +import luckyweb.seagull.spring.service.UserInfoService; +import luckyweb.seagull.util.StrLib; +import net.sf.json.JSONArray; +import net.sf.json.JSONObject; +import net.sf.json.JsonConfig; +import rmi.service.RunService; + +@Controller +@RequestMapping("/projectCasesteps") +public class ProjectCasestepsController { + + @Resource(name = "projectCaseService") + private ProjectCaseService projectcaseservice; + + @Resource(name = "projectCasestepsService") + private ProjectCasestepsService casestepsservice; + + @Resource(name = "tempcasestepdebugService") + private TempCasestepDebugService tempdebugservice; + + @Resource(name = "sectorprojectsService") + private SectorProjectsService sectorprojectsService; + + @Resource(name = "operationlogService") + private OperationLogService operationlogservice; + + @Resource(name = "userinfoService") + private UserInfoService userinfoservice; + + @Resource(name = "testclientService") + private TestClientService tcservice; + + /** + * 添加步骤 + * + * @param tj + * @param br + * @param model + * @param req + * @param rsp + * @return + * @throws Exception + * @Description: + */ + @RequestMapping(value = "/stepadd.do") + public String add(@Valid @ModelAttribute("casesteps") ProjectCasesteps casesteps, BindingResult br, Model model, + HttpServletRequest req, HttpServletResponse rsp) throws Exception { + try { + rsp.setContentType("text/html;charset=utf-8"); + req.setCharacterEncoding("utf-8"); + + if (!UserLoginController.permissionboolean(req, "case_step")) { + model.addAttribute("casesteps", new ProjectCasesteps()); + model.addAttribute("url", "/projectCase/load.do"); + model.addAttribute("message", "当前用户无权限管理用例步骤,请联系管理员!"); + return "success"; + } + + String caseid = req.getParameter("caseid"); + ProjectCase prcase = null; + if (!StrLib.isEmpty(caseid) && !"0".equals(caseid)) { + prcase = projectcaseservice.load(Integer.valueOf(caseid)); + } + + if(!UserLoginController.oppidboolean(req, prcase.getProjectid())){ + SectorProjects sp=sectorprojectsService.loadob(prcase.getProjectid()); + model.addAttribute("url", "/projectCase/load.do"); + model.addAttribute("message", "当前用户无权限管理项目【"+sp.getProjectname()+"】用例步骤,请联系管理员!"); + return "error"; + } + + String retVal = "/jsp/plancase/step_add"; + List steps = casestepsservice.getSteps(Integer.valueOf(caseid)); + if (steps.size() == 0) { + ProjectCasesteps step = new ProjectCasesteps(); + step.setPath(""); + step.setOperation(""); + step.setParameters(""); + step.setAction(""); + step.setCaseid(Integer.valueOf(caseid)); + step.setStepnum(1); + step.setExpectedresult(""); + step.setProjectid(prcase.getProjectid()); + step.setSteptype(prcase.getCasetype()); + step.setRemark(""); + steps.add(step); + } + + model.addAttribute("casesign", prcase.getSign()); + model.addAttribute("casename", prcase.getName()); + model.addAttribute("casetype", prcase.getCasetype()); + model.addAttribute("caseid", caseid); + model.addAttribute("projectid", prcase.getProjectid()); + model.addAttribute("steps", steps); + List iplist = tcservice.getClientListForProid(prcase.getProjectid()); + for(TestClient tc:iplist){ + if(tc.getStatus()==0){ + tc.setProjectper("【"+tc.getName()+"】"+tc.getClientip()+" 状态正常"); + }else if(tc.getStatus()==1){ + tc.setProjectper("【"+tc.getName()+"】"+tc.getClientip()+" 状态异常"); + }else{ + tc.setProjectper("【"+tc.getName()+"】"+tc.getClientip()+" 状态未知"); + } + } + model.addAttribute("iplist", iplist); + return retVal; + + } catch (Exception e) { + System.out.println(e); + model.addAttribute("message", e.getMessage()); + model.addAttribute("url", "/projectCase/load.do"); + return "error"; + } + + } + + /** + * + * + * @param tj + * @param model + * @return + * @throws Exception + */ + + @RequestMapping(value = "/editsteps.do") + private void editsteps(HttpServletRequest request, HttpServletResponse response) throws Exception { + response.setContentType("text/html;charset=utf-8"); + request.setCharacterEncoding("utf-8"); + PrintWriter pw = response.getWriter(); + StringBuilder sb = new StringBuilder(); + JSONObject json = new JSONObject(); + if (!UserLoginController.permissionboolean(request, "case_step")) { + json.put("status", "fail"); + json.put("ms", "编辑失败,权限不足,请联系管理员!"); + } else { + try (BufferedReader reader = request.getReader();) { + char[] buff = new char[1024]; + int len; + while ((len = reader.read(buff)) != -1) { + sb.append(buff, 0, len); + } + } catch (IOException e) { + e.printStackTrace(); + } + String jsonstr = sb.toString().substring(1, sb.toString().length() - 1); + jsonstr = jsonstr.replace("\\\"", "\""); + jsonstr = jsonstr.replace("undefined", "0"); + + JSONArray jsonarr = JSONArray.fromObject(jsonstr); + List list = JSONArray.toList(jsonarr, new ProjectCasesteps(), new JsonConfig());// 参数1为要转换的JSONArray数据,参数2为要转换的目标数据,即List盛装的数据 + String usercode = ""; + if (null != request.getSession().getAttribute("usercode") + && null != request.getSession().getAttribute("username")) { + usercode = request.getSession().getAttribute("usercode").toString(); + } + Date currentTime = new Date(); + SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + String time = formatter.format(currentTime); + ProjectCase projectcase = new ProjectCase(); + for (int i = 0; i < list.size(); i++) { + ProjectCasesteps step = (ProjectCasesteps) list.get(i); + if (i == 0) { + casestepsservice.delforcaseid(step.getCaseid()); + projectcase = projectcaseservice.load(step.getCaseid()); + } + step.setOperationer(usercode); + step.setTime(time); + step.setOperation(step.getOperation().replaceAll(""", "\"")); + step.setPath(step.getPath().replaceAll(""", "\"")); + step.setParameters(step.getParameters().replaceAll(""", "\"")); + step.setAction(step.getAction().replaceAll(""", "\"")); + step.setExpectedresult(step.getExpectedresult().replaceAll(""", "\"")); + step.setRemark(step.getRemark().replaceAll(""", "\"")); + casestepsservice.add(step); + + projectcase.setOperationer(usercode); + projectcase.setTime(time); + projectcaseservice.modify(projectcase); + } + json.put("status", "success"); + json.put("ms", "编辑步骤成功!"); + } + pw.print(json.toString()); + } + + /** + * + * + * @param tj + * @param model + * @return + * @throws Exception + */ + + @RequestMapping(value = "/list.do") + private void ajaxGetSellRecord(HttpServletRequest request, HttpServletResponse response) throws IOException { + response.setCharacterEncoding("utf-8"); + PrintWriter pw = response.getWriter(); + String strParentID = request.getParameter("strParentID"); + int caseid = 0; + if (!StrLib.isEmpty(strParentID)) { + caseid = Integer.valueOf(strParentID); + } + List casesteps = new ArrayList(); + try { + casesteps = casestepsservice.getSteps(caseid); + } catch (Exception e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + // 转换成json字符串 + String RecordJson = StrLib.listToJson(casesteps); + pw.print(RecordJson); + } + + @RequestMapping(value = "/update.do") + public void updatestep(HttpServletRequest req, HttpServletResponse rsp, ProjectCasesteps casesteps) { + // 更新实体 + try { + rsp.setContentType("text/html;charset=utf-8"); + req.setCharacterEncoding("utf-8"); + PrintWriter pw = rsp.getWriter(); + StringBuilder sb = new StringBuilder(); + JSONObject json = new JSONObject(); + if (!UserLoginController.permissionboolean(req, "case_step")) { + json.put("status", "fail"); + json.put("ms", "编辑失败,权限不足,请联系管理员!"); + } else { + ProjectCase projectcase = new ProjectCase(); + if (null != req.getSession().getAttribute("usercode") + && null != req.getSession().getAttribute("username")) { + String usercode = req.getSession().getAttribute("usercode").toString(); + casesteps.setOperationer(usercode); + projectcase = projectcaseservice.load(casesteps.getCaseid()); + projectcase.setOperationer(usercode); + } + if(!UserLoginController.oppidboolean(req, projectcase.getProjectid())){ + json.put("status", "fail"); + json.put("ms", "编辑失败,项目权限不足,请联系管理员!"); + }else{ + Date currentTime = new Date(); + SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + String time = formatter.format(currentTime); + casesteps.setTime(time); + + casestepsservice.modify(casesteps); + + projectcase.setTime(time); + projectcaseservice.modify(projectcase); + + json.put("status", "success"); + json.put("ms", "编辑步骤成功!"); + } + + } + pw.print(json.toString()); + } catch (Exception e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + + /** + * + * + * @param tj + * @param model + * @return + * @throws Exception + */ + + @RequestMapping(value = "/debugcase.do") + private void debugCase(HttpServletRequest request, HttpServletResponse response) throws IOException { + response.setCharacterEncoding("utf-8"); + PrintWriter pw = response.getWriter(); + JSONObject json = new JSONObject(); + String casesign = request.getParameter("casesign"); + String clientip = request.getParameter("clientip"); + String clientpath = request.getParameter("clientpath"); + String status="error"; + String ms="调试用例启动失败!"; + try { + if (null != request.getSession().getAttribute("usercode") + && null != request.getSession().getAttribute("username")) { + String usercode = request.getSession().getAttribute("usercode").toString(); + + tempdebugservice.delete(casesign, usercode); + + // 调用远程对象,注意RMI路径与接口必须与服务器配置一致 + RunService service = (RunService) Naming.lookup("rmi://" + clientip + ":6633/RunService"); + String result = service.webdebugcase(casesign, usercode,clientpath); + + status="success"; + ms=result; + }else{ + status="fail"; + ms="检测到用户未登录,请重新登录!"; + } + } catch (RemoteException e) { + // TODO Auto-generated catch block + ms="远程链接异常,请检查客户端!"; + } catch (Exception e) { + // TODO Auto-generated catch block + e.printStackTrace(); + }finally{ + json.put("status", status); + json.put("ms", ms); + + pw.print(json.toString()); + } + + } + + /** + * + * + * @param tj + * @param model + * @return + * @throws Exception + */ + + @RequestMapping(value = "/refreshlog.do") + private void refreshDebugLog(HttpServletRequest request, HttpServletResponse response) throws IOException { + response.setCharacterEncoding("utf-8"); + PrintWriter pw = response.getWriter(); + JSONObject json = new JSONObject(); + String casesign = request.getParameter("casesign"); + String status="error"; + String ms="获取调试日志失败!"; + try { + if (null != request.getSession().getAttribute("usercode") + && null != request.getSession().getAttribute("username")) { + String usercode = request.getSession().getAttribute("usercode").toString(); + + List tcdlist=tempdebugservice.getList(casesign, usercode); + ms=""; + for(TempCasestepDebug tcd:tcdlist){ + ms=ms+tcd.getLoglevel()+": "+tcd.getDetail()+"
"; + } + + if(null!=tcdlist&&tcdlist.size()>1){ + String lastloglevel=tcdlist.get(tcdlist.size()-1).getLoglevel(); + if(lastloglevel.indexOf("over")>-1){ + status="info"; + }else{ + status="success"; + } + }else{ + status="success"; + } + + + }else{ + status="fail"; + ms="检测到用户未登录,请重新登录!"; + } + } catch (Exception e) { + // TODO Auto-generated catch block + status="fail"; + ms="刷新日志出现异常!"; + e.printStackTrace(); + } + json.put("status", status); + json.put("ms", ms); + + pw.print(json.toString()); + } + + + @RequestMapping(value = "/cgetStepsByCase.do") + public void cgetStepsByCase(HttpServletRequest req, HttpServletResponse rsp) { + // 更新实体 + try { + rsp.setContentType("text/html;charset=GBK"); + req.setCharacterEncoding("GBK"); + PrintWriter pw = rsp.getWriter(); + JSONObject json = new JSONObject(); + String caseid = req.getParameter("caseid"); + + List steps = casestepsservice.getSteps(Integer.valueOf(caseid)); + + // 转换成json字符串 + String RecordJson = StrLib.listToJson(steps); + + // 需要返回的数据有总记录数和行数据 + json.put("steps", RecordJson); + pw.print(json.toString()); + } catch (Exception e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + + @RequestMapping(value = "/cpoststep.do") + public void cpoststep(HttpServletRequest req, HttpServletResponse rsp) throws IOException { + // 更新实体 + rsp.setContentType("text/html;charset=GBK"); + req.setCharacterEncoding("GBK"); + PrintWriter pw = rsp.getWriter(); + try { + ProjectCasesteps steps = new ProjectCasesteps(); + + String path = req.getParameter("path"); + if (null != path) { + path = path.replace("DHDHDH", "="); + } + String operation = req.getParameter("operation"); + String parameters = req.getParameter("parameters"); + if (null != parameters) { + parameters = parameters.replace("BBFFHH", "%"); + } + String action = req.getParameter("action"); + String caseid = req.getParameter("caseid"); + String stepnum = req.getParameter("stepnum"); + String expectedresult = req.getParameter("expectedresult"); + if (null != expectedresult) { + expectedresult = expectedresult.replace("BBFFHH", "%"); + } + String projectid = req.getParameter("projectid"); + String steptype = req.getParameter("steptype"); + steps.setPath(path); + steps.setOperation(operation); + steps.setParameters(parameters); + steps.setAction(action); + steps.setCaseid(Integer.valueOf(caseid)); + steps.setStepnum(Integer.valueOf(stepnum)); + steps.setExpectedresult(expectedresult); + steps.setProjectid(Integer.valueOf(projectid)); + steps.setSteptype(Integer.valueOf(steptype)); + + Date currentTime = new Date(); + SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + String time = formatter.format(currentTime); + steps.setTime(time); + steps.setOperationer("http-post"); + + int stepid = casestepsservice.add(steps); + + pw.print(stepid); + } catch (Exception e) { + // TODO Auto-generated catch block + e.printStackTrace(); + pw.print("fail"); + } + } + + @RequestMapping(value = "/cUpdateStepExpectedResults.do") + public void cUpdateStepExpectedResults(HttpServletRequest req, HttpServletResponse rsp) { + try { + rsp.setContentType("text/html;charset=GBK"); + req.setCharacterEncoding("GBK"); + PrintWriter pw = rsp.getWriter(); + String caseno = req.getParameter("caseno"); + String stepnum = req.getParameter("stepnum"); + String expectedresults = req.getParameter("expectedresults"); + expectedresults = expectedresults.replace("BBFFHH", "%"); + expectedresults = expectedresults.replace("DHDHDH", "="); + expectedresults = expectedresults.replace("ANDAND", "&"); + + String result = "更新用例【" + caseno + "】第【" + stepnum + "】步失败,预期结果【" + expectedresults + "】"; + ProjectCase pc = projectcaseservice.getCaseBySign(caseno); + List steps = casestepsservice.getSteps(pc.getId()); + + for (ProjectCasesteps step : steps) { + if (stepnum.equals(String.valueOf(step.getStepnum()))) { + Date currentTime = new Date(); + SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + String time = formatter.format(currentTime); + + step.setTime(time); + step.setOperationer("http-post"); + step.setExpectedresult(expectedresults); + + pc.setTime(time); + pc.setOperationer("http-post"); + + casestepsservice.modify(step); + projectcaseservice.modify(pc); + result = "更新用例【" + caseno + "】第【" + stepnum + "】步成功,预期结果【" + expectedresults + "】"; + break; + } + } + pw.print(result); + } catch (Exception e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + + @RequestMapping(value = "/cPostDebugLog.do") + public void cPostDebugLog(HttpServletRequest req, HttpServletResponse rsp) { + // 更新实体 + try { + rsp.setContentType("text/html;charset=GBK"); + req.setCharacterEncoding("GBK"); + PrintWriter pw = rsp.getWriter(); + String sign = req.getParameter("sign"); + String executor = req.getParameter("executor"); + String loglevel = req.getParameter("loglevel"); + String detail = req.getParameter("detail"); + sign = sign.replace("BBFFHH", "%"); + sign = sign.replace("DHDHDH", "="); + sign = sign.replace("ANDAND", "&"); + detail = detail.replace("BBFFHH", "%"); + detail = detail.replace("DHDHDH", "="); + detail = detail.replace("ANDAND", "&"); + + TempCasestepDebug tcd = new TempCasestepDebug(); + tcd.setSign(sign); + tcd.setExecutor(executor); + tcd.setLoglevel(loglevel); + tcd.setDetail(detail); + int id = tempdebugservice.add(tcd); + + pw.print(id); + } catch (Exception e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + + public static void main(String[] args) throws Exception { + + } + +} diff --git a/src/main/java/luckyweb/seagull/spring/mvc/ProjectPlanCaseController.java b/src/main/java/luckyweb/seagull/spring/mvc/ProjectPlanCaseController.java index 70bffc1..007ed71 100644 --- a/src/main/java/luckyweb/seagull/spring/mvc/ProjectPlanCaseController.java +++ b/src/main/java/luckyweb/seagull/spring/mvc/ProjectPlanCaseController.java @@ -1,430 +1,430 @@ -package luckyweb.seagull.spring.mvc; - -import java.io.BufferedReader; -import java.io.IOException; -import java.io.PrintWriter; -import java.text.SimpleDateFormat; -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.RequestMapping; - -import luckyweb.seagull.spring.entity.ProjectCase; -import luckyweb.seagull.spring.entity.ProjectModule; -import luckyweb.seagull.spring.entity.ProjectPlan; -import luckyweb.seagull.spring.entity.ProjectPlanCase; -import luckyweb.seagull.spring.entity.SectorProjects; -import luckyweb.seagull.spring.service.OperationLogService; -import luckyweb.seagull.spring.service.ProjectCaseService; -import luckyweb.seagull.spring.service.ProjectModuleService; -import luckyweb.seagull.spring.service.ProjectPlanCaseService; -import luckyweb.seagull.spring.service.ProjectPlanService; -import luckyweb.seagull.spring.service.SectorProjectsService; -import luckyweb.seagull.spring.service.UserInfoService; -import luckyweb.seagull.util.StrLib; -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; - -@Controller -@RequestMapping("/projectPlanCase") -public class ProjectPlanCaseController { - - @Resource(name = "projectPlanCaseService") - private ProjectPlanCaseService projectplancaseservice; - - @Resource(name = "projectPlanService") - private ProjectPlanService projectplanservice; - - @Resource(name = "projectModuleService") - private ProjectModuleService moduleservice; - - @Resource(name = "projectCaseService") - private ProjectCaseService projectcaseservice; - - @Resource(name = "sectorprojectsService") - private SectorProjectsService sectorprojectsService; - - @Resource(name = "operationlogService") - private OperationLogService operationlogservice; - - @Resource(name = "userinfoService") - private UserInfoService userinfoservice; - - private List viewToSaveCase; - - private List listmoduleid=new ArrayList(); - - /** - * - * 获取计划用例列表 - * - * @param tj - * @param model - * @return - * @throws Exception - */ - @RequestMapping(value = "/casesload.do") - public String casesload(HttpServletRequest req, Model model) throws Exception { - - try { - if (!UserLoginController.permissionboolean(req, "proplan_3")) { - model.addAttribute("url", "/projectPlan/load.do"); - model.addAttribute("message", "当前用户无权限管理计划用例,请联系管理员!"); - return "success"; - } - - String planid = req.getParameter("planid"); - ProjectPlan propaln = projectplanservice.load(Integer.valueOf(planid)); - - if(!UserLoginController.oppidboolean(req, propaln.getProjectid())){ - SectorProjects sp=sectorprojectsService.loadob(propaln.getProjectid()); - model.addAttribute("url", "/projectPlan/load.do"); - model.addAttribute("message", "当前用户无权限管理项目【"+sp.getProjectname()+"】的计划用例,请联系管理员!"); - return "error"; - } - model.addAttribute("projectid", propaln.getProjectid()); - model.addAttribute("planid", planid); - model.addAttribute("planname", propaln.getName()); - } catch (Exception e) { - e.printStackTrace(); - model.addAttribute("message", e.getMessage()); - model.addAttribute("url", "/projectPlan/load.do"); - return "error"; - } - return "/jsp/plancase/projectplancase"; - } - - @SuppressWarnings("unchecked") - @RequestMapping(value = "/getCaseList.do") - private void getCaseList(Integer limit, Integer offset, HttpServletRequest request, HttpServletResponse response) - throws Exception { - response.setCharacterEncoding("utf-8"); - PrintWriter pw = response.getWriter(); - String search = request.getParameter("search"); - String projectid = request.getParameter("projectid"); - String planidstr = request.getParameter("planid"); - String moduleid = request.getParameter("moduleid"); - String onlypcase = request.getParameter("onlypcase"); - - List modulelist = moduleservice.getModuleList(); - List projectcases=new ArrayList(); - List plancases=new ArrayList(); - int total=0; - if (null == offset && null == limit) { - offset = 0; - } - if (null == limit || limit == 0) { - limit = 10; - } - // 得到客户端传递的查询参数 - int planid = 0; - if (!StrLib.isEmpty(planidstr)) { - planid = Integer.valueOf(planidstr); - } - ProjectCase projectcase = new ProjectCase(); - if ("0".equals(onlypcase)) { - // 得到客户端传递的查询参数 - if (!StrLib.isEmpty(search)) { - projectcase.setSign(search); - projectcase.setName(search); - projectcase.setOperationer(search); - projectcase.setRemark(search); - } - // 得到客户端传递的查询参数 - if (!StrLib.isEmpty(projectid) && !"99".equals(projectid)) { - projectcase.setProjectid(Integer.valueOf(projectid)); - } - - // 得到客户端传递的查询参数 - if (!StrLib.isEmpty(moduleid)) { - projectcase.setModuleid(Integer.valueOf(moduleid)); - if(0!=projectcase.getModuleid()){ - listmoduleid.clear(); - getchildmoduList(projectcase.getProjectid(),projectcase.getModuleid()); - Integer[] moduleidarr=new Integer[listmoduleid.size()+1]; - moduleidarr[0]=projectcase.getModuleid(); - for(int i=0;i plancases = projectplancaseservice.getcases(Integer.valueOf(planid)); - ProjectPlanCase projectplancase = new ProjectPlanCase(); - StringBuilder sb = new StringBuilder(); - try (BufferedReader reader = req.getReader();) { - char[] buff = new char[1024]; - int len; - while ((len = reader.read(buff)) != -1) { - sb.append(buff, 0, len); - } - } catch (IOException e) { - e.printStackTrace(); - } - JSONObject jsonObject = JSONObject.fromObject(sb.toString()); - JSONArray jsonarr = JSONArray.fromObject(jsonObject.getString("caseids")); - List caselist=viewToSaveCase; - for (int i = 0; i < jsonarr.size(); i++) { // 添加列表中多的用例 - int caseid = Integer.valueOf(jsonarr.get(i).toString()); - for (ProjectCase viewcase:caselist) { - if (viewcase.getId() == caseid) { - if(viewcase.getChecktype()==1){ - caselist.remove(viewcase); - break; - }else{ - projectplancase.setCaseid(caseid); - projectplancase.setPlanid(Integer.valueOf(planid)); - projectplancase.setPriority(0); - - projectplancaseservice.add(projectplancase); - caselist.remove(viewcase); - break; - } - } - } - } - - for (int k = 0; k < caselist.size(); k++) { // 删除原有列表中多的用例 - for(ProjectPlanCase ppc:plancases){ - if(ppc.getCaseid()==caselist.get(k).getId()){ - projectplancaseservice.delete(ppc); - } - } - } - - if (null != req.getSession().getAttribute("usercode") - && null != req.getSession().getAttribute("username")) { - String usercode = req.getSession().getAttribute("usercode").toString(); - pc.setOperationer(usercode); - } - Date currentTime = new Date(); - SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); - String time = formatter.format(currentTime); - pc.setTime(time); - int count = projectplancaseservice.getcases(Integer.valueOf(planid)).size(); - pc.setCasecount(count); - projectplanservice.modify(pc); - - operationlogservice.add(req, "PROJECT_PLAN", Integer.valueOf(planid), pc.getProjectid(), "保存计划用例成功!"); - json.put("status", "success"); - json.put("ms", "保存计划用例成功!"); - } - pw.print(json.toString()); - - } catch (Exception e) { - e.printStackTrace(); - } - - } - - @RequestMapping(value = "/update.do") - public void updatecase(HttpServletRequest req, HttpServletResponse rsp, ProjectCase projectcase) { - // 更新实体 - try { - rsp.setContentType("text/html;charset=utf-8"); - req.setCharacterEncoding("utf-8"); - PrintWriter pw = rsp.getWriter(); - JSONObject json = new JSONObject(); - if (!UserLoginController.permissionboolean(req, "proplan_3")) { - json.put("status", "fail"); - json.put("ms", "编辑计划用例失败,权限不足,请联系管理员!"); - } else { - String planid = req.getParameter("planid"); - String result = "编辑成功!"; - ProjectPlanCase projectplancase = new ProjectPlanCase(); - projectplancase.setCaseid(projectcase.getId()); - projectplancase.setPlanid(Integer.valueOf(planid)); - projectplancase.setPriority(projectcase.getPriority()); - int id = projectplancaseservice.findRows(projectplancase); - if (id == 0) { - result = "编辑成功!并已帮您把此用例加入到计划中!"; - projectplancaseservice.add(projectplancase); - } else { - projectplancase.setId(id); - projectplancaseservice.modify(projectplancase); - } - - json.put("status", "success"); - json.put("ms", result); - } - pw.print(json.toString()); - } catch (Exception e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - } - - @RequestMapping(value = "/cgetcasebyplanid.do") - public void cgetCaseByPlanid(HttpServletRequest req, HttpServletResponse rsp) { - // 更新实体 - try { - rsp.setContentType("text/html;charset=GBK"); - req.setCharacterEncoding("GBK"); - PrintWriter pw = rsp.getWriter(); - JSONObject json = new JSONObject(); - String planid = req.getParameter("planid"); - - List plancases = projectplancaseservice.getcases(Integer.valueOf(planid)); - List projectcases=new ArrayList(); - - for(int i=0;i plancases = projectplancaseservice.getcases(pp.getId()); - List projectcases=new ArrayList(); - - for(int i=0;i getchildmoduList(int projectid,int pid){ - List modules = moduleservice.getModuleListByProjectid(projectid, pid); - for(ProjectModule pm: modules){ - listmoduleid.add(pm.getId()); - //递归遍历下一级 - getchildmoduList(projectid,pm.getId()); - } - return listmoduleid; - } -} +package luckyweb.seagull.spring.mvc; + +import java.io.BufferedReader; +import java.io.IOException; +import java.io.PrintWriter; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.springframework.stereotype.Controller; +import org.springframework.ui.Model; +import org.springframework.web.bind.annotation.RequestMapping; + +import luckyweb.seagull.spring.entity.ProjectCase; +import luckyweb.seagull.spring.entity.ProjectModule; +import luckyweb.seagull.spring.entity.ProjectPlan; +import luckyweb.seagull.spring.entity.ProjectPlanCase; +import luckyweb.seagull.spring.entity.SectorProjects; +import luckyweb.seagull.spring.service.OperationLogService; +import luckyweb.seagull.spring.service.ProjectCaseService; +import luckyweb.seagull.spring.service.ProjectModuleService; +import luckyweb.seagull.spring.service.ProjectPlanCaseService; +import luckyweb.seagull.spring.service.ProjectPlanService; +import luckyweb.seagull.spring.service.SectorProjectsService; +import luckyweb.seagull.spring.service.UserInfoService; +import luckyweb.seagull.util.StrLib; +import net.sf.json.JSONArray; +import net.sf.json.JSONObject; + +@Controller +@RequestMapping("/projectPlanCase") +public class ProjectPlanCaseController { + + @Resource(name = "projectPlanCaseService") + private ProjectPlanCaseService projectplancaseservice; + + @Resource(name = "projectPlanService") + private ProjectPlanService projectplanservice; + + @Resource(name = "projectModuleService") + private ProjectModuleService moduleservice; + + @Resource(name = "projectCaseService") + private ProjectCaseService projectcaseservice; + + @Resource(name = "sectorprojectsService") + private SectorProjectsService sectorprojectsService; + + @Resource(name = "operationlogService") + private OperationLogService operationlogservice; + + @Resource(name = "userinfoService") + private UserInfoService userinfoservice; + + private List viewToSaveCase; + + private List listmoduleid=new ArrayList(); + + /** + * + * 获取计划用例列表 + * + * @param tj + * @param model + * @return + * @throws Exception + */ + @RequestMapping(value = "/casesload.do") + public String casesload(HttpServletRequest req, Model model) throws Exception { + + try { + if (!UserLoginController.permissionboolean(req, "proplan_3")) { + model.addAttribute("url", "/projectPlan/load.do"); + model.addAttribute("message", "当前用户无权限管理计划用例,请联系管理员!"); + return "success"; + } + + String planid = req.getParameter("planid"); + ProjectPlan propaln = projectplanservice.load(Integer.valueOf(planid)); + + if(!UserLoginController.oppidboolean(req, propaln.getProjectid())){ + SectorProjects sp=sectorprojectsService.loadob(propaln.getProjectid()); + model.addAttribute("url", "/projectPlan/load.do"); + model.addAttribute("message", "当前用户无权限管理项目【"+sp.getProjectname()+"】的计划用例,请联系管理员!"); + return "error"; + } + model.addAttribute("projectid", propaln.getProjectid()); + model.addAttribute("planid", planid); + model.addAttribute("planname", propaln.getName()); + } catch (Exception e) { + e.printStackTrace(); + model.addAttribute("message", e.getMessage()); + model.addAttribute("url", "/projectPlan/load.do"); + return "error"; + } + return "/jsp/plancase/projectplancase"; + } + + @SuppressWarnings("unchecked") + @RequestMapping(value = "/getCaseList.do") + private void getCaseList(Integer limit, Integer offset, HttpServletRequest request, HttpServletResponse response) + throws Exception { + response.setCharacterEncoding("utf-8"); + PrintWriter pw = response.getWriter(); + String search = request.getParameter("search"); + String projectid = request.getParameter("projectid"); + String planidstr = request.getParameter("planid"); + String moduleid = request.getParameter("moduleid"); + String onlypcase = request.getParameter("onlypcase"); + + List modulelist = moduleservice.getModuleList(); + List projectcases=new ArrayList(); + List plancases=new ArrayList(); + int total=0; + if (null == offset && null == limit) { + offset = 0; + } + if (null == limit || limit == 0) { + limit = 10; + } + // 得到客户端传递的查询参数 + int planid = 0; + if (!StrLib.isEmpty(planidstr)) { + planid = Integer.valueOf(planidstr); + } + ProjectCase projectcase = new ProjectCase(); + if ("0".equals(onlypcase)) { + // 得到客户端传递的查询参数 + if (!StrLib.isEmpty(search)) { + projectcase.setSign(search); + projectcase.setName(search); + projectcase.setOperationer(search); + projectcase.setRemark(search); + } + // 得到客户端传递的查询参数 + if (!StrLib.isEmpty(projectid) && !"99".equals(projectid)) { + projectcase.setProjectid(Integer.valueOf(projectid)); + } + + // 得到客户端传递的查询参数 + if (!StrLib.isEmpty(moduleid)) { + projectcase.setModuleid(Integer.valueOf(moduleid)); + if(0!=projectcase.getModuleid()){ + listmoduleid.clear(); + getchildmoduList(projectcase.getProjectid(),projectcase.getModuleid()); + Integer[] moduleidarr=new Integer[listmoduleid.size()+1]; + moduleidarr[0]=projectcase.getModuleid(); + for(int i=0;i plancases = projectplancaseservice.getcases(Integer.valueOf(planid)); + ProjectPlanCase projectplancase = new ProjectPlanCase(); + StringBuilder sb = new StringBuilder(); + try (BufferedReader reader = req.getReader();) { + char[] buff = new char[1024]; + int len; + while ((len = reader.read(buff)) != -1) { + sb.append(buff, 0, len); + } + } catch (IOException e) { + e.printStackTrace(); + } + JSONObject jsonObject = JSONObject.fromObject(sb.toString()); + JSONArray jsonarr = JSONArray.fromObject(jsonObject.getString("caseids")); + List caselist=viewToSaveCase; + for (int i = 0; i < jsonarr.size(); i++) { // 添加列表中多的用例 + int caseid = Integer.valueOf(jsonarr.get(i).toString()); + for (ProjectCase viewcase:caselist) { + if (viewcase.getId() == caseid) { + if(viewcase.getChecktype()==1){ + caselist.remove(viewcase); + break; + }else{ + projectplancase.setCaseid(caseid); + projectplancase.setPlanid(Integer.valueOf(planid)); + projectplancase.setPriority(0); + + projectplancaseservice.add(projectplancase); + caselist.remove(viewcase); + break; + } + } + } + } + + for (int k = 0; k < caselist.size(); k++) { // 删除原有列表中多的用例 + for(ProjectPlanCase ppc:plancases){ + if(ppc.getCaseid()==caselist.get(k).getId()){ + projectplancaseservice.delete(ppc); + } + } + } + + if (null != req.getSession().getAttribute("usercode") + && null != req.getSession().getAttribute("username")) { + String usercode = req.getSession().getAttribute("usercode").toString(); + pc.setOperationer(usercode); + } + Date currentTime = new Date(); + SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + String time = formatter.format(currentTime); + pc.setTime(time); + int count = projectplancaseservice.getcases(Integer.valueOf(planid)).size(); + pc.setCasecount(count); + projectplanservice.modify(pc); + + operationlogservice.add(req, "PROJECT_PLAN", Integer.valueOf(planid), pc.getProjectid(), "保存计划用例成功!"); + json.put("status", "success"); + json.put("ms", "保存计划用例成功!"); + } + pw.print(json.toString()); + + } catch (Exception e) { + e.printStackTrace(); + } + + } + + @RequestMapping(value = "/update.do") + public void updatecase(HttpServletRequest req, HttpServletResponse rsp, ProjectCase projectcase) { + // 更新实体 + try { + rsp.setContentType("text/html;charset=utf-8"); + req.setCharacterEncoding("utf-8"); + PrintWriter pw = rsp.getWriter(); + JSONObject json = new JSONObject(); + if (!UserLoginController.permissionboolean(req, "proplan_3")) { + json.put("status", "fail"); + json.put("ms", "编辑计划用例失败,权限不足,请联系管理员!"); + } else { + String planid = req.getParameter("planid"); + String result = "编辑成功!"; + ProjectPlanCase projectplancase = new ProjectPlanCase(); + projectplancase.setCaseid(projectcase.getId()); + projectplancase.setPlanid(Integer.valueOf(planid)); + projectplancase.setPriority(projectcase.getPriority()); + int id = projectplancaseservice.findRows(projectplancase); + if (id == 0) { + result = "编辑成功!并已帮您把此用例加入到计划中!"; + projectplancaseservice.add(projectplancase); + } else { + projectplancase.setId(id); + projectplancaseservice.modify(projectplancase); + } + + json.put("status", "success"); + json.put("ms", result); + } + pw.print(json.toString()); + } catch (Exception e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + + @RequestMapping(value = "/cgetcasebyplanid.do") + public void cgetCaseByPlanid(HttpServletRequest req, HttpServletResponse rsp) { + // 更新实体 + try { + rsp.setContentType("text/html;charset=GBK"); + req.setCharacterEncoding("GBK"); + PrintWriter pw = rsp.getWriter(); + JSONObject json = new JSONObject(); + String planid = req.getParameter("planid"); + + List plancases = projectplancaseservice.getcases(Integer.valueOf(planid)); + List projectcases=new ArrayList(); + + for(int i=0;i plancases = projectplancaseservice.getcases(pp.getId()); + List projectcases=new ArrayList(); + + for(int i=0;i getchildmoduList(int projectid,int pid){ + List modules = moduleservice.getModuleListByProjectid(projectid, pid); + for(ProjectModule pm: modules){ + listmoduleid.add(pm.getId()); + //递归遍历下一级 + getchildmoduList(projectid,pm.getId()); + } + return listmoduleid; + } +} diff --git a/src/main/java/luckyweb/seagull/spring/mvc/ProjectPlanController.java b/src/main/java/luckyweb/seagull/spring/mvc/ProjectPlanController.java index 8c6ef20..1d20dbd 100644 --- a/src/main/java/luckyweb/seagull/spring/mvc/ProjectPlanController.java +++ b/src/main/java/luckyweb/seagull/spring/mvc/ProjectPlanController.java @@ -1,344 +1,344 @@ -package luckyweb.seagull.spring.mvc; - -import java.io.BufferedReader; -import java.io.IOException; -import java.io.PrintWriter; -import java.text.SimpleDateFormat; -import java.util.Date; -import java.util.List; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.RequestMapping; - -import luckyweb.seagull.comm.QueueListener; -import luckyweb.seagull.spring.entity.ProjectCase; -import luckyweb.seagull.spring.entity.ProjectPlan; -import luckyweb.seagull.spring.entity.SectorProjects; -import luckyweb.seagull.spring.entity.UserInfo; -import luckyweb.seagull.spring.service.OperationLogService; -import luckyweb.seagull.spring.service.ProjectCaseService; -import luckyweb.seagull.spring.service.ProjectPlanCaseService; -import luckyweb.seagull.spring.service.ProjectPlanService; -import luckyweb.seagull.spring.service.SectorProjectsService; -import luckyweb.seagull.spring.service.UserInfoService; -import luckyweb.seagull.util.StrLib; -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; - -@Controller -@RequestMapping("/projectPlan") -public class ProjectPlanController { - - @Resource(name = "projectPlanCaseService") - private ProjectPlanCaseService projectplancaseservice; - - @Resource(name = "projectPlanService") - private ProjectPlanService projectplanservice; - - @Resource(name = "sectorprojectsService") - private SectorProjectsService sectorprojectsService; - - @Resource(name = "operationlogService") - private OperationLogService operationlogservice; - - @Resource(name = "userinfoService") - private UserInfoService userinfoservice; - - /** - * - * - * @param tj - * @param model - * @return - * @throws Exception - */ - @RequestMapping(value = "/load.do") - public String load(HttpServletRequest req, Model model) throws Exception { - - try { - int projectid = 99; - if (null != req.getSession().getAttribute("usercode") - && null != req.getSession().getAttribute("username")) { - String usercode = req.getSession().getAttribute("usercode").toString(); - UserInfo userinfo = userinfoservice.getUseinfo(usercode); - projectid = userinfo.getProjectid(); - } - - List prolist = QueueListener.qa_projlist; - model.addAttribute("projects", prolist); - model.addAttribute("projectid", projectid); - } catch (Exception e) { - e.printStackTrace(); - model.addAttribute("message", e.getMessage()); - model.addAttribute("url", "/projectPlan/load.do"); - return "error"; - } - return "/jsp/plancase/projectplan"; - } - - @RequestMapping(value = "/list.do") - private void ajaxGetSellRecord(Integer limit, Integer offset, HttpServletRequest request, - HttpServletResponse response) throws IOException { - response.setCharacterEncoding("utf-8"); - PrintWriter pw = response.getWriter(); - String search = request.getParameter("search"); - String projectid = request.getParameter("projectid"); - ProjectPlan projectplan = new ProjectPlan(); - if (null == offset && null == limit) { - offset = 0; - } - if (null == limit || limit == 0) { - limit = 10; - } - // 得到客户端传递的查询参数 - if (!StrLib.isEmpty(search)) { - projectplan.setName(search); - projectplan.setOperationer(search); - projectplan.setRemark(search); - } - // 得到客户端传递的查询参数 - if (!StrLib.isEmpty(projectid)) { - projectplan.setProjectid(Integer.valueOf(projectid)); - } - - List projectplans = projectplanservice.findByPage(projectplan, offset, limit); - List prolist = QueueListener.qa_projlist; - for (int i = 0; i < projectplans.size(); i++) { - ProjectPlan pp = projectplans.get(i); - for (SectorProjects projectlist : prolist) { - if (pp.getProjectid() == projectlist.getProjectid()) { - pp.setProjectname(projectlist.getProjectname()); - projectplans.set(i, pp); - break; - } - } - - } - // 转换成json字符串 - String RecordJson = StrLib.listToJson(projectplans); - // 得到总记录数 - int total = projectplanservice.findRows(projectplan); - // 需要返回的数据有总记录数和行数据 - JSONObject json = new JSONObject(); - json.put("total", total); - json.put("rows", RecordJson); - pw.print(json.toString()); - } - - @RequestMapping(value = "/update.do") - public void updateplan(HttpServletRequest req, HttpServletResponse rsp, ProjectPlan projectplan) { - // 更新实体 - try { - rsp.setContentType("text/html;charset=utf-8"); - req.setCharacterEncoding("utf-8"); - PrintWriter pw = rsp.getWriter(); - JSONObject json = new JSONObject(); - if (!UserLoginController.permissionboolean(req, "proplan_3")) { - json.put("status", "fail"); - json.put("ms", "编辑计划失败,权限不足,请联系管理员!"); - } else { - if(!UserLoginController.oppidboolean(req, projectplan.getProjectid())){ - json.put("status", "fail"); - json.put("ms", "编辑计划失败,项目权限不足,请联系管理员!"); - }else{ - if (null != req.getSession().getAttribute("usercode") - && null != req.getSession().getAttribute("username")) { - String usercode = req.getSession().getAttribute("usercode").toString(); - projectplan.setOperationer(usercode); - } - Date currentTime = new Date(); - SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); - String time = formatter.format(currentTime); - projectplan.setTime(time); - - projectplanservice.modify(projectplan); - - operationlogservice.add(req, "PROJECT_PLAN", projectplan.getId(), projectplan.getProjectid(), - "修改测试计划成功!"); - json.put("status", "success"); - json.put("ms", "编辑计划成功!"); - } - - } - pw.print(json.toString()); - } catch (Exception e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - } - - /** - * 添加计划 - * - * @param tj - * @param br - * @param model - * @param req - * @param rsp - * @return - * @throws Exception - * @Description: - */ - @RequestMapping(value = "/planadd.do") - public void add(ProjectPlan projectplan, HttpServletRequest req, HttpServletResponse rsp) throws Exception { - try { - rsp.setContentType("text/html;charset=utf-8"); - req.setCharacterEncoding("utf-8"); - PrintWriter pw = rsp.getWriter(); - JSONObject json = new JSONObject(); - if (!UserLoginController.permissionboolean(req, "proplan_1")) { - json.put("status", "fail"); - json.put("ms", "增加测试计划失败,权限不足,请联系管理员!"); - } else { - if(!UserLoginController.oppidboolean(req, projectplan.getProjectid())){ - json.put("status", "fail"); - json.put("ms", "增加测试计划失败,此项目权限不足,请联系管理员!"); - }else{ - if (null != req.getSession().getAttribute("usercode") - && null != req.getSession().getAttribute("username")) { - String usercode = req.getSession().getAttribute("usercode").toString(); - projectplan.setOperationer(usercode); - } - - String regEx_space = "\t|\r|\n";// 定义空格回车换行符 - Pattern p_space = Pattern.compile(regEx_space, Pattern.CASE_INSENSITIVE); - Matcher m_space = p_space.matcher(projectplan.getRemark()); - projectplan.setRemark(m_space.replaceAll("")); // 过滤空格回车标签 - - Date currentTime = new Date(); - SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); - String time = formatter.format(currentTime); - projectplan.setTime(time); - - int planid = projectplanservice.add(projectplan); - - operationlogservice.add(req, "PROJECT_PLAN", planid, projectplan.getProjectid(), "添加测试计划成功!"); - - json.put("status", "success"); - json.put("ms", "添加测试计划成功!"); - } - - } - pw.print(json.toString()); - - } catch (Exception e) { - e.printStackTrace(); - } - - } - - /** - * 删除计划 - * - * @param tj - * @param br - * @param model - * @param req - * @param rsp - * @return - * @throws Exception - * @Description: - */ - @RequestMapping(value = "/delete.do") - public void delete(HttpServletRequest req, HttpServletResponse rsp) throws Exception { - try { - rsp.setContentType("text/html;charset=utf-8"); - req.setCharacterEncoding("utf-8"); - PrintWriter pw = rsp.getWriter(); - JSONObject json = new JSONObject(); - if (!UserLoginController.permissionboolean(req, "proplan_2")) { - json.put("status", "fail"); - json.put("ms", "删除计划失败,权限不足,请联系管理员!"); - } else { - StringBuilder sb = new StringBuilder(); - try (BufferedReader reader = req.getReader();) { - char[] buff = new char[1024]; - int len; - while ((len = reader.read(buff)) != -1) { - sb.append(buff, 0, len); - } - } catch (IOException e) { - e.printStackTrace(); - } - JSONObject jsonObject = JSONObject.fromObject(sb.toString()); - JSONArray jsonarr = JSONArray.fromObject(jsonObject.getString("planids")); - - String status="fail"; - String ms="删除计划失败!"; - int suc=0; - int fail=0; - for (int i = 0; i < jsonarr.size(); i++) { - int id = Integer.valueOf(jsonarr.get(i).toString()); - ProjectPlan projectplan = projectplanservice.load(id); - - if(!UserLoginController.oppidboolean(req, projectplan.getProjectid())){ - fail++; - continue; - } - projectplancaseservice.delforplanid(id); - projectplanservice.delete(projectplan); - operationlogservice.add(req, "PROJECT_PLAN", id, projectplan.getProjectid(), "删除测试计划成功!"); - suc++; - } - - if(suc>0){ - status="success"; - ms="删除计划成功!"; - if(fail>0){ - status="success"; - ms="删除计划"+suc+"条成功!"+fail+"条因为无项目权限删除失败!"; - } - } - - json.put("status", status); - json.put("ms", ms); - } - pw.print(json.toString()); - - } catch (Exception e) { - e.printStackTrace(); - } - - } - - /** - * 联动查询测试计划 - * @param tj - * @param br - * @param model - * @param req - * @param rsp - * @return - * @throws Exception - * @Description: - */ - @RequestMapping(value = "/getplanlist.do") - public void getplanlist(HttpServletRequest req, HttpServletResponse rsp) throws Exception{ - int projectid = Integer.valueOf(req.getParameter("projectid")); - - ProjectPlan projectplan=new ProjectPlan(); - projectplan.setProjectid(projectid); - List listplan = projectplanservice.findByPage(projectplan, 0, 1000); - - // 取集合 - rsp.setContentType("text/xml;charset=utf-8"); - - JSONArray jsonArray = JSONArray.fromObject(listplan); - JSONObject jsobjcet = new JSONObject(); - jsobjcet.put("data", jsonArray); - - rsp.getWriter().write(jsobjcet.toString()); - } - - public static void main(String[] args) throws Exception { - - } - -} +package luckyweb.seagull.spring.mvc; + +import java.io.BufferedReader; +import java.io.IOException; +import java.io.PrintWriter; +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.List; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.springframework.stereotype.Controller; +import org.springframework.ui.Model; +import org.springframework.web.bind.annotation.RequestMapping; + +import luckyweb.seagull.comm.QueueListener; +import luckyweb.seagull.spring.entity.ProjectCase; +import luckyweb.seagull.spring.entity.ProjectPlan; +import luckyweb.seagull.spring.entity.SectorProjects; +import luckyweb.seagull.spring.entity.UserInfo; +import luckyweb.seagull.spring.service.OperationLogService; +import luckyweb.seagull.spring.service.ProjectCaseService; +import luckyweb.seagull.spring.service.ProjectPlanCaseService; +import luckyweb.seagull.spring.service.ProjectPlanService; +import luckyweb.seagull.spring.service.SectorProjectsService; +import luckyweb.seagull.spring.service.UserInfoService; +import luckyweb.seagull.util.StrLib; +import net.sf.json.JSONArray; +import net.sf.json.JSONObject; + +@Controller +@RequestMapping("/projectPlan") +public class ProjectPlanController { + + @Resource(name = "projectPlanCaseService") + private ProjectPlanCaseService projectplancaseservice; + + @Resource(name = "projectPlanService") + private ProjectPlanService projectplanservice; + + @Resource(name = "sectorprojectsService") + private SectorProjectsService sectorprojectsService; + + @Resource(name = "operationlogService") + private OperationLogService operationlogservice; + + @Resource(name = "userinfoService") + private UserInfoService userinfoservice; + + /** + * + * + * @param tj + * @param model + * @return + * @throws Exception + */ + @RequestMapping(value = "/load.do") + public String load(HttpServletRequest req, Model model) throws Exception { + + try { + int projectid = 99; + if (null != req.getSession().getAttribute("usercode") + && null != req.getSession().getAttribute("username")) { + String usercode = req.getSession().getAttribute("usercode").toString(); + UserInfo userinfo = userinfoservice.getUseinfo(usercode); + projectid = userinfo.getProjectid(); + } + + List prolist = QueueListener.qa_projlist; + model.addAttribute("projects", prolist); + model.addAttribute("projectid", projectid); + } catch (Exception e) { + e.printStackTrace(); + model.addAttribute("message", e.getMessage()); + model.addAttribute("url", "/projectPlan/load.do"); + return "error"; + } + return "/jsp/plancase/projectplan"; + } + + @RequestMapping(value = "/list.do") + private void ajaxGetSellRecord(Integer limit, Integer offset, HttpServletRequest request, + HttpServletResponse response) throws IOException { + response.setCharacterEncoding("utf-8"); + PrintWriter pw = response.getWriter(); + String search = request.getParameter("search"); + String projectid = request.getParameter("projectid"); + ProjectPlan projectplan = new ProjectPlan(); + if (null == offset && null == limit) { + offset = 0; + } + if (null == limit || limit == 0) { + limit = 10; + } + // 得到客户端传递的查询参数 + if (!StrLib.isEmpty(search)) { + projectplan.setName(search); + projectplan.setOperationer(search); + projectplan.setRemark(search); + } + // 得到客户端传递的查询参数 + if (!StrLib.isEmpty(projectid)) { + projectplan.setProjectid(Integer.valueOf(projectid)); + } + + List projectplans = projectplanservice.findByPage(projectplan, offset, limit); + List prolist = QueueListener.qa_projlist; + for (int i = 0; i < projectplans.size(); i++) { + ProjectPlan pp = projectplans.get(i); + for (SectorProjects projectlist : prolist) { + if (pp.getProjectid() == projectlist.getProjectid()) { + pp.setProjectname(projectlist.getProjectname()); + projectplans.set(i, pp); + break; + } + } + + } + // 转换成json字符串 + String RecordJson = StrLib.listToJson(projectplans); + // 得到总记录数 + int total = projectplanservice.findRows(projectplan); + // 需要返回的数据有总记录数和行数据 + JSONObject json = new JSONObject(); + json.put("total", total); + json.put("rows", RecordJson); + pw.print(json.toString()); + } + + @RequestMapping(value = "/update.do") + public void updateplan(HttpServletRequest req, HttpServletResponse rsp, ProjectPlan projectplan) { + // 更新实体 + try { + rsp.setContentType("text/html;charset=utf-8"); + req.setCharacterEncoding("utf-8"); + PrintWriter pw = rsp.getWriter(); + JSONObject json = new JSONObject(); + if (!UserLoginController.permissionboolean(req, "proplan_3")) { + json.put("status", "fail"); + json.put("ms", "编辑计划失败,权限不足,请联系管理员!"); + } else { + if(!UserLoginController.oppidboolean(req, projectplan.getProjectid())){ + json.put("status", "fail"); + json.put("ms", "编辑计划失败,项目权限不足,请联系管理员!"); + }else{ + if (null != req.getSession().getAttribute("usercode") + && null != req.getSession().getAttribute("username")) { + String usercode = req.getSession().getAttribute("usercode").toString(); + projectplan.setOperationer(usercode); + } + Date currentTime = new Date(); + SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + String time = formatter.format(currentTime); + projectplan.setTime(time); + + projectplanservice.modify(projectplan); + + operationlogservice.add(req, "PROJECT_PLAN", projectplan.getId(), projectplan.getProjectid(), + "修改测试计划成功!"); + json.put("status", "success"); + json.put("ms", "编辑计划成功!"); + } + + } + pw.print(json.toString()); + } catch (Exception e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + + /** + * 添加计划 + * + * @param tj + * @param br + * @param model + * @param req + * @param rsp + * @return + * @throws Exception + * @Description: + */ + @RequestMapping(value = "/planadd.do") + public void add(ProjectPlan projectplan, HttpServletRequest req, HttpServletResponse rsp) throws Exception { + try { + rsp.setContentType("text/html;charset=utf-8"); + req.setCharacterEncoding("utf-8"); + PrintWriter pw = rsp.getWriter(); + JSONObject json = new JSONObject(); + if (!UserLoginController.permissionboolean(req, "proplan_1")) { + json.put("status", "fail"); + json.put("ms", "增加测试计划失败,权限不足,请联系管理员!"); + } else { + if(!UserLoginController.oppidboolean(req, projectplan.getProjectid())){ + json.put("status", "fail"); + json.put("ms", "增加测试计划失败,此项目权限不足,请联系管理员!"); + }else{ + if (null != req.getSession().getAttribute("usercode") + && null != req.getSession().getAttribute("username")) { + String usercode = req.getSession().getAttribute("usercode").toString(); + projectplan.setOperationer(usercode); + } + + String regEx_space = "\t|\r|\n";// 定义空格回车换行符 + Pattern p_space = Pattern.compile(regEx_space, Pattern.CASE_INSENSITIVE); + Matcher m_space = p_space.matcher(projectplan.getRemark()); + projectplan.setRemark(m_space.replaceAll("")); // 过滤空格回车标签 + + Date currentTime = new Date(); + SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + String time = formatter.format(currentTime); + projectplan.setTime(time); + + int planid = projectplanservice.add(projectplan); + + operationlogservice.add(req, "PROJECT_PLAN", planid, projectplan.getProjectid(), "添加测试计划成功!"); + + json.put("status", "success"); + json.put("ms", "添加测试计划成功!"); + } + + } + pw.print(json.toString()); + + } catch (Exception e) { + e.printStackTrace(); + } + + } + + /** + * 删除计划 + * + * @param tj + * @param br + * @param model + * @param req + * @param rsp + * @return + * @throws Exception + * @Description: + */ + @RequestMapping(value = "/delete.do") + public void delete(HttpServletRequest req, HttpServletResponse rsp) throws Exception { + try { + rsp.setContentType("text/html;charset=utf-8"); + req.setCharacterEncoding("utf-8"); + PrintWriter pw = rsp.getWriter(); + JSONObject json = new JSONObject(); + if (!UserLoginController.permissionboolean(req, "proplan_2")) { + json.put("status", "fail"); + json.put("ms", "删除计划失败,权限不足,请联系管理员!"); + } else { + StringBuilder sb = new StringBuilder(); + try (BufferedReader reader = req.getReader();) { + char[] buff = new char[1024]; + int len; + while ((len = reader.read(buff)) != -1) { + sb.append(buff, 0, len); + } + } catch (IOException e) { + e.printStackTrace(); + } + JSONObject jsonObject = JSONObject.fromObject(sb.toString()); + JSONArray jsonarr = JSONArray.fromObject(jsonObject.getString("planids")); + + String status="fail"; + String ms="删除计划失败!"; + int suc=0; + int fail=0; + for (int i = 0; i < jsonarr.size(); i++) { + int id = Integer.valueOf(jsonarr.get(i).toString()); + ProjectPlan projectplan = projectplanservice.load(id); + + if(!UserLoginController.oppidboolean(req, projectplan.getProjectid())){ + fail++; + continue; + } + projectplancaseservice.delforplanid(id); + projectplanservice.delete(projectplan); + operationlogservice.add(req, "PROJECT_PLAN", id, projectplan.getProjectid(), "删除测试计划成功!"); + suc++; + } + + if(suc>0){ + status="success"; + ms="删除计划成功!"; + if(fail>0){ + status="success"; + ms="删除计划"+suc+"条成功!"+fail+"条因为无项目权限删除失败!"; + } + } + + json.put("status", status); + json.put("ms", ms); + } + pw.print(json.toString()); + + } catch (Exception e) { + e.printStackTrace(); + } + + } + + /** + * 联动查询测试计划 + * @param tj + * @param br + * @param model + * @param req + * @param rsp + * @return + * @throws Exception + * @Description: + */ + @RequestMapping(value = "/getplanlist.do") + public void getplanlist(HttpServletRequest req, HttpServletResponse rsp) throws Exception{ + int projectid = Integer.valueOf(req.getParameter("projectid")); + + ProjectPlan projectplan=new ProjectPlan(); + projectplan.setProjectid(projectid); + List listplan = projectplanservice.findByPage(projectplan, 0, 1000); + + // 取集合 + rsp.setContentType("text/xml;charset=utf-8"); + + JSONArray jsonArray = JSONArray.fromObject(listplan); + JSONObject jsobjcet = new JSONObject(); + jsobjcet.put("data", jsonArray); + + rsp.getWriter().write(jsobjcet.toString()); + } + + public static void main(String[] args) throws Exception { + + } + +} diff --git a/src/main/java/luckyweb/seagull/spring/mvc/ProjectProtocolTemplateController.java b/src/main/java/luckyweb/seagull/spring/mvc/ProjectProtocolTemplateController.java index 10eda43..55f2aa2 100644 --- a/src/main/java/luckyweb/seagull/spring/mvc/ProjectProtocolTemplateController.java +++ b/src/main/java/luckyweb/seagull/spring/mvc/ProjectProtocolTemplateController.java @@ -1,414 +1,414 @@ -package luckyweb.seagull.spring.mvc; - -import java.io.BufferedReader; -import java.io.IOException; -import java.io.PrintWriter; -import java.text.SimpleDateFormat; -import java.util.Date; -import java.util.List; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.RequestMapping; - -import luckyweb.seagull.comm.QueueListener; -import luckyweb.seagull.spring.entity.ProjectCase; -import luckyweb.seagull.spring.entity.ProjectCasesteps; -import luckyweb.seagull.spring.entity.ProjectPlan; -import luckyweb.seagull.spring.entity.ProjectProtocolTemplate; -import luckyweb.seagull.spring.entity.SectorProjects; -import luckyweb.seagull.spring.entity.UserInfo; -import luckyweb.seagull.spring.service.OperationLogService; -import luckyweb.seagull.spring.service.ProjectProtocolTemplateService; -import luckyweb.seagull.spring.service.ProjectTemplateParamsService; -import luckyweb.seagull.spring.service.SectorProjectsService; -import luckyweb.seagull.spring.service.UserInfoService; -import luckyweb.seagull.util.StrLib; -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; - - -@Controller -@RequestMapping("/projectprotocolTemplate") -public class ProjectProtocolTemplateController { - - @Resource(name = "projectprotocoltemplateService") - private ProjectProtocolTemplateService ptemplateservice; - - @Resource(name = "projecttemplateparamsService") - private ProjectTemplateParamsService ptemplateparamsService; - - @Resource(name = "sectorprojectsService") - private SectorProjectsService sectorprojectsService; - - @Resource(name = "userinfoService") - private UserInfoService userinfoservice; - - @Resource(name = "operationlogService") - private OperationLogService operationlogservice; - /** - * - * - * @param tj - * @param model - * @return - * @throws Exception - */ - @RequestMapping(value = "/load.do") - public String load(HttpServletRequest req, Model model) throws Exception { - try { - int projectid = 99; - if (null != req.getSession().getAttribute("usercode") - && null != req.getSession().getAttribute("username")) { - String usercode = req.getSession().getAttribute("usercode").toString(); - UserInfo userinfo = userinfoservice.getUseinfo(usercode); - projectid = userinfo.getProjectid(); - } - List prolist=sectorprojectsService.getAllProject(); - for(int i=0;i ptlist = ptemplateservice.findByPage(ppt, offset, limit); - List prolist = QueueListener.qa_projlist; - for (int i = 0; i < ptlist.size(); i++) { - ProjectProtocolTemplate Template = ptlist.get(i); - for (SectorProjects projectlist : prolist) { - if (Template.getProjectid() == projectlist.getProjectid()) { - Template.setProjectname(projectlist.getProjectname()); - ptlist.set(i, Template); - break; - } - } - - } - // 转换成json字符串 - String RecordJson = StrLib.listToJson(ptlist); - // 得到总记录数 - int total = ptemplateservice.findRows(ppt); - // 需要返回的数据有总记录数和行数据 - JSONObject json = new JSONObject(); - json.put("total", total); - json.put("rows", RecordJson); - pw.print(json.toString()); - } - - /** - * 添加模板 - * - * @param tj - * @param br - * @param model - * @param req - * @param rsp - * @return - * @throws Exception - * @Description: - */ - @RequestMapping(value = "/add.do") - public void add(ProjectProtocolTemplate ppt, HttpServletRequest req, HttpServletResponse rsp) throws Exception { - try { - rsp.setContentType("text/html;charset=utf-8"); - req.setCharacterEncoding("utf-8"); - PrintWriter pw = rsp.getWriter(); - JSONObject json = new JSONObject(); - if (!UserLoginController.permissionboolean(req, "ptct_1")) { - json.put("status", "fail"); - json.put("ms", "增加协议模板失败,权限不足,请联系管理员!"); - } else { - if(!UserLoginController.oppidboolean(req, ppt.getProjectid())){ - json.put("status", "fail"); - json.put("ms", "增加协议模板失败,项目权限不足,请联系管理员!"); - }else{ - if (null != req.getSession().getAttribute("usercode") - && null != req.getSession().getAttribute("username")) { - String usercode = req.getSession().getAttribute("usercode").toString(); - ppt.setOperationer(usercode); - } - - String regEx_space = "\t|\r|\n";// 定义空格回车换行符 - Pattern p_space = Pattern.compile(regEx_space, Pattern.CASE_INSENSITIVE); - Matcher m_space = p_space.matcher(ppt.getRemark()); - ppt.setRemark(m_space.replaceAll("")); // 过滤空格回车标签 - - Date currentTime = new Date(); - SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); - String time = formatter.format(currentTime); - ppt.setTime(time); - - int id = ptemplateservice.add(ppt); - - operationlogservice.add(req, "PROJECT_PROTOCOLTEMPLATE", id, ppt.getProjectid(), "添加协议模板成功!"); - - json.put("status", "success"); - json.put("ms", "添加协议模板成功!"); - } - } - pw.print(json.toString()); - - } catch (Exception e) { - e.printStackTrace(); - } - - } - - - @RequestMapping(value = "/update.do") - public void updateplan(HttpServletRequest req, HttpServletResponse rsp, ProjectProtocolTemplate ppt) { - // 更新实体 - try { - rsp.setContentType("text/html;charset=utf-8"); - req.setCharacterEncoding("utf-8"); - PrintWriter pw = rsp.getWriter(); - JSONObject json = new JSONObject(); - if (!UserLoginController.permissionboolean(req, "ptct_3")) { - json.put("status", "fail"); - json.put("ms", "编辑模板失败,权限不足,请联系管理员!"); - } else { - if(!UserLoginController.oppidboolean(req, ppt.getProjectid())){ - json.put("status", "fail"); - json.put("ms", "编辑模板失败,项目权限不足,请联系管理员!"); - }else{ - if (null != req.getSession().getAttribute("usercode") - && null != req.getSession().getAttribute("username")) { - String usercode = req.getSession().getAttribute("usercode").toString(); - ppt.setOperationer(usercode); - } - Date currentTime = new Date(); - SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); - String time = formatter.format(currentTime); - ppt.setTime(time); - - ptemplateservice.modify(ppt); - - operationlogservice.add(req, "PROJECT_PROTOCOLTEMPLATE", ppt.getId(), ppt.getProjectid(), - "修改测试协议模板成功!"); - json.put("status", "success"); - json.put("ms", "编辑测试协议模板成功!"); - } - - } - pw.print(json.toString()); - } catch (Exception e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - } - - /** - * 删除模板 - * - * @param tj - * @param br - * @param model - * @param req - * @param rsp - * @return - * @throws Exception - * @Description: - */ - @RequestMapping(value = "/delete.do") - public void delete(HttpServletRequest req, HttpServletResponse rsp) throws Exception { - try { - rsp.setContentType("text/html;charset=utf-8"); - req.setCharacterEncoding("utf-8"); - PrintWriter pw = rsp.getWriter(); - JSONObject json = new JSONObject(); - if (!UserLoginController.permissionboolean(req, "ptct_2")) { - json.put("status", "fail"); - json.put("ms", "删除模板失败,权限不足,请联系管理员!"); - } else { - StringBuilder sb = new StringBuilder(); - try (BufferedReader reader = req.getReader();) { - char[] buff = new char[1024]; - int len; - while ((len = reader.read(buff)) != -1) { - sb.append(buff, 0, len); - } - } catch (IOException e) { - e.printStackTrace(); - } - JSONObject jsonObject = JSONObject.fromObject(sb.toString()); - JSONArray jsonarr = JSONArray.fromObject(jsonObject.getString("templateids")); - - String status="fail"; - String ms="删除协议模板失败!"; - int suc=0; - int fail=0; - for (int i = 0; i < jsonarr.size(); i++) { - int id = Integer.valueOf(jsonarr.get(i).toString()); - ProjectProtocolTemplate ppt = ptemplateservice.load(id); - - if(!UserLoginController.oppidboolean(req, ppt.getProjectid())){ - fail++; - continue; - } - ptemplateparamsService.delete(id); - ptemplateservice.deleteforob(ppt); - operationlogservice.add(req, "PROJECT_PROTOCOLTEMPLATE", id, ppt.getProjectid(), "删除协议模板成功!"); - suc++; - } - - if(suc>0){ - status="success"; - ms="删除协议模板成功!"; - if(fail>0){ - status="success"; - ms="删除协议模板"+suc+"条成功!"+fail+"条因为无项目权限删除失败!"; - } - } - - json.put("status", status); - json.put("ms", ms); - } - pw.print(json.toString()); - - } catch (Exception e) { - e.printStackTrace(); - } - - } - - @RequestMapping(value = "/cgetPTemplateList.do") - public void cgetPTemplateList(HttpServletRequest req, HttpServletResponse rsp) { - // 更新实体 - try { - rsp.setCharacterEncoding("utf-8"); - PrintWriter pw = rsp.getWriter(); - JSONObject json = new JSONObject(); - ProjectProtocolTemplate ppt=new ProjectProtocolTemplate(); - String projectid = req.getParameter("projectid"); - String steptype = req.getParameter("steptype"); - // 得到客户端传递的查询参数 - if (!StrLib.isEmpty(projectid)) { - ppt.setProjectid(Integer.valueOf(projectid)); - } - if (!StrLib.isEmpty(steptype)) { - ppt.setProtocoltype(steptype); - } - List ptlist = ptemplateservice.findByPage(ppt, 0, 99999); - JSONArray jsonarr = new JSONArray(); - for(ProjectProtocolTemplate obppt:ptlist){ - JSONObject jo = new JSONObject(); - jo.put("name", "【"+obppt.getId()+"】"+obppt.getName()); - jo.put("protocoltype", obppt.getProtocoltype()); - jo.put("operationer", obppt.getOperationer()); - jsonarr.add(jo); - } - String RecordJson = jsonarr.toString(); - String str = "{\"message\": \"\",\"value\": "+RecordJson+",\"code\": 200,\"redirect\": \"\" }"; - - json = JSONObject.fromObject(str); - pw.print(json.toString()); - } catch (Exception e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - } - - @RequestMapping(value = "/cgetStepParamList.do") - public void cgetStepParamList(HttpServletRequest req, HttpServletResponse rsp) { - // 更新实体 - try { - rsp.setCharacterEncoding("utf-8"); - PrintWriter pw = rsp.getWriter(); - JSONObject json = new JSONObject(); - ProjectProtocolTemplate ppt=new ProjectProtocolTemplate(); - String steptype = req.getParameter("steptype"); - String parentid = req.getParameter("parentid"); - String fieldname = req.getParameter("fieldname"); - int isteptype=0; - int iparentid=0; - // 得到客户端传递的查询参数 - if (!StrLib.isEmpty(parentid)) { - iparentid = Integer.valueOf(parentid); - } - if (!StrLib.isEmpty(steptype)) { - isteptype = Integer.valueOf(steptype); - } - List sptlist = ptemplateservice.findstepsparamList(isteptype, iparentid, fieldname); - JSONArray jsonarr = new JSONArray(); - for(Object[] obparam:sptlist){ - JSONObject jo = new JSONObject(); - jo.put("name", obparam[0]); - jo.put("description", obparam[1]); - jsonarr.add(jo); - } - String RecordJson = jsonarr.toString(); - String str = "{\"message\": \"\",\"value\": "+RecordJson+",\"code\": 200,\"redirect\": \"\" }"; - - json = JSONObject.fromObject(str); - pw.print(json.toString()); - } catch (Exception e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - } - - @RequestMapping(value = "/cgetPTemplateById.do") - public void cgetPTemplateById(HttpServletRequest req, HttpServletResponse rsp) { - // 更新实体 - try { - rsp.setContentType("text/html;charset=GBK"); - req.setCharacterEncoding("GBK"); - PrintWriter pw = rsp.getWriter(); - String templateid = req.getParameter("templateid"); - - ProjectProtocolTemplate ppt = ptemplateservice.load(Integer.valueOf(templateid)); - String jsonStr = JSONObject.fromObject(ppt).toString(); - pw.print(jsonStr); - } catch (Exception e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - } - - public static void main(String[] args) throws Exception { - // TODO Auto-generated method stub - } - -} +package luckyweb.seagull.spring.mvc; + +import java.io.BufferedReader; +import java.io.IOException; +import java.io.PrintWriter; +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.List; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.springframework.stereotype.Controller; +import org.springframework.ui.Model; +import org.springframework.web.bind.annotation.RequestMapping; + +import luckyweb.seagull.comm.QueueListener; +import luckyweb.seagull.spring.entity.ProjectCase; +import luckyweb.seagull.spring.entity.ProjectCasesteps; +import luckyweb.seagull.spring.entity.ProjectPlan; +import luckyweb.seagull.spring.entity.ProjectProtocolTemplate; +import luckyweb.seagull.spring.entity.SectorProjects; +import luckyweb.seagull.spring.entity.UserInfo; +import luckyweb.seagull.spring.service.OperationLogService; +import luckyweb.seagull.spring.service.ProjectProtocolTemplateService; +import luckyweb.seagull.spring.service.ProjectTemplateParamsService; +import luckyweb.seagull.spring.service.SectorProjectsService; +import luckyweb.seagull.spring.service.UserInfoService; +import luckyweb.seagull.util.StrLib; +import net.sf.json.JSONArray; +import net.sf.json.JSONObject; + + +@Controller +@RequestMapping("/projectprotocolTemplate") +public class ProjectProtocolTemplateController { + + @Resource(name = "projectprotocoltemplateService") + private ProjectProtocolTemplateService ptemplateservice; + + @Resource(name = "projecttemplateparamsService") + private ProjectTemplateParamsService ptemplateparamsService; + + @Resource(name = "sectorprojectsService") + private SectorProjectsService sectorprojectsService; + + @Resource(name = "userinfoService") + private UserInfoService userinfoservice; + + @Resource(name = "operationlogService") + private OperationLogService operationlogservice; + /** + * + * + * @param tj + * @param model + * @return + * @throws Exception + */ + @RequestMapping(value = "/load.do") + public String load(HttpServletRequest req, Model model) throws Exception { + try { + int projectid = 99; + if (null != req.getSession().getAttribute("usercode") + && null != req.getSession().getAttribute("username")) { + String usercode = req.getSession().getAttribute("usercode").toString(); + UserInfo userinfo = userinfoservice.getUseinfo(usercode); + projectid = userinfo.getProjectid(); + } + List prolist=sectorprojectsService.getAllProject(); + for(int i=0;i ptlist = ptemplateservice.findByPage(ppt, offset, limit); + List prolist = QueueListener.qa_projlist; + for (int i = 0; i < ptlist.size(); i++) { + ProjectProtocolTemplate Template = ptlist.get(i); + for (SectorProjects projectlist : prolist) { + if (Template.getProjectid() == projectlist.getProjectid()) { + Template.setProjectname(projectlist.getProjectname()); + ptlist.set(i, Template); + break; + } + } + + } + // 转换成json字符串 + String RecordJson = StrLib.listToJson(ptlist); + // 得到总记录数 + int total = ptemplateservice.findRows(ppt); + // 需要返回的数据有总记录数和行数据 + JSONObject json = new JSONObject(); + json.put("total", total); + json.put("rows", RecordJson); + pw.print(json.toString()); + } + + /** + * 添加模板 + * + * @param tj + * @param br + * @param model + * @param req + * @param rsp + * @return + * @throws Exception + * @Description: + */ + @RequestMapping(value = "/add.do") + public void add(ProjectProtocolTemplate ppt, HttpServletRequest req, HttpServletResponse rsp) throws Exception { + try { + rsp.setContentType("text/html;charset=utf-8"); + req.setCharacterEncoding("utf-8"); + PrintWriter pw = rsp.getWriter(); + JSONObject json = new JSONObject(); + if (!UserLoginController.permissionboolean(req, "ptct_1")) { + json.put("status", "fail"); + json.put("ms", "增加协议模板失败,权限不足,请联系管理员!"); + } else { + if(!UserLoginController.oppidboolean(req, ppt.getProjectid())){ + json.put("status", "fail"); + json.put("ms", "增加协议模板失败,项目权限不足,请联系管理员!"); + }else{ + if (null != req.getSession().getAttribute("usercode") + && null != req.getSession().getAttribute("username")) { + String usercode = req.getSession().getAttribute("usercode").toString(); + ppt.setOperationer(usercode); + } + + String regEx_space = "\t|\r|\n";// 定义空格回车换行符 + Pattern p_space = Pattern.compile(regEx_space, Pattern.CASE_INSENSITIVE); + Matcher m_space = p_space.matcher(ppt.getRemark()); + ppt.setRemark(m_space.replaceAll("")); // 过滤空格回车标签 + + Date currentTime = new Date(); + SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + String time = formatter.format(currentTime); + ppt.setTime(time); + + int id = ptemplateservice.add(ppt); + + operationlogservice.add(req, "PROJECT_PROTOCOLTEMPLATE", id, ppt.getProjectid(), "添加协议模板成功!"); + + json.put("status", "success"); + json.put("ms", "添加协议模板成功!"); + } + } + pw.print(json.toString()); + + } catch (Exception e) { + e.printStackTrace(); + } + + } + + + @RequestMapping(value = "/update.do") + public void updateplan(HttpServletRequest req, HttpServletResponse rsp, ProjectProtocolTemplate ppt) { + // 更新实体 + try { + rsp.setContentType("text/html;charset=utf-8"); + req.setCharacterEncoding("utf-8"); + PrintWriter pw = rsp.getWriter(); + JSONObject json = new JSONObject(); + if (!UserLoginController.permissionboolean(req, "ptct_3")) { + json.put("status", "fail"); + json.put("ms", "编辑模板失败,权限不足,请联系管理员!"); + } else { + if(!UserLoginController.oppidboolean(req, ppt.getProjectid())){ + json.put("status", "fail"); + json.put("ms", "编辑模板失败,项目权限不足,请联系管理员!"); + }else{ + if (null != req.getSession().getAttribute("usercode") + && null != req.getSession().getAttribute("username")) { + String usercode = req.getSession().getAttribute("usercode").toString(); + ppt.setOperationer(usercode); + } + Date currentTime = new Date(); + SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + String time = formatter.format(currentTime); + ppt.setTime(time); + + ptemplateservice.modify(ppt); + + operationlogservice.add(req, "PROJECT_PROTOCOLTEMPLATE", ppt.getId(), ppt.getProjectid(), + "修改测试协议模板成功!"); + json.put("status", "success"); + json.put("ms", "编辑测试协议模板成功!"); + } + + } + pw.print(json.toString()); + } catch (Exception e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + + /** + * 删除模板 + * + * @param tj + * @param br + * @param model + * @param req + * @param rsp + * @return + * @throws Exception + * @Description: + */ + @RequestMapping(value = "/delete.do") + public void delete(HttpServletRequest req, HttpServletResponse rsp) throws Exception { + try { + rsp.setContentType("text/html;charset=utf-8"); + req.setCharacterEncoding("utf-8"); + PrintWriter pw = rsp.getWriter(); + JSONObject json = new JSONObject(); + if (!UserLoginController.permissionboolean(req, "ptct_2")) { + json.put("status", "fail"); + json.put("ms", "删除模板失败,权限不足,请联系管理员!"); + } else { + StringBuilder sb = new StringBuilder(); + try (BufferedReader reader = req.getReader();) { + char[] buff = new char[1024]; + int len; + while ((len = reader.read(buff)) != -1) { + sb.append(buff, 0, len); + } + } catch (IOException e) { + e.printStackTrace(); + } + JSONObject jsonObject = JSONObject.fromObject(sb.toString()); + JSONArray jsonarr = JSONArray.fromObject(jsonObject.getString("templateids")); + + String status="fail"; + String ms="删除协议模板失败!"; + int suc=0; + int fail=0; + for (int i = 0; i < jsonarr.size(); i++) { + int id = Integer.valueOf(jsonarr.get(i).toString()); + ProjectProtocolTemplate ppt = ptemplateservice.load(id); + + if(!UserLoginController.oppidboolean(req, ppt.getProjectid())){ + fail++; + continue; + } + ptemplateparamsService.delete(id); + ptemplateservice.deleteforob(ppt); + operationlogservice.add(req, "PROJECT_PROTOCOLTEMPLATE", id, ppt.getProjectid(), "删除协议模板成功!"); + suc++; + } + + if(suc>0){ + status="success"; + ms="删除协议模板成功!"; + if(fail>0){ + status="success"; + ms="删除协议模板"+suc+"条成功!"+fail+"条因为无项目权限删除失败!"; + } + } + + json.put("status", status); + json.put("ms", ms); + } + pw.print(json.toString()); + + } catch (Exception e) { + e.printStackTrace(); + } + + } + + @RequestMapping(value = "/cgetPTemplateList.do") + public void cgetPTemplateList(HttpServletRequest req, HttpServletResponse rsp) { + // 更新实体 + try { + rsp.setCharacterEncoding("utf-8"); + PrintWriter pw = rsp.getWriter(); + JSONObject json = new JSONObject(); + ProjectProtocolTemplate ppt=new ProjectProtocolTemplate(); + String projectid = req.getParameter("projectid"); + String steptype = req.getParameter("steptype"); + // 得到客户端传递的查询参数 + if (!StrLib.isEmpty(projectid)) { + ppt.setProjectid(Integer.valueOf(projectid)); + } + if (!StrLib.isEmpty(steptype)) { + ppt.setProtocoltype(steptype); + } + List ptlist = ptemplateservice.findByPage(ppt, 0, 99999); + JSONArray jsonarr = new JSONArray(); + for(ProjectProtocolTemplate obppt:ptlist){ + JSONObject jo = new JSONObject(); + jo.put("name", "【"+obppt.getId()+"】"+obppt.getName()); + jo.put("protocoltype", obppt.getProtocoltype()); + jo.put("operationer", obppt.getOperationer()); + jsonarr.add(jo); + } + String RecordJson = jsonarr.toString(); + String str = "{\"message\": \"\",\"value\": "+RecordJson+",\"code\": 200,\"redirect\": \"\" }"; + + json = JSONObject.fromObject(str); + pw.print(json.toString()); + } catch (Exception e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + + @RequestMapping(value = "/cgetStepParamList.do") + public void cgetStepParamList(HttpServletRequest req, HttpServletResponse rsp) { + // 更新实体 + try { + rsp.setCharacterEncoding("utf-8"); + PrintWriter pw = rsp.getWriter(); + JSONObject json = new JSONObject(); + ProjectProtocolTemplate ppt=new ProjectProtocolTemplate(); + String steptype = req.getParameter("steptype"); + String parentid = req.getParameter("parentid"); + String fieldname = req.getParameter("fieldname"); + int isteptype=0; + int iparentid=0; + // 得到客户端传递的查询参数 + if (!StrLib.isEmpty(parentid)) { + iparentid = Integer.valueOf(parentid); + } + if (!StrLib.isEmpty(steptype)) { + isteptype = Integer.valueOf(steptype); + } + List sptlist = ptemplateservice.findstepsparamList(isteptype, iparentid, fieldname); + JSONArray jsonarr = new JSONArray(); + for(Object[] obparam:sptlist){ + JSONObject jo = new JSONObject(); + jo.put("name", obparam[0]); + jo.put("description", obparam[1]); + jsonarr.add(jo); + } + String RecordJson = jsonarr.toString(); + String str = "{\"message\": \"\",\"value\": "+RecordJson+",\"code\": 200,\"redirect\": \"\" }"; + + json = JSONObject.fromObject(str); + pw.print(json.toString()); + } catch (Exception e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + + @RequestMapping(value = "/cgetPTemplateById.do") + public void cgetPTemplateById(HttpServletRequest req, HttpServletResponse rsp) { + // 更新实体 + try { + rsp.setContentType("text/html;charset=GBK"); + req.setCharacterEncoding("GBK"); + PrintWriter pw = rsp.getWriter(); + String templateid = req.getParameter("templateid"); + + ProjectProtocolTemplate ppt = ptemplateservice.load(Integer.valueOf(templateid)); + String jsonStr = JSONObject.fromObject(ppt).toString(); + pw.print(jsonStr); + } catch (Exception e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + + public static void main(String[] args) throws Exception { + // TODO Auto-generated method stub + } + +} diff --git a/src/main/java/luckyweb/seagull/spring/mvc/ProjectTemplateParamsController.java b/src/main/java/luckyweb/seagull/spring/mvc/ProjectTemplateParamsController.java index 2526bf0..45d8c5c 100644 --- a/src/main/java/luckyweb/seagull/spring/mvc/ProjectTemplateParamsController.java +++ b/src/main/java/luckyweb/seagull/spring/mvc/ProjectTemplateParamsController.java @@ -1,236 +1,236 @@ -package luckyweb.seagull.spring.mvc; - -import java.io.BufferedReader; -import java.io.IOException; -import java.io.PrintWriter; -import java.text.SimpleDateFormat; -import java.util.Date; -import java.util.List; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.RequestMapping; - -import luckyweb.seagull.comm.QueueListener; -import luckyweb.seagull.spring.entity.ProjectProtocolTemplate; -import luckyweb.seagull.spring.entity.ProjectTemplateParams; -import luckyweb.seagull.spring.entity.SectorProjects; -import luckyweb.seagull.spring.service.OperationLogService; -import luckyweb.seagull.spring.service.ProjectProtocolTemplateService; -import luckyweb.seagull.spring.service.ProjectTemplateParamsService; -import luckyweb.seagull.spring.service.SectorProjectsService; -import luckyweb.seagull.spring.service.UserInfoService; -import luckyweb.seagull.util.StrLib; -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; -import net.sf.json.JsonConfig; - -@Controller -@RequestMapping("/projectTemplateParams") -public class ProjectTemplateParamsController { - - @Resource(name = "projecttemplateparamsService") - private ProjectTemplateParamsService ptemplateparamsService; - - @Resource(name = "projectprotocoltemplateService") - private ProjectProtocolTemplateService ptemplateservice; - - @Resource(name = "sectorprojectsService") - private SectorProjectsService sectorprojectsService; - - @Resource(name = "operationlogService") - private OperationLogService operationlogservice; - - @Resource(name = "userinfoService") - private UserInfoService userinfoservice; - - private List oldParamsList; - /** - * 添加步骤 - * - * @param tj - * @param br - * @param model - * @param req - * @param rsp - * @return - * @throws Exception - * @Description: - */ - @RequestMapping(value = "/templateParams.do") - public String templateParams(Model model,HttpServletRequest req, HttpServletResponse rsp) throws Exception { - try { - rsp.setContentType("text/html;charset=utf-8"); - req.setCharacterEncoding("utf-8"); - - if (!UserLoginController.permissionboolean(req, "ptct_3")) { - model.addAttribute("url", "/projectprotocolTemplate/load.do"); - model.addAttribute("message", "当前用户无权限编辑协议模板,请联系管理员!"); - return "success"; - } - - String templateid = req.getParameter("templateid"); - ProjectProtocolTemplate ppt = null; - if (!StrLib.isEmpty(templateid) && !"0".equals(templateid)) { - ppt = ptemplateservice.load(Integer.valueOf(templateid)); - if(!UserLoginController.oppidboolean(req, ppt.getProjectid())){ - SectorProjects sp=sectorprojectsService.loadob(ppt.getProjectid()); - model.addAttribute("url", "/projectprotocolTemplate/load.do"); - model.addAttribute("message", "当前用户无权限编辑项目【"+sp.getProjectname()+"】的协议模板,请联系管理员!"); - return "error"; - } - List prolist = QueueListener.qa_projlist; - for (SectorProjects project : prolist) { - if (ppt.getProjectid() == project.getProjectid()) { - ppt.setProjectname(project.getProjectname()); - break; - } - } - } - String retVal = "/jsp/plancase/templateparam"; - List paramslist = ptemplateparamsService.getParamsList(Integer.valueOf(templateid)); - oldParamsList = paramslist; - - if (paramslist.size() == 0) { - ProjectTemplateParams ptp = new ProjectTemplateParams(); - ptp.setParam(""); - ptp.setParamname(""); - ptp.setTemplateid(Integer.valueOf(templateid)); - paramslist.add(ptp); - }else{ - for(int i=0;i list = JSONArray.toList(jsonarr, new ProjectTemplateParams(), new JsonConfig());// 参数1为要转换的JSONArray数据,参数2为要转换的目标数据,即List盛装的数据 - String usercode = ""; - if (null != request.getSession().getAttribute("usercode") - && null != request.getSession().getAttribute("username")) { - usercode = request.getSession().getAttribute("usercode").toString(); - } - Date currentTime = new Date(); - SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); - String time = formatter.format(currentTime); - ProjectProtocolTemplate ppt = new ProjectProtocolTemplate(); - - List paramslist =oldParamsList; - for (int i = 0; i < list.size(); i++) { - ProjectTemplateParams param = (ProjectTemplateParams) list.get(i); - if(i==0){ - ppt = ptemplateservice.load(param.getTemplateid()); - } - int tag=0; //标识是否已有参数 - for (ProjectTemplateParams oldparam:paramslist) { - if(param.getId()==oldparam.getId()&&oldparam.getId()!=0){ - tag=1; - param.setParam(param.getParam().replaceAll(""", "\"")); - param.setParamname(param.getParamname().replaceAll(""", "\"")); - ptemplateparamsService.modify(param); - paramslist.remove(oldparam); - break; - } - } - - if(tag==0){ - param.setParam(param.getParam().replaceAll(""", "\"")); - param.setParamname(param.getParamname().replaceAll(""", "\"")); - ptemplateparamsService.add(param); - } - } - - for (ProjectTemplateParams oldparam:paramslist) { // 删除原有列表中多的步骤 - ptemplateparamsService.deleteforob(oldparam); - } - - ppt.setOperationer(usercode); - ppt.setTime(time); - ptemplateservice.modify(ppt); - - json.put("status", "success"); - json.put("ms", "编辑模板参数成功!"); - } - pw.print(json.toString()); - } - - @RequestMapping(value = "/cgetParamsByTemplate.do") - public void cgetParamsByTemplate(HttpServletRequest req, HttpServletResponse rsp) { - // 更新实体 - try { - rsp.setContentType("text/html;charset=GBK"); - req.setCharacterEncoding("GBK"); - PrintWriter pw = rsp.getWriter(); - JSONObject json = new JSONObject(); - String templateid = req.getParameter("templateid"); - - List params = ptemplateparamsService.getParamsList(Integer.valueOf(templateid)); - - // 转换成json字符串 - String RecordJson = StrLib.listToJson(params); - - // 需要返回的数据有总记录数和行数据 - json.put("params", RecordJson); - pw.print(json.toString()); - } catch (Exception e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - } - - public static void main(String[] args) throws Exception { - - } - -} +package luckyweb.seagull.spring.mvc; + +import java.io.BufferedReader; +import java.io.IOException; +import java.io.PrintWriter; +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.List; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.springframework.stereotype.Controller; +import org.springframework.ui.Model; +import org.springframework.web.bind.annotation.RequestMapping; + +import luckyweb.seagull.comm.QueueListener; +import luckyweb.seagull.spring.entity.ProjectProtocolTemplate; +import luckyweb.seagull.spring.entity.ProjectTemplateParams; +import luckyweb.seagull.spring.entity.SectorProjects; +import luckyweb.seagull.spring.service.OperationLogService; +import luckyweb.seagull.spring.service.ProjectProtocolTemplateService; +import luckyweb.seagull.spring.service.ProjectTemplateParamsService; +import luckyweb.seagull.spring.service.SectorProjectsService; +import luckyweb.seagull.spring.service.UserInfoService; +import luckyweb.seagull.util.StrLib; +import net.sf.json.JSONArray; +import net.sf.json.JSONObject; +import net.sf.json.JsonConfig; + +@Controller +@RequestMapping("/projectTemplateParams") +public class ProjectTemplateParamsController { + + @Resource(name = "projecttemplateparamsService") + private ProjectTemplateParamsService ptemplateparamsService; + + @Resource(name = "projectprotocoltemplateService") + private ProjectProtocolTemplateService ptemplateservice; + + @Resource(name = "sectorprojectsService") + private SectorProjectsService sectorprojectsService; + + @Resource(name = "operationlogService") + private OperationLogService operationlogservice; + + @Resource(name = "userinfoService") + private UserInfoService userinfoservice; + + private List oldParamsList; + /** + * 添加步骤 + * + * @param tj + * @param br + * @param model + * @param req + * @param rsp + * @return + * @throws Exception + * @Description: + */ + @RequestMapping(value = "/templateParams.do") + public String templateParams(Model model,HttpServletRequest req, HttpServletResponse rsp) throws Exception { + try { + rsp.setContentType("text/html;charset=utf-8"); + req.setCharacterEncoding("utf-8"); + + if (!UserLoginController.permissionboolean(req, "ptct_3")) { + model.addAttribute("url", "/projectprotocolTemplate/load.do"); + model.addAttribute("message", "当前用户无权限编辑协议模板,请联系管理员!"); + return "success"; + } + + String templateid = req.getParameter("templateid"); + ProjectProtocolTemplate ppt = null; + if (!StrLib.isEmpty(templateid) && !"0".equals(templateid)) { + ppt = ptemplateservice.load(Integer.valueOf(templateid)); + if(!UserLoginController.oppidboolean(req, ppt.getProjectid())){ + SectorProjects sp=sectorprojectsService.loadob(ppt.getProjectid()); + model.addAttribute("url", "/projectprotocolTemplate/load.do"); + model.addAttribute("message", "当前用户无权限编辑项目【"+sp.getProjectname()+"】的协议模板,请联系管理员!"); + return "error"; + } + List prolist = QueueListener.qa_projlist; + for (SectorProjects project : prolist) { + if (ppt.getProjectid() == project.getProjectid()) { + ppt.setProjectname(project.getProjectname()); + break; + } + } + } + String retVal = "/jsp/plancase/templateparam"; + List paramslist = ptemplateparamsService.getParamsList(Integer.valueOf(templateid)); + oldParamsList = paramslist; + + if (paramslist.size() == 0) { + ProjectTemplateParams ptp = new ProjectTemplateParams(); + ptp.setParam(""); + ptp.setParamname(""); + ptp.setTemplateid(Integer.valueOf(templateid)); + paramslist.add(ptp); + }else{ + for(int i=0;i list = JSONArray.toList(jsonarr, new ProjectTemplateParams(), new JsonConfig());// 参数1为要转换的JSONArray数据,参数2为要转换的目标数据,即List盛装的数据 + String usercode = ""; + if (null != request.getSession().getAttribute("usercode") + && null != request.getSession().getAttribute("username")) { + usercode = request.getSession().getAttribute("usercode").toString(); + } + Date currentTime = new Date(); + SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + String time = formatter.format(currentTime); + ProjectProtocolTemplate ppt = new ProjectProtocolTemplate(); + + List paramslist =oldParamsList; + for (int i = 0; i < list.size(); i++) { + ProjectTemplateParams param = (ProjectTemplateParams) list.get(i); + if(i==0){ + ppt = ptemplateservice.load(param.getTemplateid()); + } + int tag=0; //标识是否已有参数 + for (ProjectTemplateParams oldparam:paramslist) { + if(param.getId()==oldparam.getId()&&oldparam.getId()!=0){ + tag=1; + param.setParam(param.getParam().replaceAll(""", "\"")); + param.setParamname(param.getParamname().replaceAll(""", "\"")); + ptemplateparamsService.modify(param); + paramslist.remove(oldparam); + break; + } + } + + if(tag==0){ + param.setParam(param.getParam().replaceAll(""", "\"")); + param.setParamname(param.getParamname().replaceAll(""", "\"")); + ptemplateparamsService.add(param); + } + } + + for (ProjectTemplateParams oldparam:paramslist) { // 删除原有列表中多的步骤 + ptemplateparamsService.deleteforob(oldparam); + } + + ppt.setOperationer(usercode); + ppt.setTime(time); + ptemplateservice.modify(ppt); + + json.put("status", "success"); + json.put("ms", "编辑模板参数成功!"); + } + pw.print(json.toString()); + } + + @RequestMapping(value = "/cgetParamsByTemplate.do") + public void cgetParamsByTemplate(HttpServletRequest req, HttpServletResponse rsp) { + // 更新实体 + try { + rsp.setContentType("text/html;charset=GBK"); + req.setCharacterEncoding("GBK"); + PrintWriter pw = rsp.getWriter(); + JSONObject json = new JSONObject(); + String templateid = req.getParameter("templateid"); + + List params = ptemplateparamsService.getParamsList(Integer.valueOf(templateid)); + + // 转换成json字符串 + String RecordJson = StrLib.listToJson(params); + + // 需要返回的数据有总记录数和行数据 + json.put("params", RecordJson); + pw.print(json.toString()); + } catch (Exception e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + + public static void main(String[] args) throws Exception { + + } + +} diff --git a/src/main/java/luckyweb/seagull/spring/mvc/ProjectVersionController.java b/src/main/java/luckyweb/seagull/spring/mvc/ProjectVersionController.java index c43151c..76b8bbf 100644 --- a/src/main/java/luckyweb/seagull/spring/mvc/ProjectVersionController.java +++ b/src/main/java/luckyweb/seagull/spring/mvc/ProjectVersionController.java @@ -1,1413 +1,1413 @@ -package luckyweb.seagull.spring.mvc; - -import java.io.IOException; -import java.io.PrintWriter; -import java.text.DecimalFormat; -import java.text.ParseException; -import java.text.SimpleDateFormat; -import java.util.ArrayList; -import java.util.Date; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import javax.validation.Valid; - -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.validation.BindingResult; -import org.springframework.validation.FieldError; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; - -import luckyweb.seagull.comm.QueueListener; -import luckyweb.seagull.spring.entity.Barchart3; -import luckyweb.seagull.spring.entity.ProjectVersion; -import luckyweb.seagull.spring.entity.SectorProjects; -import luckyweb.seagull.spring.entity.TestCasedetail; -import luckyweb.seagull.spring.service.OperationLogService; -import luckyweb.seagull.spring.service.ProjectsVersionService; -import luckyweb.seagull.spring.service.SectorProjectsService; -import luckyweb.seagull.util.StrLib; -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; - -@Controller -@RequestMapping("/projectVersion") -public class ProjectVersionController { - - private int allPage; - private int pageSize = 20; - private int allRows; - private int page = 1; - private int offset; - - private final String zentaoWeb_ipport="10.211.19.75"; - - @Resource(name = "projectversionService") - private ProjectsVersionService projectsversionservice; - - @Resource(name = "sectorprojectsService") - private SectorProjectsService sectorprojectsService; - - public ProjectsVersionService getprojectsversionService() { - return projectsversionservice; - } - - @Resource(name = "operationlogService") - private OperationLogService operationlogservice; - - public OperationLogService getOperationlogService() { - return operationlogservice; - } - - @RequestMapping(value = "/projectversion.do") - public String qualityshow(TestCasedetail caseDetail, HttpServletRequest req,HttpServletResponse rsp, - Model model) throws Exception { - return "/jsp/projectversion/projectversion"; - } - - /** - * - * - * @param tj - * @param model - * @return - * @throws Exception - */ - @RequestMapping(value = "/load.do") - public String load(HttpServletRequest req, Model model) throws Exception { - - try { - int projectid = 99; - - List prolist = QueueListener.qa_projlist; - model.addAttribute("projects", prolist); - model.addAttribute("projectid", projectid); - model.addAttribute("zentaoip", zentaoWeb_ipport); - } catch (Exception e) { - e.printStackTrace(); - model.addAttribute("message", e.getMessage()); - model.addAttribute("url", "/projectVersion/load.do"); - return "error"; - } - return "/jsp/projectversion/projectversion"; - } - - @SuppressWarnings("unchecked") - @RequestMapping(value = "/list.do") - private void ajaxGetSellRecord(Integer limit, Integer offset, HttpServletRequest request, - HttpServletResponse response) throws IOException { - response.setCharacterEncoding("utf-8"); - PrintWriter pw = response.getWriter(); - String search = request.getParameter("search"); - String projectid = request.getParameter("projectid"); - String startDate = request.getParameter("startDate"); - String endDate = request.getParameter("endDate"); - ProjectVersion projectversion = new ProjectVersion(); - if (null == offset && null == limit) { - offset = 0; - } - if (null == limit || limit == 0) { - limit = 10; - } - // 得到客户端传递的查询参数 - if (!StrLib.isEmpty(search)) { - projectversion.setVersionnumber(search); - projectversion.setImprint(search); - } - // 得到客户端传递的查询参数 - if (!StrLib.isEmpty(projectid)) { - projectversion.setProjectid(Integer.valueOf(projectid)); - } - - if (!StrLib.isEmpty(startDate)) { - projectversion.setStartactually_launchdate(startDate); - } - - if (!StrLib.isEmpty(endDate)) { - projectversion.setEndactually_launchdate(endDate); - } - - List projectversions = projectsversionservice.findByPage(projectversion, offset, limit); - - // 转换成json字符串 - String RecordJson = StrLib.listToJson(projectversions); - // 得到总记录数 - int total = projectsversionservice.findRows(projectversion); - // 需要返回的数据有总记录数和行数据 - JSONObject json = new JSONObject(); - json.put("total", total); - json.put("rows", RecordJson); - pw.print(json.toString()); - } - - /** - * 版本添加 - * @param tj - * @param br - * @param model - * @param req - * @param rsp - * @return - * @throws Exception - * @Description: - */ - @RequestMapping(value = "/add.do") - public String add(@Valid @ModelAttribute("projectversion") ProjectVersion projectversion, BindingResult br, Model model, - HttpServletRequest req, HttpServletResponse rsp) throws Exception - { - try - { - rsp.setContentType("text/html;charset=utf-8"); - req.setCharacterEncoding("utf-8"); - - if(!UserLoginController.permissionboolean(req, "pv_1")){ - model.addAttribute("projectversion", new ProjectVersion()); - model.addAttribute("url", "/projectVersion/load.do"); - model.addAttribute("message", "当前用户无权限添加版本信息,请联系管理员!"); - return "success"; - } - - String retVal = "/jsp/projectversion/projectversion_add"; - if (req.getMethod().equals("POST")) - { - if (br.hasErrors()) - { - return retVal; - } - String message = ""; - - if(projectversion.getProjectid()==0){ - message = "请选择项目!"; - model.addAttribute("message", message); - return retVal; - }else{ - if(!UserLoginController.oppidboolean(req, projectversion.getProjectid())){ - SectorProjects sp=sectorprojectsService.loadob(projectversion.getProjectid()); - model.addAttribute("message", "当前用户无权限添加项目【"+sp.getProjectname()+"】版本信息,请联系管理员!"); - return retVal; - } - } - - if(projectversion.getActually_testend().equals("")||projectversion.getPlan_testend().equals("")){ - message = "版本已完成,请选择测试计划结束日期以及测试实际结束日期!"; - model.addAttribute("message", message); - return retVal; - } - - if(projectversion.getPlan_demand()==0){ - message = "请填写计划上线需求数!"; - model.addAttribute("message", message); - return retVal; - } - if(projectversion.getActually_demand()==0){ - message = "请填写实际上线需求数!"; - model.addAttribute("message", message); - return retVal; - } - if(!checkdate(projectversion.getPlan_devstart(),projectversion.getPlan_devend())){ - message = "计划开发开始日期大于计划开发结束日期!"; - model.addAttribute("message", message); - return retVal; - } - if(!checkdate(projectversion.getActually_devstart(),projectversion.getActually_devend())){ - message = "实际开发开始日期大于实际开发结束日期!"; - model.addAttribute("message", message); - return retVal; - } - if(!checkdate(projectversion.getPlan_teststart(),projectversion.getPlan_testend())){ - message = "计划测试开始日期大于计划测试结束日期!"; - model.addAttribute("message", message); - return retVal; - } - if(!checkdate(projectversion.getActually_teststart(),projectversion.getActually_testend())){ - message = "实际测试开始日期大于实际测试结束日期!"; - model.addAttribute("message", message); - return retVal; - } - - int actuallydevinterval = interval(projectversion.getActually_devstart(),projectversion.getActually_devend(),1); - int actuallytestinterval = interval(projectversion.getActually_teststart(),projectversion.getActually_testend(),1); - int plandevinterval = interval(projectversion.getPlan_devstart(),projectversion.getPlan_devend(),1); - int plantestinterval = interval(projectversion.getPlan_teststart(),projectversion.getPlan_testend(),1); - //版本达成日期偏差,结实结束日期直接使用测试的实际完成日期 - //int launchinterval = interval(projectversion.getPlan_launchdate(),projectversion.getActually_launchdate(),0); - int launchinterval = interval(projectversion.getPlan_testend(),projectversion.getActually_testend(),0); - - int membernum = member(projectversion.getDev_member()).length+member(projectversion.getTest_member()).length; - int devhuman = member(projectversion.getDev_member()).length*actuallydevinterval; - int testhuman = member(projectversion.getTest_member()).length*actuallytestinterval; - projectversion.setHuman_costdev(String.valueOf(devhuman)); - projectversion.setHuman_costtest(String.valueOf(testhuman)); - if(membernum>0){ //耗费人力资源 - projectversion.setHuman_cost(String.valueOf(devhuman+testhuman)); - }else{ - projectversion.setHuman_cost(projectversion.getHuman_cost()); - } - - //开发效率 - if(member(projectversion.getDev_member()).length>0&&actuallydevinterval!=0){ - double per_dev = Double.valueOf(new DecimalFormat("#.00").format((double)(projectversion.getCodeline())/devhuman)); - projectversion.setPer_dev(String.valueOf(per_dev)); - }else{ - projectversion.setPer_dev(projectversion.getPer_dev()); - } - - //测试效率 - if(member(projectversion.getTest_member()).length>0&&actuallytestinterval!=0){ - double per_test = Double.valueOf(new DecimalFormat("#.00").format((double)projectversion.getTestcasenum()/testhuman)); - projectversion.setPer_test(String.valueOf(per_test)); - }else{ - projectversion.setPer_test(projectversion.getPer_test()); - } - - //开发工期偏差+延期 - if(actuallydevinterval!=0&&plandevinterval!=0){ - double devtime_deviation = Double.valueOf(new DecimalFormat("#.00").format(((double)(actuallydevinterval-plandevinterval)/plandevinterval)*100)); - projectversion.setDevtime_deviation(String.valueOf(devtime_deviation)); - projectversion.setDevdelay_days(String.valueOf(interval(projectversion.getPlan_devend(),projectversion.getActually_devend(),0))); - - }else{ - projectversion.setDevtime_deviation(projectversion.getDevtime_deviation()); - projectversion.setDevdelay_days(projectversion.getDevdelay_days()); - } - - //测试工期偏差+延期 - if(actuallydevinterval!=0&&plandevinterval!=0){ - double testtime_deviation = Double.valueOf(new DecimalFormat("#.00").format(((double)(actuallytestinterval-plantestinterval)/plantestinterval)*100)); - projectversion.setTesttime_deviation(String.valueOf(testtime_deviation)); - projectversion.setTestdelay_days(String.valueOf(interval(projectversion.getPlan_testend(),projectversion.getActually_testend(),0))); - - }else{ - projectversion.setTesttime_deviation(projectversion.getTesttime_deviation()); - projectversion.setTestdelay_days(projectversion.getTestdelay_days()); - } - - //版本达成进度偏差+延期 - if(actuallydevinterval!=0&&plandevinterval!=0){ - double launchdeviation = Double.valueOf(new DecimalFormat("#.00").format(((double)launchinterval/(actuallydevinterval+actuallytestinterval))*100)); - projectversion.setProtime_deviation(String.valueOf(launchdeviation)); - projectversion.setProdelay_days(String.valueOf(launchinterval)); - - }else{ - projectversion.setProtime_deviation(projectversion.getProtime_deviation()); - projectversion.setProdelay_days(projectversion.getProdelay_days()); - } - - - projectversion.setVersionnumber(projectversion.getVersionnumber()); - - //直接取测试完成日期 - projectversion.setPlan_launchdate(projectversion.getPlan_testend()); - projectversion.setActually_launchdate(projectversion.getActually_testend()); - - projectversion.setImprint(projectversion.getImprint()); - projectversion.setRemark(projectversion.getRemark()); - projectversion.setPlan_demand(projectversion.getPlan_demand()); - projectversion.setActually_demand(projectversion.getActually_demand()); - projectversion.setCodestandard_yz(projectversion.getCodestandard_yz()); - projectversion.setCodestandard_zd(projectversion.getCodestandard_zd()); - projectversion.setCodestandard_zy(projectversion.getCodestandard_zy()); - projectversion.setTestcasenum(projectversion.getTestcasenum()); - projectversion.setCodeline(projectversion.getCodeline()); - projectversion.setChangetestingreturn(projectversion.getChangetestingreturn()); - projectversion.setDev_member(projectversion.getDev_member()); - projectversion.setTest_member(projectversion.getTest_member()); - projectversion.setZt_versionlink(projectversion.getZt_versionlink()); - projectversion.setVersiontype(1); - - double divalue = projectversion.getBug_zm()*10+projectversion.getBug_yz()*3+projectversion.getBug_yb()+projectversion.getBug_ts()*0.1; - - if(projectversion.getCodeline()!=0){ - projectversion.setCode_DI(Double.valueOf(new DecimalFormat("#.00").format(divalue/projectversion.getCodeline())).toString()); - }else{ - projectversion.setCode_DI("0"); - } - - if(projectversion.getActually_demand()!=0&&projectversion.getPlan_demand()!=0){ - projectversion.setPerdemand(Double.valueOf(new DecimalFormat("#.00").format(((double)projectversion.getActually_demand()/projectversion.getPlan_demand())*100))); - }else{ - projectversion.setPerdemand(0.00); - } - - projectversion.setPlan_devstart(projectversion.getPlan_devstart()); - projectversion.setPlan_devend(projectversion.getPlan_devend()); - projectversion.setActually_devstart(projectversion.getActually_devstart()); - projectversion.setActually_devend(projectversion.getActually_devend()); - projectversion.setPlan_teststart(projectversion.getPlan_teststart()); - projectversion.setPlan_testend(projectversion.getPlan_testend()); - projectversion.setActually_teststart(projectversion.getActually_teststart()); - projectversion.setActually_testend(projectversion.getActually_testend()); - projectversion.setQualityreview(projectversion.getQualityreview()); - projectversion.setBug_zm(projectversion.getBug_zm()); - projectversion.setBug_yz(projectversion.getBug_yz()); - projectversion.setBug_yb(projectversion.getBug_yb()); - projectversion.setBug_ts(projectversion.getBug_ts()); - - - SectorProjects p = new SectorProjects(); - p.setProjectid(projectversion.getProjectid()); - projectversion.setSectorProjects(p); - - int versionid = projectsversionservice.add(projectversion); - - operationlogservice.add(req, "QA_PROJECTVERSION", versionid, - projectversion.getProjectid(),"版本信息添加成功!版本号:"+projectversion.getVersionnumber()); - - model.addAttribute("message", "添加成功"); - model.addAttribute("url", "/projectVersion/load.do"); - return retVal; - - } - model.addAttribute("projectversion", projectversion); - model.addAttribute("projects", QueueListener.qa_projlist); - return retVal; - - } - catch (Exception e) - { - model.addAttribute("message", e.getMessage()); - model.addAttribute("url", "/projectVersion/load.do"); - return "error"; - } - - } - - /** - * - * 根据versionid更新版本信息 - * @param id - * @param model - * @return - * @throws Exception - */ - @RequestMapping(value = "/update.do") - public String update(@Valid @ModelAttribute("projectversion") ProjectVersion projectversion, BindingResult br, - Model model, HttpServletRequest req) throws Exception - { - req.setCharacterEncoding("utf-8"); - int versionid = Integer.valueOf(req.getParameter("versionid")); - String retVal = "/jsp/projectversion/projectversion_add"; - - if(!UserLoginController.permissionboolean(req, "pv_3")){ - model.addAttribute("projectversion", new ProjectVersion()); - model.addAttribute("url", "/projectVersion/load.do"); - model.addAttribute("message", "当前用户无权限操作修改版本信息,请联系管理员!"); - return "success"; - } - - model.addAttribute("projects", QueueListener.qa_projlist); - if (req.getMethod().equals("POST")) - { - if (br.hasErrors()) - { - return retVal; - } - String message = ""; - - if(projectversion.getProjectid()==0){ - message = "请选择项目!"; - model.addAttribute("message", message); - return retVal; - }else{ - if(!UserLoginController.oppidboolean(req, projectversion.getProjectid())){ - SectorProjects sp=sectorprojectsService.loadob(projectversion.getProjectid()); - model.addAttribute("message", "当前用户无权限操作修改项目【"+sp.getProjectname()+"】版本信息,请联系管理员!"); - return retVal; - } - } - - if(projectversion.getPlan_testend().equals("")){ - message = "请选择测试计划结束日期!"; - model.addAttribute("message", message); - return retVal; - } - - if(projectversion.getActually_testend().equals("")&&projectversion.getVersiontype()==1){ - message = "版本已完成,请选择测试实际结束日期!"; - model.addAttribute("message", message); - return retVal; - } - - if(projectversion.getPlan_demand()==0){ - message = "请填写计划上线需求数!"; - model.addAttribute("message", message); - return retVal; - } - if(projectversion.getActually_demand()==0&&projectversion.getVersiontype()==1){ - message = "请填写实际上线需求数!"; - model.addAttribute("message", message); - return retVal; - } - if(projectversion.getTestcasenum()==0&&projectversion.getVersiontype()==1){ - message = "请填写测试用例数!"; - model.addAttribute("message", message); - return retVal; - } - if(!checkdate(projectversion.getPlan_devstart(),projectversion.getPlan_devend())){ - message = "计划开发开始日期大于计划开发结束日期!"; - model.addAttribute("message", message); - return retVal; - } - if(!checkdate(projectversion.getActually_devstart(),projectversion.getActually_devend())&&projectversion.getVersiontype()==1){ - message = "实际开发开始日期大于实际开发结束日期!"; - model.addAttribute("message", message); - return retVal; - } - if(!checkdate(projectversion.getPlan_teststart(),projectversion.getPlan_testend())){ - message = "计划测试开始日期大于计划测试结束日期!"; - model.addAttribute("message", message); - return retVal; - } - if(!checkdate(projectversion.getActually_teststart(),projectversion.getActually_testend())&&projectversion.getVersiontype()==1){ - message = "实际测试开始日期大于实际测试结束日期!"; - model.addAttribute("message", message); - return retVal; - } - - int actuallydevinterval = interval(projectversion.getActually_devstart(),projectversion.getActually_devend(),1); - int actuallytestinterval = interval(projectversion.getActually_teststart(),projectversion.getActually_testend(),1); - int plandevinterval = interval(projectversion.getPlan_devstart(),projectversion.getPlan_devend(),1); - int plantestinterval = interval(projectversion.getPlan_teststart(),projectversion.getPlan_testend(),1); - //其际版本偏差的计算方式,实际结束日期直接使用测试的实际结束日期 - int launchinterval = interval(projectversion.getPlan_testend(),projectversion.getActually_testend(),0); - - int membernum = member(projectversion.getDev_member()).length+member(projectversion.getTest_member()).length; - int devhuman = member(projectversion.getDev_member()).length*actuallydevinterval; - int testhuman = member(projectversion.getTest_member()).length*actuallytestinterval; - projectversion.setHuman_costdev(String.valueOf(devhuman)); - projectversion.setHuman_costtest(String.valueOf(testhuman)); - if(membernum>0){ //耗费人力资源 - projectversion.setHuman_cost(String.valueOf(devhuman+testhuman)); - }else{ - projectversion.setHuman_cost(projectversion.getHuman_cost()); - } - - //开发效率 - if(member(projectversion.getDev_member()).length>0&&actuallydevinterval!=0){ - double per_dev = Double.valueOf(new DecimalFormat("#.00").format((double)(projectversion.getCodeline())/devhuman)); - projectversion.setPer_dev(String.valueOf(per_dev)); - }else{ - projectversion.setPer_dev(projectversion.getPer_dev()); - } - - //测试效率 - if(member(projectversion.getTest_member()).length>0&&actuallytestinterval!=0){ - double per_test = Double.valueOf(new DecimalFormat("#.00").format((double)projectversion.getTestcasenum()/testhuman)); - projectversion.setPer_test(String.valueOf(per_test)); - }else{ - projectversion.setPer_test(projectversion.getPer_test()); - } - - //开发工期偏差+延期 - if(actuallydevinterval!=0&&plandevinterval!=0){ - double devtime_deviation = Double.valueOf(new DecimalFormat("#.00").format(((double)(actuallydevinterval-plandevinterval)/plandevinterval)*100)); - projectversion.setDevtime_deviation(String.valueOf(devtime_deviation)); - projectversion.setDevdelay_days(String.valueOf(interval(projectversion.getPlan_devend(),projectversion.getActually_devend(),0))); - - }else{ - projectversion.setDevtime_deviation(projectversion.getDevtime_deviation()); - projectversion.setDevdelay_days(projectversion.getDevdelay_days()); - } - - //测试工期偏差+延期 - if(actuallydevinterval!=0&&plandevinterval!=0){ - double testtime_deviation = Double.valueOf(new DecimalFormat("#.00").format(((double)(actuallytestinterval-plantestinterval)/plantestinterval)*100)); - projectversion.setTesttime_deviation(String.valueOf(testtime_deviation)); - projectversion.setTestdelay_days(String.valueOf(interval(projectversion.getPlan_testend(),projectversion.getActually_testend(),0))); - - }else{ - projectversion.setTesttime_deviation(projectversion.getTesttime_deviation()); - projectversion.setTestdelay_days(projectversion.getTestdelay_days()); - } - - //版本达成进度偏差+延期 - if(actuallydevinterval!=0&&plandevinterval!=0){ - double launchdeviation = Double.valueOf(new DecimalFormat("#.00").format(((double)launchinterval/(actuallydevinterval+actuallytestinterval))*100)); - projectversion.setProtime_deviation(String.valueOf(launchdeviation)); - projectversion.setProdelay_days(String.valueOf(launchinterval)); - - }else{ - projectversion.setProtime_deviation(projectversion.getProtime_deviation()); - projectversion.setProdelay_days(projectversion.getProdelay_days()); - } - - projectversion.setVersionnumber(projectversion.getVersionnumber()); - - //直接取测试完成日期 - projectversion.setPlan_launchdate(projectversion.getPlan_testend()); - projectversion.setActually_launchdate(projectversion.getActually_testend()); - - projectversion.setImprint(projectversion.getImprint()); - projectversion.setRemark(projectversion.getRemark()); - projectversion.setPlan_demand(projectversion.getPlan_demand()); - projectversion.setActually_demand(projectversion.getActually_demand()); - projectversion.setCodestandard_yz(projectversion.getCodestandard_yz()); - projectversion.setCodestandard_zd(projectversion.getCodestandard_zd()); - projectversion.setCodestandard_zy(projectversion.getCodestandard_zy()); - projectversion.setTestcasenum(projectversion.getTestcasenum()); - projectversion.setCodeline(projectversion.getCodeline()); - projectversion.setChangetestingreturn(projectversion.getChangetestingreturn()); - projectversion.setDev_member(projectversion.getDev_member()); - projectversion.setTest_member(projectversion.getTest_member()); - projectversion.setZt_versionlink(projectversion.getZt_versionlink()); - projectversion.setVersiontype(projectversion.getVersiontype()); - - double divalue = projectversion.getBug_zm()*10+projectversion.getBug_yz()*3+projectversion.getBug_yb()+projectversion.getBug_ts()*0.1; - - if(projectversion.getCodeline()!=0){ - projectversion.setCode_DI(Double.valueOf(new DecimalFormat("#.00").format(divalue/projectversion.getCodeline())).toString()); - }else{ - projectversion.setCode_DI("0"); - } - - if(projectversion.getActually_demand()!=0&&projectversion.getPlan_demand()!=0){ - projectversion.setPerdemand(Double.valueOf(new DecimalFormat("#.00").format(((double)projectversion.getActually_demand()/projectversion.getPlan_demand())*100))); - }else{ - projectversion.setPerdemand(0.00); - } - - projectversion.setPlan_devstart(projectversion.getPlan_devstart()); - projectversion.setPlan_devend(projectversion.getPlan_devend()); - projectversion.setActually_devstart(projectversion.getActually_devstart()); - projectversion.setActually_devend(projectversion.getActually_devend()); - projectversion.setPlan_teststart(projectversion.getPlan_teststart()); - projectversion.setPlan_testend(projectversion.getPlan_testend()); - projectversion.setActually_teststart(projectversion.getActually_teststart()); - projectversion.setActually_testend(projectversion.getActually_testend()); - projectversion.setQualityreview(projectversion.getQualityreview()); - projectversion.setBug_zm(projectversion.getBug_zm()); - projectversion.setBug_yz(projectversion.getBug_yz()); - projectversion.setBug_yb(projectversion.getBug_yb()); - projectversion.setBug_ts(projectversion.getBug_ts()); - - SectorProjects p = new SectorProjects(); - p.setProjectid(projectversion.getProjectid()); - projectversion.setSectorProjects(p); - - projectsversionservice.modify(projectversion); - - operationlogservice.add(req, "QA_PROJECTVERSION", versionid, - projectversion.getProjectid(),"版本信息修改成功!版本号:"+projectversion.getVersionnumber()); - - model.addAttribute("message", "修改成功"); - model.addAttribute("url", "/projectVersion/load.do"); - return retVal; - } - - //projectversion.setVersionid(versionid); - projectversion = projectsversionservice.load(versionid); - projectversion.setProjectid(projectversion.getSectorProjects().getProjectid()); - - model.addAttribute("projectversion", projectversion); - return "/jsp/projectversion/projectversion_update"; - } - - /** - * 计划添加 - * @param tj - * @param br - * @param model - * @param req - * @param rsp - * @return - * @throws Exception - * @Description: - */ - @RequestMapping(value = "/addplan.do") - public String addplan(@Valid @ModelAttribute("projectversion") ProjectVersion projectversion, BindingResult br, Model model, - HttpServletRequest req, HttpServletResponse rsp) throws Exception - { - try - { - rsp.setContentType("text/html;charset=utf-8"); - req.setCharacterEncoding("utf-8"); - - if(!UserLoginController.permissionboolean(req, "pvp_1")){ - model.addAttribute("projectversion", new ProjectVersion()); - model.addAttribute("url", "/projectVersion/load.do"); - model.addAttribute("message", "当前用户无权限添加版本计划信息,请联系管理员!"); - return "success"; - } - - String retVal = "/jsp/projectversion/projectversion_addplan"; - if (req.getMethod().equals("POST")) - { - if (br.hasErrors()) - { - List err=br.getFieldErrors(); - FieldError fe; - String field; - String errorMessage; - for (int i = 0; i < err.size(); i++) { - fe=err.get(i); - field=fe.getField();//得到那个字段验证出错 - errorMessage=fe.getDefaultMessage();//得到错误消息 - System.out.println("错误字段消息:"+field +" : "+errorMessage); - } - return retVal; - } - String message = ""; - - if(projectversion.getProjectid()==0){ - message = "请选择项目!"; - model.addAttribute("message", message); - return retVal; - }else{ - if(!UserLoginController.oppidboolean(req, projectversion.getProjectid())){ - SectorProjects sp=sectorprojectsService.loadob(projectversion.getProjectid()); - model.addAttribute("message", "当前用户无权限添加项目【"+sp.getProjectname()+"】版本计划信息,请联系管理员!"); - return retVal; - } - } - - if(projectversion.getPlan_demand()==0){ - message = "请填写计划上线需求数!"; - model.addAttribute("message", message); - return retVal; - } - - if(projectversion.getPlan_testend().equals("")){ - message = "请选择测试计划结束日期!"; - model.addAttribute("message", message); - return retVal; - } - - int actuallydevinterval = interval(projectversion.getActually_devstart(),projectversion.getActually_devend(),1); - int actuallytestinterval = interval(projectversion.getActually_teststart(),projectversion.getActually_testend(),1); - int plandevinterval = interval(projectversion.getPlan_devstart(),projectversion.getPlan_devend(),1); - int plantestinterval = interval(projectversion.getPlan_teststart(),projectversion.getPlan_testend(),1); - //版本达成日期偏差,结实结束日期直接使用测试的实际完成日期 - //int launchinterval = interval(projectversion.getPlan_launchdate(),projectversion.getActually_launchdate(),0); - int launchinterval = interval(projectversion.getPlan_launchdate(),projectversion.getActually_testend(),0); - - int membernum = member(projectversion.getDev_member()).length+member(projectversion.getTest_member()).length; - int devhuman = member(projectversion.getDev_member()).length*actuallydevinterval; - int testhuman = member(projectversion.getTest_member()).length*actuallytestinterval; - projectversion.setHuman_costdev(String.valueOf(devhuman)); - projectversion.setHuman_costtest(String.valueOf(testhuman)); - if(membernum>0){ //耗费人力资源 - projectversion.setHuman_cost(String.valueOf(devhuman+testhuman)); - }else{ - projectversion.setHuman_cost(projectversion.getHuman_cost()); - } - - //开发效率 - if(member(projectversion.getDev_member()).length>0&&actuallydevinterval!=0){ - double per_dev = Double.valueOf(new DecimalFormat("#.00").format((double)(projectversion.getCodeline())/devhuman)); - projectversion.setPer_dev(String.valueOf(per_dev)); - }else{ - projectversion.setPer_dev(projectversion.getPer_dev()); - } - - //测试效率 - if(member(projectversion.getTest_member()).length>0&&actuallytestinterval!=0){ - double per_test = Double.valueOf(new DecimalFormat("#.00").format((double)projectversion.getTestcasenum()/testhuman)); - projectversion.setPer_test(String.valueOf(per_test)); - }else{ - projectversion.setPer_test(projectversion.getPer_test()); - } - - //开发工期偏差+延期 - if(actuallydevinterval!=0&&plandevinterval!=0){ - double devtime_deviation = Double.valueOf(new DecimalFormat("#.00").format(((double)(actuallydevinterval-plandevinterval)/plandevinterval)*100)); - projectversion.setDevtime_deviation(String.valueOf(devtime_deviation)); - projectversion.setDevdelay_days(String.valueOf(interval(projectversion.getPlan_devend(),projectversion.getActually_devend(),0))); - - }else{ - projectversion.setDevtime_deviation(projectversion.getDevtime_deviation()); - projectversion.setDevdelay_days(projectversion.getDevdelay_days()); - } - - //测试工期偏差+延期 - if(actuallydevinterval!=0&&plandevinterval!=0){ - double testtime_deviation = Double.valueOf(new DecimalFormat("#.00").format(((double)(actuallytestinterval-plantestinterval)/plantestinterval)*100)); - projectversion.setTesttime_deviation(String.valueOf(testtime_deviation)); - projectversion.setTestdelay_days(String.valueOf(interval(projectversion.getPlan_testend(),projectversion.getActually_testend(),0))); - - }else{ - projectversion.setTesttime_deviation(projectversion.getTesttime_deviation()); - projectversion.setTestdelay_days(projectversion.getTestdelay_days()); - } - - //版本达成进度偏差+延期 - if(actuallydevinterval!=0&&plandevinterval!=0){ - double launchdeviation = Double.valueOf(new DecimalFormat("#.00").format(((double)launchinterval/(actuallydevinterval+actuallytestinterval))*100)); - projectversion.setProtime_deviation(String.valueOf(launchdeviation)); - projectversion.setProdelay_days(String.valueOf(launchinterval)); - - }else{ - projectversion.setProtime_deviation(projectversion.getProtime_deviation()); - projectversion.setProdelay_days(projectversion.getProdelay_days()); - } - - - projectversion.setVersionnumber(projectversion.getVersionnumber()); - projectversion.setPlan_launchdate(projectversion.getPlan_launchdate()); - //直接取测试完成日期 - projectversion.setActually_launchdate(projectversion.getActually_testend()); - - projectversion.setImprint(projectversion.getImprint()); - projectversion.setRemark(projectversion.getRemark()); - projectversion.setPlan_demand(projectversion.getPlan_demand()); - projectversion.setActually_demand(projectversion.getActually_demand()); - projectversion.setCodestandard_yz(0); - projectversion.setCodestandard_zd(0); - projectversion.setCodestandard_zy(0); - projectversion.setTestcasenum(projectversion.getTestcasenum()); - projectversion.setCodeline(projectversion.getCodeline()); - projectversion.setChangetestingreturn(projectversion.getChangetestingreturn()); - projectversion.setDev_member(projectversion.getDev_member()); - projectversion.setTest_member(projectversion.getTest_member()); - projectversion.setZt_versionlink(projectversion.getZt_versionlink()); - - double divalue = projectversion.getBug_zm()*10+projectversion.getBug_yz()*3+projectversion.getBug_yb()+projectversion.getBug_ts()*0.1; - - if(projectversion.getCodeline()!=0){ - projectversion.setCode_DI(Double.valueOf(new DecimalFormat("#.00").format(divalue/projectversion.getCodeline())).toString()); - }else{ - projectversion.setCode_DI("0"); - } - - if(projectversion.getActually_demand()!=0&&projectversion.getPlan_demand()!=0){ - projectversion.setPerdemand(Double.valueOf(new DecimalFormat("#.00").format(((double)projectversion.getActually_demand()/projectversion.getPlan_demand())*100))); - }else{ - projectversion.setPerdemand(0.00); - } - - projectversion.setPlan_devstart(projectversion.getPlan_devstart()); - projectversion.setPlan_devend(projectversion.getPlan_devend()); - projectversion.setActually_devstart(projectversion.getActually_devstart()); - projectversion.setActually_devend(projectversion.getActually_devend()); - projectversion.setPlan_teststart(projectversion.getPlan_teststart()); - projectversion.setPlan_testend(projectversion.getPlan_testend()); - projectversion.setActually_teststart(projectversion.getActually_teststart()); - projectversion.setActually_testend(projectversion.getActually_testend()); - projectversion.setQualityreview(projectversion.getQualityreview()); - projectversion.setBug_zm(projectversion.getBug_zm()); - projectversion.setBug_yz(projectversion.getBug_yz()); - projectversion.setBug_yb(projectversion.getBug_yb()); - projectversion.setBug_ts(projectversion.getBug_ts()); - projectversion.setVersiontype(0); - - - SectorProjects p = new SectorProjects(); - p.setProjectid(projectversion.getProjectid()); - projectversion.setSectorProjects(p); - - int versionid = projectsversionservice.add(projectversion); - - operationlogservice.add(req, "QA_PROJECTVERSION", versionid, - projectversion.getProjectid(),"版本计划添加成功!版本号:"+projectversion.getVersionnumber()); - - model.addAttribute("message", "添加成功"); - model.addAttribute("url", "/projectVersion/load.do"); - return retVal; - - } - model.addAttribute("projectversion", projectversion); - model.addAttribute("projects", QueueListener.qa_projlist); - return retVal; - - } - catch (Exception e) - { - model.addAttribute("message", e.getMessage()); - model.addAttribute("url", "/projectVersion/load.do"); - return "error"; - } - - } - - /** - * 删除版本记录 - * - * @param tj - * @param br - * @param model - * @param req - * @param rsp - * @return - * @throws Exception - * @Description: - */ - @RequestMapping(value = "/delete.do") - public void delete(HttpServletRequest req, HttpServletResponse rsp) throws Exception { - try { - rsp.setContentType("text/html;charset=utf-8"); - req.setCharacterEncoding("utf-8"); - PrintWriter pw = rsp.getWriter(); - JSONObject json = new JSONObject(); - if (!UserLoginController.permissionboolean(req, "pv_2")) { - json.put("status", "fail"); - json.put("ms", "删除项目版本信息失败,权限不足,请联系管理员!"); - } else { - int versionid = Integer.valueOf(req.getParameter("versionid")); - ProjectVersion projectversion = projectsversionservice.load(versionid); - try - { - if(!UserLoginController.oppidboolean(req, projectversion.getSectorProjects().getProjectid())){ - json.put("status", "fail"); - json.put("ms", "删除项目版本信息失败,项目权限不足,请联系管理员!"); - }else{ - projectsversionservice.delete(versionid); - - operationlogservice.add(req, "QA_PROJECTVERSION", versionid, - projectversion.getSectorProjects().getProjectid(),"版本信息删除成功!版本号:"+projectversion.getVersionnumber()); - - json.put("status", "success"); - json.put("ms", "删除项目版本信息成功!"); - } - - } - catch (Exception e) - { - json.put("status", "fail"); - json.put("ms", "删除项目版本信息失败!"); - } - } - pw.print(json.toString()); - - } catch (Exception e) { - e.printStackTrace(); - } - - } - - /** - * 版本详情 - * - * @param id - * @param model - * @return - * @throws Exception - */ - @RequestMapping(value = "/show.do") - public String show(HttpServletRequest req,Model model) throws Exception - { - String versionid = req.getParameter("versionid"); - ProjectVersion pv = new ProjectVersion(); - pv.setVersionid(Integer.valueOf(versionid)); - ProjectVersion projectversion = projectsversionservice.load(pv.getVersionid()); - model.addAttribute("projectversion", projectversion); - return "/jsp/projectversion/projectversion_show"; - } - - /** - * - * 质量报表 - * @param model - * @param req - * @return - * @throws Exception - * @Description: - */ - @RequestMapping(value = "/showreport.do") - public String showReport(HttpServletRequest req,Model model) throws Exception - { - try{ - String p = req.getParameter("page"); - String startdate = req.getParameter("startdate"); - String enddate = req.getParameter("enddate"); - String startdatestr = startdate+"至"; - String enddatestr = enddate; - - if(startdate==""||startdate==null){ - startdate = "0"; - startdatestr = "初始数据日期至"; - } - if(enddate==""||enddate==null){ - enddate = "9999-99-99"; - enddatestr = "今天"; - } - - if (StrLib.isEmpty(p) || Integer.valueOf(p) == 0) { - page = 1; - } - - String page2 = req.getParameter("page"); - if (StrLib.isEmpty(page2)) { - page = 1; - } else { - try { - page = Integer.parseInt(page2); - } catch (Exception e) { - page = 1; - } - } - allRows = projectsversionservice.findRowsreport(startdate, enddate); - offset = (page - 1) * pageSize; - if (allRows % pageSize == 0) { - allPage = allRows / pageSize; - } else { - allPage = allRows / pageSize + 1; - } - - model.addAttribute("allRows", allRows); - model.addAttribute("page", page); - model.addAttribute("offset", offset); - model.addAttribute("pageSize", pageSize); - model.addAttribute("allPage", allPage); - - - List reportlist = projectsversionservice.findByPagereport(offset, pageSize, startdate, enddate); - - for(int i=0;i(); - - Map innerptMap = new HashMap(); - innerptMap.put("type", "max"); - innerptMap.put("name", "最大值"); - - Map innerptMap1 = new HashMap(); - innerptMap1.put("type", "min"); - innerptMap1.put("name", "最小值"); - List datamapList = new ArrayList(); - datamapList.add(innerptMap); - datamapList.add(innerptMap1); - pointMap.put("data", datamapList); - - - Map lineMap = new HashMap(); - - Map innerliMap = new HashMap(); - innerliMap.put("type", "average"); - innerliMap.put("name", "平均值"); - List datamapList1 = new ArrayList(); - datamapList1.add(innerliMap); - lineMap.put("data", datamapList1); - //获取数据 - for(int i=0;i pv = projectsversionservice.list(projectid,startdate,enddate); - - String[] columnname = {"代码规范DI评分","开发平均生产率(千行/天)","测试平均生产率(执行 个/天)","项目工期偏移率(百分比)","缺陷DI值(千行)","需求达成率(百分比)"}; - - Barchart3[] data = new Barchart3[columnname.length]; - - Map pointMap = new HashMap(); - - Map innerptMap = new HashMap(); - innerptMap.put("type", "max"); - innerptMap.put("name", "最大值"); - - Map innerptMap1 = new HashMap(); - innerptMap1.put("type", "min"); - innerptMap1.put("name", "最小值"); - List datamapList = new ArrayList(); - datamapList.add(innerptMap); - datamapList.add(innerptMap1); - pointMap.put("data", datamapList); - - - Map lineMap = new HashMap(); - - Map innerliMap = new HashMap(); - innerliMap.put("type", "average"); - innerliMap.put("name", "平均值"); - List datamapList1 = new ArrayList(); - datamapList1.add(innerliMap); - lineMap.put("data", datamapList1); - //获取数据 - for(int i=0;i pv = projectsversionservice.list(projectid,startdate,enddate); - - String[] columnname = {"代码规范DI评分","开发平均生产率(千行/天)","测试平均生产率(执行 个/天)","项目工期偏移率(百分比)","缺陷DI值(千行)","需求达成率(百分比)"}; - - Barchart3[] data = new Barchart3[columnname.length]; - - Map pointMap = new HashMap(); - - Map innerptMap = new HashMap(); - innerptMap.put("type", "max"); - innerptMap.put("name", "最大值"); - - Map innerptMap1 = new HashMap(); - innerptMap1.put("type", "min"); - innerptMap1.put("name", "最小值"); - List datamapList = new ArrayList(); - datamapList.add(innerptMap); - datamapList.add(innerptMap1); - pointMap.put("data", datamapList); - - - Map lineMap = new HashMap(); - - Map innerliMap = new HashMap(); - innerliMap.put("type", "average"); - innerliMap.put("name", "平均值"); - List datamapList1 = new ArrayList(); - datamapList1.add(innerliMap); - lineMap.put("data", datamapList1); - //获取数据 - for(int i=0;ienddate){ - return false; - }else{ - return true; - } - - } - - public static String[] member(String str){ - String splitFlag = ";"; - String temp[] = new String[0]; - if(str.equals("")){ - return temp; - } - if(str.substring(str.length()-1,str.length()).indexOf(";")>-1){ - str = str.substring(0,str.length()-1); - } - temp=str.split(splitFlag,-1); - return temp; - } - - public static int interval(String str1,String str2,int type){ - try - { - if(str1.equals("")||str2.equals("")){ - return 0; - } - SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); - Date date1 = sdf.parse(str1); - Date date2 = sdf.parse(str2); - long sl=date1.getTime(); - long el=date2.getTime(); - long ei=el-sl; - int interval = (int)(ei/(1000*60*60*24)); - if(type==1){ - if(interval>=0){ - interval = interval+1; - }else{ - interval = interval-1; - } - } - - return interval; - } - catch (ParseException e) - { - System.out.println(e.getMessage()); - return 0; - } - } - - - - - public static void main(String[] args) throws Exception { - // TODO Auto-generated method stub - System.out.println(Double.valueOf(100.00-(3*5)-(12*2) - -(24*0.3))); - - } - -} +package luckyweb.seagull.spring.mvc; + +import java.io.IOException; +import java.io.PrintWriter; +import java.text.DecimalFormat; +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Date; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import javax.validation.Valid; + +import org.springframework.stereotype.Controller; +import org.springframework.ui.Model; +import org.springframework.validation.BindingResult; +import org.springframework.validation.FieldError; +import org.springframework.web.bind.annotation.ModelAttribute; +import org.springframework.web.bind.annotation.RequestMapping; + +import luckyweb.seagull.comm.QueueListener; +import luckyweb.seagull.spring.entity.Barchart3; +import luckyweb.seagull.spring.entity.ProjectVersion; +import luckyweb.seagull.spring.entity.SectorProjects; +import luckyweb.seagull.spring.entity.TestCasedetail; +import luckyweb.seagull.spring.service.OperationLogService; +import luckyweb.seagull.spring.service.ProjectsVersionService; +import luckyweb.seagull.spring.service.SectorProjectsService; +import luckyweb.seagull.util.StrLib; +import net.sf.json.JSONArray; +import net.sf.json.JSONObject; + +@Controller +@RequestMapping("/projectVersion") +public class ProjectVersionController { + + private int allPage; + private int pageSize = 20; + private int allRows; + private int page = 1; + private int offset; + + private final String zentaoWeb_ipport="10.211.19.75"; + + @Resource(name = "projectversionService") + private ProjectsVersionService projectsversionservice; + + @Resource(name = "sectorprojectsService") + private SectorProjectsService sectorprojectsService; + + public ProjectsVersionService getprojectsversionService() { + return projectsversionservice; + } + + @Resource(name = "operationlogService") + private OperationLogService operationlogservice; + + public OperationLogService getOperationlogService() { + return operationlogservice; + } + + @RequestMapping(value = "/projectversion.do") + public String qualityshow(TestCasedetail caseDetail, HttpServletRequest req,HttpServletResponse rsp, + Model model) throws Exception { + return "/jsp/projectversion/projectversion"; + } + + /** + * + * + * @param tj + * @param model + * @return + * @throws Exception + */ + @RequestMapping(value = "/load.do") + public String load(HttpServletRequest req, Model model) throws Exception { + + try { + int projectid = 99; + + List prolist = QueueListener.qa_projlist; + model.addAttribute("projects", prolist); + model.addAttribute("projectid", projectid); + model.addAttribute("zentaoip", zentaoWeb_ipport); + } catch (Exception e) { + e.printStackTrace(); + model.addAttribute("message", e.getMessage()); + model.addAttribute("url", "/projectVersion/load.do"); + return "error"; + } + return "/jsp/projectversion/projectversion"; + } + + @SuppressWarnings("unchecked") + @RequestMapping(value = "/list.do") + private void ajaxGetSellRecord(Integer limit, Integer offset, HttpServletRequest request, + HttpServletResponse response) throws IOException { + response.setCharacterEncoding("utf-8"); + PrintWriter pw = response.getWriter(); + String search = request.getParameter("search"); + String projectid = request.getParameter("projectid"); + String startDate = request.getParameter("startDate"); + String endDate = request.getParameter("endDate"); + ProjectVersion projectversion = new ProjectVersion(); + if (null == offset && null == limit) { + offset = 0; + } + if (null == limit || limit == 0) { + limit = 10; + } + // 得到客户端传递的查询参数 + if (!StrLib.isEmpty(search)) { + projectversion.setVersionnumber(search); + projectversion.setImprint(search); + } + // 得到客户端传递的查询参数 + if (!StrLib.isEmpty(projectid)) { + projectversion.setProjectid(Integer.valueOf(projectid)); + } + + if (!StrLib.isEmpty(startDate)) { + projectversion.setStartactually_launchdate(startDate); + } + + if (!StrLib.isEmpty(endDate)) { + projectversion.setEndactually_launchdate(endDate); + } + + List projectversions = projectsversionservice.findByPage(projectversion, offset, limit); + + // 转换成json字符串 + String RecordJson = StrLib.listToJson(projectversions); + // 得到总记录数 + int total = projectsversionservice.findRows(projectversion); + // 需要返回的数据有总记录数和行数据 + JSONObject json = new JSONObject(); + json.put("total", total); + json.put("rows", RecordJson); + pw.print(json.toString()); + } + + /** + * 版本添加 + * @param tj + * @param br + * @param model + * @param req + * @param rsp + * @return + * @throws Exception + * @Description: + */ + @RequestMapping(value = "/add.do") + public String add(@Valid @ModelAttribute("projectversion") ProjectVersion projectversion, BindingResult br, Model model, + HttpServletRequest req, HttpServletResponse rsp) throws Exception + { + try + { + rsp.setContentType("text/html;charset=utf-8"); + req.setCharacterEncoding("utf-8"); + + if(!UserLoginController.permissionboolean(req, "pv_1")){ + model.addAttribute("projectversion", new ProjectVersion()); + model.addAttribute("url", "/projectVersion/load.do"); + model.addAttribute("message", "当前用户无权限添加版本信息,请联系管理员!"); + return "success"; + } + + String retVal = "/jsp/projectversion/projectversion_add"; + if (req.getMethod().equals("POST")) + { + if (br.hasErrors()) + { + return retVal; + } + String message = ""; + + if(projectversion.getProjectid()==0){ + message = "请选择项目!"; + model.addAttribute("message", message); + return retVal; + }else{ + if(!UserLoginController.oppidboolean(req, projectversion.getProjectid())){ + SectorProjects sp=sectorprojectsService.loadob(projectversion.getProjectid()); + model.addAttribute("message", "当前用户无权限添加项目【"+sp.getProjectname()+"】版本信息,请联系管理员!"); + return retVal; + } + } + + if(projectversion.getActually_testend().equals("")||projectversion.getPlan_testend().equals("")){ + message = "版本已完成,请选择测试计划结束日期以及测试实际结束日期!"; + model.addAttribute("message", message); + return retVal; + } + + if(projectversion.getPlan_demand()==0){ + message = "请填写计划上线需求数!"; + model.addAttribute("message", message); + return retVal; + } + if(projectversion.getActually_demand()==0){ + message = "请填写实际上线需求数!"; + model.addAttribute("message", message); + return retVal; + } + if(!checkdate(projectversion.getPlan_devstart(),projectversion.getPlan_devend())){ + message = "计划开发开始日期大于计划开发结束日期!"; + model.addAttribute("message", message); + return retVal; + } + if(!checkdate(projectversion.getActually_devstart(),projectversion.getActually_devend())){ + message = "实际开发开始日期大于实际开发结束日期!"; + model.addAttribute("message", message); + return retVal; + } + if(!checkdate(projectversion.getPlan_teststart(),projectversion.getPlan_testend())){ + message = "计划测试开始日期大于计划测试结束日期!"; + model.addAttribute("message", message); + return retVal; + } + if(!checkdate(projectversion.getActually_teststart(),projectversion.getActually_testend())){ + message = "实际测试开始日期大于实际测试结束日期!"; + model.addAttribute("message", message); + return retVal; + } + + int actuallydevinterval = interval(projectversion.getActually_devstart(),projectversion.getActually_devend(),1); + int actuallytestinterval = interval(projectversion.getActually_teststart(),projectversion.getActually_testend(),1); + int plandevinterval = interval(projectversion.getPlan_devstart(),projectversion.getPlan_devend(),1); + int plantestinterval = interval(projectversion.getPlan_teststart(),projectversion.getPlan_testend(),1); + //版本达成日期偏差,结实结束日期直接使用测试的实际完成日期 + //int launchinterval = interval(projectversion.getPlan_launchdate(),projectversion.getActually_launchdate(),0); + int launchinterval = interval(projectversion.getPlan_testend(),projectversion.getActually_testend(),0); + + int membernum = member(projectversion.getDev_member()).length+member(projectversion.getTest_member()).length; + int devhuman = member(projectversion.getDev_member()).length*actuallydevinterval; + int testhuman = member(projectversion.getTest_member()).length*actuallytestinterval; + projectversion.setHuman_costdev(String.valueOf(devhuman)); + projectversion.setHuman_costtest(String.valueOf(testhuman)); + if(membernum>0){ //耗费人力资源 + projectversion.setHuman_cost(String.valueOf(devhuman+testhuman)); + }else{ + projectversion.setHuman_cost(projectversion.getHuman_cost()); + } + + //开发效率 + if(member(projectversion.getDev_member()).length>0&&actuallydevinterval!=0){ + double per_dev = Double.valueOf(new DecimalFormat("#.00").format((double)(projectversion.getCodeline())/devhuman)); + projectversion.setPer_dev(String.valueOf(per_dev)); + }else{ + projectversion.setPer_dev(projectversion.getPer_dev()); + } + + //测试效率 + if(member(projectversion.getTest_member()).length>0&&actuallytestinterval!=0){ + double per_test = Double.valueOf(new DecimalFormat("#.00").format((double)projectversion.getTestcasenum()/testhuman)); + projectversion.setPer_test(String.valueOf(per_test)); + }else{ + projectversion.setPer_test(projectversion.getPer_test()); + } + + //开发工期偏差+延期 + if(actuallydevinterval!=0&&plandevinterval!=0){ + double devtime_deviation = Double.valueOf(new DecimalFormat("#.00").format(((double)(actuallydevinterval-plandevinterval)/plandevinterval)*100)); + projectversion.setDevtime_deviation(String.valueOf(devtime_deviation)); + projectversion.setDevdelay_days(String.valueOf(interval(projectversion.getPlan_devend(),projectversion.getActually_devend(),0))); + + }else{ + projectversion.setDevtime_deviation(projectversion.getDevtime_deviation()); + projectversion.setDevdelay_days(projectversion.getDevdelay_days()); + } + + //测试工期偏差+延期 + if(actuallydevinterval!=0&&plandevinterval!=0){ + double testtime_deviation = Double.valueOf(new DecimalFormat("#.00").format(((double)(actuallytestinterval-plantestinterval)/plantestinterval)*100)); + projectversion.setTesttime_deviation(String.valueOf(testtime_deviation)); + projectversion.setTestdelay_days(String.valueOf(interval(projectversion.getPlan_testend(),projectversion.getActually_testend(),0))); + + }else{ + projectversion.setTesttime_deviation(projectversion.getTesttime_deviation()); + projectversion.setTestdelay_days(projectversion.getTestdelay_days()); + } + + //版本达成进度偏差+延期 + if(actuallydevinterval!=0&&plandevinterval!=0){ + double launchdeviation = Double.valueOf(new DecimalFormat("#.00").format(((double)launchinterval/(actuallydevinterval+actuallytestinterval))*100)); + projectversion.setProtime_deviation(String.valueOf(launchdeviation)); + projectversion.setProdelay_days(String.valueOf(launchinterval)); + + }else{ + projectversion.setProtime_deviation(projectversion.getProtime_deviation()); + projectversion.setProdelay_days(projectversion.getProdelay_days()); + } + + + projectversion.setVersionnumber(projectversion.getVersionnumber()); + + //直接取测试完成日期 + projectversion.setPlan_launchdate(projectversion.getPlan_testend()); + projectversion.setActually_launchdate(projectversion.getActually_testend()); + + projectversion.setImprint(projectversion.getImprint()); + projectversion.setRemark(projectversion.getRemark()); + projectversion.setPlan_demand(projectversion.getPlan_demand()); + projectversion.setActually_demand(projectversion.getActually_demand()); + projectversion.setCodestandard_yz(projectversion.getCodestandard_yz()); + projectversion.setCodestandard_zd(projectversion.getCodestandard_zd()); + projectversion.setCodestandard_zy(projectversion.getCodestandard_zy()); + projectversion.setTestcasenum(projectversion.getTestcasenum()); + projectversion.setCodeline(projectversion.getCodeline()); + projectversion.setChangetestingreturn(projectversion.getChangetestingreturn()); + projectversion.setDev_member(projectversion.getDev_member()); + projectversion.setTest_member(projectversion.getTest_member()); + projectversion.setZt_versionlink(projectversion.getZt_versionlink()); + projectversion.setVersiontype(1); + + double divalue = projectversion.getBug_zm()*10+projectversion.getBug_yz()*3+projectversion.getBug_yb()+projectversion.getBug_ts()*0.1; + + if(projectversion.getCodeline()!=0){ + projectversion.setCode_DI(Double.valueOf(new DecimalFormat("#.00").format(divalue/projectversion.getCodeline())).toString()); + }else{ + projectversion.setCode_DI("0"); + } + + if(projectversion.getActually_demand()!=0&&projectversion.getPlan_demand()!=0){ + projectversion.setPerdemand(Double.valueOf(new DecimalFormat("#.00").format(((double)projectversion.getActually_demand()/projectversion.getPlan_demand())*100))); + }else{ + projectversion.setPerdemand(0.00); + } + + projectversion.setPlan_devstart(projectversion.getPlan_devstart()); + projectversion.setPlan_devend(projectversion.getPlan_devend()); + projectversion.setActually_devstart(projectversion.getActually_devstart()); + projectversion.setActually_devend(projectversion.getActually_devend()); + projectversion.setPlan_teststart(projectversion.getPlan_teststart()); + projectversion.setPlan_testend(projectversion.getPlan_testend()); + projectversion.setActually_teststart(projectversion.getActually_teststart()); + projectversion.setActually_testend(projectversion.getActually_testend()); + projectversion.setQualityreview(projectversion.getQualityreview()); + projectversion.setBug_zm(projectversion.getBug_zm()); + projectversion.setBug_yz(projectversion.getBug_yz()); + projectversion.setBug_yb(projectversion.getBug_yb()); + projectversion.setBug_ts(projectversion.getBug_ts()); + + + SectorProjects p = new SectorProjects(); + p.setProjectid(projectversion.getProjectid()); + projectversion.setSectorProjects(p); + + int versionid = projectsversionservice.add(projectversion); + + operationlogservice.add(req, "QA_PROJECTVERSION", versionid, + projectversion.getProjectid(),"版本信息添加成功!版本号:"+projectversion.getVersionnumber()); + + model.addAttribute("message", "添加成功"); + model.addAttribute("url", "/projectVersion/load.do"); + return retVal; + + } + model.addAttribute("projectversion", projectversion); + model.addAttribute("projects", QueueListener.qa_projlist); + return retVal; + + } + catch (Exception e) + { + model.addAttribute("message", e.getMessage()); + model.addAttribute("url", "/projectVersion/load.do"); + return "error"; + } + + } + + /** + * + * 根据versionid更新版本信息 + * @param id + * @param model + * @return + * @throws Exception + */ + @RequestMapping(value = "/update.do") + public String update(@Valid @ModelAttribute("projectversion") ProjectVersion projectversion, BindingResult br, + Model model, HttpServletRequest req) throws Exception + { + req.setCharacterEncoding("utf-8"); + int versionid = Integer.valueOf(req.getParameter("versionid")); + String retVal = "/jsp/projectversion/projectversion_add"; + + if(!UserLoginController.permissionboolean(req, "pv_3")){ + model.addAttribute("projectversion", new ProjectVersion()); + model.addAttribute("url", "/projectVersion/load.do"); + model.addAttribute("message", "当前用户无权限操作修改版本信息,请联系管理员!"); + return "success"; + } + + model.addAttribute("projects", QueueListener.qa_projlist); + if (req.getMethod().equals("POST")) + { + if (br.hasErrors()) + { + return retVal; + } + String message = ""; + + if(projectversion.getProjectid()==0){ + message = "请选择项目!"; + model.addAttribute("message", message); + return retVal; + }else{ + if(!UserLoginController.oppidboolean(req, projectversion.getProjectid())){ + SectorProjects sp=sectorprojectsService.loadob(projectversion.getProjectid()); + model.addAttribute("message", "当前用户无权限操作修改项目【"+sp.getProjectname()+"】版本信息,请联系管理员!"); + return retVal; + } + } + + if(projectversion.getPlan_testend().equals("")){ + message = "请选择测试计划结束日期!"; + model.addAttribute("message", message); + return retVal; + } + + if(projectversion.getActually_testend().equals("")&&projectversion.getVersiontype()==1){ + message = "版本已完成,请选择测试实际结束日期!"; + model.addAttribute("message", message); + return retVal; + } + + if(projectversion.getPlan_demand()==0){ + message = "请填写计划上线需求数!"; + model.addAttribute("message", message); + return retVal; + } + if(projectversion.getActually_demand()==0&&projectversion.getVersiontype()==1){ + message = "请填写实际上线需求数!"; + model.addAttribute("message", message); + return retVal; + } + if(projectversion.getTestcasenum()==0&&projectversion.getVersiontype()==1){ + message = "请填写测试用例数!"; + model.addAttribute("message", message); + return retVal; + } + if(!checkdate(projectversion.getPlan_devstart(),projectversion.getPlan_devend())){ + message = "计划开发开始日期大于计划开发结束日期!"; + model.addAttribute("message", message); + return retVal; + } + if(!checkdate(projectversion.getActually_devstart(),projectversion.getActually_devend())&&projectversion.getVersiontype()==1){ + message = "实际开发开始日期大于实际开发结束日期!"; + model.addAttribute("message", message); + return retVal; + } + if(!checkdate(projectversion.getPlan_teststart(),projectversion.getPlan_testend())){ + message = "计划测试开始日期大于计划测试结束日期!"; + model.addAttribute("message", message); + return retVal; + } + if(!checkdate(projectversion.getActually_teststart(),projectversion.getActually_testend())&&projectversion.getVersiontype()==1){ + message = "实际测试开始日期大于实际测试结束日期!"; + model.addAttribute("message", message); + return retVal; + } + + int actuallydevinterval = interval(projectversion.getActually_devstart(),projectversion.getActually_devend(),1); + int actuallytestinterval = interval(projectversion.getActually_teststart(),projectversion.getActually_testend(),1); + int plandevinterval = interval(projectversion.getPlan_devstart(),projectversion.getPlan_devend(),1); + int plantestinterval = interval(projectversion.getPlan_teststart(),projectversion.getPlan_testend(),1); + //其际版本偏差的计算方式,实际结束日期直接使用测试的实际结束日期 + int launchinterval = interval(projectversion.getPlan_testend(),projectversion.getActually_testend(),0); + + int membernum = member(projectversion.getDev_member()).length+member(projectversion.getTest_member()).length; + int devhuman = member(projectversion.getDev_member()).length*actuallydevinterval; + int testhuman = member(projectversion.getTest_member()).length*actuallytestinterval; + projectversion.setHuman_costdev(String.valueOf(devhuman)); + projectversion.setHuman_costtest(String.valueOf(testhuman)); + if(membernum>0){ //耗费人力资源 + projectversion.setHuman_cost(String.valueOf(devhuman+testhuman)); + }else{ + projectversion.setHuman_cost(projectversion.getHuman_cost()); + } + + //开发效率 + if(member(projectversion.getDev_member()).length>0&&actuallydevinterval!=0){ + double per_dev = Double.valueOf(new DecimalFormat("#.00").format((double)(projectversion.getCodeline())/devhuman)); + projectversion.setPer_dev(String.valueOf(per_dev)); + }else{ + projectversion.setPer_dev(projectversion.getPer_dev()); + } + + //测试效率 + if(member(projectversion.getTest_member()).length>0&&actuallytestinterval!=0){ + double per_test = Double.valueOf(new DecimalFormat("#.00").format((double)projectversion.getTestcasenum()/testhuman)); + projectversion.setPer_test(String.valueOf(per_test)); + }else{ + projectversion.setPer_test(projectversion.getPer_test()); + } + + //开发工期偏差+延期 + if(actuallydevinterval!=0&&plandevinterval!=0){ + double devtime_deviation = Double.valueOf(new DecimalFormat("#.00").format(((double)(actuallydevinterval-plandevinterval)/plandevinterval)*100)); + projectversion.setDevtime_deviation(String.valueOf(devtime_deviation)); + projectversion.setDevdelay_days(String.valueOf(interval(projectversion.getPlan_devend(),projectversion.getActually_devend(),0))); + + }else{ + projectversion.setDevtime_deviation(projectversion.getDevtime_deviation()); + projectversion.setDevdelay_days(projectversion.getDevdelay_days()); + } + + //测试工期偏差+延期 + if(actuallydevinterval!=0&&plandevinterval!=0){ + double testtime_deviation = Double.valueOf(new DecimalFormat("#.00").format(((double)(actuallytestinterval-plantestinterval)/plantestinterval)*100)); + projectversion.setTesttime_deviation(String.valueOf(testtime_deviation)); + projectversion.setTestdelay_days(String.valueOf(interval(projectversion.getPlan_testend(),projectversion.getActually_testend(),0))); + + }else{ + projectversion.setTesttime_deviation(projectversion.getTesttime_deviation()); + projectversion.setTestdelay_days(projectversion.getTestdelay_days()); + } + + //版本达成进度偏差+延期 + if(actuallydevinterval!=0&&plandevinterval!=0){ + double launchdeviation = Double.valueOf(new DecimalFormat("#.00").format(((double)launchinterval/(actuallydevinterval+actuallytestinterval))*100)); + projectversion.setProtime_deviation(String.valueOf(launchdeviation)); + projectversion.setProdelay_days(String.valueOf(launchinterval)); + + }else{ + projectversion.setProtime_deviation(projectversion.getProtime_deviation()); + projectversion.setProdelay_days(projectversion.getProdelay_days()); + } + + projectversion.setVersionnumber(projectversion.getVersionnumber()); + + //直接取测试完成日期 + projectversion.setPlan_launchdate(projectversion.getPlan_testend()); + projectversion.setActually_launchdate(projectversion.getActually_testend()); + + projectversion.setImprint(projectversion.getImprint()); + projectversion.setRemark(projectversion.getRemark()); + projectversion.setPlan_demand(projectversion.getPlan_demand()); + projectversion.setActually_demand(projectversion.getActually_demand()); + projectversion.setCodestandard_yz(projectversion.getCodestandard_yz()); + projectversion.setCodestandard_zd(projectversion.getCodestandard_zd()); + projectversion.setCodestandard_zy(projectversion.getCodestandard_zy()); + projectversion.setTestcasenum(projectversion.getTestcasenum()); + projectversion.setCodeline(projectversion.getCodeline()); + projectversion.setChangetestingreturn(projectversion.getChangetestingreturn()); + projectversion.setDev_member(projectversion.getDev_member()); + projectversion.setTest_member(projectversion.getTest_member()); + projectversion.setZt_versionlink(projectversion.getZt_versionlink()); + projectversion.setVersiontype(projectversion.getVersiontype()); + + double divalue = projectversion.getBug_zm()*10+projectversion.getBug_yz()*3+projectversion.getBug_yb()+projectversion.getBug_ts()*0.1; + + if(projectversion.getCodeline()!=0){ + projectversion.setCode_DI(Double.valueOf(new DecimalFormat("#.00").format(divalue/projectversion.getCodeline())).toString()); + }else{ + projectversion.setCode_DI("0"); + } + + if(projectversion.getActually_demand()!=0&&projectversion.getPlan_demand()!=0){ + projectversion.setPerdemand(Double.valueOf(new DecimalFormat("#.00").format(((double)projectversion.getActually_demand()/projectversion.getPlan_demand())*100))); + }else{ + projectversion.setPerdemand(0.00); + } + + projectversion.setPlan_devstart(projectversion.getPlan_devstart()); + projectversion.setPlan_devend(projectversion.getPlan_devend()); + projectversion.setActually_devstart(projectversion.getActually_devstart()); + projectversion.setActually_devend(projectversion.getActually_devend()); + projectversion.setPlan_teststart(projectversion.getPlan_teststart()); + projectversion.setPlan_testend(projectversion.getPlan_testend()); + projectversion.setActually_teststart(projectversion.getActually_teststart()); + projectversion.setActually_testend(projectversion.getActually_testend()); + projectversion.setQualityreview(projectversion.getQualityreview()); + projectversion.setBug_zm(projectversion.getBug_zm()); + projectversion.setBug_yz(projectversion.getBug_yz()); + projectversion.setBug_yb(projectversion.getBug_yb()); + projectversion.setBug_ts(projectversion.getBug_ts()); + + SectorProjects p = new SectorProjects(); + p.setProjectid(projectversion.getProjectid()); + projectversion.setSectorProjects(p); + + projectsversionservice.modify(projectversion); + + operationlogservice.add(req, "QA_PROJECTVERSION", versionid, + projectversion.getProjectid(),"版本信息修改成功!版本号:"+projectversion.getVersionnumber()); + + model.addAttribute("message", "修改成功"); + model.addAttribute("url", "/projectVersion/load.do"); + return retVal; + } + + //projectversion.setVersionid(versionid); + projectversion = projectsversionservice.load(versionid); + projectversion.setProjectid(projectversion.getSectorProjects().getProjectid()); + + model.addAttribute("projectversion", projectversion); + return "/jsp/projectversion/projectversion_update"; + } + + /** + * 计划添加 + * @param tj + * @param br + * @param model + * @param req + * @param rsp + * @return + * @throws Exception + * @Description: + */ + @RequestMapping(value = "/addplan.do") + public String addplan(@Valid @ModelAttribute("projectversion") ProjectVersion projectversion, BindingResult br, Model model, + HttpServletRequest req, HttpServletResponse rsp) throws Exception + { + try + { + rsp.setContentType("text/html;charset=utf-8"); + req.setCharacterEncoding("utf-8"); + + if(!UserLoginController.permissionboolean(req, "pvp_1")){ + model.addAttribute("projectversion", new ProjectVersion()); + model.addAttribute("url", "/projectVersion/load.do"); + model.addAttribute("message", "当前用户无权限添加版本计划信息,请联系管理员!"); + return "success"; + } + + String retVal = "/jsp/projectversion/projectversion_addplan"; + if (req.getMethod().equals("POST")) + { + if (br.hasErrors()) + { + List err=br.getFieldErrors(); + FieldError fe; + String field; + String errorMessage; + for (int i = 0; i < err.size(); i++) { + fe=err.get(i); + field=fe.getField();//得到那个字段验证出错 + errorMessage=fe.getDefaultMessage();//得到错误消息 + System.out.println("错误字段消息:"+field +" : "+errorMessage); + } + return retVal; + } + String message = ""; + + if(projectversion.getProjectid()==0){ + message = "请选择项目!"; + model.addAttribute("message", message); + return retVal; + }else{ + if(!UserLoginController.oppidboolean(req, projectversion.getProjectid())){ + SectorProjects sp=sectorprojectsService.loadob(projectversion.getProjectid()); + model.addAttribute("message", "当前用户无权限添加项目【"+sp.getProjectname()+"】版本计划信息,请联系管理员!"); + return retVal; + } + } + + if(projectversion.getPlan_demand()==0){ + message = "请填写计划上线需求数!"; + model.addAttribute("message", message); + return retVal; + } + + if(projectversion.getPlan_testend().equals("")){ + message = "请选择测试计划结束日期!"; + model.addAttribute("message", message); + return retVal; + } + + int actuallydevinterval = interval(projectversion.getActually_devstart(),projectversion.getActually_devend(),1); + int actuallytestinterval = interval(projectversion.getActually_teststart(),projectversion.getActually_testend(),1); + int plandevinterval = interval(projectversion.getPlan_devstart(),projectversion.getPlan_devend(),1); + int plantestinterval = interval(projectversion.getPlan_teststart(),projectversion.getPlan_testend(),1); + //版本达成日期偏差,结实结束日期直接使用测试的实际完成日期 + //int launchinterval = interval(projectversion.getPlan_launchdate(),projectversion.getActually_launchdate(),0); + int launchinterval = interval(projectversion.getPlan_launchdate(),projectversion.getActually_testend(),0); + + int membernum = member(projectversion.getDev_member()).length+member(projectversion.getTest_member()).length; + int devhuman = member(projectversion.getDev_member()).length*actuallydevinterval; + int testhuman = member(projectversion.getTest_member()).length*actuallytestinterval; + projectversion.setHuman_costdev(String.valueOf(devhuman)); + projectversion.setHuman_costtest(String.valueOf(testhuman)); + if(membernum>0){ //耗费人力资源 + projectversion.setHuman_cost(String.valueOf(devhuman+testhuman)); + }else{ + projectversion.setHuman_cost(projectversion.getHuman_cost()); + } + + //开发效率 + if(member(projectversion.getDev_member()).length>0&&actuallydevinterval!=0){ + double per_dev = Double.valueOf(new DecimalFormat("#.00").format((double)(projectversion.getCodeline())/devhuman)); + projectversion.setPer_dev(String.valueOf(per_dev)); + }else{ + projectversion.setPer_dev(projectversion.getPer_dev()); + } + + //测试效率 + if(member(projectversion.getTest_member()).length>0&&actuallytestinterval!=0){ + double per_test = Double.valueOf(new DecimalFormat("#.00").format((double)projectversion.getTestcasenum()/testhuman)); + projectversion.setPer_test(String.valueOf(per_test)); + }else{ + projectversion.setPer_test(projectversion.getPer_test()); + } + + //开发工期偏差+延期 + if(actuallydevinterval!=0&&plandevinterval!=0){ + double devtime_deviation = Double.valueOf(new DecimalFormat("#.00").format(((double)(actuallydevinterval-plandevinterval)/plandevinterval)*100)); + projectversion.setDevtime_deviation(String.valueOf(devtime_deviation)); + projectversion.setDevdelay_days(String.valueOf(interval(projectversion.getPlan_devend(),projectversion.getActually_devend(),0))); + + }else{ + projectversion.setDevtime_deviation(projectversion.getDevtime_deviation()); + projectversion.setDevdelay_days(projectversion.getDevdelay_days()); + } + + //测试工期偏差+延期 + if(actuallydevinterval!=0&&plandevinterval!=0){ + double testtime_deviation = Double.valueOf(new DecimalFormat("#.00").format(((double)(actuallytestinterval-plantestinterval)/plantestinterval)*100)); + projectversion.setTesttime_deviation(String.valueOf(testtime_deviation)); + projectversion.setTestdelay_days(String.valueOf(interval(projectversion.getPlan_testend(),projectversion.getActually_testend(),0))); + + }else{ + projectversion.setTesttime_deviation(projectversion.getTesttime_deviation()); + projectversion.setTestdelay_days(projectversion.getTestdelay_days()); + } + + //版本达成进度偏差+延期 + if(actuallydevinterval!=0&&plandevinterval!=0){ + double launchdeviation = Double.valueOf(new DecimalFormat("#.00").format(((double)launchinterval/(actuallydevinterval+actuallytestinterval))*100)); + projectversion.setProtime_deviation(String.valueOf(launchdeviation)); + projectversion.setProdelay_days(String.valueOf(launchinterval)); + + }else{ + projectversion.setProtime_deviation(projectversion.getProtime_deviation()); + projectversion.setProdelay_days(projectversion.getProdelay_days()); + } + + + projectversion.setVersionnumber(projectversion.getVersionnumber()); + projectversion.setPlan_launchdate(projectversion.getPlan_launchdate()); + //直接取测试完成日期 + projectversion.setActually_launchdate(projectversion.getActually_testend()); + + projectversion.setImprint(projectversion.getImprint()); + projectversion.setRemark(projectversion.getRemark()); + projectversion.setPlan_demand(projectversion.getPlan_demand()); + projectversion.setActually_demand(projectversion.getActually_demand()); + projectversion.setCodestandard_yz(0); + projectversion.setCodestandard_zd(0); + projectversion.setCodestandard_zy(0); + projectversion.setTestcasenum(projectversion.getTestcasenum()); + projectversion.setCodeline(projectversion.getCodeline()); + projectversion.setChangetestingreturn(projectversion.getChangetestingreturn()); + projectversion.setDev_member(projectversion.getDev_member()); + projectversion.setTest_member(projectversion.getTest_member()); + projectversion.setZt_versionlink(projectversion.getZt_versionlink()); + + double divalue = projectversion.getBug_zm()*10+projectversion.getBug_yz()*3+projectversion.getBug_yb()+projectversion.getBug_ts()*0.1; + + if(projectversion.getCodeline()!=0){ + projectversion.setCode_DI(Double.valueOf(new DecimalFormat("#.00").format(divalue/projectversion.getCodeline())).toString()); + }else{ + projectversion.setCode_DI("0"); + } + + if(projectversion.getActually_demand()!=0&&projectversion.getPlan_demand()!=0){ + projectversion.setPerdemand(Double.valueOf(new DecimalFormat("#.00").format(((double)projectversion.getActually_demand()/projectversion.getPlan_demand())*100))); + }else{ + projectversion.setPerdemand(0.00); + } + + projectversion.setPlan_devstart(projectversion.getPlan_devstart()); + projectversion.setPlan_devend(projectversion.getPlan_devend()); + projectversion.setActually_devstart(projectversion.getActually_devstart()); + projectversion.setActually_devend(projectversion.getActually_devend()); + projectversion.setPlan_teststart(projectversion.getPlan_teststart()); + projectversion.setPlan_testend(projectversion.getPlan_testend()); + projectversion.setActually_teststart(projectversion.getActually_teststart()); + projectversion.setActually_testend(projectversion.getActually_testend()); + projectversion.setQualityreview(projectversion.getQualityreview()); + projectversion.setBug_zm(projectversion.getBug_zm()); + projectversion.setBug_yz(projectversion.getBug_yz()); + projectversion.setBug_yb(projectversion.getBug_yb()); + projectversion.setBug_ts(projectversion.getBug_ts()); + projectversion.setVersiontype(0); + + + SectorProjects p = new SectorProjects(); + p.setProjectid(projectversion.getProjectid()); + projectversion.setSectorProjects(p); + + int versionid = projectsversionservice.add(projectversion); + + operationlogservice.add(req, "QA_PROJECTVERSION", versionid, + projectversion.getProjectid(),"版本计划添加成功!版本号:"+projectversion.getVersionnumber()); + + model.addAttribute("message", "添加成功"); + model.addAttribute("url", "/projectVersion/load.do"); + return retVal; + + } + model.addAttribute("projectversion", projectversion); + model.addAttribute("projects", QueueListener.qa_projlist); + return retVal; + + } + catch (Exception e) + { + model.addAttribute("message", e.getMessage()); + model.addAttribute("url", "/projectVersion/load.do"); + return "error"; + } + + } + + /** + * 删除版本记录 + * + * @param tj + * @param br + * @param model + * @param req + * @param rsp + * @return + * @throws Exception + * @Description: + */ + @RequestMapping(value = "/delete.do") + public void delete(HttpServletRequest req, HttpServletResponse rsp) throws Exception { + try { + rsp.setContentType("text/html;charset=utf-8"); + req.setCharacterEncoding("utf-8"); + PrintWriter pw = rsp.getWriter(); + JSONObject json = new JSONObject(); + if (!UserLoginController.permissionboolean(req, "pv_2")) { + json.put("status", "fail"); + json.put("ms", "删除项目版本信息失败,权限不足,请联系管理员!"); + } else { + int versionid = Integer.valueOf(req.getParameter("versionid")); + ProjectVersion projectversion = projectsversionservice.load(versionid); + try + { + if(!UserLoginController.oppidboolean(req, projectversion.getSectorProjects().getProjectid())){ + json.put("status", "fail"); + json.put("ms", "删除项目版本信息失败,项目权限不足,请联系管理员!"); + }else{ + projectsversionservice.delete(versionid); + + operationlogservice.add(req, "QA_PROJECTVERSION", versionid, + projectversion.getSectorProjects().getProjectid(),"版本信息删除成功!版本号:"+projectversion.getVersionnumber()); + + json.put("status", "success"); + json.put("ms", "删除项目版本信息成功!"); + } + + } + catch (Exception e) + { + json.put("status", "fail"); + json.put("ms", "删除项目版本信息失败!"); + } + } + pw.print(json.toString()); + + } catch (Exception e) { + e.printStackTrace(); + } + + } + + /** + * 版本详情 + * + * @param id + * @param model + * @return + * @throws Exception + */ + @RequestMapping(value = "/show.do") + public String show(HttpServletRequest req,Model model) throws Exception + { + String versionid = req.getParameter("versionid"); + ProjectVersion pv = new ProjectVersion(); + pv.setVersionid(Integer.valueOf(versionid)); + ProjectVersion projectversion = projectsversionservice.load(pv.getVersionid()); + model.addAttribute("projectversion", projectversion); + return "/jsp/projectversion/projectversion_show"; + } + + /** + * + * 质量报表 + * @param model + * @param req + * @return + * @throws Exception + * @Description: + */ + @RequestMapping(value = "/showreport.do") + public String showReport(HttpServletRequest req,Model model) throws Exception + { + try{ + String p = req.getParameter("page"); + String startdate = req.getParameter("startdate"); + String enddate = req.getParameter("enddate"); + String startdatestr = startdate+"至"; + String enddatestr = enddate; + + if(startdate==""||startdate==null){ + startdate = "0"; + startdatestr = "初始数据日期至"; + } + if(enddate==""||enddate==null){ + enddate = "9999-99-99"; + enddatestr = "今天"; + } + + if (StrLib.isEmpty(p) || Integer.valueOf(p) == 0) { + page = 1; + } + + String page2 = req.getParameter("page"); + if (StrLib.isEmpty(page2)) { + page = 1; + } else { + try { + page = Integer.parseInt(page2); + } catch (Exception e) { + page = 1; + } + } + allRows = projectsversionservice.findRowsreport(startdate, enddate); + offset = (page - 1) * pageSize; + if (allRows % pageSize == 0) { + allPage = allRows / pageSize; + } else { + allPage = allRows / pageSize + 1; + } + + model.addAttribute("allRows", allRows); + model.addAttribute("page", page); + model.addAttribute("offset", offset); + model.addAttribute("pageSize", pageSize); + model.addAttribute("allPage", allPage); + + + List reportlist = projectsversionservice.findByPagereport(offset, pageSize, startdate, enddate); + + for(int i=0;i(); + + Map innerptMap = new HashMap(); + innerptMap.put("type", "max"); + innerptMap.put("name", "最大值"); + + Map innerptMap1 = new HashMap(); + innerptMap1.put("type", "min"); + innerptMap1.put("name", "最小值"); + List datamapList = new ArrayList(); + datamapList.add(innerptMap); + datamapList.add(innerptMap1); + pointMap.put("data", datamapList); + + + Map lineMap = new HashMap(); + + Map innerliMap = new HashMap(); + innerliMap.put("type", "average"); + innerliMap.put("name", "平均值"); + List datamapList1 = new ArrayList(); + datamapList1.add(innerliMap); + lineMap.put("data", datamapList1); + //获取数据 + for(int i=0;i pv = projectsversionservice.list(projectid,startdate,enddate); + + String[] columnname = {"代码规范DI评分","开发平均生产率(千行/天)","测试平均生产率(执行 个/天)","项目工期偏移率(百分比)","缺陷DI值(千行)","需求达成率(百分比)"}; + + Barchart3[] data = new Barchart3[columnname.length]; + + Map pointMap = new HashMap(); + + Map innerptMap = new HashMap(); + innerptMap.put("type", "max"); + innerptMap.put("name", "最大值"); + + Map innerptMap1 = new HashMap(); + innerptMap1.put("type", "min"); + innerptMap1.put("name", "最小值"); + List datamapList = new ArrayList(); + datamapList.add(innerptMap); + datamapList.add(innerptMap1); + pointMap.put("data", datamapList); + + + Map lineMap = new HashMap(); + + Map innerliMap = new HashMap(); + innerliMap.put("type", "average"); + innerliMap.put("name", "平均值"); + List datamapList1 = new ArrayList(); + datamapList1.add(innerliMap); + lineMap.put("data", datamapList1); + //获取数据 + for(int i=0;i pv = projectsversionservice.list(projectid,startdate,enddate); + + String[] columnname = {"代码规范DI评分","开发平均生产率(千行/天)","测试平均生产率(执行 个/天)","项目工期偏移率(百分比)","缺陷DI值(千行)","需求达成率(百分比)"}; + + Barchart3[] data = new Barchart3[columnname.length]; + + Map pointMap = new HashMap(); + + Map innerptMap = new HashMap(); + innerptMap.put("type", "max"); + innerptMap.put("name", "最大值"); + + Map innerptMap1 = new HashMap(); + innerptMap1.put("type", "min"); + innerptMap1.put("name", "最小值"); + List datamapList = new ArrayList(); + datamapList.add(innerptMap); + datamapList.add(innerptMap1); + pointMap.put("data", datamapList); + + + Map lineMap = new HashMap(); + + Map innerliMap = new HashMap(); + innerliMap.put("type", "average"); + innerliMap.put("name", "平均值"); + List datamapList1 = new ArrayList(); + datamapList1.add(innerliMap); + lineMap.put("data", datamapList1); + //获取数据 + for(int i=0;ienddate){ + return false; + }else{ + return true; + } + + } + + public static String[] member(String str){ + String splitFlag = ";"; + String temp[] = new String[0]; + if(str.equals("")){ + return temp; + } + if(str.substring(str.length()-1,str.length()).indexOf(";")>-1){ + str = str.substring(0,str.length()-1); + } + temp=str.split(splitFlag,-1); + return temp; + } + + public static int interval(String str1,String str2,int type){ + try + { + if(str1.equals("")||str2.equals("")){ + return 0; + } + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); + Date date1 = sdf.parse(str1); + Date date2 = sdf.parse(str2); + long sl=date1.getTime(); + long el=date2.getTime(); + long ei=el-sl; + int interval = (int)(ei/(1000*60*60*24)); + if(type==1){ + if(interval>=0){ + interval = interval+1; + }else{ + interval = interval-1; + } + } + + return interval; + } + catch (ParseException e) + { + System.out.println(e.getMessage()); + return 0; + } + } + + + + + public static void main(String[] args) throws Exception { + // TODO Auto-generated method stub + System.out.println(Double.valueOf(100.00-(3*5)-(12*2) + -(24*0.3))); + + } + +} diff --git a/src/main/java/luckyweb/seagull/spring/mvc/ReviewController.java b/src/main/java/luckyweb/seagull/spring/mvc/ReviewController.java index f62a8a7..2d2f359 100644 --- a/src/main/java/luckyweb/seagull/spring/mvc/ReviewController.java +++ b/src/main/java/luckyweb/seagull/spring/mvc/ReviewController.java @@ -1,280 +1,280 @@ -package luckyweb.seagull.spring.mvc; - -import java.io.BufferedReader; -import java.io.IOException; -import java.io.PrintWriter; -import java.util.List; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import javax.validation.Valid; - -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.validation.BindingResult; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; - -import luckyweb.seagull.comm.QueueListener; -import luckyweb.seagull.spring.entity.Review; -import luckyweb.seagull.spring.entity.SectorProjects; -import luckyweb.seagull.spring.service.OperationLogService; -import luckyweb.seagull.spring.service.ReviewInfoService; -import luckyweb.seagull.spring.service.ReviewService; -import luckyweb.seagull.spring.service.SectorProjectsService; -import luckyweb.seagull.util.StrLib; -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; - -@Controller -@RequestMapping("/review") -public class ReviewController { - - @Resource(name = "reviewService") - private ReviewService reviewservice; - - @Resource(name = "reviewInfoService") - private ReviewInfoService reviewinfoservice; - - @Resource(name = "sectorprojectsService") - private SectorProjectsService sectorprojectsService; - - @Resource(name = "operationlogService") - private OperationLogService operationlogservice; - - /** - * - * - * @param tj - * @param model - * @return - * @throws Exception - */ - @RequestMapping(value = "/load.do") - public String load(HttpServletRequest req, Model model) throws Exception { - - try { - int projectid = 99; - - List prolist = QueueListener.qa_projlist; - model.addAttribute("projects", prolist); - model.addAttribute("projectid", projectid); - } catch (Exception e) { - e.printStackTrace(); - model.addAttribute("message", e.getMessage()); - model.addAttribute("url", "/review/load.do"); - return "error"; - } - return "/jsp/review/review"; - } - - @SuppressWarnings("unchecked") - @RequestMapping(value = "/list.do") - private void ajaxGetSellRecord(Integer limit, Integer offset, HttpServletRequest request, - HttpServletResponse response) throws NumberFormatException, Exception { - response.setCharacterEncoding("utf-8"); - PrintWriter pw = response.getWriter(); - String search = request.getParameter("search"); - String projectid = request.getParameter("projectid"); - String startDate = request.getParameter("startDate"); - String endDate = request.getParameter("endDate"); - Review review = new Review(); - if (null == offset && null == limit) { - offset = 0; - } - if (null == limit || limit == 0) { - limit = 10; - } - // 得到客户端传递的查询参数 - if (!StrLib.isEmpty(search)) { - review.setVersion(search); - review.setReview_type(search); - review.setReview_result(search); - } - // 得到客户端传递的查询参数 - if (!StrLib.isEmpty(projectid)&&!"99".equals(projectid)) { - review.setProjectid(Integer.valueOf(projectid)); - } - - if (!StrLib.isEmpty(startDate)) { - review.setReview_startdate(startDate); - } - - if (!StrLib.isEmpty(endDate)) { - review.setReview_enddate(endDate); - } - - List reviewlist = reviewservice.findByPage(review, offset, limit); - - // 转换成json字符串 - String RecordJson = StrLib.listToJson(reviewlist); - // 得到总记录数 - int total = reviewservice.findRows(review); - // 需要返回的数据有总记录数和行数据 - JSONObject json = new JSONObject(); - json.put("total", total); - json.put("rows", RecordJson); - pw.print(json.toString()); - } - - - /** - * 删除评审记录 - * - * @param id - * @param model - * @return - * @throws Exception - */ - @RequestMapping(value = "/delete.do") - public void delete(HttpServletRequest req, HttpServletResponse rsp) throws Exception { - try { - rsp.setContentType("text/html;charset=utf-8"); - req.setCharacterEncoding("utf-8"); - PrintWriter pw = rsp.getWriter(); - JSONObject json = new JSONObject(); - if (!UserLoginController.permissionboolean(req, "rev_2")) { - json.put("status", "fail"); - json.put("ms", "删除失败,权限不足,请联系管理员!"); - } else { - StringBuilder sb = new StringBuilder(); - try (BufferedReader reader = req.getReader();) { - char[] buff = new char[1024]; - int len; - while ((len = reader.read(buff)) != -1) { - sb.append(buff, 0, len); - } - } catch (IOException e) { - e.printStackTrace(); - } - JSONObject jsonObject = JSONObject.fromObject(sb.toString()); - JSONArray jsonarr = JSONArray.fromObject(jsonObject.getString("ids")); - - String status="fail"; - String ms="删除评审记录失败!"; - int suc=0; - int fail=0; - for (int i = 0; i < jsonarr.size(); i++) { - int id = Integer.valueOf(jsonarr.get(i).toString()); - Review review = reviewservice.load(id); - - if(!UserLoginController.oppidboolean(req, review.getSectorProjects().getProjectid())){ - fail++; - continue; - } - reviewinfoservice.delete_reviewid(id); - reviewservice.delete(id); - operationlogservice.add(req, "QA_REVIEW", id, - review.getSectorProjects().getProjectid(),"评审信息删除成功!"); - suc++; - } - - if(suc>0){ - status="success"; - ms="删除评审记录成功!"; - if(fail>0){ - status="success"; - ms="删除评审记录"+suc+"条成功!"+fail+"条因为无项目权限删除失败!"; - } - } - - json.put("status", status); - json.put("ms", ms); - } - pw.print(json.toString()); - - } catch (Exception e) { - e.printStackTrace(); - } - - } - - /** - * 修改评审信息 - * @param tj - * @param br - * @param model - * @param req - * @param rsp - * @return - * @throws Exception - * @Description: - */ - @RequestMapping(value = "/update.do") - public String update(@Valid @ModelAttribute("review") Review review, BindingResult br, Model model, - HttpServletRequest req, HttpServletResponse rsp) throws Exception - { - try - { - rsp.setContentType("text/html;charset=utf-8"); - req.setCharacterEncoding("utf-8"); - - Review review_update = reviewservice.load(Integer.valueOf(req.getParameter("id"))); - - if(!UserLoginController.permissionboolean(req, "rev_3")){ - model.addAttribute("review", new Review()); - model.addAttribute("url", "/review/load.do"); - model.addAttribute("message", "当前用户无权限修改评审信息,请联系管理员!"); - return "success"; - } - - if(!UserLoginController.oppidboolean(req, review.getProjectid())){ - SectorProjects sp=sectorprojectsService.loadob(review.getProjectid()); - model.addAttribute("review", new Review()); - model.addAttribute("url", "/review/load.do"); - model.addAttribute("message", "当前用户无权限修改项目【"+sp.getProjectname()+"】评审信息,请联系管理员!"); - return "error"; - } - String retVal = "/jsp/review/review_update"; - - if (req.getMethod().equals("POST")) - { - if (br.hasErrors()) { - return retVal; - } - - SectorProjects p = new SectorProjects(); - p.setProjectid(review.getProjectid()); - review_update.setSectorProjects(p); - review_update.setVersion(review.getVersion()); - review_update.setReview_date(review.getReview_date()); - review_update.setReview_type(review.getReview_type()); - review_update.setReview_object(review.getReview_object()); - review_update.setConfirm_date(review.getConfirm_date()); - review_update.setResult_Confirmor(review.getResult_Confirmor()); - review_update.setReview_result(review.getReview_result()); - review_update.setRemark(review.getRemark()); - - reviewservice.modify(review_update); - - operationlogservice.add(req, "QA_REVIEW", review_update.getId(), - review_update.getSectorProjects().getProjectid(),"评审记录修改成功!"); - - model.addAttribute("message", "修改成功"); - model.addAttribute("url", "/reviewinfo/load.do"); - return retVal; - - } - review_update.setProjectid(review_update.getSectorProjects().getProjectid()); - model.addAttribute("url", "/review/load.do"); - model.addAttribute("review", review_update); - model.addAttribute("projects", QueueListener.qa_projlist); - return retVal; - - } - catch (Exception e) - { - model.addAttribute("message", e.getMessage()); - model.addAttribute("url", "/review/load.do"); - return "error"; - } - - } - - - public static void main(String[] args) throws Exception { - - } - -} +package luckyweb.seagull.spring.mvc; + +import java.io.BufferedReader; +import java.io.IOException; +import java.io.PrintWriter; +import java.util.List; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import javax.validation.Valid; + +import org.springframework.stereotype.Controller; +import org.springframework.ui.Model; +import org.springframework.validation.BindingResult; +import org.springframework.web.bind.annotation.ModelAttribute; +import org.springframework.web.bind.annotation.RequestMapping; + +import luckyweb.seagull.comm.QueueListener; +import luckyweb.seagull.spring.entity.Review; +import luckyweb.seagull.spring.entity.SectorProjects; +import luckyweb.seagull.spring.service.OperationLogService; +import luckyweb.seagull.spring.service.ReviewInfoService; +import luckyweb.seagull.spring.service.ReviewService; +import luckyweb.seagull.spring.service.SectorProjectsService; +import luckyweb.seagull.util.StrLib; +import net.sf.json.JSONArray; +import net.sf.json.JSONObject; + +@Controller +@RequestMapping("/review") +public class ReviewController { + + @Resource(name = "reviewService") + private ReviewService reviewservice; + + @Resource(name = "reviewInfoService") + private ReviewInfoService reviewinfoservice; + + @Resource(name = "sectorprojectsService") + private SectorProjectsService sectorprojectsService; + + @Resource(name = "operationlogService") + private OperationLogService operationlogservice; + + /** + * + * + * @param tj + * @param model + * @return + * @throws Exception + */ + @RequestMapping(value = "/load.do") + public String load(HttpServletRequest req, Model model) throws Exception { + + try { + int projectid = 99; + + List prolist = QueueListener.qa_projlist; + model.addAttribute("projects", prolist); + model.addAttribute("projectid", projectid); + } catch (Exception e) { + e.printStackTrace(); + model.addAttribute("message", e.getMessage()); + model.addAttribute("url", "/review/load.do"); + return "error"; + } + return "/jsp/review/review"; + } + + @SuppressWarnings("unchecked") + @RequestMapping(value = "/list.do") + private void ajaxGetSellRecord(Integer limit, Integer offset, HttpServletRequest request, + HttpServletResponse response) throws NumberFormatException, Exception { + response.setCharacterEncoding("utf-8"); + PrintWriter pw = response.getWriter(); + String search = request.getParameter("search"); + String projectid = request.getParameter("projectid"); + String startDate = request.getParameter("startDate"); + String endDate = request.getParameter("endDate"); + Review review = new Review(); + if (null == offset && null == limit) { + offset = 0; + } + if (null == limit || limit == 0) { + limit = 10; + } + // 得到客户端传递的查询参数 + if (!StrLib.isEmpty(search)) { + review.setVersion(search); + review.setReview_type(search); + review.setReview_result(search); + } + // 得到客户端传递的查询参数 + if (!StrLib.isEmpty(projectid)&&!"99".equals(projectid)) { + review.setProjectid(Integer.valueOf(projectid)); + } + + if (!StrLib.isEmpty(startDate)) { + review.setReview_startdate(startDate); + } + + if (!StrLib.isEmpty(endDate)) { + review.setReview_enddate(endDate); + } + + List reviewlist = reviewservice.findByPage(review, offset, limit); + + // 转换成json字符串 + String RecordJson = StrLib.listToJson(reviewlist); + // 得到总记录数 + int total = reviewservice.findRows(review); + // 需要返回的数据有总记录数和行数据 + JSONObject json = new JSONObject(); + json.put("total", total); + json.put("rows", RecordJson); + pw.print(json.toString()); + } + + + /** + * 删除评审记录 + * + * @param id + * @param model + * @return + * @throws Exception + */ + @RequestMapping(value = "/delete.do") + public void delete(HttpServletRequest req, HttpServletResponse rsp) throws Exception { + try { + rsp.setContentType("text/html;charset=utf-8"); + req.setCharacterEncoding("utf-8"); + PrintWriter pw = rsp.getWriter(); + JSONObject json = new JSONObject(); + if (!UserLoginController.permissionboolean(req, "rev_2")) { + json.put("status", "fail"); + json.put("ms", "删除失败,权限不足,请联系管理员!"); + } else { + StringBuilder sb = new StringBuilder(); + try (BufferedReader reader = req.getReader();) { + char[] buff = new char[1024]; + int len; + while ((len = reader.read(buff)) != -1) { + sb.append(buff, 0, len); + } + } catch (IOException e) { + e.printStackTrace(); + } + JSONObject jsonObject = JSONObject.fromObject(sb.toString()); + JSONArray jsonarr = JSONArray.fromObject(jsonObject.getString("ids")); + + String status="fail"; + String ms="删除评审记录失败!"; + int suc=0; + int fail=0; + for (int i = 0; i < jsonarr.size(); i++) { + int id = Integer.valueOf(jsonarr.get(i).toString()); + Review review = reviewservice.load(id); + + if(!UserLoginController.oppidboolean(req, review.getSectorProjects().getProjectid())){ + fail++; + continue; + } + reviewinfoservice.delete_reviewid(id); + reviewservice.delete(id); + operationlogservice.add(req, "QA_REVIEW", id, + review.getSectorProjects().getProjectid(),"评审信息删除成功!"); + suc++; + } + + if(suc>0){ + status="success"; + ms="删除评审记录成功!"; + if(fail>0){ + status="success"; + ms="删除评审记录"+suc+"条成功!"+fail+"条因为无项目权限删除失败!"; + } + } + + json.put("status", status); + json.put("ms", ms); + } + pw.print(json.toString()); + + } catch (Exception e) { + e.printStackTrace(); + } + + } + + /** + * 修改评审信息 + * @param tj + * @param br + * @param model + * @param req + * @param rsp + * @return + * @throws Exception + * @Description: + */ + @RequestMapping(value = "/update.do") + public String update(@Valid @ModelAttribute("review") Review review, BindingResult br, Model model, + HttpServletRequest req, HttpServletResponse rsp) throws Exception + { + try + { + rsp.setContentType("text/html;charset=utf-8"); + req.setCharacterEncoding("utf-8"); + + Review review_update = reviewservice.load(Integer.valueOf(req.getParameter("id"))); + + if(!UserLoginController.permissionboolean(req, "rev_3")){ + model.addAttribute("review", new Review()); + model.addAttribute("url", "/review/load.do"); + model.addAttribute("message", "当前用户无权限修改评审信息,请联系管理员!"); + return "success"; + } + + if(!UserLoginController.oppidboolean(req, review.getProjectid())){ + SectorProjects sp=sectorprojectsService.loadob(review.getProjectid()); + model.addAttribute("review", new Review()); + model.addAttribute("url", "/review/load.do"); + model.addAttribute("message", "当前用户无权限修改项目【"+sp.getProjectname()+"】评审信息,请联系管理员!"); + return "error"; + } + String retVal = "/jsp/review/review_update"; + + if (req.getMethod().equals("POST")) + { + if (br.hasErrors()) { + return retVal; + } + + SectorProjects p = new SectorProjects(); + p.setProjectid(review.getProjectid()); + review_update.setSectorProjects(p); + review_update.setVersion(review.getVersion()); + review_update.setReview_date(review.getReview_date()); + review_update.setReview_type(review.getReview_type()); + review_update.setReview_object(review.getReview_object()); + review_update.setConfirm_date(review.getConfirm_date()); + review_update.setResult_Confirmor(review.getResult_Confirmor()); + review_update.setReview_result(review.getReview_result()); + review_update.setRemark(review.getRemark()); + + reviewservice.modify(review_update); + + operationlogservice.add(req, "QA_REVIEW", review_update.getId(), + review_update.getSectorProjects().getProjectid(),"评审记录修改成功!"); + + model.addAttribute("message", "修改成功"); + model.addAttribute("url", "/reviewinfo/load.do"); + return retVal; + + } + review_update.setProjectid(review_update.getSectorProjects().getProjectid()); + model.addAttribute("url", "/review/load.do"); + model.addAttribute("review", review_update); + model.addAttribute("projects", QueueListener.qa_projlist); + return retVal; + + } + catch (Exception e) + { + model.addAttribute("message", e.getMessage()); + model.addAttribute("url", "/review/load.do"); + return "error"; + } + + } + + + public static void main(String[] args) throws Exception { + + } + +} diff --git a/src/main/java/luckyweb/seagull/spring/mvc/ReviewInfoController.java b/src/main/java/luckyweb/seagull/spring/mvc/ReviewInfoController.java index 0b54849..4fc9545 100644 --- a/src/main/java/luckyweb/seagull/spring/mvc/ReviewInfoController.java +++ b/src/main/java/luckyweb/seagull/spring/mvc/ReviewInfoController.java @@ -1,415 +1,415 @@ -package luckyweb.seagull.spring.mvc; - -import java.io.BufferedReader; -import java.io.IOException; -import java.io.PrintWriter; -import java.util.List; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import javax.validation.Valid; - -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.validation.BindingResult; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; - -import luckyweb.seagull.comm.QueueListener; -import luckyweb.seagull.spring.entity.Review; -import luckyweb.seagull.spring.entity.ReviewInfo; -import luckyweb.seagull.spring.entity.SectorProjects; -import luckyweb.seagull.spring.service.OperationLogService; -import luckyweb.seagull.spring.service.ReviewInfoService; -import luckyweb.seagull.spring.service.ReviewService; -import luckyweb.seagull.spring.service.SectorProjectsService; -import luckyweb.seagull.util.StrLib; -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; - -@Controller -@RequestMapping("/reviewinfo") -public class ReviewInfoController { - - @Resource(name = "reviewService") - private ReviewService reviewservice; - - @Resource(name = "reviewInfoService") - private ReviewInfoService reviewinfoservice; - - @Resource(name = "sectorprojectsService") - private SectorProjectsService sectorprojectsService; - - @Resource(name = "operationlogService") - private OperationLogService operationlogservice; - - /** - * - * - * @param tj - * @param model - * @return - * @throws Exception - */ - @RequestMapping(value = "/load.do") - public String load(HttpServletRequest req, Model model) throws Exception { - try { - int reviewid = Integer.valueOf(req.getParameter("reviewid")); - Review review = reviewservice.load(reviewid); - - model.addAttribute("review", review); - model.addAttribute("reviewid", reviewid); - } catch (Exception e) { - e.printStackTrace(); - model.addAttribute("message", e.getMessage()); - model.addAttribute("url", "/review/load.do"); - return "error"; - } - return "/jsp/review/reviewinfo"; - } - - @SuppressWarnings("unchecked") - @RequestMapping(value = "/list.do") - private void ajaxGetSellRecord(Integer limit, Integer offset, HttpServletRequest request, - HttpServletResponse response) throws NumberFormatException, Exception { - response.setCharacterEncoding("utf-8"); - PrintWriter pw = response.getWriter(); - int reviewid = Integer.valueOf(request.getParameter("reviewid")); - ReviewInfo reviewinfo = new ReviewInfo(); - reviewinfo.setReview_id(reviewid); - reviewinfo.setId(0); - if (null == offset && null == limit) { - offset = 0; - } - if (null == limit || limit == 0) { - limit = 10; - } - List reviewlist = reviewinfoservice.findByPage(reviewinfo, offset, limit); - - // 转换成json字符串 - String RecordJson = StrLib.listToJson(reviewlist); - // 得到总记录数 - int total = reviewinfoservice.findRows(reviewinfo); - // 需要返回的数据有总记录数和行数据 - JSONObject json = new JSONObject(); - json.put("total", total); - json.put("rows", RecordJson); - pw.print(json.toString()); - } - - - /** - * 添加评审信息 - * @param tj - * @param br - * @param model - * @param req - * @param rsp - * @return - * @throws Exception - * @Description: - */ - @RequestMapping(value = "/add.do") - public String add(@Valid @ModelAttribute("reviewinfo") ReviewInfo reviewinfo, BindingResult br, Model model, - HttpServletRequest req, HttpServletResponse rsp) throws Exception - { - try - { - rsp.setContentType("text/html;charset=utf-8"); - req.setCharacterEncoding("utf-8"); - - if(!UserLoginController.permissionboolean(req, "revinfo_1")){ - model.addAttribute("reviewinfo", new ReviewInfo()); - model.addAttribute("url", "/review/load.do"); - model.addAttribute("message", "当前用户无权限添加评审信息,请联系管理员!"); - return "success"; - } - - String retVal = "/jsp/review/reviewinfo_add"; - Review review = null; - if (req.getMethod().equals("POST")) - { - if (br.hasErrors()) - { - return retVal; - } - String message = ""; - - if(reviewinfo.getProjectid()==0){ - message = "请选择项目!"; - model.addAttribute("message", message); - model.addAttribute("projects", QueueListener.qa_projlist); - return retVal; - }else{ - if(!UserLoginController.oppidboolean(req, reviewinfo.getProjectid())){ - SectorProjects sp=sectorprojectsService.loadob(reviewinfo.getProjectid()); - model.addAttribute("projects", QueueListener.qa_projlist); - model.addAttribute("message", "当前用户无权限添加项目【"+sp.getProjectname()+"】评审信息,请联系管理员!"); - return retVal; - } - } - - int reviewid = 0; - if(req.getParameter("reviewid")==null||Integer.valueOf(req.getParameter("reviewid"))==0){ - review = new Review(); - SectorProjects p = new SectorProjects(); - p.setProjectid(reviewinfo.getProjectid()); - review.setSectorProjects(p); - - review.setVersion(reviewinfo.getVersion()); - review.setReview_type(reviewinfo.getReview_type()); - review.setReview_date(reviewinfo.getReview_date()); - review.setBug_num(1); - if("已修复".equals(reviewinfo.getStatus())){ - review.setRepair_num(review.getRepair_num()+1); - }else{ - review.setRepair_num(0); - } - review.setConfirm_date(reviewinfo.getReview_date()); - review.setReview_object(reviewinfo.getReview_object()); - review.setReview_result(reviewinfo.getReview_result()); - review.setResult_Confirmor(reviewinfo.getResult_Confirmor()); - review.setRemark(reviewinfo.getRemark()); - - reviewid = reviewservice.add(review); - }else{ - review = reviewservice.load(Integer.valueOf(req.getParameter("reviewid"))); - reviewid = review.getId(); - - review.setBug_num(review.getBug_num()+1); - if("已修复".equals(reviewinfo.getStatus())){ - review.setRepair_num(review.getRepair_num()+1); - } - review.setConfirm_date(reviewinfo.getConfirm_date()); - review.setResult_Confirmor(reviewinfo.getDuty_officer()); - - reviewservice.modify(review); - } - - reviewinfo.setBug_description(reviewinfo.getBug_description()); - reviewinfo.setConfirm_date(reviewinfo.getConfirm_date()); - reviewinfo.setDuty_officer(reviewinfo.getDuty_officer()); - reviewinfo.setReview_id(reviewid); - reviewinfo.setStatus(reviewinfo.getStatus()); - reviewinfo.setCorrective(reviewinfo.getCorrective()); - - int infoid = reviewinfoservice.add(reviewinfo); - - operationlogservice.add(req, "QA_REVIEWINFO", infoid, - reviewinfo.getProjectid(),"评审记录登记成功!"); - - model.addAttribute("message", "添加成功"); - model.addAttribute("url", "/reviewinfo/load.do?reviewid="+reviewid); - return retVal; - - }else{ - - if(req.getParameter("reviewid")!=null&&Integer.valueOf(req.getParameter("reviewid"))!=0){ - review = reviewservice.load(Integer.valueOf(req.getParameter("reviewid"))); - - reviewinfo.setProjectid(review.getSectorProjects().getProjectid()); - reviewinfo.setVersion(review.getVersion()); - reviewinfo.setReview_date(review.getReview_date()); - reviewinfo.setReview_type(review.getReview_type()); - reviewinfo.setReview_object(review.getReview_object()); - reviewinfo.setReview_result(review.getReview_result()); - reviewinfo.setRemark(review.getRemark()); - reviewinfo.setProjectname(review.getSectorProjects().getProjectname()); - reviewinfo.setResult_Confirmor(review.getResult_Confirmor()); - retVal = "/jsp/review/reviewinfo_add"; - model.addAttribute("url", "/reviewinfo/load.do?reviewid="+review.getId()); - } - } - model.addAttribute("reviewinfo", reviewinfo); - model.addAttribute("projects", QueueListener.qa_projlist); - return retVal; - - } - catch (Exception e) - { - model.addAttribute("message", e.getMessage()); - model.addAttribute("url", "/review/load.do"); - return "error"; - } - - } - - /** - * 删除评审记录 - * - * @param id - * @param model - * @return - * @throws Exception - */ - @RequestMapping(value = "/delete.do") - public void delete(HttpServletRequest req, HttpServletResponse rsp) throws Exception { - try { - rsp.setContentType("text/html;charset=utf-8"); - req.setCharacterEncoding("utf-8"); - PrintWriter pw = rsp.getWriter(); - JSONObject json = new JSONObject(); - if (!UserLoginController.permissionboolean(req, "revinfo_2")) { - json.put("status", "fail"); - json.put("ms", "删除失败,权限不足,请联系管理员!"); - } else { - StringBuilder sb = new StringBuilder(); - try (BufferedReader reader = req.getReader();) { - char[] buff = new char[1024]; - int len; - while ((len = reader.read(buff)) != -1) { - sb.append(buff, 0, len); - } - } catch (IOException e) { - e.printStackTrace(); - } - JSONObject jsonObject = JSONObject.fromObject(sb.toString()); - JSONArray jsonarr = JSONArray.fromObject(jsonObject.getString("ids")); - - String status="fail"; - String ms="删除评审明细信息失败!"; - int suc=0; - int fail=0; - for (int i = 0; i < jsonarr.size(); i++) { - int id = Integer.valueOf(jsonarr.get(i).toString()); - ReviewInfo reviewinfo = reviewinfoservice.load(id); - Review review = reviewservice.load(reviewinfo.getReview_id()); - - if(!UserLoginController.oppidboolean(req, review.getSectorProjects().getProjectid())){ - fail++; - continue; - } - if ("已修复".equals(reviewinfo.getStatus())) { - review.setRepair_num(review.getRepair_num() - 1); - } - - review.setBug_num(review.getBug_num()-1); - - reviewservice.modify(review); - - reviewinfoservice.delete(id); - - operationlogservice.add(req, "QA_REVIEWINFO", id, - review.getSectorProjects().getProjectid(),"评审明细信息删除成功!"); - suc++; - } - - if(suc>0){ - status="success"; - ms="删除评审明细信息成功!"; - if(fail>0){ - status="success"; - ms="删除评审明细信息"+suc+"条成功!"+fail+"条因为无项目权限删除失败!"; - } - } - - json.put("status", status); - json.put("ms", ms); - } - pw.print(json.toString()); - - } catch (Exception e) { - e.printStackTrace(); - } - - } - - - /** - * 修改评审信息 - * @param tj - * @param br - * @param model - * @param req - * @param rsp - * @return - * @throws Exception - * @Description: - */ - @RequestMapping(value = "/update.do") - public String update(@Valid @ModelAttribute("reviewinfo") ReviewInfo reviewinfo, BindingResult br, Model model, - HttpServletRequest req, HttpServletResponse rsp) throws Exception - { - try - { - rsp.setContentType("text/html;charset=utf-8"); - req.setCharacterEncoding("utf-8"); - - ReviewInfo reinfo = reviewinfoservice.load(Integer.valueOf(req.getParameter("id"))); - Review review = reviewservice.load(reinfo.getReview_id()); - - if(!UserLoginController.permissionboolean(req, "revinfo_3")){ - model.addAttribute("reviewinfo", new ReviewInfo()); - model.addAttribute("url", "/reviewinfo/load.do?reviewid="+reinfo.getReview_id()); - model.addAttribute("message", "当前用户无权限修改评审信息,请联系管理员!"); - return "error"; - } - if(!UserLoginController.oppidboolean(req, reviewinfo.getProjectid())){ - SectorProjects sp=sectorprojectsService.loadob(reviewinfo.getProjectid()); - model.addAttribute("reviewinfo", new ReviewInfo()); - model.addAttribute("url", "/reviewinfo/load.do?reviewid="+reinfo.getReview_id()); - model.addAttribute("message", "当前用户无权限修改项目【"+sp.getProjectname()+"】评审信息,请联系管理员!"); - return "error"; - } - String retVal = "/jsp/review/reviewinfo_update"; - - if (req.getMethod().equals("POST")) - { - if (br.hasErrors()) { - return retVal; - } - String message = ""; - - if ("已修复".equals(reviewinfo.getStatus())) { - review.setRepair_num(review.getRepair_num() + 1); - } - review.setConfirm_date(reviewinfo.getConfirm_date()); - reviewservice.modify(review); - - reinfo.setBug_description(reviewinfo.getBug_description()); - reinfo.setConfirm_date(reviewinfo.getConfirm_date()); - reinfo.setDuty_officer(reviewinfo.getDuty_officer()); - reinfo.setStatus(reviewinfo.getStatus()); - reinfo.setCorrective(reviewinfo.getCorrective()); - - reviewinfoservice.modify(reinfo); - - operationlogservice.add(req, "QA_REVIEWINFO", reinfo.getId(), - reinfo.getProjectid(),"评审记录修改成功!"); - - model.addAttribute("message", "修改成功"); - model.addAttribute("url", "/reviewinfo/load.do?reviewid="+reinfo.getReview_id()); - return retVal; - - }else{ - reinfo.setProjectid(review.getSectorProjects().getProjectid()); - reinfo.setVersion(review.getVersion()); - reinfo.setReview_date(review.getReview_date()); - reinfo.setReview_type(review.getReview_type()); - reinfo.setReview_object(review.getReview_object()); - reinfo.setReview_result(review.getReview_result()); - reinfo.setRemark(review.getRemark()); - reinfo.setProjectname(review.getSectorProjects().getProjectname()); - reinfo.setResult_Confirmor(review.getResult_Confirmor()); - } - model.addAttribute("url", "/reviewinfo/load.do?reviewid="+reinfo.getReview_id()); - model.addAttribute("reviewinfo", reinfo); - model.addAttribute("projects", QueueListener.qa_projlist); - return retVal; - - } - catch (Exception e) - { - model.addAttribute("message", e.getMessage()); - model.addAttribute("url", "/review/load.do"); - return "error"; - } - - } - - public static void main(String[] args) throws Exception { - - } - -} +package luckyweb.seagull.spring.mvc; + +import java.io.BufferedReader; +import java.io.IOException; +import java.io.PrintWriter; +import java.util.List; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import javax.validation.Valid; + +import org.springframework.stereotype.Controller; +import org.springframework.ui.Model; +import org.springframework.validation.BindingResult; +import org.springframework.web.bind.annotation.ModelAttribute; +import org.springframework.web.bind.annotation.RequestMapping; + +import luckyweb.seagull.comm.QueueListener; +import luckyweb.seagull.spring.entity.Review; +import luckyweb.seagull.spring.entity.ReviewInfo; +import luckyweb.seagull.spring.entity.SectorProjects; +import luckyweb.seagull.spring.service.OperationLogService; +import luckyweb.seagull.spring.service.ReviewInfoService; +import luckyweb.seagull.spring.service.ReviewService; +import luckyweb.seagull.spring.service.SectorProjectsService; +import luckyweb.seagull.util.StrLib; +import net.sf.json.JSONArray; +import net.sf.json.JSONObject; + +@Controller +@RequestMapping("/reviewinfo") +public class ReviewInfoController { + + @Resource(name = "reviewService") + private ReviewService reviewservice; + + @Resource(name = "reviewInfoService") + private ReviewInfoService reviewinfoservice; + + @Resource(name = "sectorprojectsService") + private SectorProjectsService sectorprojectsService; + + @Resource(name = "operationlogService") + private OperationLogService operationlogservice; + + /** + * + * + * @param tj + * @param model + * @return + * @throws Exception + */ + @RequestMapping(value = "/load.do") + public String load(HttpServletRequest req, Model model) throws Exception { + try { + int reviewid = Integer.valueOf(req.getParameter("reviewid")); + Review review = reviewservice.load(reviewid); + + model.addAttribute("review", review); + model.addAttribute("reviewid", reviewid); + } catch (Exception e) { + e.printStackTrace(); + model.addAttribute("message", e.getMessage()); + model.addAttribute("url", "/review/load.do"); + return "error"; + } + return "/jsp/review/reviewinfo"; + } + + @SuppressWarnings("unchecked") + @RequestMapping(value = "/list.do") + private void ajaxGetSellRecord(Integer limit, Integer offset, HttpServletRequest request, + HttpServletResponse response) throws NumberFormatException, Exception { + response.setCharacterEncoding("utf-8"); + PrintWriter pw = response.getWriter(); + int reviewid = Integer.valueOf(request.getParameter("reviewid")); + ReviewInfo reviewinfo = new ReviewInfo(); + reviewinfo.setReview_id(reviewid); + reviewinfo.setId(0); + if (null == offset && null == limit) { + offset = 0; + } + if (null == limit || limit == 0) { + limit = 10; + } + List reviewlist = reviewinfoservice.findByPage(reviewinfo, offset, limit); + + // 转换成json字符串 + String RecordJson = StrLib.listToJson(reviewlist); + // 得到总记录数 + int total = reviewinfoservice.findRows(reviewinfo); + // 需要返回的数据有总记录数和行数据 + JSONObject json = new JSONObject(); + json.put("total", total); + json.put("rows", RecordJson); + pw.print(json.toString()); + } + + + /** + * 添加评审信息 + * @param tj + * @param br + * @param model + * @param req + * @param rsp + * @return + * @throws Exception + * @Description: + */ + @RequestMapping(value = "/add.do") + public String add(@Valid @ModelAttribute("reviewinfo") ReviewInfo reviewinfo, BindingResult br, Model model, + HttpServletRequest req, HttpServletResponse rsp) throws Exception + { + try + { + rsp.setContentType("text/html;charset=utf-8"); + req.setCharacterEncoding("utf-8"); + + if(!UserLoginController.permissionboolean(req, "revinfo_1")){ + model.addAttribute("reviewinfo", new ReviewInfo()); + model.addAttribute("url", "/review/load.do"); + model.addAttribute("message", "当前用户无权限添加评审信息,请联系管理员!"); + return "success"; + } + + String retVal = "/jsp/review/reviewinfo_add"; + Review review = null; + if (req.getMethod().equals("POST")) + { + if (br.hasErrors()) + { + return retVal; + } + String message = ""; + + if(reviewinfo.getProjectid()==0){ + message = "请选择项目!"; + model.addAttribute("message", message); + model.addAttribute("projects", QueueListener.qa_projlist); + return retVal; + }else{ + if(!UserLoginController.oppidboolean(req, reviewinfo.getProjectid())){ + SectorProjects sp=sectorprojectsService.loadob(reviewinfo.getProjectid()); + model.addAttribute("projects", QueueListener.qa_projlist); + model.addAttribute("message", "当前用户无权限添加项目【"+sp.getProjectname()+"】评审信息,请联系管理员!"); + return retVal; + } + } + + int reviewid = 0; + if(req.getParameter("reviewid")==null||Integer.valueOf(req.getParameter("reviewid"))==0){ + review = new Review(); + SectorProjects p = new SectorProjects(); + p.setProjectid(reviewinfo.getProjectid()); + review.setSectorProjects(p); + + review.setVersion(reviewinfo.getVersion()); + review.setReview_type(reviewinfo.getReview_type()); + review.setReview_date(reviewinfo.getReview_date()); + review.setBug_num(1); + if("已修复".equals(reviewinfo.getStatus())){ + review.setRepair_num(review.getRepair_num()+1); + }else{ + review.setRepair_num(0); + } + review.setConfirm_date(reviewinfo.getReview_date()); + review.setReview_object(reviewinfo.getReview_object()); + review.setReview_result(reviewinfo.getReview_result()); + review.setResult_Confirmor(reviewinfo.getResult_Confirmor()); + review.setRemark(reviewinfo.getRemark()); + + reviewid = reviewservice.add(review); + }else{ + review = reviewservice.load(Integer.valueOf(req.getParameter("reviewid"))); + reviewid = review.getId(); + + review.setBug_num(review.getBug_num()+1); + if("已修复".equals(reviewinfo.getStatus())){ + review.setRepair_num(review.getRepair_num()+1); + } + review.setConfirm_date(reviewinfo.getConfirm_date()); + review.setResult_Confirmor(reviewinfo.getDuty_officer()); + + reviewservice.modify(review); + } + + reviewinfo.setBug_description(reviewinfo.getBug_description()); + reviewinfo.setConfirm_date(reviewinfo.getConfirm_date()); + reviewinfo.setDuty_officer(reviewinfo.getDuty_officer()); + reviewinfo.setReview_id(reviewid); + reviewinfo.setStatus(reviewinfo.getStatus()); + reviewinfo.setCorrective(reviewinfo.getCorrective()); + + int infoid = reviewinfoservice.add(reviewinfo); + + operationlogservice.add(req, "QA_REVIEWINFO", infoid, + reviewinfo.getProjectid(),"评审记录登记成功!"); + + model.addAttribute("message", "添加成功"); + model.addAttribute("url", "/reviewinfo/load.do?reviewid="+reviewid); + return retVal; + + }else{ + + if(req.getParameter("reviewid")!=null&&Integer.valueOf(req.getParameter("reviewid"))!=0){ + review = reviewservice.load(Integer.valueOf(req.getParameter("reviewid"))); + + reviewinfo.setProjectid(review.getSectorProjects().getProjectid()); + reviewinfo.setVersion(review.getVersion()); + reviewinfo.setReview_date(review.getReview_date()); + reviewinfo.setReview_type(review.getReview_type()); + reviewinfo.setReview_object(review.getReview_object()); + reviewinfo.setReview_result(review.getReview_result()); + reviewinfo.setRemark(review.getRemark()); + reviewinfo.setProjectname(review.getSectorProjects().getProjectname()); + reviewinfo.setResult_Confirmor(review.getResult_Confirmor()); + retVal = "/jsp/review/reviewinfo_add"; + model.addAttribute("url", "/reviewinfo/load.do?reviewid="+review.getId()); + } + } + model.addAttribute("reviewinfo", reviewinfo); + model.addAttribute("projects", QueueListener.qa_projlist); + return retVal; + + } + catch (Exception e) + { + model.addAttribute("message", e.getMessage()); + model.addAttribute("url", "/review/load.do"); + return "error"; + } + + } + + /** + * 删除评审记录 + * + * @param id + * @param model + * @return + * @throws Exception + */ + @RequestMapping(value = "/delete.do") + public void delete(HttpServletRequest req, HttpServletResponse rsp) throws Exception { + try { + rsp.setContentType("text/html;charset=utf-8"); + req.setCharacterEncoding("utf-8"); + PrintWriter pw = rsp.getWriter(); + JSONObject json = new JSONObject(); + if (!UserLoginController.permissionboolean(req, "revinfo_2")) { + json.put("status", "fail"); + json.put("ms", "删除失败,权限不足,请联系管理员!"); + } else { + StringBuilder sb = new StringBuilder(); + try (BufferedReader reader = req.getReader();) { + char[] buff = new char[1024]; + int len; + while ((len = reader.read(buff)) != -1) { + sb.append(buff, 0, len); + } + } catch (IOException e) { + e.printStackTrace(); + } + JSONObject jsonObject = JSONObject.fromObject(sb.toString()); + JSONArray jsonarr = JSONArray.fromObject(jsonObject.getString("ids")); + + String status="fail"; + String ms="删除评审明细信息失败!"; + int suc=0; + int fail=0; + for (int i = 0; i < jsonarr.size(); i++) { + int id = Integer.valueOf(jsonarr.get(i).toString()); + ReviewInfo reviewinfo = reviewinfoservice.load(id); + Review review = reviewservice.load(reviewinfo.getReview_id()); + + if(!UserLoginController.oppidboolean(req, review.getSectorProjects().getProjectid())){ + fail++; + continue; + } + if ("已修复".equals(reviewinfo.getStatus())) { + review.setRepair_num(review.getRepair_num() - 1); + } + + review.setBug_num(review.getBug_num()-1); + + reviewservice.modify(review); + + reviewinfoservice.delete(id); + + operationlogservice.add(req, "QA_REVIEWINFO", id, + review.getSectorProjects().getProjectid(),"评审明细信息删除成功!"); + suc++; + } + + if(suc>0){ + status="success"; + ms="删除评审明细信息成功!"; + if(fail>0){ + status="success"; + ms="删除评审明细信息"+suc+"条成功!"+fail+"条因为无项目权限删除失败!"; + } + } + + json.put("status", status); + json.put("ms", ms); + } + pw.print(json.toString()); + + } catch (Exception e) { + e.printStackTrace(); + } + + } + + + /** + * 修改评审信息 + * @param tj + * @param br + * @param model + * @param req + * @param rsp + * @return + * @throws Exception + * @Description: + */ + @RequestMapping(value = "/update.do") + public String update(@Valid @ModelAttribute("reviewinfo") ReviewInfo reviewinfo, BindingResult br, Model model, + HttpServletRequest req, HttpServletResponse rsp) throws Exception + { + try + { + rsp.setContentType("text/html;charset=utf-8"); + req.setCharacterEncoding("utf-8"); + + ReviewInfo reinfo = reviewinfoservice.load(Integer.valueOf(req.getParameter("id"))); + Review review = reviewservice.load(reinfo.getReview_id()); + + if(!UserLoginController.permissionboolean(req, "revinfo_3")){ + model.addAttribute("reviewinfo", new ReviewInfo()); + model.addAttribute("url", "/reviewinfo/load.do?reviewid="+reinfo.getReview_id()); + model.addAttribute("message", "当前用户无权限修改评审信息,请联系管理员!"); + return "error"; + } + if(!UserLoginController.oppidboolean(req, reviewinfo.getProjectid())){ + SectorProjects sp=sectorprojectsService.loadob(reviewinfo.getProjectid()); + model.addAttribute("reviewinfo", new ReviewInfo()); + model.addAttribute("url", "/reviewinfo/load.do?reviewid="+reinfo.getReview_id()); + model.addAttribute("message", "当前用户无权限修改项目【"+sp.getProjectname()+"】评审信息,请联系管理员!"); + return "error"; + } + String retVal = "/jsp/review/reviewinfo_update"; + + if (req.getMethod().equals("POST")) + { + if (br.hasErrors()) { + return retVal; + } + String message = ""; + + if ("已修复".equals(reviewinfo.getStatus())) { + review.setRepair_num(review.getRepair_num() + 1); + } + review.setConfirm_date(reviewinfo.getConfirm_date()); + reviewservice.modify(review); + + reinfo.setBug_description(reviewinfo.getBug_description()); + reinfo.setConfirm_date(reviewinfo.getConfirm_date()); + reinfo.setDuty_officer(reviewinfo.getDuty_officer()); + reinfo.setStatus(reviewinfo.getStatus()); + reinfo.setCorrective(reviewinfo.getCorrective()); + + reviewinfoservice.modify(reinfo); + + operationlogservice.add(req, "QA_REVIEWINFO", reinfo.getId(), + reinfo.getProjectid(),"评审记录修改成功!"); + + model.addAttribute("message", "修改成功"); + model.addAttribute("url", "/reviewinfo/load.do?reviewid="+reinfo.getReview_id()); + return retVal; + + }else{ + reinfo.setProjectid(review.getSectorProjects().getProjectid()); + reinfo.setVersion(review.getVersion()); + reinfo.setReview_date(review.getReview_date()); + reinfo.setReview_type(review.getReview_type()); + reinfo.setReview_object(review.getReview_object()); + reinfo.setReview_result(review.getReview_result()); + reinfo.setRemark(review.getRemark()); + reinfo.setProjectname(review.getSectorProjects().getProjectname()); + reinfo.setResult_Confirmor(review.getResult_Confirmor()); + } + model.addAttribute("url", "/reviewinfo/load.do?reviewid="+reinfo.getReview_id()); + model.addAttribute("reviewinfo", reinfo); + model.addAttribute("projects", QueueListener.qa_projlist); + return retVal; + + } + catch (Exception e) + { + model.addAttribute("message", e.getMessage()); + model.addAttribute("url", "/review/load.do"); + return "error"; + } + + } + + public static void main(String[] args) throws Exception { + + } + +} diff --git a/src/main/java/luckyweb/seagull/spring/mvc/SecondarySectorController.java b/src/main/java/luckyweb/seagull/spring/mvc/SecondarySectorController.java index c854750..22ee32e 100644 --- a/src/main/java/luckyweb/seagull/spring/mvc/SecondarySectorController.java +++ b/src/main/java/luckyweb/seagull/spring/mvc/SecondarySectorController.java @@ -1,215 +1,215 @@ -package luckyweb.seagull.spring.mvc; - -import java.io.BufferedReader; -import java.io.IOException; -import java.io.PrintWriter; -import java.util.List; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.RequestMapping; - -import luckyweb.seagull.spring.entity.SecondarySector; -import luckyweb.seagull.spring.service.OperationLogService; -import luckyweb.seagull.spring.service.SecondarySectorService; -import luckyweb.seagull.spring.service.SectorProjectsService; -import luckyweb.seagull.util.StrLib; -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; - -@Controller -@RequestMapping("/secondarySector") -public class SecondarySectorController { - - @Resource(name = "secondarysectorService") - private SecondarySectorService secondarysectorservice; - - @Resource(name = "operationlogService") - private OperationLogService operationlogservice; - - @Resource(name = "sectorprojectsService") - private SectorProjectsService sectorprojectsservice; - /** - * - * - * @param tj - * @param model - * @return - * @throws Exception - */ - @RequestMapping(value = "/load.do") - public String load(HttpServletRequest req, Model model) throws Exception { - return "/jsp/base/secondarysector"; - } - - @RequestMapping(value = "/list.do") - private void ajaxGetSellRecord(Integer limit, Integer offset, HttpServletRequest request, - HttpServletResponse response) throws Exception { - response.setContentType("text/html;charset=utf-8"); - request.setCharacterEncoding("utf-8"); - PrintWriter pw = response.getWriter(); - String search = request.getParameter("search"); - SecondarySector ss=new SecondarySector(); - if (null == offset && null == limit) { - offset = 0; - } - if (null == limit || limit == 0) { - limit = 10; - } - // 得到客户端传递的查询参数 - if (!StrLib.isEmpty(search)) { - ss.setDepartmentname(search); - } - - List sectors = secondarysectorservice.findByPage(ss, offset, limit); - - // 转换成json字符串 - String RecordJson = StrLib.listToJson(sectors); - // 得到总记录数 - int total = secondarysectorservice.findRows(ss); - // 需要返回的数据有总记录数和行数据 - JSONObject json = new JSONObject(); - json.put("total", total-1); - json.put("rows", RecordJson); - pw.print(json.toString()); - } - - @RequestMapping(value = "/update.do") - public void update(HttpServletRequest req, HttpServletResponse rsp, SecondarySector sectors) { - // 更新实体 - try { - rsp.setContentType("text/html;charset=utf-8"); - req.setCharacterEncoding("utf-8"); - PrintWriter pw = rsp.getWriter(); - JSONObject json = new JSONObject(); - if (!UserLoginController.permissionboolean(req, "dpmt_3")) { - json.put("status", "fail"); - json.put("ms", "当前用户无权限修改部门信息,请联系管理员!"); - } else { - secondarysectorservice.modify(sectors); - - operationlogservice.add(req, "SecondarySector", sectors.getSectorid(), - 99,"部门信息修改成功!部门名称:"+sectors.getDepartmentname()); - - json.put("status", "success"); - json.put("ms", "编辑部门成功!"); - } - pw.print(json.toString()); - } catch (Exception e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - } - - /** - * 添加部门 - * - * @param tj - * @param br - * @param model - * @param req - * @param rsp - * @return - * @throws Exception - * @Description: - */ - @RequestMapping(value = "/add.do") - public void add(SecondarySector sectors, HttpServletRequest req, HttpServletResponse rsp) throws Exception { - try { - rsp.setContentType("text/html;charset=utf-8"); - req.setCharacterEncoding("utf-8"); - PrintWriter pw = rsp.getWriter(); - JSONObject json = new JSONObject(); - if (!UserLoginController.permissionboolean(req, "dpmt_1")) { - json.put("status", "fail"); - json.put("ms", "增加部门失败,权限不足,请联系管理员!"); - } else { - int sid = secondarysectorservice.add(sectors); - operationlogservice.add(req, "SectorProjects", sid, - 99,"部门添加成功!部门名:"+sectors.getDepartmentname()); - - json.put("status", "success"); - json.put("ms", "添加部门成功!"); - } - pw.print(json.toString()); - - } catch (Exception e) { - e.printStackTrace(); - } - - } - - /** - * 删除项目 - * - * @param tj - * @param br - * @param model - * @param req - * @param rsp - * @return - * @throws Exception - * @Description: - */ - @RequestMapping(value = "/delete.do") - public void delete(HttpServletRequest req, HttpServletResponse rsp) throws Exception { - try { - rsp.setContentType("text/html;charset=utf-8"); - req.setCharacterEncoding("utf-8"); - PrintWriter pw = rsp.getWriter(); - JSONObject json = new JSONObject(); - if (!UserLoginController.permissionboolean(req, "dpmt_2")) { - json.put("status", "fail"); - json.put("ms", "删除部门失败,权限不足,请联系管理员!"); - } else { - StringBuilder sb = new StringBuilder(); - try (BufferedReader reader = req.getReader();) { - char[] buff = new char[1024]; - int len; - while ((len = reader.read(buff)) != -1) { - sb.append(buff, 0, len); - } - } catch (IOException e) { - e.printStackTrace(); - } - JSONObject jsonObject = JSONObject.fromObject(sb.toString()); - JSONArray jsonarr = JSONArray.fromObject(jsonObject.getString("seids")); - - String status="fail"; - String ms="删除失败!"; - for (int i = 0; i < jsonarr.size(); i++) { - int id = Integer.valueOf(jsonarr.get(i).toString()); - SecondarySector sectors = secondarysectorservice.load(id); - - if(null!=sectors){ - int rows = sectorprojectsservice.projectrowfordmtp(id); - if(rows>=1){ - status="fail"; - ms=sectors.getDepartmentname()+"有相关联的项目信息,不能删除!"; - break; - } - } - - secondarysectorservice.delete(sectors); - operationlogservice.add(req, "SectorProjects", id, - 99,"部门删除成功!部门名:"+sectors.getDepartmentname()); - status="success"; - ms="删除部门成功!"; - } - json.put("status", status); - json.put("ms", ms); - } - pw.print(json.toString()); - - } catch (Exception e) { - e.printStackTrace(); - } - - } - - -} +package luckyweb.seagull.spring.mvc; + +import java.io.BufferedReader; +import java.io.IOException; +import java.io.PrintWriter; +import java.util.List; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.springframework.stereotype.Controller; +import org.springframework.ui.Model; +import org.springframework.web.bind.annotation.RequestMapping; + +import luckyweb.seagull.spring.entity.SecondarySector; +import luckyweb.seagull.spring.service.OperationLogService; +import luckyweb.seagull.spring.service.SecondarySectorService; +import luckyweb.seagull.spring.service.SectorProjectsService; +import luckyweb.seagull.util.StrLib; +import net.sf.json.JSONArray; +import net.sf.json.JSONObject; + +@Controller +@RequestMapping("/secondarySector") +public class SecondarySectorController { + + @Resource(name = "secondarysectorService") + private SecondarySectorService secondarysectorservice; + + @Resource(name = "operationlogService") + private OperationLogService operationlogservice; + + @Resource(name = "sectorprojectsService") + private SectorProjectsService sectorprojectsservice; + /** + * + * + * @param tj + * @param model + * @return + * @throws Exception + */ + @RequestMapping(value = "/load.do") + public String load(HttpServletRequest req, Model model) throws Exception { + return "/jsp/base/secondarysector"; + } + + @RequestMapping(value = "/list.do") + private void ajaxGetSellRecord(Integer limit, Integer offset, HttpServletRequest request, + HttpServletResponse response) throws Exception { + response.setContentType("text/html;charset=utf-8"); + request.setCharacterEncoding("utf-8"); + PrintWriter pw = response.getWriter(); + String search = request.getParameter("search"); + SecondarySector ss=new SecondarySector(); + if (null == offset && null == limit) { + offset = 0; + } + if (null == limit || limit == 0) { + limit = 10; + } + // 得到客户端传递的查询参数 + if (!StrLib.isEmpty(search)) { + ss.setDepartmentname(search); + } + + List sectors = secondarysectorservice.findByPage(ss, offset, limit); + + // 转换成json字符串 + String RecordJson = StrLib.listToJson(sectors); + // 得到总记录数 + int total = secondarysectorservice.findRows(ss); + // 需要返回的数据有总记录数和行数据 + JSONObject json = new JSONObject(); + json.put("total", total-1); + json.put("rows", RecordJson); + pw.print(json.toString()); + } + + @RequestMapping(value = "/update.do") + public void update(HttpServletRequest req, HttpServletResponse rsp, SecondarySector sectors) { + // 更新实体 + try { + rsp.setContentType("text/html;charset=utf-8"); + req.setCharacterEncoding("utf-8"); + PrintWriter pw = rsp.getWriter(); + JSONObject json = new JSONObject(); + if (!UserLoginController.permissionboolean(req, "dpmt_3")) { + json.put("status", "fail"); + json.put("ms", "当前用户无权限修改部门信息,请联系管理员!"); + } else { + secondarysectorservice.modify(sectors); + + operationlogservice.add(req, "SecondarySector", sectors.getSectorid(), + 99,"部门信息修改成功!部门名称:"+sectors.getDepartmentname()); + + json.put("status", "success"); + json.put("ms", "编辑部门成功!"); + } + pw.print(json.toString()); + } catch (Exception e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + + /** + * 添加部门 + * + * @param tj + * @param br + * @param model + * @param req + * @param rsp + * @return + * @throws Exception + * @Description: + */ + @RequestMapping(value = "/add.do") + public void add(SecondarySector sectors, HttpServletRequest req, HttpServletResponse rsp) throws Exception { + try { + rsp.setContentType("text/html;charset=utf-8"); + req.setCharacterEncoding("utf-8"); + PrintWriter pw = rsp.getWriter(); + JSONObject json = new JSONObject(); + if (!UserLoginController.permissionboolean(req, "dpmt_1")) { + json.put("status", "fail"); + json.put("ms", "增加部门失败,权限不足,请联系管理员!"); + } else { + int sid = secondarysectorservice.add(sectors); + operationlogservice.add(req, "SectorProjects", sid, + 99,"部门添加成功!部门名:"+sectors.getDepartmentname()); + + json.put("status", "success"); + json.put("ms", "添加部门成功!"); + } + pw.print(json.toString()); + + } catch (Exception e) { + e.printStackTrace(); + } + + } + + /** + * 删除项目 + * + * @param tj + * @param br + * @param model + * @param req + * @param rsp + * @return + * @throws Exception + * @Description: + */ + @RequestMapping(value = "/delete.do") + public void delete(HttpServletRequest req, HttpServletResponse rsp) throws Exception { + try { + rsp.setContentType("text/html;charset=utf-8"); + req.setCharacterEncoding("utf-8"); + PrintWriter pw = rsp.getWriter(); + JSONObject json = new JSONObject(); + if (!UserLoginController.permissionboolean(req, "dpmt_2")) { + json.put("status", "fail"); + json.put("ms", "删除部门失败,权限不足,请联系管理员!"); + } else { + StringBuilder sb = new StringBuilder(); + try (BufferedReader reader = req.getReader();) { + char[] buff = new char[1024]; + int len; + while ((len = reader.read(buff)) != -1) { + sb.append(buff, 0, len); + } + } catch (IOException e) { + e.printStackTrace(); + } + JSONObject jsonObject = JSONObject.fromObject(sb.toString()); + JSONArray jsonarr = JSONArray.fromObject(jsonObject.getString("seids")); + + String status="fail"; + String ms="删除失败!"; + for (int i = 0; i < jsonarr.size(); i++) { + int id = Integer.valueOf(jsonarr.get(i).toString()); + SecondarySector sectors = secondarysectorservice.load(id); + + if(null!=sectors){ + int rows = sectorprojectsservice.projectrowfordmtp(id); + if(rows>=1){ + status="fail"; + ms=sectors.getDepartmentname()+"有相关联的项目信息,不能删除!"; + break; + } + } + + secondarysectorservice.delete(sectors); + operationlogservice.add(req, "SectorProjects", id, + 99,"部门删除成功!部门名:"+sectors.getDepartmentname()); + status="success"; + ms="删除部门成功!"; + } + json.put("status", status); + json.put("ms", ms); + } + pw.print(json.toString()); + + } catch (Exception e) { + e.printStackTrace(); + } + + } + + +} diff --git a/src/main/java/luckyweb/seagull/spring/mvc/SectorProjectsController.java b/src/main/java/luckyweb/seagull/spring/mvc/SectorProjectsController.java index 7495b8a..11c7dc9 100644 --- a/src/main/java/luckyweb/seagull/spring/mvc/SectorProjectsController.java +++ b/src/main/java/luckyweb/seagull/spring/mvc/SectorProjectsController.java @@ -1,346 +1,346 @@ -package luckyweb.seagull.spring.mvc; - -import java.io.BufferedReader; -import java.io.IOException; -import java.io.PrintWriter; -import java.util.List; - - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.RequestMapping; - -import luckyweb.seagull.comm.QueueListener; -import luckyweb.seagull.spring.entity.ProjectCase; -import luckyweb.seagull.spring.entity.ProjectPlan; -import luckyweb.seagull.spring.entity.SecondarySector; -import luckyweb.seagull.spring.entity.SectorProjects; -import luckyweb.seagull.spring.entity.TestCasedetail; -import luckyweb.seagull.spring.entity.TestJobs; -import luckyweb.seagull.spring.service.OperationLogService; -import luckyweb.seagull.spring.service.ProjectCaseService; -import luckyweb.seagull.spring.service.ProjectPlanService; -import luckyweb.seagull.spring.service.SecondarySectorService; -import luckyweb.seagull.spring.service.SectorProjectsService; -import luckyweb.seagull.spring.service.TestJobsService; -import luckyweb.seagull.util.StrLib; -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; - -@Controller -@RequestMapping("/sectorProjects") -public class SectorProjectsController { - - @Resource(name = "sectorprojectsService") - private SectorProjectsService sectorprojectsservice; - - @Resource(name = "secondarysectorService") - private SecondarySectorService secondarysectorservice; - - @Resource(name = "projectCaseService") - private ProjectCaseService projectcaseservice; - - @Resource(name = "testJobsService") - private TestJobsService testJobsService; - - @Resource(name = "projectPlanService") - private ProjectPlanService projectplanservice; - - @Resource(name = "operationlogService") - private OperationLogService operationlogservice; - - @RequestMapping(value = "/sectorprojects.do") - public String qualityshow(TestCasedetail caseDetail, HttpServletRequest req,HttpServletResponse rsp, - Model model) throws Exception { - return "/jsp/base/sectorprojects"; - } - - /** - * - * - * @param tj - * @param model - * @return - * @throws Exception - */ - @RequestMapping(value = "/load.do") - public String load(HttpServletRequest req, Model model) throws Exception { - List sectors=secondarysectorservice.findSecotorList(); - model.addAttribute("sectors", sectors); - return "/jsp/base/sectorprojects"; - } - - @RequestMapping(value = "/list.do") - private void ajaxGetSellRecord(Integer limit, Integer offset, HttpServletRequest request, - HttpServletResponse response) throws Exception { - response.setContentType("text/html;charset=utf-8"); - request.setCharacterEncoding("utf-8"); - PrintWriter pw = response.getWriter(); - String search = request.getParameter("search"); - SectorProjects sectorprojects=new SectorProjects(); - if (null == offset && null == limit) { - offset = 0; - } - if (null == limit || limit == 0) { - limit = 10; - } - // 得到客户端传递的查询参数 - if (!StrLib.isEmpty(search)) { - sectorprojects.setProjectname(search); - sectorprojects.setProjectmanager(search); - sectorprojects.setProjectsign(search); - } - - List projects = sectorprojectsservice.findByPage(sectorprojects, offset, limit); - List sectors = secondarysectorservice.findSecotorList(); - for(int i=0;i qaprolist=QueueListener.qa_projlist; - for(int i=0;i prolist=QueueListener.projlist; - for(int i=0;i qaprolist=QueueListener.qa_projlist; - qaprolist.add(sectorprojects); - }else if(sectorprojects.getProjecttype()==1){ - List prolist=QueueListener.projlist; - prolist.add(sectorprojects); - } - - operationlogservice.add(req, "SectorProjects", proid, - proid,"项目添加成功!项目名:"+sectorprojects.getProjectname()); - - json.put("status", "success"); - json.put("ms", "添加项目成功!"); - } - pw.print(json.toString()); - - } catch (Exception e) { - e.printStackTrace(); - } - - } - - /** - * 删除项目 - * - * @param tj - * @param br - * @param model - * @param req - * @param rsp - * @return - * @throws Exception - * @Description: - */ - @RequestMapping(value = "/delete.do") - public void delete(HttpServletRequest req, HttpServletResponse rsp) throws Exception { - try { - rsp.setContentType("text/html;charset=utf-8"); - req.setCharacterEncoding("utf-8"); - PrintWriter pw = rsp.getWriter(); - JSONObject json = new JSONObject(); - if (!UserLoginController.permissionboolean(req, "pro_2")) { - json.put("status", "fail"); - json.put("ms", "删除项目失败,权限不足,请联系管理员!"); - } else { - StringBuilder sb = new StringBuilder(); - try (BufferedReader reader = req.getReader();) { - char[] buff = new char[1024]; - int len; - while ((len = reader.read(buff)) != -1) { - sb.append(buff, 0, len); - } - } catch (IOException e) { - e.printStackTrace(); - } - JSONObject jsonObject = JSONObject.fromObject(sb.toString()); - JSONArray jsonarr = JSONArray.fromObject(jsonObject.getString("proids")); - - String status="fail"; - String ms="删除项目失败!"; - for (int i = 0; i < jsonarr.size(); i++) { - int id = Integer.valueOf(jsonarr.get(i).toString()); - SectorProjects sectorproject = sectorprojectsservice.loadob(id); - - if(null!=sectorproject&§orproject.getProjecttype()==0){ - int rows = sectorprojectsservice.projectrow(id); - if(rows>=1){ - status="fail"; - ms=sectorproject.getProjectname()+"有关联质量模块的记录,不能删除!"; - break; - } - } - - if(null!=sectorproject&§orproject.getProjecttype()==1){ - TestJobs testjobs = new TestJobs(); - testjobs.setPlanproj(sectorproject.getProjectname()); - int rows = testJobsService.findRows(testjobs); - if(rows>=1){ - status="fail"; - ms=sectorproject.getProjectname()+"有关联自动化调度任务的记录,不能删除!"; - break; - } - } - - if(null!=sectorproject&§orproject.getProjecttype()==0){ - ProjectPlan plan = new ProjectPlan(); - plan.setProjectid(id); - int rows = projectplanservice.findRows(plan); - if(rows>=1){ - status="fail"; - ms=sectorproject.getProjectname()+"有关联测试计划的记录,不能删除!"; - break; - } - } - - if(null!=sectorproject&§orproject.getProjecttype()==0){ - ProjectCase cases = new ProjectCase(); - cases.setProjectid(id); - int rows = projectcaseservice.findRows(cases); - if(rows>=1){ - status="fail"; - ms=sectorproject.getProjectname()+"有关联测试用例的记录,不能删除!"; - break; - } - } - - operationlogservice.delete(id); - sectorprojectsservice.delete(sectorproject); - - if(sectorproject.getProjecttype()==0){ - List qaprolist=QueueListener.qa_projlist; - for(int j=0;j prolist=QueueListener.projlist; - for(int j=0;j sectors=secondarysectorservice.findSecotorList(); + model.addAttribute("sectors", sectors); + return "/jsp/base/sectorprojects"; + } + + @RequestMapping(value = "/list.do") + private void ajaxGetSellRecord(Integer limit, Integer offset, HttpServletRequest request, + HttpServletResponse response) throws Exception { + response.setContentType("text/html;charset=utf-8"); + request.setCharacterEncoding("utf-8"); + PrintWriter pw = response.getWriter(); + String search = request.getParameter("search"); + SectorProjects sectorprojects=new SectorProjects(); + if (null == offset && null == limit) { + offset = 0; + } + if (null == limit || limit == 0) { + limit = 10; + } + // 得到客户端传递的查询参数 + if (!StrLib.isEmpty(search)) { + sectorprojects.setProjectname(search); + sectorprojects.setProjectmanager(search); + sectorprojects.setProjectsign(search); + } + + List projects = sectorprojectsservice.findByPage(sectorprojects, offset, limit); + List sectors = secondarysectorservice.findSecotorList(); + for(int i=0;i qaprolist=QueueListener.qa_projlist; + for(int i=0;i prolist=QueueListener.projlist; + for(int i=0;i qaprolist=QueueListener.qa_projlist; + qaprolist.add(sectorprojects); + }else if(sectorprojects.getProjecttype()==1){ + List prolist=QueueListener.projlist; + prolist.add(sectorprojects); + } + + operationlogservice.add(req, "SectorProjects", proid, + proid,"项目添加成功!项目名:"+sectorprojects.getProjectname()); + + json.put("status", "success"); + json.put("ms", "添加项目成功!"); + } + pw.print(json.toString()); + + } catch (Exception e) { + e.printStackTrace(); + } + + } + + /** + * 删除项目 + * + * @param tj + * @param br + * @param model + * @param req + * @param rsp + * @return + * @throws Exception + * @Description: + */ + @RequestMapping(value = "/delete.do") + public void delete(HttpServletRequest req, HttpServletResponse rsp) throws Exception { + try { + rsp.setContentType("text/html;charset=utf-8"); + req.setCharacterEncoding("utf-8"); + PrintWriter pw = rsp.getWriter(); + JSONObject json = new JSONObject(); + if (!UserLoginController.permissionboolean(req, "pro_2")) { + json.put("status", "fail"); + json.put("ms", "删除项目失败,权限不足,请联系管理员!"); + } else { + StringBuilder sb = new StringBuilder(); + try (BufferedReader reader = req.getReader();) { + char[] buff = new char[1024]; + int len; + while ((len = reader.read(buff)) != -1) { + sb.append(buff, 0, len); + } + } catch (IOException e) { + e.printStackTrace(); + } + JSONObject jsonObject = JSONObject.fromObject(sb.toString()); + JSONArray jsonarr = JSONArray.fromObject(jsonObject.getString("proids")); + + String status="fail"; + String ms="删除项目失败!"; + for (int i = 0; i < jsonarr.size(); i++) { + int id = Integer.valueOf(jsonarr.get(i).toString()); + SectorProjects sectorproject = sectorprojectsservice.loadob(id); + + if(null!=sectorproject&§orproject.getProjecttype()==0){ + int rows = sectorprojectsservice.projectrow(id); + if(rows>=1){ + status="fail"; + ms=sectorproject.getProjectname()+"有关联质量模块的记录,不能删除!"; + break; + } + } + + if(null!=sectorproject&§orproject.getProjecttype()==1){ + TestJobs testjobs = new TestJobs(); + testjobs.setPlanproj(sectorproject.getProjectname()); + int rows = testJobsService.findRows(testjobs); + if(rows>=1){ + status="fail"; + ms=sectorproject.getProjectname()+"有关联自动化调度任务的记录,不能删除!"; + break; + } + } + + if(null!=sectorproject&§orproject.getProjecttype()==0){ + ProjectPlan plan = new ProjectPlan(); + plan.setProjectid(id); + int rows = projectplanservice.findRows(plan); + if(rows>=1){ + status="fail"; + ms=sectorproject.getProjectname()+"有关联测试计划的记录,不能删除!"; + break; + } + } + + if(null!=sectorproject&§orproject.getProjecttype()==0){ + ProjectCase cases = new ProjectCase(); + cases.setProjectid(id); + int rows = projectcaseservice.findRows(cases); + if(rows>=1){ + status="fail"; + ms=sectorproject.getProjectname()+"有关联测试用例的记录,不能删除!"; + break; + } + } + + operationlogservice.delete(id); + sectorprojectsservice.delete(sectorproject); + + if(sectorproject.getProjecttype()==0){ + List qaprolist=QueueListener.qa_projlist; + for(int j=0;j prolist=QueueListener.projlist; + for(int j=0;j jobs = testJobsService.findJobsList(); - String jobid = req.getParameter("jobid"); - if (StrLib.isEmpty(jobid)) { - jobid = "0"; - } - model.addAttribute("jobs", jobs); - model.addAttribute("jobid", jobid); - - } catch (Exception e) { - e.printStackTrace(); - model.addAttribute("message", e.getMessage()); - model.addAttribute("url", "/tastExecute/load.do"); - return "error"; - } - return "/jsp/task/taskexcute_list"; - } - - @SuppressWarnings({ "unused", "unchecked" }) - @RequestMapping(value = "/list.do") - private void ajaxGetSellRecord(Integer limit, Integer offset, HttpServletRequest request, - HttpServletResponse response) throws IOException { - response.setCharacterEncoding("utf-8"); - PrintWriter pw = response.getWriter(); - String search = request.getParameter("search"); - String jobid = request.getParameter("jobid"); - String startDate = request.getParameter("startDate"); - String endDate = request.getParameter("endDate"); - String status = request.getParameter("status"); - TestTaskexcute task = new TestTaskexcute(); - if (null == offset && null == limit) { - offset = 0; - } - if (null == limit || limit == 0) { - limit = 10; - } - // 得到客户端传递的查询参数 - if (!StrLib.isEmpty(search)) { - task.setTaskId(search); - } - // 得到客户端传递的查询参数 - if (!StrLib.isEmpty(jobid)) { - task.setJobid(Integer.valueOf(jobid)); - } - - if (StrLib.isEmpty(startDate)) { - task.setStartDate(DateLib.befor_Nd_format("yyyy-MM-dd", 7)); - } else { - task.setStartDate(startDate); - } - if (StrLib.isEmpty(endDate)) { - task.setEndDate(DateLib.today("yyyy-MM-dd")); - } else { - task.setEndDate(endDate); - } - if (!StrLib.isEmpty(status)) { - task.setTaskStatus(status); - } - List tasklist = tastExcuteService.findByPage(task, offset, limit); - // 转换成json字符串 - String RecordJson = StrLib.listToJson(tasklist); - // 得到总记录数 - int total = tastExcuteService.findRows(task); - // 需要返回的数据有总记录数和行数据 - JSONObject json = new JSONObject(); - json.put("total", total); - json.put("rows", RecordJson); - pw.print(json.toString()); - } - - /** - * 根据任务Id删除任务 - * - * @param tj - * @param br - * @param model - * @param req - * @param rsp - * @return - * @throws Exception - * @Description: - */ - @RequestMapping(value = "/delete.do") - public void delete(HttpServletRequest req, HttpServletResponse rsp) throws Exception { - try { - rsp.setContentType("text/html;charset=utf-8"); - req.setCharacterEncoding("utf-8"); - PrintWriter pw = rsp.getWriter(); - JSONObject json = new JSONObject(); - if (!UserLoginController.permissionboolean(req, "tastex_2")) { - json.put("status", "fail"); - json.put("ms", "删除任务失败,权限不足,请联系管理员!"); - } else { - StringBuilder sb = new StringBuilder(); - try (BufferedReader reader = req.getReader();) { - char[] buff = new char[1024]; - int len; - while ((len = reader.read(buff)) != -1) { - sb.append(buff, 0, len); - } - } catch (IOException e) { - e.printStackTrace(); - } - JSONObject jsonObject = JSONObject.fromObject(sb.toString()); - JSONArray jsonarr = JSONArray.fromObject(jsonObject.getString("taskids")); - - String status="success"; - String ms="删除任务成功!"; - for (int i = 0; i < jsonarr.size(); i++) { - int id = Integer.valueOf(jsonarr.get(i).toString()); - TestTaskexcute task = tastExcuteService.get(id); - - if(!UserLoginController.oppidboolean(req, task.getTestJob().getProjectid())){ - status = "fail"; - ms = "您有任务没有项目权限进行删除,请确认!"; - break; - } - - if (task == null) { - status = "fail"; - ms = "有任务不存在或已经删除,请确认!"; - break; - } - - Date date = new Date(); - date.setMinutes(date.getMinutes() - 30); - - if (("0".equals(task.getTaskStatus()) || "1".equals(task.getTaskStatus())) - && task.getCreateTime().after(date)) { - status = "fail"; - ms = "任务开始30分钟时间内不允许删除!"; - break; - } - - try { - this.logdetailService.delete(id); - this.casedetailService.delete(id); - this.tastExcuteService.delete(id); - } catch (Exception e) { - status = "fail"; - ms = "任务删除过程中异常,请确认!"; - break; - } - - operationlogservice.add(req, "TEST_TASKEXCUTE", id, - task.getTestJob().getProjectid(), - "自动化用例已执行任务记录删除成功!任务名称:" + task.getTaskId()); - } - - json.put("status", status); - json.put("ms", ms); - } - pw.print(json.toString()); - - } catch (Exception e) { - e.printStackTrace(); - } - - } - - /** - * 获取进度条数据 - * - * @throws Exception - * @Description: - */ - @RequestMapping(value = "/progressdata.do") - public void progressdata(HttpServletRequest req, HttpServletResponse rsp) throws Exception { - - String taskid = req.getParameter("id"); - String[] per = new String[8]; - per[0] = taskid; - - TestTaskexcute task = tastExcuteService.get(Integer.valueOf(taskid)); - TestCasedetail caseDetail = new TestCasedetail(); - caseDetail.setTaskId(Integer.valueOf(taskid)); - - if (null != task && task.getCasetotalCount() != 0) { - int excount = casedetailService.findRows(caseDetail); - // int excount = - // task.getCasesuccCount()+task.getCasenoexecCount()+task.getCaselockCount()+task.getCasefailCount(); - int a = (int) ((Double.valueOf(excount) / Double.valueOf(task.getCasetotalCount())) * 100); - per[1] = String.valueOf(a); - per[7] = String.valueOf(task.getCasetotalCount()); - if (task.getCasetotalCount() == excount) { - if (null != task.getFinishtime()) { - SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");// 定义格式,不显示毫秒 - per[2] = df.format(task.getFinishtime()); - } - per[3] = String.valueOf(task.getCasesuccCount()); - per[4] = String.valueOf(task.getCasefailCount()); - per[5] = String.valueOf(task.getCaselockCount()); - per[6] = String.valueOf(task.getCasenoexecCount()); - } - } else { - per[1] = "0"; - } - - rsp.setContentType("text/xml;charset=utf-8"); - JSONArray jsonArray = JSONArray.fromObject(per); - JSONObject jsobjcet = new JSONObject(); - jsobjcet.put("data", jsonArray); - - rsp.getWriter().write(jsobjcet.toString()); - } - - @RequestMapping(value = "/cgettaskbyid.do") - public void cgetCaseByPlan(HttpServletRequest req, HttpServletResponse rsp) { - // 更新实体 - try { - rsp.setContentType("text/html;charset=GBK"); - req.setCharacterEncoding("GBK"); - PrintWriter pw = rsp.getWriter(); - String taskid = req.getParameter("taskid"); - - TestTaskexcute task = tastExcuteService.load(Integer.valueOf(taskid)); - String jsonStr = JSONObject.fromObject(task).toString(); - pw.print(jsonStr); - } catch (Exception e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - } - -} +package luckyweb.seagull.spring.mvc; + +import java.io.BufferedReader; +import java.io.IOException; +import java.io.PrintWriter; +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.List; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.apache.log4j.Logger; +import org.springframework.stereotype.Controller; +import org.springframework.ui.Model; +import org.springframework.web.bind.annotation.RequestMapping; +import luckyweb.seagull.spring.entity.TestCasedetail; +import luckyweb.seagull.spring.entity.TestJobs; +import luckyweb.seagull.spring.entity.TestTaskexcute; +import luckyweb.seagull.spring.service.CaseDetailService; +import luckyweb.seagull.spring.service.LogDetailService; +import luckyweb.seagull.spring.service.OperationLogService; +import luckyweb.seagull.spring.service.SectorProjectsService; +import luckyweb.seagull.spring.service.TestJobsService; +import luckyweb.seagull.spring.service.TestTastExcuteService; +import luckyweb.seagull.util.DateLib; +import luckyweb.seagull.util.StrLib; + +import net.sf.json.JSONArray; +import net.sf.json.JSONObject; + +@Controller +@RequestMapping("/tastExecute") +public class TastExcuteController { + private static final Logger log = Logger.getLogger(TastExcuteController.class); + + @Resource(name = "tastExcuteService") + private TestTastExcuteService tastExcuteService; + + @Resource(name = "testJobsService") + private TestJobsService testJobsService; + + @Resource(name = "casedetailService") + private CaseDetailService casedetailService; + + @Resource(name = "logdetailService") + private LogDetailService logdetailService; + + @Resource(name = "operationlogService") + private OperationLogService operationlogservice; + + @Resource(name = "sectorprojectsService") + private SectorProjectsService sectorprojectsService; + + /** + * + * + * @param tj + * @param model + * @return + * @throws Exception + */ + @RequestMapping(value = "/load.do") + public String load(HttpServletRequest req, Model model) throws Exception { + + try { + // 调度列表 + List jobs = testJobsService.findJobsList(); + String jobid = req.getParameter("jobid"); + if (StrLib.isEmpty(jobid)) { + jobid = "0"; + } + model.addAttribute("jobs", jobs); + model.addAttribute("jobid", jobid); + + } catch (Exception e) { + e.printStackTrace(); + model.addAttribute("message", e.getMessage()); + model.addAttribute("url", "/tastExecute/load.do"); + return "error"; + } + return "/jsp/task/taskexcute_list"; + } + + @SuppressWarnings({ "unused", "unchecked" }) + @RequestMapping(value = "/list.do") + private void ajaxGetSellRecord(Integer limit, Integer offset, HttpServletRequest request, + HttpServletResponse response) throws IOException { + response.setCharacterEncoding("utf-8"); + PrintWriter pw = response.getWriter(); + String search = request.getParameter("search"); + String jobid = request.getParameter("jobid"); + String startDate = request.getParameter("startDate"); + String endDate = request.getParameter("endDate"); + String status = request.getParameter("status"); + TestTaskexcute task = new TestTaskexcute(); + if (null == offset && null == limit) { + offset = 0; + } + if (null == limit || limit == 0) { + limit = 10; + } + // 得到客户端传递的查询参数 + if (!StrLib.isEmpty(search)) { + task.setTaskId(search); + } + // 得到客户端传递的查询参数 + if (!StrLib.isEmpty(jobid)) { + task.setJobid(Integer.valueOf(jobid)); + } + + if (StrLib.isEmpty(startDate)) { + task.setStartDate(DateLib.befor_Nd_format("yyyy-MM-dd", 7)); + } else { + task.setStartDate(startDate); + } + if (StrLib.isEmpty(endDate)) { + task.setEndDate(DateLib.today("yyyy-MM-dd")); + } else { + task.setEndDate(endDate); + } + if (!StrLib.isEmpty(status)) { + task.setTaskStatus(status); + } + List tasklist = tastExcuteService.findByPage(task, offset, limit); + // 转换成json字符串 + String RecordJson = StrLib.listToJson(tasklist); + // 得到总记录数 + int total = tastExcuteService.findRows(task); + // 需要返回的数据有总记录数和行数据 + JSONObject json = new JSONObject(); + json.put("total", total); + json.put("rows", RecordJson); + pw.print(json.toString()); + } + + /** + * 根据任务Id删除任务 + * + * @param tj + * @param br + * @param model + * @param req + * @param rsp + * @return + * @throws Exception + * @Description: + */ + @RequestMapping(value = "/delete.do") + public void delete(HttpServletRequest req, HttpServletResponse rsp) throws Exception { + try { + rsp.setContentType("text/html;charset=utf-8"); + req.setCharacterEncoding("utf-8"); + PrintWriter pw = rsp.getWriter(); + JSONObject json = new JSONObject(); + if (!UserLoginController.permissionboolean(req, "tastex_2")) { + json.put("status", "fail"); + json.put("ms", "删除任务失败,权限不足,请联系管理员!"); + } else { + StringBuilder sb = new StringBuilder(); + try (BufferedReader reader = req.getReader();) { + char[] buff = new char[1024]; + int len; + while ((len = reader.read(buff)) != -1) { + sb.append(buff, 0, len); + } + } catch (IOException e) { + e.printStackTrace(); + } + JSONObject jsonObject = JSONObject.fromObject(sb.toString()); + JSONArray jsonarr = JSONArray.fromObject(jsonObject.getString("taskids")); + + String status="success"; + String ms="删除任务成功!"; + for (int i = 0; i < jsonarr.size(); i++) { + int id = Integer.valueOf(jsonarr.get(i).toString()); + TestTaskexcute task = tastExcuteService.get(id); + + if(!UserLoginController.oppidboolean(req, task.getTestJob().getProjectid())){ + status = "fail"; + ms = "您有任务没有项目权限进行删除,请确认!"; + break; + } + + if (task == null) { + status = "fail"; + ms = "有任务不存在或已经删除,请确认!"; + break; + } + + Date date = new Date(); + date.setMinutes(date.getMinutes() - 30); + + if (("0".equals(task.getTaskStatus()) || "1".equals(task.getTaskStatus())) + && task.getCreateTime().after(date)) { + status = "fail"; + ms = "任务开始30分钟时间内不允许删除!"; + break; + } + + try { + this.logdetailService.delete(id); + this.casedetailService.delete(id); + this.tastExcuteService.delete(id); + } catch (Exception e) { + status = "fail"; + ms = "任务删除过程中异常,请确认!"; + break; + } + + operationlogservice.add(req, "TEST_TASKEXCUTE", id, + task.getTestJob().getProjectid(), + "自动化用例已执行任务记录删除成功!任务名称:" + task.getTaskId()); + } + + json.put("status", status); + json.put("ms", ms); + } + pw.print(json.toString()); + + } catch (Exception e) { + e.printStackTrace(); + } + + } + + /** + * 获取进度条数据 + * + * @throws Exception + * @Description: + */ + @RequestMapping(value = "/progressdata.do") + public void progressdata(HttpServletRequest req, HttpServletResponse rsp) throws Exception { + + String taskid = req.getParameter("id"); + String[] per = new String[8]; + per[0] = taskid; + + TestTaskexcute task = tastExcuteService.get(Integer.valueOf(taskid)); + TestCasedetail caseDetail = new TestCasedetail(); + caseDetail.setTaskId(Integer.valueOf(taskid)); + + if (null != task && task.getCasetotalCount() != 0) { + int excount = casedetailService.findRows(caseDetail); + // int excount = + // task.getCasesuccCount()+task.getCasenoexecCount()+task.getCaselockCount()+task.getCasefailCount(); + int a = (int) ((Double.valueOf(excount) / Double.valueOf(task.getCasetotalCount())) * 100); + per[1] = String.valueOf(a); + per[7] = String.valueOf(task.getCasetotalCount()); + if (task.getCasetotalCount() == excount) { + if (null != task.getFinishtime()) { + SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");// 定义格式,不显示毫秒 + per[2] = df.format(task.getFinishtime()); + } + per[3] = String.valueOf(task.getCasesuccCount()); + per[4] = String.valueOf(task.getCasefailCount()); + per[5] = String.valueOf(task.getCaselockCount()); + per[6] = String.valueOf(task.getCasenoexecCount()); + } + } else { + per[1] = "0"; + } + + rsp.setContentType("text/xml;charset=utf-8"); + JSONArray jsonArray = JSONArray.fromObject(per); + JSONObject jsobjcet = new JSONObject(); + jsobjcet.put("data", jsonArray); + + rsp.getWriter().write(jsobjcet.toString()); + } + + @RequestMapping(value = "/cgettaskbyid.do") + public void cgetCaseByPlan(HttpServletRequest req, HttpServletResponse rsp) { + // 更新实体 + try { + rsp.setContentType("text/html;charset=GBK"); + req.setCharacterEncoding("GBK"); + PrintWriter pw = rsp.getWriter(); + String taskid = req.getParameter("taskid"); + + TestTaskexcute task = tastExcuteService.load(Integer.valueOf(taskid)); + String jsonStr = JSONObject.fromObject(task).toString(); + pw.print(jsonStr); + } catch (Exception e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + +} diff --git a/src/main/java/luckyweb/seagull/spring/mvc/TestClientController.java b/src/main/java/luckyweb/seagull/spring/mvc/TestClientController.java index 13dcbc0..9d27737 100644 --- a/src/main/java/luckyweb/seagull/spring/mvc/TestClientController.java +++ b/src/main/java/luckyweb/seagull/spring/mvc/TestClientController.java @@ -1,335 +1,335 @@ -package luckyweb.seagull.spring.mvc; - -import java.io.BufferedReader; -import java.io.IOException; -import java.io.PrintWriter; -import java.util.ArrayList; -import java.util.List; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.RequestMapping; - -import luckyweb.seagull.comm.QueueListener; -import luckyweb.seagull.quartz.QuartzManager; -import luckyweb.seagull.quartz.QuratzJobDataMgr; -import luckyweb.seagull.spring.entity.SectorProjects; -import luckyweb.seagull.spring.entity.TestClient; -import luckyweb.seagull.spring.service.OperationLogService; -import luckyweb.seagull.spring.service.SectorProjectsService; -import luckyweb.seagull.spring.service.TestClientService; -import luckyweb.seagull.util.StrLib; -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; - - -@Controller -@RequestMapping("/testClient") -public class TestClientController { - - @Resource(name = "testclientService") - private TestClientService tcservice; - - @Resource(name = "sectorprojectsService") - private SectorProjectsService sectorprojectsService; - - @Resource(name = "operationlogService") - private OperationLogService operationlogservice; - - /** - * - * - * @param tj - * @param model - * @return - * @throws Exception - */ - @RequestMapping(value = "/load.do") - public String load(HttpServletRequest req, Model model) throws Exception { - List lsp=sectorprojectsService.getAllProject(); - for(SectorProjects sp:lsp){ - if(sp.getProjecttype()==1){ - sp.setProjectname(sp.getProjectname()+"(TestLink项目)"); - } - if(null!=sp&&sp.getProjectid()==99){ - lsp.remove(sp); - break; - } - } - model.addAttribute("projectlist", lsp); - return "/jsp/base/testclient"; - } - - @SuppressWarnings({ "unchecked" }) - @RequestMapping(value = "/list.do") - private void ajaxGetSellRecord(Integer limit, Integer offset, HttpServletRequest request, - HttpServletResponse response) throws Exception { - response.setCharacterEncoding("utf-8"); - PrintWriter pw = response.getWriter(); - String search = request.getParameter("search"); - TestClient tc= new TestClient(); - if (null == offset && null == limit) { - offset = 0; - } - if (null == limit || limit == 0) { - limit = 10; - } - // 得到客户端传递的查询参数 - if (!StrLib.isEmpty(search)) { - tc.setClientip(search); - tc.setName(search); - } - List prolist = sectorprojectsService.getAllProject(); - List tcs = tcservice.findByPage(tc, offset, limit); - for(TestClient tct:tcs){ - String[] projectids=tct.getProjectper().split(","); - StringBuffer sbnames = new StringBuffer(); - for(String proid:projectids){ - if(!StrLib.isEmpty(proid)&&!"0".equals(proid)){ - SectorProjects sp = sectorprojectsService.loadob(Integer.valueOf(proid)); - String projectname=sp.getProjectname(); - if(sp.getProjecttype()==1){ - sbnames.append(projectname+"(TestLink),"); - }else{ - sbnames.append(projectname+","); - } - } - } - tct.setProjectpername(sbnames.toString()); - } - // 转换成json字符串 - String RecordJson = StrLib.listToJson(tcs); - // 得到总记录数 - int total = tcservice.findRows(tc); - // 需要返回的数据有总记录数和行数据 - JSONObject json = new JSONObject(); - json.put("total", total); - json.put("rows", RecordJson); - pw.print(json.toString()); - } - - /** - * 添加项目 - * - * @param tj - * @param br - * @param model - * @param req - * @param rsp - * @return - * @throws Exception - * @Description: - */ - @RequestMapping(value = "/add.do") - public void add(TestClient tc, HttpServletRequest req, HttpServletResponse rsp) throws Exception { - try { - rsp.setContentType("text/html;charset=utf-8"); - req.setCharacterEncoding("utf-8"); - PrintWriter pw = rsp.getWriter(); - JSONObject json = new JSONObject(); - TestClient tctest =tcservice.getClient(tc.getClientip()); - if(tc.getId()==0){ - if (!UserLoginController.permissionboolean(req, "client_1")) { - json.put("status", "fail"); - json.put("ms", "增加客户端失败,权限不足,请联系管理员!"); - } else { - tc.setProjectper(","+tc.getProjectper()+","); - tc.setStatus(2); - - if(tctest==null){ - int tcid = tcservice.add(tc); - tc.setId(tcid); - - //将测试调度任务加入到定时任务中 - QueueListener.listen_Clientlist.add(tc); - QuratzJobDataMgr mgr = new QuratzJobDataMgr(); - mgr.addTestClient(tc, tcid); - - operationlogservice.add(req, "TestClient", tcid, - 99,"客户端【"+tc.getName()+"】添加成功!"); - - json.put("status", "success"); - json.put("ms", "添加客户端成功!"); - }else{ - json.put("status", "fail"); - json.put("ms", "添加失败,客户端IP重复啦"); - } - - } - }else{ - if (!UserLoginController.permissionboolean(req, "client_3")) { - json.put("status", "fail"); - json.put("ms", "编辑客户端失败,权限不足,请联系管理员!"); - } else { - TestClient tctemp=tcservice.load(tc.getId()); - if(tctest==null||tctemp.getClientip().equals(tc.getClientip())){ - tc.setProjectper(","+tc.getProjectper()+","); - tc.setStatus(2); - tcservice.modify(tc); - TestClient tct=null; - for (int i = 0; i < QueueListener.listen_Clientlist.size(); i++) - { - tct = new TestClient(); - tct = QueueListener.listen_Clientlist.get(i); - if (tc.getId() == tct.getId()) - { - QueueListener.listen_Clientlist.remove(i); - QueueListener.listen_Clientlist.add(tc); - break; - } - } - - String msg = QuartzManager.modifyJobTime(tc.getId() + "*CLIENT", "0/"+tc.getCheckinterval()+" * * * * ?"); - - operationlogservice.add(req, "TestClient", tc.getId(), - 99,"客户端【"+tc.getName()+"】编辑成功!"); - - json.put("status", "success"); - json.put("ms", "编辑客户端成功!"); - }else{ - json.put("status", "fail"); - json.put("ms", "编辑失败,客户端IP重复啦"); - } - - } - } - pw.print(json.toString()); - - } catch (Exception e) { - e.printStackTrace(); - } - - } - - /** - * 删除项目 - * - * @param tj - * @param br - * @param model - * @param req - * @param rsp - * @return - * @throws Exception - * @Description: - */ - @RequestMapping(value = "/delete.do") - public void delete(HttpServletRequest req, HttpServletResponse rsp) throws Exception { - try { - rsp.setContentType("text/html;charset=utf-8"); - req.setCharacterEncoding("utf-8"); - PrintWriter pw = rsp.getWriter(); - JSONObject json = new JSONObject(); - if (!UserLoginController.permissionboolean(req, "client_2")) { - json.put("status", "fail"); - json.put("ms", "删除客户端失败,权限不足,请联系管理员!"); - } else { - StringBuilder sb = new StringBuilder(); - try (BufferedReader reader = req.getReader();) { - char[] buff = new char[1024]; - int len; - while ((len = reader.read(buff)) != -1) { - sb.append(buff, 0, len); - } - } catch (IOException e) { - e.printStackTrace(); - } - JSONObject jsonObject = JSONObject.fromObject(sb.toString()); - JSONArray jsonarr = JSONArray.fromObject(jsonObject.getString("ids")); - - String status="fail"; - String ms="删除客户端失败!"; - for (int i = 0; i < jsonarr.size(); i++) { - int id = Integer.valueOf(jsonarr.get(i).toString()); - TestClient tc = tcservice.load(id); - - tcservice.delete(tc); - QuartzManager.removeJob(id + "*CLIENT"); - QueueListener.listen_Clientlist.remove(tc); - - operationlogservice.add(req, "TestClient", id, - 99,"客户端删除成功!"); - status="success"; - ms="删除客户端成功!"; - } - json.put("status", status); - json.put("ms", ms); - } - pw.print(json.toString()); - - } catch (Exception e) { - e.printStackTrace(); - } - - } - - /** - * 联动查询客户端列表 - * @param tj - * @param br - * @param model - * @param req - * @param rsp - * @return - * @throws Exception - * @Description: - */ - @RequestMapping(value = "/getclientlist.do") - public void getclientlist(HttpServletRequest req, HttpServletResponse rsp) throws Exception{ - int projectid = Integer.valueOf(req.getParameter("projectid")); - - List listc = tcservice.getClientListForProid(projectid); - - // 取集合 - rsp.setContentType("text/xml;charset=utf-8"); - - JSONArray jsonArray = JSONArray.fromObject(listc); - JSONObject jsobjcet = new JSONObject(); - jsobjcet.put("data", jsonArray); - - rsp.getWriter().write(jsobjcet.toString()); - } - - /** - * 联动查询客户端驱动路径列表 - * @param tj - * @param br - * @param model - * @param req - * @param rsp - * @return - * @throws Exception - * @Description: - */ - @RequestMapping(value = "/getclientpathlist.do") - public void getclientpathlist(HttpServletRequest req, HttpServletResponse rsp) throws Exception{ - String clientip = req.getParameter("clientip"); - - TestClient tc=tcservice.getClient(clientip); - ArrayList pathlist=new ArrayList(); - String path=tc.getClientpath(); - String temp[]=path.split(";",-1); - for(String pathtemp:temp){ - if(!StrLib.isEmpty(pathtemp)){ - pathlist.add(pathtemp); - } - } - - // 取集合 - rsp.setContentType("text/xml;charset=utf-8"); - - JSONArray jsonArray = JSONArray.fromObject(pathlist); - JSONObject jsobjcet = new JSONObject(); - jsobjcet.put("data", jsonArray); - - rsp.getWriter().write(jsobjcet.toString()); - } - - public static void main(String[] args) throws Exception { - } - -} +package luckyweb.seagull.spring.mvc; + +import java.io.BufferedReader; +import java.io.IOException; +import java.io.PrintWriter; +import java.util.ArrayList; +import java.util.List; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.springframework.stereotype.Controller; +import org.springframework.ui.Model; +import org.springframework.web.bind.annotation.RequestMapping; + +import luckyweb.seagull.comm.QueueListener; +import luckyweb.seagull.quartz.QuartzManager; +import luckyweb.seagull.quartz.QuratzJobDataMgr; +import luckyweb.seagull.spring.entity.SectorProjects; +import luckyweb.seagull.spring.entity.TestClient; +import luckyweb.seagull.spring.service.OperationLogService; +import luckyweb.seagull.spring.service.SectorProjectsService; +import luckyweb.seagull.spring.service.TestClientService; +import luckyweb.seagull.util.StrLib; +import net.sf.json.JSONArray; +import net.sf.json.JSONObject; + + +@Controller +@RequestMapping("/testClient") +public class TestClientController { + + @Resource(name = "testclientService") + private TestClientService tcservice; + + @Resource(name = "sectorprojectsService") + private SectorProjectsService sectorprojectsService; + + @Resource(name = "operationlogService") + private OperationLogService operationlogservice; + + /** + * + * + * @param tj + * @param model + * @return + * @throws Exception + */ + @RequestMapping(value = "/load.do") + public String load(HttpServletRequest req, Model model) throws Exception { + List lsp=sectorprojectsService.getAllProject(); + for(SectorProjects sp:lsp){ + if(sp.getProjecttype()==1){ + sp.setProjectname(sp.getProjectname()+"(TestLink项目)"); + } + if(null!=sp&&sp.getProjectid()==99){ + lsp.remove(sp); + break; + } + } + model.addAttribute("projectlist", lsp); + return "/jsp/base/testclient"; + } + + @SuppressWarnings({ "unchecked" }) + @RequestMapping(value = "/list.do") + private void ajaxGetSellRecord(Integer limit, Integer offset, HttpServletRequest request, + HttpServletResponse response) throws Exception { + response.setCharacterEncoding("utf-8"); + PrintWriter pw = response.getWriter(); + String search = request.getParameter("search"); + TestClient tc= new TestClient(); + if (null == offset && null == limit) { + offset = 0; + } + if (null == limit || limit == 0) { + limit = 10; + } + // 得到客户端传递的查询参数 + if (!StrLib.isEmpty(search)) { + tc.setClientip(search); + tc.setName(search); + } + List prolist = sectorprojectsService.getAllProject(); + List tcs = tcservice.findByPage(tc, offset, limit); + for(TestClient tct:tcs){ + String[] projectids=tct.getProjectper().split(","); + StringBuffer sbnames = new StringBuffer(); + for(String proid:projectids){ + if(!StrLib.isEmpty(proid)&&!"0".equals(proid)){ + SectorProjects sp = sectorprojectsService.loadob(Integer.valueOf(proid)); + String projectname=sp.getProjectname(); + if(sp.getProjecttype()==1){ + sbnames.append(projectname+"(TestLink),"); + }else{ + sbnames.append(projectname+","); + } + } + } + tct.setProjectpername(sbnames.toString()); + } + // 转换成json字符串 + String RecordJson = StrLib.listToJson(tcs); + // 得到总记录数 + int total = tcservice.findRows(tc); + // 需要返回的数据有总记录数和行数据 + JSONObject json = new JSONObject(); + json.put("total", total); + json.put("rows", RecordJson); + pw.print(json.toString()); + } + + /** + * 添加项目 + * + * @param tj + * @param br + * @param model + * @param req + * @param rsp + * @return + * @throws Exception + * @Description: + */ + @RequestMapping(value = "/add.do") + public void add(TestClient tc, HttpServletRequest req, HttpServletResponse rsp) throws Exception { + try { + rsp.setContentType("text/html;charset=utf-8"); + req.setCharacterEncoding("utf-8"); + PrintWriter pw = rsp.getWriter(); + JSONObject json = new JSONObject(); + TestClient tctest =tcservice.getClient(tc.getClientip()); + if(tc.getId()==0){ + if (!UserLoginController.permissionboolean(req, "client_1")) { + json.put("status", "fail"); + json.put("ms", "增加客户端失败,权限不足,请联系管理员!"); + } else { + tc.setProjectper(","+tc.getProjectper()+","); + tc.setStatus(2); + + if(tctest==null){ + int tcid = tcservice.add(tc); + tc.setId(tcid); + + //将测试调度任务加入到定时任务中 + QueueListener.listen_Clientlist.add(tc); + QuratzJobDataMgr mgr = new QuratzJobDataMgr(); + mgr.addTestClient(tc, tcid); + + operationlogservice.add(req, "TestClient", tcid, + 99,"客户端【"+tc.getName()+"】添加成功!"); + + json.put("status", "success"); + json.put("ms", "添加客户端成功!"); + }else{ + json.put("status", "fail"); + json.put("ms", "添加失败,客户端IP重复啦"); + } + + } + }else{ + if (!UserLoginController.permissionboolean(req, "client_3")) { + json.put("status", "fail"); + json.put("ms", "编辑客户端失败,权限不足,请联系管理员!"); + } else { + TestClient tctemp=tcservice.load(tc.getId()); + if(tctest==null||tctemp.getClientip().equals(tc.getClientip())){ + tc.setProjectper(","+tc.getProjectper()+","); + tc.setStatus(2); + tcservice.modify(tc); + TestClient tct=null; + for (int i = 0; i < QueueListener.listen_Clientlist.size(); i++) + { + tct = new TestClient(); + tct = QueueListener.listen_Clientlist.get(i); + if (tc.getId() == tct.getId()) + { + QueueListener.listen_Clientlist.remove(i); + QueueListener.listen_Clientlist.add(tc); + break; + } + } + + String msg = QuartzManager.modifyJobTime(tc.getId() + "*CLIENT", "0/"+tc.getCheckinterval()+" * * * * ?"); + + operationlogservice.add(req, "TestClient", tc.getId(), + 99,"客户端【"+tc.getName()+"】编辑成功!"); + + json.put("status", "success"); + json.put("ms", "编辑客户端成功!"); + }else{ + json.put("status", "fail"); + json.put("ms", "编辑失败,客户端IP重复啦"); + } + + } + } + pw.print(json.toString()); + + } catch (Exception e) { + e.printStackTrace(); + } + + } + + /** + * 删除项目 + * + * @param tj + * @param br + * @param model + * @param req + * @param rsp + * @return + * @throws Exception + * @Description: + */ + @RequestMapping(value = "/delete.do") + public void delete(HttpServletRequest req, HttpServletResponse rsp) throws Exception { + try { + rsp.setContentType("text/html;charset=utf-8"); + req.setCharacterEncoding("utf-8"); + PrintWriter pw = rsp.getWriter(); + JSONObject json = new JSONObject(); + if (!UserLoginController.permissionboolean(req, "client_2")) { + json.put("status", "fail"); + json.put("ms", "删除客户端失败,权限不足,请联系管理员!"); + } else { + StringBuilder sb = new StringBuilder(); + try (BufferedReader reader = req.getReader();) { + char[] buff = new char[1024]; + int len; + while ((len = reader.read(buff)) != -1) { + sb.append(buff, 0, len); + } + } catch (IOException e) { + e.printStackTrace(); + } + JSONObject jsonObject = JSONObject.fromObject(sb.toString()); + JSONArray jsonarr = JSONArray.fromObject(jsonObject.getString("ids")); + + String status="fail"; + String ms="删除客户端失败!"; + for (int i = 0; i < jsonarr.size(); i++) { + int id = Integer.valueOf(jsonarr.get(i).toString()); + TestClient tc = tcservice.load(id); + + tcservice.delete(tc); + QuartzManager.removeJob(id + "*CLIENT"); + QueueListener.listen_Clientlist.remove(tc); + + operationlogservice.add(req, "TestClient", id, + 99,"客户端删除成功!"); + status="success"; + ms="删除客户端成功!"; + } + json.put("status", status); + json.put("ms", ms); + } + pw.print(json.toString()); + + } catch (Exception e) { + e.printStackTrace(); + } + + } + + /** + * 联动查询客户端列表 + * @param tj + * @param br + * @param model + * @param req + * @param rsp + * @return + * @throws Exception + * @Description: + */ + @RequestMapping(value = "/getclientlist.do") + public void getclientlist(HttpServletRequest req, HttpServletResponse rsp) throws Exception{ + int projectid = Integer.valueOf(req.getParameter("projectid")); + + List listc = tcservice.getClientListForProid(projectid); + + // 取集合 + rsp.setContentType("text/xml;charset=utf-8"); + + JSONArray jsonArray = JSONArray.fromObject(listc); + JSONObject jsobjcet = new JSONObject(); + jsobjcet.put("data", jsonArray); + + rsp.getWriter().write(jsobjcet.toString()); + } + + /** + * 联动查询客户端驱动路径列表 + * @param tj + * @param br + * @param model + * @param req + * @param rsp + * @return + * @throws Exception + * @Description: + */ + @RequestMapping(value = "/getclientpathlist.do") + public void getclientpathlist(HttpServletRequest req, HttpServletResponse rsp) throws Exception{ + String clientip = req.getParameter("clientip"); + + TestClient tc=tcservice.getClient(clientip); + ArrayList pathlist=new ArrayList(); + String path=tc.getClientpath(); + String temp[]=path.split(";",-1); + for(String pathtemp:temp){ + if(!StrLib.isEmpty(pathtemp)){ + pathlist.add(pathtemp); + } + } + + // 取集合 + rsp.setContentType("text/xml;charset=utf-8"); + + JSONArray jsonArray = JSONArray.fromObject(pathlist); + JSONObject jsobjcet = new JSONObject(); + jsobjcet.put("data", jsonArray); + + rsp.getWriter().write(jsobjcet.toString()); + } + + public static void main(String[] args) throws Exception { + } + +} diff --git a/src/main/java/luckyweb/seagull/spring/mvc/TestJobsController.java b/src/main/java/luckyweb/seagull/spring/mvc/TestJobsController.java index 65ce13a..ae02e06 100644 --- a/src/main/java/luckyweb/seagull/spring/mvc/TestJobsController.java +++ b/src/main/java/luckyweb/seagull/spring/mvc/TestJobsController.java @@ -1,1127 +1,1127 @@ -package luckyweb.seagull.spring.mvc; - -import java.io.BufferedInputStream; -import java.io.File; -import java.io.FileInputStream; -import java.io.FileNotFoundException; -import java.io.IOException; -import java.io.PrintWriter; -import java.rmi.Naming; -import java.sql.SQLException; -import java.sql.Timestamp; -import java.text.SimpleDateFormat; -import java.util.ArrayList; -import java.util.List; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import javax.validation.Valid; - -import org.apache.log4j.Logger; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.validation.BindingResult; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestMethod; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.multipart.MultipartFile; - -import luckyweb.seagull.comm.QueueListener; -import luckyweb.seagull.quartz.QuartzJob; -import luckyweb.seagull.quartz.QuartzManager; -import luckyweb.seagull.quartz.QuratzJobDataMgr; -import luckyweb.seagull.spring.entity.ProjectPlan; -import luckyweb.seagull.spring.entity.SectorProjects; -import luckyweb.seagull.spring.entity.TestClient; -import luckyweb.seagull.spring.entity.TestJobs; -import luckyweb.seagull.spring.entity.UserInfo; -import luckyweb.seagull.spring.service.CaseDetailService; -import luckyweb.seagull.spring.service.LogDetailService; -import luckyweb.seagull.spring.service.OperationLogService; -import luckyweb.seagull.spring.service.ProjectPlanService; -import luckyweb.seagull.spring.service.SectorProjectsService; -import luckyweb.seagull.spring.service.TestClientService; -import luckyweb.seagull.spring.service.TestJobsService; -import luckyweb.seagull.spring.service.TestTastExcuteService; -import luckyweb.seagull.spring.service.UserInfoService; -import luckyweb.seagull.util.DateLib; -import luckyweb.seagull.util.DateUtil; -import luckyweb.seagull.util.StrLib; -import net.sf.json.JSONObject; -import rmi.service.RunService; - -@Controller -@RequestMapping("/testJobs") -public class TestJobsController -{ - private static final Logger log = Logger.getLogger(TestJobsController.class); - - - @Resource(name = "testJobsService") - private TestJobsService testJobsService; - - @Resource(name = "tastExcuteService") - private TestTastExcuteService tastExcuteService; - - @Resource(name = "casedetailService") - private CaseDetailService casedetailService; - - @Resource(name = "projectPlanService") - private ProjectPlanService projectplanservice; - - @Resource(name = "logdetailService") - private LogDetailService logdetailService; - - @Resource(name = "operationlogService") - private OperationLogService operationlogservice; - - @Resource(name = "userinfoService") - private UserInfoService userinfoservice; - - @Resource(name = "sectorprojectsService") - private SectorProjectsService sectorprojectsService; - - @Resource(name = "testclientService") - private TestClientService tcservice; - - /** - * - * - * @param tj - * @param model - * @return - * @throws Exception - */ - @RequestMapping(value = "/load.do") - public String load(HttpServletRequest req, Model model) throws Exception { - - try { - int projectid = 99; - if (null != req.getSession().getAttribute("usercode") - && null != req.getSession().getAttribute("username")) { - String usercode = req.getSession().getAttribute("usercode").toString(); - UserInfo userinfo = userinfoservice.getUseinfo(usercode); - projectid = userinfo.getProjectid(); - } - - List prolist=sectorprojectsService.getAllProject(); - for(int i=0;i iplist = tcservice.getClientList(); - for(TestClient tc:iplist){ - if(tc.getStatus()==0){ - tc.setName("【"+tc.getName()+"】"+tc.getClientip()+" 【客户端状态正常】"); - }else if(tc.getStatus()==1){ - tc.setName("【"+tc.getName()+"】"+tc.getClientip()+" 【客户端状态异常】"); - }else{ - tc.setName("【"+tc.getName()+"】"+tc.getClientip()+" 【客户端状态未知】"); - } - } - model.addAttribute("iplist", iplist); - - model.addAttribute("projects", prolist); - model.addAttribute("projectid", projectid); - model.addAttribute("date", DateLib.today("yyyy-MM-dd")); - } catch (Exception e) { - e.printStackTrace(); - model.addAttribute("message", e.getMessage()); - model.addAttribute("url", "/testJobs/load.do"); - return "error"; - } - return "/jsp/task/job_list"; - } - - @SuppressWarnings({ "unchecked" }) - @RequestMapping(value = "/list.do") - private void ajaxGetSellRecord(Integer limit, Integer offset, HttpServletRequest request, - HttpServletResponse response) throws Exception { - response.setCharacterEncoding("utf-8"); - PrintWriter pw = response.getWriter(); - String search = request.getParameter("search"); - String projectid = request.getParameter("projectid"); - TestJobs tj= new TestJobs(); - if (null == offset && null == limit) { - offset = 0; - } - if (null == limit || limit == 0) { - limit = 10; - } - // 得到客户端传递的查询参数 - if (!StrLib.isEmpty(search)) { - tj.setTaskName(search); - tj.setPlanproj(search); - } - // 得到客户端传递的查询参数 - if (!StrLib.isEmpty(projectid)) { - tj.setProjectid(Integer.valueOf(projectid)); - } - - List jobs = testJobsService.findByPage(tj, offset, limit); - List iplist = tcservice.getClientList(); - for(TestJobs tjs:jobs){ - for(TestClient tc:iplist){ - if(tc.getClientip().equals(tjs.getClientip())){ - tjs.setClientip(tjs.getClientip()+"**"+tc.getStatus()); - } - } - } - // 转换成json字符串 - String RecordJson = StrLib.listToJson(jobs); - // 得到总记录数 - int total = testJobsService.findRows(tj); - // 需要返回的数据有总记录数和行数据 - JSONObject json = new JSONObject(); - json.put("total", total); - json.put("rows", RecordJson); - pw.print(json.toString()); - } - - /** - * 新增Job - * @param tj - * @param br - * @param model - * @param req - * @param rsp - * @return - * @throws Exception - * @Description: - */ - @RequestMapping(value = "/add.do") - public String add(@Valid @ModelAttribute("taskjob") TestJobs tj, BindingResult br, Model model, - HttpServletRequest req, HttpServletResponse rsp) throws Exception - { - try - { - rsp.setContentType("text/html;charset=utf-8"); - req.setCharacterEncoding("utf-8"); - - if(!UserLoginController.permissionboolean(req, "tast_1")){ - model.addAttribute("taskjob", new TestJobs()); - model.addAttribute("url", "/testJobs/load.do"); - model.addAttribute("message", "当前用户无权限添加计划任务,请联系管理员!"); - return "success"; - } - - List qaprolist=QueueListener.qa_projlist; - List prolist=QueueListener.projlist; - String retVal = "/jsp/task/task_add"; - if (req.getMethod().equals("POST")) - { - - if (br.hasErrors()) - { - return retVal; - } - - String message = ""; - if (tj.getProjecttype()==1&&(StrLib.isEmpty(tj.getPlanproj())||"0".equals(tj.getPlanproj()))) - { - message = "项目名必选!"; - model.addAttribute("message", message); - return retVal; - }else if(tj.getProjecttype()==1){ - if(!UserLoginController.oppidboolean(req, Integer.valueOf(tj.getPlanproj()))){ - model.addAttribute("message", "当前用户无权限添加当前项目的调度任务,请联系管理员!"); - return retVal; - } - } - - if (tj.getProjecttype()==0&&tj.getProjectid()==0) - { - message = "项目名必选!"; - model.addAttribute("message", message); - return retVal; - }else if(tj.getProjecttype()==0){ - if(!UserLoginController.oppidboolean(req, tj.getProjectid())){ - model.addAttribute("message", "当前用户无权限添加当前项目的调度任务,请联系管理员!"); - return retVal; - } - } - - if (StrLib.isEmpty(tj.getClientip())||"0".equals(tj.getClientip())) { - message = "客户端IP不能为空!"; - model.addAttribute("message", message); - return retVal; - } - - if (StrLib.isEmpty(tj.getClientpath())||"0".equals(tj.getClientpath())) { - message = "客户端驱动桩路径不能为空!"; - model.addAttribute("message", message); - return retVal; - } - - if (StrLib.isEmpty(tj.getTaskName())||"0".equals(tj.getTaskName())) - { - message = "计划名称不能为空!"; - model.addAttribute("message", message); - return retVal; - } - - if (tj.getThreadCount() < 1 || tj.getThreadCount() > 20) - { - message = "线程数在1-20之间"; - model.addAttribute("message", message); - return retVal; - } - - if (tj.getTimeout() < 1 || tj.getTimeout() > 120) - { - message = "超时时间必须在1-120分钟之间"; - model.addAttribute("message", message); - return retVal; - } - - String startDate = DateLib.today("yyyy-MM-dd"); - String startTime = DateLib.today("HH:mm:ss"); - tj.setStartDate(startDate); - tj.setStartTime(startTime); - - tj.setEndTimestr(null); - tj.setState("1"); - long runtime = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse( - tj.getStartDate() + " " + tj.getStartTime()).getTime(); - tj.setRunTime(new Timestamp(runtime)); - tj.setCreateTime(DateUtil.now()); - //邮件处理 - if (tj.getIsSendMail().equals("1")) - { - message = ""; - if (StrLib.isEmpty(tj.getEmailer())) - { - message = "确定要发送邮件时,收件人不能为空!"; - } - else - { - if (!tj.getEmailer().contains(";")) - { - message = "收件人分隔格式不对!"; - } - if (!tj.getEmailer().contains("@")) - {// 未用正则表达式 - message = "收件人邮箱格式不对!"; - } - } - if (!StrLib.isEmpty(message)) - { - model.addAttribute("message", message); - return "/jsp/task/task_add"; - } - - } - else - { - tj.setEmailer(""); - } - - //构建方式处理 - if (tj.getIsbuilding().equals("1")) - { - message = ""; - if (StrLib.isEmpty(tj.getBuildname())) - { - message = "确定要自动构建时,构建项目名不能为空!"; - } - else - { - if (!tj.getBuildname().contains(";")) - { - message = "构建项目名分隔格式不对!"; - } - } - if (!StrLib.isEmpty(message)) - { - model.addAttribute("message", message); - return "/jsp/task/task_add"; - } - - } - else - { - tj.setBuildname(""); - } - - //重启TOMCAT处理 - if (tj.getIsrestart().equals("1")) - { - message = ""; - if (StrLib.isEmpty(tj.getRestartcomm())) - { - message = "确定要自动重启时,重启脚本行不能为空!"; - } - else - { - if (!tj.getRestartcomm().contains(";")) - { - message = "构建项目名分隔格式不对!"; - } - } - if (!StrLib.isEmpty(message)) - { - model.addAttribute("message", message); - return "/jsp/task/task_add"; - } - - } - else - { - tj.setRestartcomm(""); - } - - if(tj.getProjecttype()==0){ - String projectname="0"; - for(int i=0;i qaprolist=QueueListener.qa_projlist; - List prolist=QueueListener.projlist; - - model.addAttribute("projects", prolist); - model.addAttribute("sysprojects", qaprolist); - if(!UserLoginController.permissionboolean(req, "tast_3")){ - model.addAttribute("taskjob", new TestJobs()); - model.addAttribute("url", "/testJobs/load.do"); - model.addAttribute("message", "当前用户无权限修改计划任务,请联系管理员!"); - return "success"; - } - - TestJobs jobload = testJobsService.load(id); - if (req.getMethod().equals("POST")) - { - try - { - if (br.hasErrors()) - { - return "/jsp/task/task_update"; - } - String message = ""; - - if (StrLib.isEmpty(tj.getClientip())||"0".equals(tj.getClientip())) { - message = "客户端IP不能为空!"; - model.addAttribute("message", message); - return "/jsp/task/task_add"; - } - - if (StrLib.isEmpty(tj.getClientpath())||"0".equals(tj.getClientpath())) { - message = "客户端驱动桩路径不能为空!"; - model.addAttribute("message", message); - return "/jsp/task/task_add"; - } - - if (StrLib.isEmpty(tj.getTaskName())||"0".equals(tj.getTaskName())) - { - message = "计划名称不能为空!"; - model.addAttribute("message", message); - return "/jsp/task/task_update"; - } - - if (tj.getProjecttype()==1&&(StrLib.isEmpty(tj.getPlanproj())||"0".equals(tj.getPlanproj()))) - { - message = "项目名必选!"; - model.addAttribute("message", message); - return "/jsp/task/task_update"; - }else if(tj.getProjecttype()==1){ - if(!UserLoginController.oppidboolean(req, Integer.valueOf(tj.getPlanproj()))){ - model.addAttribute("message", "当前用户无权限修改当前项目的调度任务,请联系管理员!"); - return "/jsp/task/task_update"; - } - } - - if (tj.getProjecttype()==0&&tj.getProjectid()==0) - { - message = "项目名必选!"; - model.addAttribute("message", message); - return "/jsp/task/task_update"; - }else if(tj.getProjecttype()==0){ - if(!UserLoginController.oppidboolean(req, tj.getProjectid())){ - model.addAttribute("message", "当前用户无权限修改当前项目的调度任务,请联系管理员!"); - return "/jsp/task/task_update"; - } - } - - if (tj.getThreadCount() < 1 || tj.getThreadCount() > 20) - { - message = "线程数在1-20之间"; - model.addAttribute("message", message); - return "/jsp/task/task_update"; - } - - if (tj.getTimeout() < 1 || tj.getTimeout() > 120) - { - message = "超时时间必须在1-120分钟之间"; - model.addAttribute("message", message); - return "/jsp/task/task_update"; - } - - if (tj.getIsSendMail().equals("1")) - { - message = ""; - if (StrLib.isEmpty(tj.getEmailer())) - { - message = "确定要发送邮件时,收件人不能为空!"; - } - else - { - if (!tj.getEmailer().contains(";")) - { - message = "收件人分隔格式不对!"; - } - if (!tj.getEmailer().contains("@")) - {// 未用正则表达式 - message = "收件人邮箱格式不对!"; - } - } - if (!StrLib.isEmpty(message)) - { - model.addAttribute("message", message); - return "/jsp/task/task_update"; - } - - } - else - { - tj.setEmailer(""); - } - - //构建方式处理 - if (tj.getIsbuilding().equals("1")) - { - message = ""; - if (StrLib.isEmpty(tj.getBuildname())) - { - message = "确定要自动构建时,构建项目名不能为空!"; - } - else - { - if (!tj.getBuildname().contains(";")) - { - message = "构建项目名分隔格式不对!"; - } - } - if (!StrLib.isEmpty(message)) - { - model.addAttribute("message", message); - return "/jsp/task/task_update"; - } - - } - else - { - tj.setBuildname(""); - } - - - //重启TOMCAT处理 - if (tj.getIsrestart().equals("1")) - { - message = ""; - if (StrLib.isEmpty(tj.getRestartcomm())) - { - message = "确定要自动构建时,构建项目名不能为空!"; - } - else - { - if (!tj.getRestartcomm().contains(";")) - { - message = "构建项目名分隔格式不对!"; - } - } - if (!StrLib.isEmpty(message)) - { - model.addAttribute("message", message); - return "/jsp/task/task_update"; - } - - } - else - { - tj.setRestartcomm(""); - } - - - if("1".equals(tj.getIsSendMail())){ - tj.setEmailer(tj.getEmailer()); - }else{ - tj.setEmailer(jobload.getEmailer()); - } - - if("1".equals(tj.getIsbuilding())){ - tj.setBuildname(tj.getBuildname()); - }else{ - tj.setBuildname(jobload.getBuildname()); - } - - if("1".equals(tj.getIsrestart())){ - tj.setRestartcomm(tj.getRestartcomm()); - }else{ - tj.setRestartcomm(jobload.getRestartcomm()); - } - - - String startDate = DateLib.today("yyyy-MM-dd"); - String startTime = DateLib.today("HH:mm:ss"); - tj.setStartDate(startDate); - tj.setStartTime(startTime); - - long runtime = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse( - tj.getStartDate() + " " + tj.getStartTime()).getTime(); - tj.setRunTime(new Timestamp(runtime)); - - String startTimestr = tj.getStartTimestr(); - tj.setStartTimestr(startTimestr); - - if(tj.getProjecttype()==0){ - String projectname="0"; - for(int i=0;i tclist=tcservice.getClientListForProid(jobload.getProjectid()); - for(TestClient tc:tclist){ - if(tc.getStatus()==0){ - tc.setName("【"+tc.getName()+"】"+tc.getClientip()+" 【客户端状态正常】"); - }else if(tc.getStatus()==1){ - tc.setName("【"+tc.getName()+"】"+tc.getClientip()+" 【客户端状态异常】"); - }else{ - tc.setName("【"+tc.getName()+"】"+tc.getClientip()+" 【客户端状态未知】"); - } - } - model.addAttribute("tclist", tclist); - ArrayList pathlist=new ArrayList(); - TestClient tc=tcservice.getClient(jobload.getClientip()); - - String clientpath = tc.getClientpath(); - String temp[] = clientpath.split(";", -1); - for (String pathtemp : temp) { - if (!StrLib.isEmpty(pathtemp)) { - pathlist.add(pathtemp); - } - } - - model.addAttribute("tcpathlist", pathlist); - if(jobload.getProjecttype()==0){ - ProjectPlan projectplan=new ProjectPlan(); - projectplan.setProjectid(jobload.getProjectid()); - List listplan = projectplanservice.findByPage(projectplan, 0, 1000); - model.addAttribute("planlist", listplan); - } - model.addAttribute("taskjob", jobload); - return "/jsp/task/task_update"; - } - - /** - * 删除调度 - * - * @param tj - * @param br - * @param model - * @param req - * @param rsp - * @return - * @throws Exception - * @Description: - */ - @RequestMapping(value = "/delete.do") - public void delete(HttpServletRequest req, HttpServletResponse rsp) throws Exception { - try { - rsp.setContentType("text/html;charset=utf-8"); - req.setCharacterEncoding("utf-8"); - PrintWriter pw = rsp.getWriter(); - JSONObject json = new JSONObject(); - if (!UserLoginController.permissionboolean(req, "tast_2")) { - json.put("status", "fail"); - json.put("ms", "删除调度失败,权限不足,请联系管理员!"); - } else { - int id = Integer.valueOf(req.getParameter("jobid")); - TestJobs tj = testJobsService.get(id); - if(!UserLoginController.oppidboolean(req, tj.getProjectid())){ - json.put("status", "fail"); - json.put("ms", "删除调度失败,项目权限不足,请联系管理员!"); - }else{ - List idlist = tastExcuteService.getidlist(id); - try - { - int tastid = 0; - for(int i=0;i pathlist=new ArrayList(); - String path=tc.getClientpath(); - String temp[]=path.split(";",-1); - for(String pathtemp:temp){ - if(!StrLib.isEmpty(pathtemp)){ - pathlist.add(pathtemp); - } - } - model.addAttribute("clientip", clientip); - model.addAttribute("pathlist", pathlist); - return "/jsp/task/file_upload"; - } - - /** - * 上传 - * - * @param request - * @param response - * @return - * @throws Exception - */ - @RequestMapping(value = "/upload.do") - public String upload(@RequestParam(value = "file", required = false) MultipartFile file, Model model, - HttpServletRequest request, HttpServletResponse response) throws Exception - { - if(null==file.getOriginalFilename()||file.getOriginalFilename().length()<4){ - String message = "请选择一个文件后,再进行上传操作!"; - model.addAttribute("message", message); - return "/jsp/task/file_upload"; - } - String fileName = file.getOriginalFilename().substring(file.getOriginalFilename().length() - 4, - file.getOriginalFilename().length()); - String clientip = request.getParameter("clientip"); - String clientpath = request.getParameter("clientpath"); - if (!fileName.toLowerCase().equals(".jar")) - { - String message = "只能上传.jar的文件!"; - model.addAttribute("message", message); - return "/jsp/task/file_upload"; - } - // 文件目录 - String path = System.getProperty("user.dir")+"\\"; - String pathName = path + file.getOriginalFilename(); - System.out.println(pathName); - File targetFile = new File(pathName); - if (targetFile.exists()){ - targetFile.delete(); - } - else - { - targetFile.mkdir(); - } - // 保存 - try - { - file.transferTo(targetFile); - } - catch (Exception e) - { - e.printStackTrace(); - model.addAttribute("message", e.getMessage()); - model.addAttribute("url", "/testJobs/load.do"); - return "error"; - } - - byte[] b = null; - String result="获取日志远程链接失败!"; - try { - b = new byte[(int) targetFile.length()]; - BufferedInputStream is = new BufferedInputStream(new FileInputStream(targetFile)); - is.read(b); - try{ - //调用远程对象,注意RMI路径与接口必须与服务器配置一致 - RunService service=(RunService)Naming.lookup("rmi://"+clientip+":6633/RunService"); - result=service.uploadjar(b, file.getOriginalFilename(),clientpath); - } catch (Exception e) { - e.printStackTrace(); - } - is.close(); - //删除服务器上的文件 - if (targetFile.exists()){ - targetFile.delete(); - } - operationlogservice.add(request, "TESTJOBS", 0, - 99,"项目jar包被上传,包名:"+file.getOriginalFilename()); - } catch (FileNotFoundException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - result = "服务端未找到正确文件路径!"; - } catch (IOException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - result = "服务端IOException!"; - } - - model.addAttribute("url", "/testJobs/load.do"); - model.addAttribute("message", result); - return "success"; - } - -} +package luckyweb.seagull.spring.mvc; + +import java.io.BufferedInputStream; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.IOException; +import java.io.PrintWriter; +import java.rmi.Naming; +import java.sql.SQLException; +import java.sql.Timestamp; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.List; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import javax.validation.Valid; + +import org.apache.log4j.Logger; +import org.springframework.stereotype.Controller; +import org.springframework.ui.Model; +import org.springframework.validation.BindingResult; +import org.springframework.web.bind.annotation.ModelAttribute; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.multipart.MultipartFile; + +import luckyweb.seagull.comm.QueueListener; +import luckyweb.seagull.quartz.QuartzJob; +import luckyweb.seagull.quartz.QuartzManager; +import luckyweb.seagull.quartz.QuratzJobDataMgr; +import luckyweb.seagull.spring.entity.ProjectPlan; +import luckyweb.seagull.spring.entity.SectorProjects; +import luckyweb.seagull.spring.entity.TestClient; +import luckyweb.seagull.spring.entity.TestJobs; +import luckyweb.seagull.spring.entity.UserInfo; +import luckyweb.seagull.spring.service.CaseDetailService; +import luckyweb.seagull.spring.service.LogDetailService; +import luckyweb.seagull.spring.service.OperationLogService; +import luckyweb.seagull.spring.service.ProjectPlanService; +import luckyweb.seagull.spring.service.SectorProjectsService; +import luckyweb.seagull.spring.service.TestClientService; +import luckyweb.seagull.spring.service.TestJobsService; +import luckyweb.seagull.spring.service.TestTastExcuteService; +import luckyweb.seagull.spring.service.UserInfoService; +import luckyweb.seagull.util.DateLib; +import luckyweb.seagull.util.DateUtil; +import luckyweb.seagull.util.StrLib; +import net.sf.json.JSONObject; +import rmi.service.RunService; + +@Controller +@RequestMapping("/testJobs") +public class TestJobsController +{ + private static final Logger log = Logger.getLogger(TestJobsController.class); + + + @Resource(name = "testJobsService") + private TestJobsService testJobsService; + + @Resource(name = "tastExcuteService") + private TestTastExcuteService tastExcuteService; + + @Resource(name = "casedetailService") + private CaseDetailService casedetailService; + + @Resource(name = "projectPlanService") + private ProjectPlanService projectplanservice; + + @Resource(name = "logdetailService") + private LogDetailService logdetailService; + + @Resource(name = "operationlogService") + private OperationLogService operationlogservice; + + @Resource(name = "userinfoService") + private UserInfoService userinfoservice; + + @Resource(name = "sectorprojectsService") + private SectorProjectsService sectorprojectsService; + + @Resource(name = "testclientService") + private TestClientService tcservice; + + /** + * + * + * @param tj + * @param model + * @return + * @throws Exception + */ + @RequestMapping(value = "/load.do") + public String load(HttpServletRequest req, Model model) throws Exception { + + try { + int projectid = 99; + if (null != req.getSession().getAttribute("usercode") + && null != req.getSession().getAttribute("username")) { + String usercode = req.getSession().getAttribute("usercode").toString(); + UserInfo userinfo = userinfoservice.getUseinfo(usercode); + projectid = userinfo.getProjectid(); + } + + List prolist=sectorprojectsService.getAllProject(); + for(int i=0;i iplist = tcservice.getClientList(); + for(TestClient tc:iplist){ + if(tc.getStatus()==0){ + tc.setName("【"+tc.getName()+"】"+tc.getClientip()+" 【客户端状态正常】"); + }else if(tc.getStatus()==1){ + tc.setName("【"+tc.getName()+"】"+tc.getClientip()+" 【客户端状态异常】"); + }else{ + tc.setName("【"+tc.getName()+"】"+tc.getClientip()+" 【客户端状态未知】"); + } + } + model.addAttribute("iplist", iplist); + + model.addAttribute("projects", prolist); + model.addAttribute("projectid", projectid); + model.addAttribute("date", DateLib.today("yyyy-MM-dd")); + } catch (Exception e) { + e.printStackTrace(); + model.addAttribute("message", e.getMessage()); + model.addAttribute("url", "/testJobs/load.do"); + return "error"; + } + return "/jsp/task/job_list"; + } + + @SuppressWarnings({ "unchecked" }) + @RequestMapping(value = "/list.do") + private void ajaxGetSellRecord(Integer limit, Integer offset, HttpServletRequest request, + HttpServletResponse response) throws Exception { + response.setCharacterEncoding("utf-8"); + PrintWriter pw = response.getWriter(); + String search = request.getParameter("search"); + String projectid = request.getParameter("projectid"); + TestJobs tj= new TestJobs(); + if (null == offset && null == limit) { + offset = 0; + } + if (null == limit || limit == 0) { + limit = 10; + } + // 得到客户端传递的查询参数 + if (!StrLib.isEmpty(search)) { + tj.setTaskName(search); + tj.setPlanproj(search); + } + // 得到客户端传递的查询参数 + if (!StrLib.isEmpty(projectid)) { + tj.setProjectid(Integer.valueOf(projectid)); + } + + List jobs = testJobsService.findByPage(tj, offset, limit); + List iplist = tcservice.getClientList(); + for(TestJobs tjs:jobs){ + for(TestClient tc:iplist){ + if(tc.getClientip().equals(tjs.getClientip())){ + tjs.setClientip(tjs.getClientip()+"**"+tc.getStatus()); + } + } + } + // 转换成json字符串 + String RecordJson = StrLib.listToJson(jobs); + // 得到总记录数 + int total = testJobsService.findRows(tj); + // 需要返回的数据有总记录数和行数据 + JSONObject json = new JSONObject(); + json.put("total", total); + json.put("rows", RecordJson); + pw.print(json.toString()); + } + + /** + * 新增Job + * @param tj + * @param br + * @param model + * @param req + * @param rsp + * @return + * @throws Exception + * @Description: + */ + @RequestMapping(value = "/add.do") + public String add(@Valid @ModelAttribute("taskjob") TestJobs tj, BindingResult br, Model model, + HttpServletRequest req, HttpServletResponse rsp) throws Exception + { + try + { + rsp.setContentType("text/html;charset=utf-8"); + req.setCharacterEncoding("utf-8"); + + if(!UserLoginController.permissionboolean(req, "tast_1")){ + model.addAttribute("taskjob", new TestJobs()); + model.addAttribute("url", "/testJobs/load.do"); + model.addAttribute("message", "当前用户无权限添加计划任务,请联系管理员!"); + return "success"; + } + + List qaprolist=QueueListener.qa_projlist; + List prolist=QueueListener.projlist; + String retVal = "/jsp/task/task_add"; + if (req.getMethod().equals("POST")) + { + + if (br.hasErrors()) + { + return retVal; + } + + String message = ""; + if (tj.getProjecttype()==1&&(StrLib.isEmpty(tj.getPlanproj())||"0".equals(tj.getPlanproj()))) + { + message = "项目名必选!"; + model.addAttribute("message", message); + return retVal; + }else if(tj.getProjecttype()==1){ + if(!UserLoginController.oppidboolean(req, Integer.valueOf(tj.getPlanproj()))){ + model.addAttribute("message", "当前用户无权限添加当前项目的调度任务,请联系管理员!"); + return retVal; + } + } + + if (tj.getProjecttype()==0&&tj.getProjectid()==0) + { + message = "项目名必选!"; + model.addAttribute("message", message); + return retVal; + }else if(tj.getProjecttype()==0){ + if(!UserLoginController.oppidboolean(req, tj.getProjectid())){ + model.addAttribute("message", "当前用户无权限添加当前项目的调度任务,请联系管理员!"); + return retVal; + } + } + + if (StrLib.isEmpty(tj.getClientip())||"0".equals(tj.getClientip())) { + message = "客户端IP不能为空!"; + model.addAttribute("message", message); + return retVal; + } + + if (StrLib.isEmpty(tj.getClientpath())||"0".equals(tj.getClientpath())) { + message = "客户端驱动桩路径不能为空!"; + model.addAttribute("message", message); + return retVal; + } + + if (StrLib.isEmpty(tj.getTaskName())||"0".equals(tj.getTaskName())) + { + message = "计划名称不能为空!"; + model.addAttribute("message", message); + return retVal; + } + + if (tj.getThreadCount() < 1 || tj.getThreadCount() > 20) + { + message = "线程数在1-20之间"; + model.addAttribute("message", message); + return retVal; + } + + if (tj.getTimeout() < 1 || tj.getTimeout() > 120) + { + message = "超时时间必须在1-120分钟之间"; + model.addAttribute("message", message); + return retVal; + } + + String startDate = DateLib.today("yyyy-MM-dd"); + String startTime = DateLib.today("HH:mm:ss"); + tj.setStartDate(startDate); + tj.setStartTime(startTime); + + tj.setEndTimestr(null); + tj.setState("1"); + long runtime = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse( + tj.getStartDate() + " " + tj.getStartTime()).getTime(); + tj.setRunTime(new Timestamp(runtime)); + tj.setCreateTime(DateUtil.now()); + //邮件处理 + if (tj.getIsSendMail().equals("1")) + { + message = ""; + if (StrLib.isEmpty(tj.getEmailer())) + { + message = "确定要发送邮件时,收件人不能为空!"; + } + else + { + if (!tj.getEmailer().contains(";")) + { + message = "收件人分隔格式不对!"; + } + if (!tj.getEmailer().contains("@")) + {// 未用正则表达式 + message = "收件人邮箱格式不对!"; + } + } + if (!StrLib.isEmpty(message)) + { + model.addAttribute("message", message); + return "/jsp/task/task_add"; + } + + } + else + { + tj.setEmailer(""); + } + + //构建方式处理 + if (tj.getIsbuilding().equals("1")) + { + message = ""; + if (StrLib.isEmpty(tj.getBuildname())) + { + message = "确定要自动构建时,构建项目名不能为空!"; + } + else + { + if (!tj.getBuildname().contains(";")) + { + message = "构建项目名分隔格式不对!"; + } + } + if (!StrLib.isEmpty(message)) + { + model.addAttribute("message", message); + return "/jsp/task/task_add"; + } + + } + else + { + tj.setBuildname(""); + } + + //重启TOMCAT处理 + if (tj.getIsrestart().equals("1")) + { + message = ""; + if (StrLib.isEmpty(tj.getRestartcomm())) + { + message = "确定要自动重启时,重启脚本行不能为空!"; + } + else + { + if (!tj.getRestartcomm().contains(";")) + { + message = "构建项目名分隔格式不对!"; + } + } + if (!StrLib.isEmpty(message)) + { + model.addAttribute("message", message); + return "/jsp/task/task_add"; + } + + } + else + { + tj.setRestartcomm(""); + } + + if(tj.getProjecttype()==0){ + String projectname="0"; + for(int i=0;i qaprolist=QueueListener.qa_projlist; + List prolist=QueueListener.projlist; + + model.addAttribute("projects", prolist); + model.addAttribute("sysprojects", qaprolist); + if(!UserLoginController.permissionboolean(req, "tast_3")){ + model.addAttribute("taskjob", new TestJobs()); + model.addAttribute("url", "/testJobs/load.do"); + model.addAttribute("message", "当前用户无权限修改计划任务,请联系管理员!"); + return "success"; + } + + TestJobs jobload = testJobsService.load(id); + if (req.getMethod().equals("POST")) + { + try + { + if (br.hasErrors()) + { + return "/jsp/task/task_update"; + } + String message = ""; + + if (StrLib.isEmpty(tj.getClientip())||"0".equals(tj.getClientip())) { + message = "客户端IP不能为空!"; + model.addAttribute("message", message); + return "/jsp/task/task_add"; + } + + if (StrLib.isEmpty(tj.getClientpath())||"0".equals(tj.getClientpath())) { + message = "客户端驱动桩路径不能为空!"; + model.addAttribute("message", message); + return "/jsp/task/task_add"; + } + + if (StrLib.isEmpty(tj.getTaskName())||"0".equals(tj.getTaskName())) + { + message = "计划名称不能为空!"; + model.addAttribute("message", message); + return "/jsp/task/task_update"; + } + + if (tj.getProjecttype()==1&&(StrLib.isEmpty(tj.getPlanproj())||"0".equals(tj.getPlanproj()))) + { + message = "项目名必选!"; + model.addAttribute("message", message); + return "/jsp/task/task_update"; + }else if(tj.getProjecttype()==1){ + if(!UserLoginController.oppidboolean(req, Integer.valueOf(tj.getPlanproj()))){ + model.addAttribute("message", "当前用户无权限修改当前项目的调度任务,请联系管理员!"); + return "/jsp/task/task_update"; + } + } + + if (tj.getProjecttype()==0&&tj.getProjectid()==0) + { + message = "项目名必选!"; + model.addAttribute("message", message); + return "/jsp/task/task_update"; + }else if(tj.getProjecttype()==0){ + if(!UserLoginController.oppidboolean(req, tj.getProjectid())){ + model.addAttribute("message", "当前用户无权限修改当前项目的调度任务,请联系管理员!"); + return "/jsp/task/task_update"; + } + } + + if (tj.getThreadCount() < 1 || tj.getThreadCount() > 20) + { + message = "线程数在1-20之间"; + model.addAttribute("message", message); + return "/jsp/task/task_update"; + } + + if (tj.getTimeout() < 1 || tj.getTimeout() > 120) + { + message = "超时时间必须在1-120分钟之间"; + model.addAttribute("message", message); + return "/jsp/task/task_update"; + } + + if (tj.getIsSendMail().equals("1")) + { + message = ""; + if (StrLib.isEmpty(tj.getEmailer())) + { + message = "确定要发送邮件时,收件人不能为空!"; + } + else + { + if (!tj.getEmailer().contains(";")) + { + message = "收件人分隔格式不对!"; + } + if (!tj.getEmailer().contains("@")) + {// 未用正则表达式 + message = "收件人邮箱格式不对!"; + } + } + if (!StrLib.isEmpty(message)) + { + model.addAttribute("message", message); + return "/jsp/task/task_update"; + } + + } + else + { + tj.setEmailer(""); + } + + //构建方式处理 + if (tj.getIsbuilding().equals("1")) + { + message = ""; + if (StrLib.isEmpty(tj.getBuildname())) + { + message = "确定要自动构建时,构建项目名不能为空!"; + } + else + { + if (!tj.getBuildname().contains(";")) + { + message = "构建项目名分隔格式不对!"; + } + } + if (!StrLib.isEmpty(message)) + { + model.addAttribute("message", message); + return "/jsp/task/task_update"; + } + + } + else + { + tj.setBuildname(""); + } + + + //重启TOMCAT处理 + if (tj.getIsrestart().equals("1")) + { + message = ""; + if (StrLib.isEmpty(tj.getRestartcomm())) + { + message = "确定要自动构建时,构建项目名不能为空!"; + } + else + { + if (!tj.getRestartcomm().contains(";")) + { + message = "构建项目名分隔格式不对!"; + } + } + if (!StrLib.isEmpty(message)) + { + model.addAttribute("message", message); + return "/jsp/task/task_update"; + } + + } + else + { + tj.setRestartcomm(""); + } + + + if("1".equals(tj.getIsSendMail())){ + tj.setEmailer(tj.getEmailer()); + }else{ + tj.setEmailer(jobload.getEmailer()); + } + + if("1".equals(tj.getIsbuilding())){ + tj.setBuildname(tj.getBuildname()); + }else{ + tj.setBuildname(jobload.getBuildname()); + } + + if("1".equals(tj.getIsrestart())){ + tj.setRestartcomm(tj.getRestartcomm()); + }else{ + tj.setRestartcomm(jobload.getRestartcomm()); + } + + + String startDate = DateLib.today("yyyy-MM-dd"); + String startTime = DateLib.today("HH:mm:ss"); + tj.setStartDate(startDate); + tj.setStartTime(startTime); + + long runtime = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse( + tj.getStartDate() + " " + tj.getStartTime()).getTime(); + tj.setRunTime(new Timestamp(runtime)); + + String startTimestr = tj.getStartTimestr(); + tj.setStartTimestr(startTimestr); + + if(tj.getProjecttype()==0){ + String projectname="0"; + for(int i=0;i tclist=tcservice.getClientListForProid(jobload.getProjectid()); + for(TestClient tc:tclist){ + if(tc.getStatus()==0){ + tc.setName("【"+tc.getName()+"】"+tc.getClientip()+" 【客户端状态正常】"); + }else if(tc.getStatus()==1){ + tc.setName("【"+tc.getName()+"】"+tc.getClientip()+" 【客户端状态异常】"); + }else{ + tc.setName("【"+tc.getName()+"】"+tc.getClientip()+" 【客户端状态未知】"); + } + } + model.addAttribute("tclist", tclist); + ArrayList pathlist=new ArrayList(); + TestClient tc=tcservice.getClient(jobload.getClientip()); + + String clientpath = tc.getClientpath(); + String temp[] = clientpath.split(";", -1); + for (String pathtemp : temp) { + if (!StrLib.isEmpty(pathtemp)) { + pathlist.add(pathtemp); + } + } + + model.addAttribute("tcpathlist", pathlist); + if(jobload.getProjecttype()==0){ + ProjectPlan projectplan=new ProjectPlan(); + projectplan.setProjectid(jobload.getProjectid()); + List listplan = projectplanservice.findByPage(projectplan, 0, 1000); + model.addAttribute("planlist", listplan); + } + model.addAttribute("taskjob", jobload); + return "/jsp/task/task_update"; + } + + /** + * 删除调度 + * + * @param tj + * @param br + * @param model + * @param req + * @param rsp + * @return + * @throws Exception + * @Description: + */ + @RequestMapping(value = "/delete.do") + public void delete(HttpServletRequest req, HttpServletResponse rsp) throws Exception { + try { + rsp.setContentType("text/html;charset=utf-8"); + req.setCharacterEncoding("utf-8"); + PrintWriter pw = rsp.getWriter(); + JSONObject json = new JSONObject(); + if (!UserLoginController.permissionboolean(req, "tast_2")) { + json.put("status", "fail"); + json.put("ms", "删除调度失败,权限不足,请联系管理员!"); + } else { + int id = Integer.valueOf(req.getParameter("jobid")); + TestJobs tj = testJobsService.get(id); + if(!UserLoginController.oppidboolean(req, tj.getProjectid())){ + json.put("status", "fail"); + json.put("ms", "删除调度失败,项目权限不足,请联系管理员!"); + }else{ + List idlist = tastExcuteService.getidlist(id); + try + { + int tastid = 0; + for(int i=0;i pathlist=new ArrayList(); + String path=tc.getClientpath(); + String temp[]=path.split(";",-1); + for(String pathtemp:temp){ + if(!StrLib.isEmpty(pathtemp)){ + pathlist.add(pathtemp); + } + } + model.addAttribute("clientip", clientip); + model.addAttribute("pathlist", pathlist); + return "/jsp/task/file_upload"; + } + + /** + * 上传 + * + * @param request + * @param response + * @return + * @throws Exception + */ + @RequestMapping(value = "/upload.do") + public String upload(@RequestParam(value = "file", required = false) MultipartFile file, Model model, + HttpServletRequest request, HttpServletResponse response) throws Exception + { + if(null==file.getOriginalFilename()||file.getOriginalFilename().length()<4){ + String message = "请选择一个文件后,再进行上传操作!"; + model.addAttribute("message", message); + return "/jsp/task/file_upload"; + } + String fileName = file.getOriginalFilename().substring(file.getOriginalFilename().length() - 4, + file.getOriginalFilename().length()); + String clientip = request.getParameter("clientip"); + String clientpath = request.getParameter("clientpath"); + if (!fileName.toLowerCase().equals(".jar")) + { + String message = "只能上传.jar的文件!"; + model.addAttribute("message", message); + return "/jsp/task/file_upload"; + } + // 文件目录 + String path = System.getProperty("user.dir")+"\\"; + String pathName = path + file.getOriginalFilename(); + System.out.println(pathName); + File targetFile = new File(pathName); + if (targetFile.exists()){ + targetFile.delete(); + } + else + { + targetFile.mkdir(); + } + // 保存 + try + { + file.transferTo(targetFile); + } + catch (Exception e) + { + e.printStackTrace(); + model.addAttribute("message", e.getMessage()); + model.addAttribute("url", "/testJobs/load.do"); + return "error"; + } + + byte[] b = null; + String result="获取日志远程链接失败!"; + try { + b = new byte[(int) targetFile.length()]; + BufferedInputStream is = new BufferedInputStream(new FileInputStream(targetFile)); + is.read(b); + try{ + //调用远程对象,注意RMI路径与接口必须与服务器配置一致 + RunService service=(RunService)Naming.lookup("rmi://"+clientip+":6633/RunService"); + result=service.uploadjar(b, file.getOriginalFilename(),clientpath); + } catch (Exception e) { + e.printStackTrace(); + } + is.close(); + //删除服务器上的文件 + if (targetFile.exists()){ + targetFile.delete(); + } + operationlogservice.add(request, "TESTJOBS", 0, + 99,"项目jar包被上传,包名:"+file.getOriginalFilename()); + } catch (FileNotFoundException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + result = "服务端未找到正确文件路径!"; + } catch (IOException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + result = "服务端IOException!"; + } + + model.addAttribute("url", "/testJobs/load.do"); + model.addAttribute("message", result); + return "success"; + } + +} diff --git a/src/main/java/luckyweb/seagull/spring/mvc/UserInfoController.java b/src/main/java/luckyweb/seagull/spring/mvc/UserInfoController.java index f999372..03efc68 100644 --- a/src/main/java/luckyweb/seagull/spring/mvc/UserInfoController.java +++ b/src/main/java/luckyweb/seagull/spring/mvc/UserInfoController.java @@ -1,920 +1,920 @@ -package luckyweb.seagull.spring.mvc; - -import java.io.PrintWriter; -import java.util.ArrayList; -import java.util.List; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import javax.validation.Valid; - -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.validation.BindingResult; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestMethod; - -import luckyweb.seagull.comm.QueueListener; -import luckyweb.seagull.spring.entity.SecondarySector; -import luckyweb.seagull.spring.entity.SectorProjects; -import luckyweb.seagull.spring.entity.UserAuthority; -import luckyweb.seagull.spring.entity.UserInfo; -import luckyweb.seagull.spring.entity.UserRole; -import luckyweb.seagull.spring.service.OperationLogService; -import luckyweb.seagull.spring.service.SecondarySectorService; -import luckyweb.seagull.spring.service.SectorProjectsService; -import luckyweb.seagull.spring.service.UserAuthorityService; -import luckyweb.seagull.spring.service.UserInfoService; -import luckyweb.seagull.spring.service.UserRoleService; -import luckyweb.seagull.util.Endecrypt; -import luckyweb.seagull.util.StrLib; -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; - - -@Controller -@RequestMapping("/userInfo") -public class UserInfoController { - - @Resource(name = "userinfoService") - private UserInfoService userinfoservice; - - @Resource(name = "userroleService") - private UserRoleService userroleservice; - - @Resource(name = "userauthorityService") - private UserAuthorityService userauthorityservice; - - @Resource(name = "secondarysectorService") - private SecondarySectorService secondarysectorService; - - @Resource(name = "sectorprojectsService") - private SectorProjectsService sectorprojectsService; - - @Resource(name = "operationlogService") - private OperationLogService operationlogservice; - - /** - * - * - * @param tj - * @param model - * @return - * @throws Exception - */ - @RequestMapping(value = "/load.do") - public String load(HttpServletRequest req, Model model) throws Exception { - return "/jsp/user/user"; - } - - @SuppressWarnings({ "unchecked" }) - @RequestMapping(value = "/list.do") - private void ajaxGetSellRecord(Integer limit, Integer offset, HttpServletRequest request, - HttpServletResponse response) throws Exception { - response.setCharacterEncoding("utf-8"); - PrintWriter pw = response.getWriter(); - String search = request.getParameter("search"); - UserInfo userinfo= new UserInfo(); - if (null == offset && null == limit) { - offset = 0; - } - if (null == limit || limit == 0) { - limit = 10; - } - // 得到客户端传递的查询参数 - if (!StrLib.isEmpty(search)) { - userinfo.setUsercode(search); - userinfo.setUsername(search); - } - List roleMap = userroleservice.listall(); - List prolist = QueueListener.qa_projlist; - List users = userinfoservice.findByPage(userinfo, offset, limit); - for(int i=0;i0){ - message = "用户名已经存在,请重新输入!"; - model.addAttribute("userrole", userroleservice.listall()); - model.addAttribute("secondarysector", secondarysectorService.listall()); - model.addAttribute("projects", QueueListener.qa_projlist); - model.addAttribute("message", message); - return retVal; - } - - Endecrypt endecrypt = new Endecrypt(); - String cryptpwd = endecrypt.get3DESEncrypt(temp[0]); - userinfo.setPassword(cryptpwd); - userinfo.setRole(userinfo.getRole().replaceAll(",", ";")); - - SecondarySector ss = secondarysectorService.load(userinfo.getSectorid()); - userinfo.setSectorid(ss.getSectorid()); - userinfo.setSecondarySector(ss); - - int userid = userinfoservice.add(userinfo); - - operationlogservice.add(req, "USERINFO", userid, - 99,"用户添加成功!用户名:"+userinfo.getUsercode()); - - model.addAttribute("message", "创建用户成功"); - model.addAttribute("url", "/userInfo/load.do"); - return "success"; - - } - model.addAttribute("userrole", userroleservice.listall()); - model.addAttribute("secondarysector", secondarysectorService.listall()); - model.addAttribute("projects", QueueListener.qa_projlist); - userinfo.setProjectid(99); - model.addAttribute("userinfo", userinfo); - return retVal; - - } - catch (Exception e) - { - model.addAttribute("message", e.getMessage()); - model.addAttribute("url", "/userInfo/load.do"); - return "error"; - } - - } - - /** - * 删除调度 - * - * @param tj - * @param br - * @param model - * @param req - * @param rsp - * @return - * @throws Exception - * @Description: - */ - @RequestMapping(value = "/delete.do") - public void delete(HttpServletRequest req, HttpServletResponse rsp) throws Exception { - try { - rsp.setContentType("text/html;charset=utf-8"); - req.setCharacterEncoding("utf-8"); - PrintWriter pw = rsp.getWriter(); - JSONObject json = new JSONObject(); - if (!UserLoginController.permissionboolean(req, "ui_2")) { - json.put("status", "fail"); - json.put("ms", "删除用户失败,权限不足,请联系管理员!"); - } else { - int id = Integer.valueOf(req.getParameter("userid")); - UserInfo userinfo = userinfoservice.load(id); - try - { - userinfoservice.delete(id); - - operationlogservice.add(req, "USERINFO", id, - 99,"用户信息删除成功!用户名:"+userinfo.getUsercode()); - - json.put("status", "success"); - json.put("ms", "删除用户成功!"); - } - catch (Exception e) - { - json.put("status", "fail"); - json.put("ms", "删除用户过程中失败!"); - } - } - pw.print(json.toString()); - - } catch (Exception e) { - e.printStackTrace(); - } - - } - - /** - * - * 根据id更新用户资料 - * @param id - * @param model - * @return - * @throws Exception - */ - @RequestMapping(value = "/update.do") - public String update(@Valid @ModelAttribute("userinfo") UserInfo userinfo, BindingResult br, - Model model, HttpServletRequest req) throws Exception - { - req.setCharacterEncoding("utf-8"); - int id = Integer.valueOf(req.getParameter("id")); - - if(!UserLoginController.permissionboolean(req, "ui_3")){ - model.addAttribute("userinfo", new UserInfo()); - model.addAttribute("url", "/userInfo/load.do"); - model.addAttribute("message", "当前用户无权限修改用户信息,请联系管理员!"); - return "success"; - } - Endecrypt endecrypt = new Endecrypt(); - try{ - String retVal = "/jsp/user/user_update"; - if (req.getMethod().equals("POST")) - { - if (br.hasErrors()) - { - return retVal; - } - String message = ""; - if(StrLib.isEmpty(userinfo.getUsername())){ - message = "真实姓名不能为空!"; - model.addAttribute("userrole", userroleservice.listall()); - model.addAttribute("secondarysector", secondarysectorService.listall()); - model.addAttribute("projects", QueueListener.qa_projlist); - model.addAttribute("message", message); - return retVal; - } - if(StrLib.isEmpty(userinfo.getUsercode())){ - message = "用户名不能为空!"; - model.addAttribute("userrole", userroleservice.listall()); - model.addAttribute("secondarysector", secondarysectorService.listall()); - model.addAttribute("projects", QueueListener.qa_projlist); - model.addAttribute("message", message); - return retVal; - } - if(userinfo.getSectorid()==0){ - message = "请至少选择一个所属部门!"; - model.addAttribute("userrole", userroleservice.listall()); - model.addAttribute("secondarysector", secondarysectorService.listall()); - model.addAttribute("projects", QueueListener.qa_projlist); - model.addAttribute("message", message); - return retVal; - } - if(StrLib.isEmpty(userinfo.getPassword())){ - message = "密码不能为空!"; - model.addAttribute("userrole", userroleservice.listall()); - model.addAttribute("secondarysector", secondarysectorService.listall()); - model.addAttribute("projects", QueueListener.qa_projlist); - model.addAttribute("message", message); - return retVal; - } - String temp[] = userinfo.getPassword().split(",",-1); - if(!temp[0].equals(temp[1])){ - message = "两次输入的密码不一致,请确认!"; - model.addAttribute("userrole", userroleservice.listall()); - model.addAttribute("secondarysector", secondarysectorService.listall()); - model.addAttribute("projects", QueueListener.qa_projlist); - model.addAttribute("message", message); - return retVal; - } - - String cryptpwd = endecrypt.get3DESEncrypt(temp[0]); - userinfo.setPassword(cryptpwd); - userinfo.setRole(userinfo.getRole().replaceAll(",", ";")); - - SecondarySector ss = secondarysectorService.load(userinfo.getSectorid()); - userinfo.setSectorid(ss.getSectorid()); - userinfo.setSecondarySector(ss); - - userinfoservice.modify(userinfo); - - operationlogservice.add(req, "USERINFO", id, - 99,"用户信息修改成功!用户名"+userinfo.getUsercode()); - - - model.addAttribute("message", "修改用户信息成功"); - model.addAttribute("url", "/userInfo/load.do"); - return "success"; - - } - userinfo = userinfoservice.load(id); - userinfo.setPassword(endecrypt.get3DESDecrypt(userinfo.getPassword())); - userinfo.setSectorid(userinfo.getSecondarySector().getSectorid()); - userinfo.setRole(userinfo.getRole().replaceAll(";", ",")); - - model.addAttribute("userrole", userroleservice.listall()); - model.addAttribute("secondarysector", secondarysectorService.listall()); - model.addAttribute("projects", QueueListener.qa_projlist); - - model.addAttribute("userinfo", userinfo); - return "/jsp/user/user_update"; - - } - catch (Exception e){ - model.addAttribute("message", e.getMessage()); - model.addAttribute("url", "/userInfo/load.do"); - return "error"; - } - } - - /** - * - * 用户修改密码 - * @param id - * @param model - * @return - * @throws Exception - */ - @RequestMapping(value = "/updatepw.do") - public String updatepw(@Valid @ModelAttribute("userinfo") UserInfo userinfo, BindingResult br, - Model model, HttpServletRequest req) throws Exception - { - req.setCharacterEncoding("utf-8"); - String usercode=""; - if(req.getSession().getAttribute("usercode")!=null&&req.getSession().getAttribute("username")!=null){ - usercode = req.getSession().getAttribute("usercode").toString(); - }else{ - model.addAttribute("message", "获取用户信息失败!"); - model.addAttribute("url", "../index.jsp"); - return "error"; - } - - Endecrypt endecrypt = new Endecrypt(); - try{ - String retVal = "/jsp/user/user_pswupdate"; - if (req.getMethod().equals("POST")) - { - if (br.hasErrors()) - { - return retVal; - } - String message = ""; - if(StrLib.isEmpty(userinfo.getOldpassword())){ - message = "旧密码不能为空!"; - model.addAttribute("message", message); - return retVal; - } - if(StrLib.isEmpty(userinfo.getPassword())){ - message = "新密码不能为空!"; - model.addAttribute("message", message); - return retVal; - } - String temp[] = userinfo.getPassword().split(",",-1); - if(!temp[0].equals(temp[1])){ - message = "新密码两次输入的不一致,请确认!"; - model.addAttribute("message", message); - return retVal; - } - - UserInfo ui = userinfoservice.getUseinfo(usercode); - String oldcryptpwd = endecrypt.get3DESEncrypt(userinfo.getOldpassword()); - if(!ui.getPassword().equals(oldcryptpwd)){ - message = "您输入的旧密码不对,请确认!"; - model.addAttribute("message", message); - return retVal; - } - - String newcryptpwd = endecrypt.get3DESEncrypt(temp[0]); - ui.setPassword(newcryptpwd); - - userinfoservice.modify(ui); - - model.addAttribute("message", "修改密码成功,请重新登录!"); - //清空用户状态,重新登录 - req.getSession().setAttribute("usercode", null); - req.getSession().setAttribute("username", null); - req.getSession().setAttribute("permission", null); - model.addAttribute("url", "/progressus/signin.jsp"); - return "success"; - - } - - model.addAttribute("userinfo", userinfo); - return retVal; - - } - catch (Exception e){ - model.addAttribute("message", e.getMessage()); - model.addAttribute("url", "/"); - return "error"; - } - } - - /** - * - * 用户修改默认项目 - * @param id - * @param model - * @return - * @throws Exception - */ - @RequestMapping(value = "/updateproject.do") - public String updateproject(@Valid @ModelAttribute("userinfo") UserInfo userinfo, BindingResult br, - Model model, HttpServletRequest req) throws Exception{ - - req.setCharacterEncoding("utf-8"); - String usercode=""; - if(req.getSession().getAttribute("usercode")!=null&&req.getSession().getAttribute("username")!=null){ - usercode = req.getSession().getAttribute("usercode").toString(); - }else{ - model.addAttribute("message", "获取用户信息失败!"); - model.addAttribute("url", "../index.jsp"); - return "error"; - } - - try{ - String retVal = "/jsp/user/user_proupdate"; - UserInfo ui = userinfoservice.getUseinfo(usercode); - if (req.getMethod().equals("POST")) - { - if (br.hasErrors()) - { - return retVal; - } - ui.setProjectid(userinfo.getProjectid()); - userinfoservice.modify(ui); - - model.addAttribute("message", "修改默认项目成功!"); - model.addAttribute("url", "/progressus/signin.jsp"); - return "success"; - - } - model.addAttribute("projects", QueueListener.qa_projlist); - model.addAttribute("userinfo", ui); - return retVal; - - } - catch (Exception e){ - model.addAttribute("message", e.getMessage()); - model.addAttribute("url", "/"); - return "error"; - } - } - - /** - * 修改角色权限 - * @param tj - * @param br - * @param model - * @param req - * @param rsp - * @return - * @throws Exception - * @Description: - */ - @RequestMapping(value = "/role.do") - public String update(@Valid @ModelAttribute("userrole") UserRole userrole, BindingResult br, Model model, - HttpServletRequest req, HttpServletResponse rsp) throws Exception - { - try - { - rsp.setContentType("text/html;charset=utf-8"); - req.setCharacterEncoding("utf-8"); - - if(!UserLoginController.permissionboolean(req, "role_3")){ - model.addAttribute("userinfo", new UserInfo()); - model.addAttribute("url", "/userInfo/load.do"); - model.addAttribute("message", "当前用户无权限查看角色权限信息,请联系管理员!"); - return "success"; - } - - List lsp=sectorprojectsService.getAllProject(); - for(SectorProjects sp:lsp){ - if(sp.getProjecttype()==1){ - sp.setProjectname(sp.getProjectname()+"(TestLink项目)"); - } - if(null!=sp&&sp.getProjectid()==99){ - lsp.remove(sp); - break; - } - } - - String retVal = "/jsp/user/role"; - if (req.getMethod().equals("POST")) - { - if (br.hasErrors()) - { - return retVal; - } - String message = ""; - if(StrLib.isEmpty(userrole.getRole())||"0".equals(userrole.getRole())){ - message = "请至少选择一个角色保存"; - model.addAttribute("projectlist", lsp); - model.addAttribute("rolelist", userroleservice.listall()); - model.addAttribute("authoritylist", userauthorityservice.listall()); - model.addAttribute("userrole", userrole); - model.addAttribute("message", message); - return retVal; - } - - if(StrLib.isEmpty(userrole.getOpprojectid())){ - message = "请至少选择一个项目保存"; - model.addAttribute("projectlist", lsp); - model.addAttribute("rolelist", userroleservice.listall()); - model.addAttribute("authoritylist", userauthorityservice.listall()); - model.addAttribute("userrole", userrole); - model.addAttribute("message", message); - return retVal; - } - - if(StrLib.isEmpty(userrole.getPermission())){ - message = "请至少选择一个权限项保存"; - model.addAttribute("projectlist", lsp); - model.addAttribute("rolelist", userroleservice.listall()); - model.addAttribute("authoritylist", userauthorityservice.listall()); - model.addAttribute("userrole", userrole); - model.addAttribute("message", message); - return retVal; - } - - UserRole urole = userroleservice.load(Integer.valueOf(userrole.getRole())); - userrole.setId(urole.getId()); - userrole.setRole(urole.getRole()); - userrole.setPermission(","+userrole.getPermission()+","); - userrole.setOpprojectid(","+userrole.getOpprojectid()+","); - - userroleservice.modify(userrole); - - operationlogservice.add(req, "USER_ROLE", userrole.getId(), - 99,"角色权限修改成功!角色名称:"+userrole.getRole()); - - model.addAttribute("message", "修改角色权限成功"); - model.addAttribute("url", "/userInfo/role.do"); - return "success"; - - } - - model.addAttribute("projectlist", lsp); - model.addAttribute("rolelist", userroleservice.listall()); - model.addAttribute("authoritylist", userauthorityservice.listall()); - model.addAttribute("userrole", userrole); - return retVal; - - } - catch (Exception e) - { - model.addAttribute("message", e.getMessage()); - model.addAttribute("url", "/userInfo/load.do"); - return "error"; - } - - } - - /** - * 角色权限 - * @param tj - * @param br - * @param model - * @param req - * @param rsp - * @return - * @throws Exception - * @Description: - */ - @RequestMapping(value = "/roleadd.do") - public String add(@Valid @ModelAttribute("userrole") UserRole userrole, BindingResult br, Model model, - HttpServletRequest req, HttpServletResponse rsp) throws Exception - { - try - { - rsp.setContentType("text/html;charset=utf-8"); - req.setCharacterEncoding("utf-8"); - - if(!UserLoginController.permissionboolean(req, "role_1")){ - model.addAttribute("userinfo", new UserInfo()); - model.addAttribute("url", "/userInfo/load.do"); - model.addAttribute("message", "当前用户无权限添加角色权限信息,请联系管理员!"); - return "success"; - } - - List lsp=sectorprojectsService.getAllProject(); - for(SectorProjects sp:lsp){ - if(sp.getProjecttype()==1){ - sp.setProjectname(sp.getProjectname()+"(TestLink项目)"); - } - if(null!=sp&&sp.getProjectid()==99){ - lsp.remove(sp); - break; - } - } - - String retVal = "/jsp/user/role_add"; - if (req.getMethod().equals("POST")) - { - if (br.hasErrors()) - { - return retVal; - } - String message = ""; - if(StrLib.isEmpty(userrole.getRole())||"0".equals(userrole.getRole())){ - message = "请至少选择一个角色保存"; - model.addAttribute("projectlist", lsp); - model.addAttribute("rolelist", userroleservice.listall()); - model.addAttribute("authoritylist", userauthorityservice.listall()); - model.addAttribute("userrole", userrole); - model.addAttribute("message", message); - return retVal; - } - - if(StrLib.isEmpty(userrole.getOpprojectid())){ - message = "请至少选择一个项目保存"; - model.addAttribute("projectlist", lsp); - model.addAttribute("rolelist", userroleservice.listall()); - model.addAttribute("authoritylist", userauthorityservice.listall()); - model.addAttribute("userrole", userrole); - model.addAttribute("message", message); - return retVal; - } - - if(StrLib.isEmpty(userrole.getPermission())){ - message = "请至少选择一个权限项保存"; - model.addAttribute("projectlist", lsp); - model.addAttribute("rolelist", userroleservice.listall()); - model.addAttribute("authoritylist", userauthorityservice.listall()); - model.addAttribute("userrole", userrole); - model.addAttribute("message", message); - return retVal; - } - - userrole.setPermission(","+userrole.getPermission()+","); - userrole.setOpprojectid(","+userrole.getOpprojectid()+","); - - userroleservice.add(userrole); - - operationlogservice.add(req, "USER_ROLE", userrole.getId(), - 99,"角色权限添加成功!角色名称:"+userrole.getRole()); - - model.addAttribute("message", "添加角色权限成功"); - model.addAttribute("url", "/userInfo/role.do"); - return "success"; - - } - model.addAttribute("projectlist", lsp); - model.addAttribute("authoritylist", userauthorityservice.listall()); - model.addAttribute("userrole", userrole); - return retVal; - - } - catch (Exception e) - { - model.addAttribute("message", e.getMessage()); - model.addAttribute("url", "/userInfo/load.do"); - return "error"; - } - - } - - /** - * 删除角色 - * - * @param id - * @param model - * @return - * @throws Exception - */ - @RequestMapping(value = "/roledelete.do", method = RequestMethod.GET) - public String roledelete(Model model,HttpServletRequest req) throws Exception - { - if(!UserLoginController.permissionboolean(req, "role_2")){ - model.addAttribute("userinfo", new UserInfo()); - model.addAttribute("url", "/userInfo/load.do"); - model.addAttribute("message", "当前用户无权限删除角色,请联系管理员!"); - return "success"; - } - - int id = Integer.valueOf(req.getParameter("id")); - UserRole userrole = userroleservice.load(id); - try - { - userroleservice.delete(id); - } - catch (Exception e) - { - model.addAttribute("message", e.getMessage()); - model.addAttribute("url", "/userInfo/load.do"); - return "error"; - } - - operationlogservice.add(req, "USER_ROLE", id, - 99,"角色信息删除成功!角色名称:"+userrole.getRole()); - - String message = "删除角色成功!"; - model.addAttribute("userinfo", new UserInfo()); - model.addAttribute("message", message); - model.addAttribute("url", "/userInfo/role.do"); - return "success"; - } - - /** - * 角色权限查询 - * @param tj - * @param br - * @param model - * @param req - * @param rsp - * @return id - * @throws Exception - * @Description: - */ - @RequestMapping(value = "/getauth.do") - public void getcheckinfo(HttpServletRequest req, HttpServletResponse rsp) throws Exception{ - int roleId = Integer.valueOf(req.getParameter("roleId")); - - UserRole urole= userroleservice.load(roleId); - List listauth = userauthorityservice.listall(); - ArrayList templistpermi=new ArrayList(); - ArrayList templistoppro=new ArrayList(); - if(!StrLib.isEmpty(urole.getPermission())){ - String temppermi[]=urole.getPermission().split(",",-1); - for(int i=0;i listauth = userauthorityservice.listall(); - try - { - UserInfo userinfo = userinfoservice.getUseinfo(usercode); - - List rolelist = userroleservice.listall(); - String temp[]=userinfo.getRole().split(";",-1); - List list = new ArrayList(); - UserRole[] urarr = new UserRole[temp.length]; - - for(int i=0;i roleMap = userroleservice.listall(); + List prolist = QueueListener.qa_projlist; + List users = userinfoservice.findByPage(userinfo, offset, limit); + for(int i=0;i0){ + message = "用户名已经存在,请重新输入!"; + model.addAttribute("userrole", userroleservice.listall()); + model.addAttribute("secondarysector", secondarysectorService.listall()); + model.addAttribute("projects", QueueListener.qa_projlist); + model.addAttribute("message", message); + return retVal; + } + + Endecrypt endecrypt = new Endecrypt(); + String cryptpwd = endecrypt.get3DESEncrypt(temp[0]); + userinfo.setPassword(cryptpwd); + userinfo.setRole(userinfo.getRole().replaceAll(",", ";")); + + SecondarySector ss = secondarysectorService.load(userinfo.getSectorid()); + userinfo.setSectorid(ss.getSectorid()); + userinfo.setSecondarySector(ss); + + int userid = userinfoservice.add(userinfo); + + operationlogservice.add(req, "USERINFO", userid, + 99,"用户添加成功!用户名:"+userinfo.getUsercode()); + + model.addAttribute("message", "创建用户成功"); + model.addAttribute("url", "/userInfo/load.do"); + return "success"; + + } + model.addAttribute("userrole", userroleservice.listall()); + model.addAttribute("secondarysector", secondarysectorService.listall()); + model.addAttribute("projects", QueueListener.qa_projlist); + userinfo.setProjectid(99); + model.addAttribute("userinfo", userinfo); + return retVal; + + } + catch (Exception e) + { + model.addAttribute("message", e.getMessage()); + model.addAttribute("url", "/userInfo/load.do"); + return "error"; + } + + } + + /** + * 删除调度 + * + * @param tj + * @param br + * @param model + * @param req + * @param rsp + * @return + * @throws Exception + * @Description: + */ + @RequestMapping(value = "/delete.do") + public void delete(HttpServletRequest req, HttpServletResponse rsp) throws Exception { + try { + rsp.setContentType("text/html;charset=utf-8"); + req.setCharacterEncoding("utf-8"); + PrintWriter pw = rsp.getWriter(); + JSONObject json = new JSONObject(); + if (!UserLoginController.permissionboolean(req, "ui_2")) { + json.put("status", "fail"); + json.put("ms", "删除用户失败,权限不足,请联系管理员!"); + } else { + int id = Integer.valueOf(req.getParameter("userid")); + UserInfo userinfo = userinfoservice.load(id); + try + { + userinfoservice.delete(id); + + operationlogservice.add(req, "USERINFO", id, + 99,"用户信息删除成功!用户名:"+userinfo.getUsercode()); + + json.put("status", "success"); + json.put("ms", "删除用户成功!"); + } + catch (Exception e) + { + json.put("status", "fail"); + json.put("ms", "删除用户过程中失败!"); + } + } + pw.print(json.toString()); + + } catch (Exception e) { + e.printStackTrace(); + } + + } + + /** + * + * 根据id更新用户资料 + * @param id + * @param model + * @return + * @throws Exception + */ + @RequestMapping(value = "/update.do") + public String update(@Valid @ModelAttribute("userinfo") UserInfo userinfo, BindingResult br, + Model model, HttpServletRequest req) throws Exception + { + req.setCharacterEncoding("utf-8"); + int id = Integer.valueOf(req.getParameter("id")); + + if(!UserLoginController.permissionboolean(req, "ui_3")){ + model.addAttribute("userinfo", new UserInfo()); + model.addAttribute("url", "/userInfo/load.do"); + model.addAttribute("message", "当前用户无权限修改用户信息,请联系管理员!"); + return "success"; + } + Endecrypt endecrypt = new Endecrypt(); + try{ + String retVal = "/jsp/user/user_update"; + if (req.getMethod().equals("POST")) + { + if (br.hasErrors()) + { + return retVal; + } + String message = ""; + if(StrLib.isEmpty(userinfo.getUsername())){ + message = "真实姓名不能为空!"; + model.addAttribute("userrole", userroleservice.listall()); + model.addAttribute("secondarysector", secondarysectorService.listall()); + model.addAttribute("projects", QueueListener.qa_projlist); + model.addAttribute("message", message); + return retVal; + } + if(StrLib.isEmpty(userinfo.getUsercode())){ + message = "用户名不能为空!"; + model.addAttribute("userrole", userroleservice.listall()); + model.addAttribute("secondarysector", secondarysectorService.listall()); + model.addAttribute("projects", QueueListener.qa_projlist); + model.addAttribute("message", message); + return retVal; + } + if(userinfo.getSectorid()==0){ + message = "请至少选择一个所属部门!"; + model.addAttribute("userrole", userroleservice.listall()); + model.addAttribute("secondarysector", secondarysectorService.listall()); + model.addAttribute("projects", QueueListener.qa_projlist); + model.addAttribute("message", message); + return retVal; + } + if(StrLib.isEmpty(userinfo.getPassword())){ + message = "密码不能为空!"; + model.addAttribute("userrole", userroleservice.listall()); + model.addAttribute("secondarysector", secondarysectorService.listall()); + model.addAttribute("projects", QueueListener.qa_projlist); + model.addAttribute("message", message); + return retVal; + } + String temp[] = userinfo.getPassword().split(",",-1); + if(!temp[0].equals(temp[1])){ + message = "两次输入的密码不一致,请确认!"; + model.addAttribute("userrole", userroleservice.listall()); + model.addAttribute("secondarysector", secondarysectorService.listall()); + model.addAttribute("projects", QueueListener.qa_projlist); + model.addAttribute("message", message); + return retVal; + } + + String cryptpwd = endecrypt.get3DESEncrypt(temp[0]); + userinfo.setPassword(cryptpwd); + userinfo.setRole(userinfo.getRole().replaceAll(",", ";")); + + SecondarySector ss = secondarysectorService.load(userinfo.getSectorid()); + userinfo.setSectorid(ss.getSectorid()); + userinfo.setSecondarySector(ss); + + userinfoservice.modify(userinfo); + + operationlogservice.add(req, "USERINFO", id, + 99,"用户信息修改成功!用户名"+userinfo.getUsercode()); + + + model.addAttribute("message", "修改用户信息成功"); + model.addAttribute("url", "/userInfo/load.do"); + return "success"; + + } + userinfo = userinfoservice.load(id); + userinfo.setPassword(endecrypt.get3DESDecrypt(userinfo.getPassword())); + userinfo.setSectorid(userinfo.getSecondarySector().getSectorid()); + userinfo.setRole(userinfo.getRole().replaceAll(";", ",")); + + model.addAttribute("userrole", userroleservice.listall()); + model.addAttribute("secondarysector", secondarysectorService.listall()); + model.addAttribute("projects", QueueListener.qa_projlist); + + model.addAttribute("userinfo", userinfo); + return "/jsp/user/user_update"; + + } + catch (Exception e){ + model.addAttribute("message", e.getMessage()); + model.addAttribute("url", "/userInfo/load.do"); + return "error"; + } + } + + /** + * + * 用户修改密码 + * @param id + * @param model + * @return + * @throws Exception + */ + @RequestMapping(value = "/updatepw.do") + public String updatepw(@Valid @ModelAttribute("userinfo") UserInfo userinfo, BindingResult br, + Model model, HttpServletRequest req) throws Exception + { + req.setCharacterEncoding("utf-8"); + String usercode=""; + if(req.getSession().getAttribute("usercode")!=null&&req.getSession().getAttribute("username")!=null){ + usercode = req.getSession().getAttribute("usercode").toString(); + }else{ + model.addAttribute("message", "获取用户信息失败!"); + model.addAttribute("url", "../index.jsp"); + return "error"; + } + + Endecrypt endecrypt = new Endecrypt(); + try{ + String retVal = "/jsp/user/user_pswupdate"; + if (req.getMethod().equals("POST")) + { + if (br.hasErrors()) + { + return retVal; + } + String message = ""; + if(StrLib.isEmpty(userinfo.getOldpassword())){ + message = "旧密码不能为空!"; + model.addAttribute("message", message); + return retVal; + } + if(StrLib.isEmpty(userinfo.getPassword())){ + message = "新密码不能为空!"; + model.addAttribute("message", message); + return retVal; + } + String temp[] = userinfo.getPassword().split(",",-1); + if(!temp[0].equals(temp[1])){ + message = "新密码两次输入的不一致,请确认!"; + model.addAttribute("message", message); + return retVal; + } + + UserInfo ui = userinfoservice.getUseinfo(usercode); + String oldcryptpwd = endecrypt.get3DESEncrypt(userinfo.getOldpassword()); + if(!ui.getPassword().equals(oldcryptpwd)){ + message = "您输入的旧密码不对,请确认!"; + model.addAttribute("message", message); + return retVal; + } + + String newcryptpwd = endecrypt.get3DESEncrypt(temp[0]); + ui.setPassword(newcryptpwd); + + userinfoservice.modify(ui); + + model.addAttribute("message", "修改密码成功,请重新登录!"); + //清空用户状态,重新登录 + req.getSession().setAttribute("usercode", null); + req.getSession().setAttribute("username", null); + req.getSession().setAttribute("permission", null); + model.addAttribute("url", "/progressus/signin.jsp"); + return "success"; + + } + + model.addAttribute("userinfo", userinfo); + return retVal; + + } + catch (Exception e){ + model.addAttribute("message", e.getMessage()); + model.addAttribute("url", "/"); + return "error"; + } + } + + /** + * + * 用户修改默认项目 + * @param id + * @param model + * @return + * @throws Exception + */ + @RequestMapping(value = "/updateproject.do") + public String updateproject(@Valid @ModelAttribute("userinfo") UserInfo userinfo, BindingResult br, + Model model, HttpServletRequest req) throws Exception{ + + req.setCharacterEncoding("utf-8"); + String usercode=""; + if(req.getSession().getAttribute("usercode")!=null&&req.getSession().getAttribute("username")!=null){ + usercode = req.getSession().getAttribute("usercode").toString(); + }else{ + model.addAttribute("message", "获取用户信息失败!"); + model.addAttribute("url", "../index.jsp"); + return "error"; + } + + try{ + String retVal = "/jsp/user/user_proupdate"; + UserInfo ui = userinfoservice.getUseinfo(usercode); + if (req.getMethod().equals("POST")) + { + if (br.hasErrors()) + { + return retVal; + } + ui.setProjectid(userinfo.getProjectid()); + userinfoservice.modify(ui); + + model.addAttribute("message", "修改默认项目成功!"); + model.addAttribute("url", "/progressus/signin.jsp"); + return "success"; + + } + model.addAttribute("projects", QueueListener.qa_projlist); + model.addAttribute("userinfo", ui); + return retVal; + + } + catch (Exception e){ + model.addAttribute("message", e.getMessage()); + model.addAttribute("url", "/"); + return "error"; + } + } + + /** + * 修改角色权限 + * @param tj + * @param br + * @param model + * @param req + * @param rsp + * @return + * @throws Exception + * @Description: + */ + @RequestMapping(value = "/role.do") + public String update(@Valid @ModelAttribute("userrole") UserRole userrole, BindingResult br, Model model, + HttpServletRequest req, HttpServletResponse rsp) throws Exception + { + try + { + rsp.setContentType("text/html;charset=utf-8"); + req.setCharacterEncoding("utf-8"); + + if(!UserLoginController.permissionboolean(req, "role_3")){ + model.addAttribute("userinfo", new UserInfo()); + model.addAttribute("url", "/userInfo/load.do"); + model.addAttribute("message", "当前用户无权限查看角色权限信息,请联系管理员!"); + return "success"; + } + + List lsp=sectorprojectsService.getAllProject(); + for(SectorProjects sp:lsp){ + if(sp.getProjecttype()==1){ + sp.setProjectname(sp.getProjectname()+"(TestLink项目)"); + } + if(null!=sp&&sp.getProjectid()==99){ + lsp.remove(sp); + break; + } + } + + String retVal = "/jsp/user/role"; + if (req.getMethod().equals("POST")) + { + if (br.hasErrors()) + { + return retVal; + } + String message = ""; + if(StrLib.isEmpty(userrole.getRole())||"0".equals(userrole.getRole())){ + message = "请至少选择一个角色保存"; + model.addAttribute("projectlist", lsp); + model.addAttribute("rolelist", userroleservice.listall()); + model.addAttribute("authoritylist", userauthorityservice.listall()); + model.addAttribute("userrole", userrole); + model.addAttribute("message", message); + return retVal; + } + + if(StrLib.isEmpty(userrole.getOpprojectid())){ + message = "请至少选择一个项目保存"; + model.addAttribute("projectlist", lsp); + model.addAttribute("rolelist", userroleservice.listall()); + model.addAttribute("authoritylist", userauthorityservice.listall()); + model.addAttribute("userrole", userrole); + model.addAttribute("message", message); + return retVal; + } + + if(StrLib.isEmpty(userrole.getPermission())){ + message = "请至少选择一个权限项保存"; + model.addAttribute("projectlist", lsp); + model.addAttribute("rolelist", userroleservice.listall()); + model.addAttribute("authoritylist", userauthorityservice.listall()); + model.addAttribute("userrole", userrole); + model.addAttribute("message", message); + return retVal; + } + + UserRole urole = userroleservice.load(Integer.valueOf(userrole.getRole())); + userrole.setId(urole.getId()); + userrole.setRole(urole.getRole()); + userrole.setPermission(","+userrole.getPermission()+","); + userrole.setOpprojectid(","+userrole.getOpprojectid()+","); + + userroleservice.modify(userrole); + + operationlogservice.add(req, "USER_ROLE", userrole.getId(), + 99,"角色权限修改成功!角色名称:"+userrole.getRole()); + + model.addAttribute("message", "修改角色权限成功"); + model.addAttribute("url", "/userInfo/role.do"); + return "success"; + + } + + model.addAttribute("projectlist", lsp); + model.addAttribute("rolelist", userroleservice.listall()); + model.addAttribute("authoritylist", userauthorityservice.listall()); + model.addAttribute("userrole", userrole); + return retVal; + + } + catch (Exception e) + { + model.addAttribute("message", e.getMessage()); + model.addAttribute("url", "/userInfo/load.do"); + return "error"; + } + + } + + /** + * 角色权限 + * @param tj + * @param br + * @param model + * @param req + * @param rsp + * @return + * @throws Exception + * @Description: + */ + @RequestMapping(value = "/roleadd.do") + public String add(@Valid @ModelAttribute("userrole") UserRole userrole, BindingResult br, Model model, + HttpServletRequest req, HttpServletResponse rsp) throws Exception + { + try + { + rsp.setContentType("text/html;charset=utf-8"); + req.setCharacterEncoding("utf-8"); + + if(!UserLoginController.permissionboolean(req, "role_1")){ + model.addAttribute("userinfo", new UserInfo()); + model.addAttribute("url", "/userInfo/load.do"); + model.addAttribute("message", "当前用户无权限添加角色权限信息,请联系管理员!"); + return "success"; + } + + List lsp=sectorprojectsService.getAllProject(); + for(SectorProjects sp:lsp){ + if(sp.getProjecttype()==1){ + sp.setProjectname(sp.getProjectname()+"(TestLink项目)"); + } + if(null!=sp&&sp.getProjectid()==99){ + lsp.remove(sp); + break; + } + } + + String retVal = "/jsp/user/role_add"; + if (req.getMethod().equals("POST")) + { + if (br.hasErrors()) + { + return retVal; + } + String message = ""; + if(StrLib.isEmpty(userrole.getRole())||"0".equals(userrole.getRole())){ + message = "请至少选择一个角色保存"; + model.addAttribute("projectlist", lsp); + model.addAttribute("rolelist", userroleservice.listall()); + model.addAttribute("authoritylist", userauthorityservice.listall()); + model.addAttribute("userrole", userrole); + model.addAttribute("message", message); + return retVal; + } + + if(StrLib.isEmpty(userrole.getOpprojectid())){ + message = "请至少选择一个项目保存"; + model.addAttribute("projectlist", lsp); + model.addAttribute("rolelist", userroleservice.listall()); + model.addAttribute("authoritylist", userauthorityservice.listall()); + model.addAttribute("userrole", userrole); + model.addAttribute("message", message); + return retVal; + } + + if(StrLib.isEmpty(userrole.getPermission())){ + message = "请至少选择一个权限项保存"; + model.addAttribute("projectlist", lsp); + model.addAttribute("rolelist", userroleservice.listall()); + model.addAttribute("authoritylist", userauthorityservice.listall()); + model.addAttribute("userrole", userrole); + model.addAttribute("message", message); + return retVal; + } + + userrole.setPermission(","+userrole.getPermission()+","); + userrole.setOpprojectid(","+userrole.getOpprojectid()+","); + + userroleservice.add(userrole); + + operationlogservice.add(req, "USER_ROLE", userrole.getId(), + 99,"角色权限添加成功!角色名称:"+userrole.getRole()); + + model.addAttribute("message", "添加角色权限成功"); + model.addAttribute("url", "/userInfo/role.do"); + return "success"; + + } + model.addAttribute("projectlist", lsp); + model.addAttribute("authoritylist", userauthorityservice.listall()); + model.addAttribute("userrole", userrole); + return retVal; + + } + catch (Exception e) + { + model.addAttribute("message", e.getMessage()); + model.addAttribute("url", "/userInfo/load.do"); + return "error"; + } + + } + + /** + * 删除角色 + * + * @param id + * @param model + * @return + * @throws Exception + */ + @RequestMapping(value = "/roledelete.do", method = RequestMethod.GET) + public String roledelete(Model model,HttpServletRequest req) throws Exception + { + if(!UserLoginController.permissionboolean(req, "role_2")){ + model.addAttribute("userinfo", new UserInfo()); + model.addAttribute("url", "/userInfo/load.do"); + model.addAttribute("message", "当前用户无权限删除角色,请联系管理员!"); + return "success"; + } + + int id = Integer.valueOf(req.getParameter("id")); + UserRole userrole = userroleservice.load(id); + try + { + userroleservice.delete(id); + } + catch (Exception e) + { + model.addAttribute("message", e.getMessage()); + model.addAttribute("url", "/userInfo/load.do"); + return "error"; + } + + operationlogservice.add(req, "USER_ROLE", id, + 99,"角色信息删除成功!角色名称:"+userrole.getRole()); + + String message = "删除角色成功!"; + model.addAttribute("userinfo", new UserInfo()); + model.addAttribute("message", message); + model.addAttribute("url", "/userInfo/role.do"); + return "success"; + } + + /** + * 角色权限查询 + * @param tj + * @param br + * @param model + * @param req + * @param rsp + * @return id + * @throws Exception + * @Description: + */ + @RequestMapping(value = "/getauth.do") + public void getcheckinfo(HttpServletRequest req, HttpServletResponse rsp) throws Exception{ + int roleId = Integer.valueOf(req.getParameter("roleId")); + + UserRole urole= userroleservice.load(roleId); + List listauth = userauthorityservice.listall(); + ArrayList templistpermi=new ArrayList(); + ArrayList templistoppro=new ArrayList(); + if(!StrLib.isEmpty(urole.getPermission())){ + String temppermi[]=urole.getPermission().split(",",-1); + for(int i=0;i listauth = userauthorityservice.listall(); + try + { + UserInfo userinfo = userinfoservice.getUseinfo(usercode); + + List rolelist = userroleservice.listall(); + String temp[]=userinfo.getRole().split(";",-1); + List list = new ArrayList(); + UserRole[] urarr = new UserRole[temp.length]; + + for(int i=0;i=0){ - result = true; - }else{ - result = false; - } - }else{ - result = false; - } - - return result; - } - - public static boolean oppidboolean(HttpServletRequest req, int projectids) { - boolean result = false; - - if (req.getSession().getAttribute("oppid") != null) { - if (req.getSession().getAttribute("oppid").toString().indexOf(","+projectids + ",") >= 0) { - result = true; - } else { - result = false; - } - } else { - result = false; - } - - return result; - } - - /** - * 角色权限查询 - * @param tj - * @param br - * @param model - * @param req - * @param rsp - * @return auth - * @throws Exception - * @Description: - */ - public static String getroleauth(UserRole[] rolearr,List listauth) throws Exception{ - List newlistauth = new ArrayList(); - - for (UserRole role : rolearr) { - if(null==role){ - continue; - } - String temp[] = role.getPermission().split(",", -1); - authlist:for (int i = 0; i < temp.length; i++) { - if (null == temp[i] || "".equals(temp[i])) { - continue; - } - for (UserAuthority usth : listauth) { - if (temp[i].equals(usth.getAlias())) { - for (UserAuthority auth : newlistauth) { - if(usth.getId()==auth.getId()){ - continue authlist; - } - } - newlistauth.add(usth); - } - } - } - } - - String authstr=""; - for (UserAuthority auth : newlistauth) { - authstr = authstr+auth.getModule()+"_"+auth.getAuth_type()+";    "; - } - - return authstr; - } - - /** - * 判断用户权限范围,前台判断 - * @throws IOException - * @throws InterruptedException - * @throws Exception - * @Description: - */ - @RequestMapping(value = "/permissionboolean.do") - public void permissionboolean_jason(HttpServletRequest req, HttpServletResponse rsp) throws IOException, InterruptedException{ - String[] status = new String[2]; - String opr = req.getParameter("permissioncode"); - - if(req.getSession().getAttribute("permission")!=null){ - if(req.getSession().getAttribute("permission").toString().indexOf(","+opr+",")>=0){ - status[0] = "true"; - }else{ - status[0] = "false"; - } - }else{ - status[0] = "false"; - } - - rsp.setContentType("text/xml;charset=utf-8"); - JSONArray jsonArray = JSONArray.fromObject(status); - JSONObject jsobjcet = new JSONObject(); - jsobjcet.put("data", jsonArray); - - rsp.getWriter().write(jsobjcet.toString()); - } - - public static void main(String[] args) throws Exception { - // TODO Auto-generated method stub - } - -} +package luckyweb.seagull.spring.mvc; + +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import net.sf.json.JSONArray; +import net.sf.json.JSONObject; + +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.RequestMapping; + +import luckyweb.seagull.spring.entity.UserAuthority; +import luckyweb.seagull.spring.entity.UserInfo; +import luckyweb.seagull.spring.entity.UserRole; +import luckyweb.seagull.spring.service.UserInfoService; +import luckyweb.seagull.spring.service.UserRoleService; +import luckyweb.seagull.util.Endecrypt; + + +@Controller +@RequestMapping("/userlogin") +public class UserLoginController { + @Resource(name = "userinfoService") + private UserInfoService userinfoservice; + + @Resource(name = "userroleService") + private UserRoleService userroleservice; + + public UserInfoService getuserinfoService() { + return userinfoservice; + } + + /** + * 登录校验用户名密码 + * @throws Exception + * @Description: + */ + @RequestMapping(value = "/userlogin.do") + public void userlogin(HttpServletRequest req, HttpServletResponse rsp) throws Exception{ + Endecrypt endecrypt = new Endecrypt(); + String usercode = req.getParameter("username"); + String password = req.getParameter("password"); + password = endecrypt.get3DESEncrypt(password); + + int id = userinfoservice.getid(usercode, password); + + String[] result = new String[3]; + if(id!=0){ + String auth = ""; + String oppid = ""; + UserInfo userinfo = userinfoservice.load(id); + String temp[]=userinfo.getRole().split(";",-1); + for(int i=0;i=0){ + result = true; + }else{ + result = false; + } + }else{ + result = false; + } + + return result; + } + + public static boolean oppidboolean(HttpServletRequest req, int projectids) { + boolean result = false; + + if (req.getSession().getAttribute("oppid") != null) { + if (req.getSession().getAttribute("oppid").toString().indexOf(","+projectids + ",") >= 0) { + result = true; + } else { + result = false; + } + } else { + result = false; + } + + return result; + } + + /** + * 角色权限查询 + * @param tj + * @param br + * @param model + * @param req + * @param rsp + * @return auth + * @throws Exception + * @Description: + */ + public static String getroleauth(UserRole[] rolearr,List listauth) throws Exception{ + List newlistauth = new ArrayList(); + + for (UserRole role : rolearr) { + if(null==role){ + continue; + } + String temp[] = role.getPermission().split(",", -1); + authlist:for (int i = 0; i < temp.length; i++) { + if (null == temp[i] || "".equals(temp[i])) { + continue; + } + for (UserAuthority usth : listauth) { + if (temp[i].equals(usth.getAlias())) { + for (UserAuthority auth : newlistauth) { + if(usth.getId()==auth.getId()){ + continue authlist; + } + } + newlistauth.add(usth); + } + } + } + } + + String authstr=""; + for (UserAuthority auth : newlistauth) { + authstr = authstr+auth.getModule()+"_"+auth.getAuth_type()+";    "; + } + + return authstr; + } + + /** + * 判断用户权限范围,前台判断 + * @throws IOException + * @throws InterruptedException + * @throws Exception + * @Description: + */ + @RequestMapping(value = "/permissionboolean.do") + public void permissionboolean_jason(HttpServletRequest req, HttpServletResponse rsp) throws IOException, InterruptedException{ + String[] status = new String[2]; + String opr = req.getParameter("permissioncode"); + + if(req.getSession().getAttribute("permission")!=null){ + if(req.getSession().getAttribute("permission").toString().indexOf(","+opr+",")>=0){ + status[0] = "true"; + }else{ + status[0] = "false"; + } + }else{ + status[0] = "false"; + } + + rsp.setContentType("text/xml;charset=utf-8"); + JSONArray jsonArray = JSONArray.fromObject(status); + JSONObject jsobjcet = new JSONObject(); + jsobjcet.put("data", jsonArray); + + rsp.getWriter().write(jsobjcet.toString()); + } + + public static void main(String[] args) throws Exception { + // TODO Auto-generated method stub + } + +} diff --git a/src/main/java/luckyweb/seagull/spring/mvc/ZentaoController.java b/src/main/java/luckyweb/seagull/spring/mvc/ZentaoController.java index 73d465e..b270e97 100644 --- a/src/main/java/luckyweb/seagull/spring/mvc/ZentaoController.java +++ b/src/main/java/luckyweb/seagull/spring/mvc/ZentaoController.java @@ -1,262 +1,262 @@ -package luckyweb.seagull.spring.mvc; - -import java.io.PrintWriter; -import java.text.DecimalFormat; -import java.util.List; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.RequestMapping; - -import luckyweb.seagull.spring.entity.ZtTask; -import luckyweb.seagull.spring.service.ZtTaskService; -import luckyweb.seagull.util.MysqlLib; -import luckyweb.seagull.util.StrLib; - - -@Controller -@RequestMapping("/zentao") -public class ZentaoController { - - private int allPage; - private int pageSize = 20; - private int allRows; - private int page = 1; - private int offset; - - @Resource(name = "zttaskService") - private ZtTaskService zttaskService; - - /** - * - * - * @param tj - * @param model - * @return - * @throws Exception - */ - @SuppressWarnings("unchecked") - @RequestMapping(value = "/list.do") - public String list(HttpServletRequest req, ZtTask zt, Model model,boolean flag) - throws Exception { - model.addAttribute("zt", zt); - String url = "/jsp/projectversion/zentaolist"; - if(zt.getVersionid()!=0){ - url = "/jsp/projectversion/zentaolistfortast"; - } - - if(flag){ - zt.setDelaystatus(2); - } - - try { - String p = req.getParameter("page"); - - if (StrLib.isEmpty(p) || Integer.valueOf(p) == 0) { - page = 1; - } - - String page2 = req.getParameter("page"); - if (StrLib.isEmpty(page2)) { - page = 1; - } else { - try { - page = Integer.parseInt(page2); - } catch (Exception e) { - page = 1; - } - } - allRows = zttaskService.findRows(zt); - offset = (page - 1) * pageSize; - if (allRows % pageSize == 0) { - allPage = allRows / pageSize; - } else { - allPage = allRows / pageSize + 1; - } - - model.addAttribute("allRows", allRows); - model.addAttribute("page", page); - model.addAttribute("offset", offset); - model.addAttribute("pageSize", pageSize); - model.addAttribute("allPage", allPage); -/* // 调度列表 - List secondarySector = secondarysectorservice.findSecotorList(); - model.addAttribute("secondarySector", secondarySector);*/ - - List sssMap = zttaskService.findByPage(zt, offset, pageSize); - model.addAttribute("zttasklist", sssMap); - - } catch (Exception e) { - e.printStackTrace(); - model.addAttribute("message", e.getMessage()); - model.addAttribute("url", "/zentao/list.do"); - return "error"; - } - return url; - } - - /** - * - * 禅道数据同步 - * @param model - * @param req - * @return - * @throws Exception - * @Description: - */ - @RequestMapping(value = "/synchronization_zt.do") - public String synchronization_zt(HttpServletRequest req, Model model, HttpServletResponse rsp) throws Exception { - - String proid = req.getParameter("proid"); - MysqlLib mysqllib = new MysqlLib(); - String message = "数据同步完成!"; - - PrintWriter pw = null; - rsp.setContentType("text/html;charset=utf-8"); - - try { - pw = rsp.getWriter(); - String[][] data = mysqllib.querydata(proid); - if (data != null) { - zttaskService.delete(Integer.valueOf(data[0][1])); - for (int i = 0; i < data.length; i++) { - ZtTask zt = new ZtTask(); - zt.setId(Integer.valueOf(data[i][0])); - zt.setVersionid(Integer.valueOf(data[i][1])); - zt.setVersionname(data[i][2]); - zt.setTaskname(data[i][3]); - zt.setAssignedDate(data[i][4]); - zt.setEstimate(Double.valueOf(data[i][5])); - zt.setConsumed(Double.valueOf(data[i][6])); - zt.setFinishedname(data[i][7]); - zt.setFinishedby(data[i][8]); - zt.setDeadline(data[i][9]); - - // 判断延期 - if (ProjectVersionController.checkdate(data[i][4].substring(0, 10), data[i][9])) { - zt.setDelaystatus(1); - } else { - zt.setDelaystatus(2); - } - - zttaskService.add(zt); - } - } else { - message = "当前ID任务未结束或链接禅道数据库异常!"; - } - } catch (Exception e) { - pw.write(e.getMessage()); - return null; - } - pw.write(message); - return null; - } - - /** - * - * 禅道报表 - * @param model - * @param req - * @return - * @throws Exception - * @Description: - */ - @RequestMapping(value = "/showreport.do") - public String showReport(HttpServletRequest req,Model model) throws Exception{ - try { - String p = req.getParameter("page"); - String startDate = req.getParameter("startDate"); - String endDate = req.getParameter("endDate"); - int reporttype = Integer.valueOf(req.getParameter("reporttype")); - String title = ""; - String startDatetitle = ""; - String endDatetitle = ""; - - if(StrLib.isEmpty(startDate)){ - startDate = "0000-00-00"; - startDatetitle = "初始日期"; - }else{ - startDatetitle = startDate; - } - if(StrLib.isEmpty(endDate)){ - endDate = "9999-99-99"; - endDatetitle = "最后日期"; - }else{ - endDatetitle = endDate; - } - - if(reporttype==1){ - title = startDatetitle+"至"+endDatetitle+" 按完成人统计"; - }else{ - title = startDatetitle+"至"+endDatetitle+" 按版本统计"; - } - - if (StrLib.isEmpty(p) || Integer.valueOf(p) == 0) { - page = 1; - } - - String page2 = req.getParameter("page"); - if (StrLib.isEmpty(page2)) { - page = 1; - } else { - try { - page = Integer.parseInt(page2); - } catch (Exception e) { - page = 1; - } - } - allRows = zttaskService.findRowsreport(startDate, endDate, reporttype); - offset = (page - 1) * pageSize; - if (allRows % pageSize == 0) { - allPage = allRows / pageSize; - } else { - allPage = allRows / pageSize + 1; - } - - model.addAttribute("allRows", allRows); - model.addAttribute("page", page); - model.addAttribute("offset", offset); - model.addAttribute("pageSize", pageSize); - model.addAttribute("allPage", allPage); - - List sssMap = zttaskService.findByPagereport(offset, pageSize, startDate, endDate, reporttype); - - for(int i=0;i secondarySector = secondarysectorservice.findSecotorList(); + model.addAttribute("secondarySector", secondarySector);*/ + + List sssMap = zttaskService.findByPage(zt, offset, pageSize); + model.addAttribute("zttasklist", sssMap); + + } catch (Exception e) { + e.printStackTrace(); + model.addAttribute("message", e.getMessage()); + model.addAttribute("url", "/zentao/list.do"); + return "error"; + } + return url; + } + + /** + * + * 禅道数据同步 + * @param model + * @param req + * @return + * @throws Exception + * @Description: + */ + @RequestMapping(value = "/synchronization_zt.do") + public String synchronization_zt(HttpServletRequest req, Model model, HttpServletResponse rsp) throws Exception { + + String proid = req.getParameter("proid"); + MysqlLib mysqllib = new MysqlLib(); + String message = "数据同步完成!"; + + PrintWriter pw = null; + rsp.setContentType("text/html;charset=utf-8"); + + try { + pw = rsp.getWriter(); + String[][] data = mysqllib.querydata(proid); + if (data != null) { + zttaskService.delete(Integer.valueOf(data[0][1])); + for (int i = 0; i < data.length; i++) { + ZtTask zt = new ZtTask(); + zt.setId(Integer.valueOf(data[i][0])); + zt.setVersionid(Integer.valueOf(data[i][1])); + zt.setVersionname(data[i][2]); + zt.setTaskname(data[i][3]); + zt.setAssignedDate(data[i][4]); + zt.setEstimate(Double.valueOf(data[i][5])); + zt.setConsumed(Double.valueOf(data[i][6])); + zt.setFinishedname(data[i][7]); + zt.setFinishedby(data[i][8]); + zt.setDeadline(data[i][9]); + + // 判断延期 + if (ProjectVersionController.checkdate(data[i][4].substring(0, 10), data[i][9])) { + zt.setDelaystatus(1); + } else { + zt.setDelaystatus(2); + } + + zttaskService.add(zt); + } + } else { + message = "当前ID任务未结束或链接禅道数据库异常!"; + } + } catch (Exception e) { + pw.write(e.getMessage()); + return null; + } + pw.write(message); + return null; + } + + /** + * + * 禅道报表 + * @param model + * @param req + * @return + * @throws Exception + * @Description: + */ + @RequestMapping(value = "/showreport.do") + public String showReport(HttpServletRequest req,Model model) throws Exception{ + try { + String p = req.getParameter("page"); + String startDate = req.getParameter("startDate"); + String endDate = req.getParameter("endDate"); + int reporttype = Integer.valueOf(req.getParameter("reporttype")); + String title = ""; + String startDatetitle = ""; + String endDatetitle = ""; + + if(StrLib.isEmpty(startDate)){ + startDate = "0000-00-00"; + startDatetitle = "初始日期"; + }else{ + startDatetitle = startDate; + } + if(StrLib.isEmpty(endDate)){ + endDate = "9999-99-99"; + endDatetitle = "最后日期"; + }else{ + endDatetitle = endDate; + } + + if(reporttype==1){ + title = startDatetitle+"至"+endDatetitle+" 按完成人统计"; + }else{ + title = startDatetitle+"至"+endDatetitle+" 按版本统计"; + } + + if (StrLib.isEmpty(p) || Integer.valueOf(p) == 0) { + page = 1; + } + + String page2 = req.getParameter("page"); + if (StrLib.isEmpty(page2)) { + page = 1; + } else { + try { + page = Integer.parseInt(page2); + } catch (Exception e) { + page = 1; + } + } + allRows = zttaskService.findRowsreport(startDate, endDate, reporttype); + offset = (page - 1) * pageSize; + if (allRows % pageSize == 0) { + allPage = allRows / pageSize; + } else { + allPage = allRows / pageSize + 1; + } + + model.addAttribute("allRows", allRows); + model.addAttribute("page", page); + model.addAttribute("offset", offset); + model.addAttribute("pageSize", pageSize); + model.addAttribute("allPage", allPage); + + List sssMap = zttaskService.findByPagereport(offset, pageSize, startDate, endDate, reporttype); + + for(int i=0;i list(TestCasedetail tast); - - public TestCasedetail load(int id); - - public List findByPage( final Object value,final int offset, final int pageSize); - - public int findRows(TestCasedetail jobs ) ; - - public void delete(int id) throws Exception; - -} +package luckyweb.seagull.spring.service; + +import java.util.List; + +import org.springframework.transaction.annotation.Propagation; +import org.springframework.transaction.annotation.Transactional; + +import luckyweb.seagull.spring.entity.TestCasedetail; + +@Transactional +public interface CaseDetailService { + public void add(TestCasedetail tast); + + @Transactional(propagation=Propagation.NOT_SUPPORTED) + public List list(TestCasedetail tast); + + public TestCasedetail load(int id); + + public List findByPage( final Object value,final int offset, final int pageSize); + + public int findRows(TestCasedetail jobs ) ; + + public void delete(int id) throws Exception; + +} diff --git a/src/main/java/luckyweb/seagull/spring/service/CaseDetailServiceImpl.java b/src/main/java/luckyweb/seagull/spring/service/CaseDetailServiceImpl.java index cc435d2..e63c546 100644 --- a/src/main/java/luckyweb/seagull/spring/service/CaseDetailServiceImpl.java +++ b/src/main/java/luckyweb/seagull/spring/service/CaseDetailServiceImpl.java @@ -1,120 +1,120 @@ -package luckyweb.seagull.spring.service; - -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import luckyweb.seagull.spring.dao.TestCasedetailDao; -import luckyweb.seagull.spring.entity.TestCasedetail; -import luckyweb.seagull.util.StrLib; - -@Service("casedetailService") -public class CaseDetailServiceImpl implements CaseDetailService { - - @Resource(name="casedetailDao") - private TestCasedetailDao casedetailDao; - - - @Override - public void add(TestCasedetail task) { - this.casedetailDao.add(task); - } - - @Override - public List list(TestCasedetail tjob) { - return this.casedetailDao.list(tjob); - } - - @Override - public TestCasedetail load(int id) { - return this.casedetailDao.load(id); - } - - public TestCasedetailDao getCasedetailDao() { - return casedetailDao; - } - - public void setCasedetailDao(TestCasedetailDao casedetailDao) { - this.casedetailDao = casedetailDao; - } - - private static String orderBy=" order by id asc "; - - @Override - public List findByPage(Object value, int offset, int pageSize) { - String hql=" from TestCasedetail "+where((TestCasedetail)value)+orderBy; - @SuppressWarnings("rawtypes") - List list= casedetailDao.findByPage(hql, value, offset, pageSize); - for(TestCasedetail caseDetail :(List)list){ - caseDetail.setCasestatus_str(setStatus(caseDetail.getCasestatus())); - } - return list; - } - - /** - * 状态 - * @param status - * @return - */ - private String setStatus(String status){ - if(StrLib.isEmpty(status)){ - return "其他"; - }else{ - if(status.equals("0")){ - return "成功"; - }else if(status.equals("1")){ - return "失败"; - }else if(status.equals("2")){ - return "锁定"; - }else if(status.equals("4")){ - return "未执行"; - } - } - return "其他"; - } - - - private String where(TestCasedetail caseDetail) { - String where = " where "; - if (!StrLib.isEmpty(caseDetail.getStartDate())&&!StrLib.isEmpty(caseDetail.getEndDate())) { - // where += " to_char(caseTime,'YYYY-MM-dd')=? and "; - where += " date_format(caseTime,'%Y-%m-%d')>=:startDate and date_format(caseTime,'%Y-%m-%d')<=:endDate and "; - } - if (caseDetail.getTaskId()!=0) { - where += " taskId=:taskId and "; - } - if (!StrLib.isEmpty(caseDetail.getCasestatus())) { - where += " casestatus=:casestatus and "; - } - if (!StrLib.isEmpty(caseDetail.getCaseno())) { - where += " (caseno like :caseno or "; - } - if (!StrLib.isEmpty(caseDetail.getCasename())) { - where += " casename like :casename) or "; - } - - if (where.length() == 7) { - where = ""; - } else { - where = where.substring(0, where.length() - 5); - } - - return where; - } - - public int findRows(TestCasedetail caseDetail ) { - String hql="select count(*) from TestCasedetail "+where(caseDetail); - return casedetailDao.findRows(hql,caseDetail); - } - - @Override - public void delete(int id) throws Exception { - String hql="delete from TestCasedetail where taskId=:taskId"; - this.casedetailDao.delete(hql, id); - } - - - -} +package luckyweb.seagull.spring.service; + +import java.util.List; + +import javax.annotation.Resource; + +import org.springframework.stereotype.Service; + +import luckyweb.seagull.spring.dao.TestCasedetailDao; +import luckyweb.seagull.spring.entity.TestCasedetail; +import luckyweb.seagull.util.StrLib; + +@Service("casedetailService") +public class CaseDetailServiceImpl implements CaseDetailService { + + @Resource(name="casedetailDao") + private TestCasedetailDao casedetailDao; + + + @Override + public void add(TestCasedetail task) { + this.casedetailDao.add(task); + } + + @Override + public List list(TestCasedetail tjob) { + return this.casedetailDao.list(tjob); + } + + @Override + public TestCasedetail load(int id) { + return this.casedetailDao.load(id); + } + + public TestCasedetailDao getCasedetailDao() { + return casedetailDao; + } + + public void setCasedetailDao(TestCasedetailDao casedetailDao) { + this.casedetailDao = casedetailDao; + } + + private static String orderBy=" order by id asc "; + + @Override + public List findByPage(Object value, int offset, int pageSize) { + String hql=" from TestCasedetail "+where((TestCasedetail)value)+orderBy; + @SuppressWarnings("rawtypes") + List list= casedetailDao.findByPage(hql, value, offset, pageSize); + for(TestCasedetail caseDetail :(List)list){ + caseDetail.setCasestatus_str(setStatus(caseDetail.getCasestatus())); + } + return list; + } + + /** + * 状态 + * @param status + * @return + */ + private String setStatus(String status){ + if(StrLib.isEmpty(status)){ + return "其他"; + }else{ + if(status.equals("0")){ + return "成功"; + }else if(status.equals("1")){ + return "失败"; + }else if(status.equals("2")){ + return "锁定"; + }else if(status.equals("4")){ + return "未执行"; + } + } + return "其他"; + } + + + private String where(TestCasedetail caseDetail) { + String where = " where "; + if (!StrLib.isEmpty(caseDetail.getStartDate())&&!StrLib.isEmpty(caseDetail.getEndDate())) { + // where += " to_char(caseTime,'YYYY-MM-dd')=? and "; + where += " date_format(caseTime,'%Y-%m-%d')>=:startDate and date_format(caseTime,'%Y-%m-%d')<=:endDate and "; + } + if (caseDetail.getTaskId()!=0) { + where += " taskId=:taskId and "; + } + if (!StrLib.isEmpty(caseDetail.getCasestatus())) { + where += " casestatus=:casestatus and "; + } + if (!StrLib.isEmpty(caseDetail.getCaseno())) { + where += " (caseno like :caseno or "; + } + if (!StrLib.isEmpty(caseDetail.getCasename())) { + where += " casename like :casename) or "; + } + + if (where.length() == 7) { + where = ""; + } else { + where = where.substring(0, where.length() - 5); + } + + return where; + } + + public int findRows(TestCasedetail caseDetail ) { + String hql="select count(*) from TestCasedetail "+where(caseDetail); + return casedetailDao.findRows(hql,caseDetail); + } + + @Override + public void delete(int id) throws Exception { + String hql="delete from TestCasedetail where taskId=:taskId"; + this.casedetailDao.delete(hql, id); + } + + + +} diff --git a/src/main/java/luckyweb/seagull/spring/service/FlowCheckService.java b/src/main/java/luckyweb/seagull/spring/service/FlowCheckService.java index 16baf5d..ecda771 100644 --- a/src/main/java/luckyweb/seagull/spring/service/FlowCheckService.java +++ b/src/main/java/luckyweb/seagull/spring/service/FlowCheckService.java @@ -1,51 +1,51 @@ -package luckyweb.seagull.spring.service; - -import java.util.List; - -import org.springframework.transaction.annotation.Propagation; -import org.springframework.transaction.annotation.Transactional; - -import luckyweb.seagull.spring.entity.FlowCheck; - -@Transactional -public interface FlowCheckService { - public int add(FlowCheck flowcheck)throws Exception; - public void modify(FlowCheck flowcheck)throws Exception; - public void modifyState(FlowCheck flowcheck)throws Exception; - public void delete(int id)throws Exception; - - @Transactional(propagation=Propagation.NOT_SUPPORTED) - public List listcheckinfo(int projectid,int checkid)throws Exception; - - public List listdateper(String startdate,String enddate) throws Exception; - - public boolean isExist(String name,String cmdType,String planPath)throws Exception; - - public int getid(int projectid,int checkid,String entry) throws Exception; - - public String getversionnum(int projectid,int checkid) throws Exception; - - public FlowCheck load(int id)throws Exception; - - public int getcheckid(int projectid)throws Exception; - - public boolean determinerecord(int projectid,int checkid,String checkentry) throws Exception; - -// public List findByPage( final int offset,final int pageSize); -// -// public List findByPage( final Object[] values,final int offset, final int pageSize); - - public List findByPage( final Object value,final int offset, final int pageSize); - - public List findByPageTable( final Object value,final int offset, final int pageSize); - - public List reportList( final Object value,final int offset, final int pageSize); - public void updateversion(int proid,String verold,String vernew) throws Exception; - public int findRowsReport(FlowCheck flowcheck) ; - public int findRows(FlowCheck flowcheck) ; -// public List getListForPage( final int offset,final int lengh); - - public int findRowsTable(FlowCheck flowcheck) ; - - public List findProjectsList(); -} +package luckyweb.seagull.spring.service; + +import java.util.List; + +import org.springframework.transaction.annotation.Propagation; +import org.springframework.transaction.annotation.Transactional; + +import luckyweb.seagull.spring.entity.FlowCheck; + +@Transactional +public interface FlowCheckService { + public int add(FlowCheck flowcheck)throws Exception; + public void modify(FlowCheck flowcheck)throws Exception; + public void modifyState(FlowCheck flowcheck)throws Exception; + public void delete(int id)throws Exception; + + @Transactional(propagation=Propagation.NOT_SUPPORTED) + public List listcheckinfo(int projectid,int checkid)throws Exception; + + public List listdateper(String startdate,String enddate) throws Exception; + + public boolean isExist(String name,String cmdType,String planPath)throws Exception; + + public int getid(int projectid,int checkid,String entry) throws Exception; + + public String getversionnum(int projectid,int checkid) throws Exception; + + public FlowCheck load(int id)throws Exception; + + public int getcheckid(int projectid)throws Exception; + + public boolean determinerecord(int projectid,int checkid,String checkentry) throws Exception; + +// public List findByPage( final int offset,final int pageSize); +// +// public List findByPage( final Object[] values,final int offset, final int pageSize); + + public List findByPage( final Object value,final int offset, final int pageSize); + + public List findByPageTable( final Object value,final int offset, final int pageSize); + + public List reportList( final Object value,final int offset, final int pageSize); + public void updateversion(int proid,String verold,String vernew) throws Exception; + public int findRowsReport(FlowCheck flowcheck) ; + public int findRows(FlowCheck flowcheck) ; +// public List getListForPage( final int offset,final int lengh); + + public int findRowsTable(FlowCheck flowcheck) ; + + public List findProjectsList(); +} diff --git a/src/main/java/luckyweb/seagull/spring/service/FlowCheckServiceImpl.java b/src/main/java/luckyweb/seagull/spring/service/FlowCheckServiceImpl.java index 4bb6bf4..eb78028 100644 --- a/src/main/java/luckyweb/seagull/spring/service/FlowCheckServiceImpl.java +++ b/src/main/java/luckyweb/seagull/spring/service/FlowCheckServiceImpl.java @@ -1,206 +1,206 @@ -package luckyweb.seagull.spring.service; - -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import luckyweb.seagull.spring.dao.FlowCheckDao; -import luckyweb.seagull.spring.entity.FlowCheck; -import luckyweb.seagull.spring.entity.FlowInfo; - -@Service("flowcheckService") -public class FlowCheckServiceImpl implements FlowCheckService{ - - private FlowCheckDao flowcheckdao; - - public FlowCheckDao getFlowCheckDao() { - return flowcheckdao; - } - - @Resource(name = "flowcheckDao") - public void setFlowCheckDao(FlowCheckDao flowcheckDao) { - this.flowcheckdao = flowcheckDao; - } - - @Override - public int add(FlowCheck flowcheck) throws Exception { - return this.flowcheckdao.add(flowcheck); - } - - @Override - public void modify(FlowCheck flowcheck) throws Exception { - this.flowcheckdao.modify(flowcheck); - - } - - @Override - public void modifyState(FlowCheck flowcheck) throws Exception { - // TODO Auto-generated method stub - - } - - @Override - public void delete(int id) throws Exception { - this.flowcheckdao.delete(id); - - } - - @Override - public boolean isExist(String name, String cmdType, String planPath) - throws Exception { - // TODO Auto-generated method stub - return false; - } - - @Override - public FlowCheck load(int id) throws Exception { - // TODO Auto-generated method stub - return this.flowcheckdao.load(id); - } - - @Override - public int getid(int projectid,int checkid,String entry) throws Exception { - // TODO Auto-generated method stub - int id = Integer.valueOf(this.flowcheckdao.get("select id from QA_FLOWCHECK t where checkid = "+checkid+" and projectid = "+projectid+" and checkentry = "+entry)); - return id; - } - - @Override - public String getversionnum(int projectid,int checkid) throws Exception { - // TODO Auto-generated method stub - return this.flowcheckdao.get("select versionnum from QA_FLOWCHECK t where checkid = "+checkid+" and projectid = "+projectid); - } - - @Override - public int getcheckid(int projectid) throws Exception { - // TODO Auto-generated method stub - int id = Integer.valueOf(this.flowcheckdao.get("select IFNULL(max(checkid),0) from QA_FLOWCHECK where projectid = "+projectid)); - return id; - } - - @Override - public boolean determinerecord(int projectid,int checkid,String checkentry) throws Exception { - // TODO Auto-generated method stub - int count = Integer.valueOf(this.flowcheckdao.get("select count(*) from QA_FLOWCHECK " - + "where projectid = "+projectid+" and checkid = "+checkid+" and checkentry = "+checkentry+"")); - if(count==0){ - return true; - }else{ - return false; - } - } - - private String where(FlowCheck fc) { - String where = " where "; -/* if (!StrLib.isEmpty(String.valueOf(ss.getSectorid()))) { - where += " sectorid=:sectorid and "; - }*/ - if (fc.getId()!=0) { - where += " id=:id and "; - } - if (fc.getProjectid()!=0) { - where += " projectid=:projectid and "; - } - if (fc.getCheckid()!=0) { - where += " checkid=:checkid and "; - } - if (fc.getVersionnum()!=null&&!fc.getVersionnum().equals("")) { - where += " versionnum=:versionnum and "; - } - if (fc.getCheckenddate()!=null&&fc.getCheckstartdate()!=null&& - !fc.getCheckenddate().equals("")&&!fc.getCheckstartdate().equals("")) { - where += " checkdate>=:checkstartdate and checkdate<=:checkenddate and "; - } - if (where.length() == 7) { - where = ""; - } - else{ - where = where.substring(0, where.length() - 5); - } - - return where; - } - - private static String orderBy="order by checkdate desc"; - - @Override - public List findByPage(Object value, int offset, int pageSize) { - String hql="select projectid,checkid,min(checkdate),sum(case when checkresult in ('未通过','通过') then sum else 0 end) as sum," - + "sum(case checkresult when '通过' then sum else 0 end) as pass,sum(case checkresult when '未通过' then sum else 0 end) as fail,versionnum,projectid as name,projectid as per," - + "sum(case checkresult when '未检查' then sum else 0 end) as uncheck" - + " from (select projectid,versionnum,checkid,checkdate ,checkresult,COUNT(*) sum from QA_FLOWCHECK t "+where((FlowCheck)value)+" group by projectid,versionnum,checkid,checkresult,checkdate) as aa" - +" group by projectid,checkid,versionnum order by max(checkdate) desc"; - List list= flowcheckdao.findByPage(hql, value, offset, pageSize); - return list; - } - - @Override - public List findByPageTable(Object value, int offset, int pageSize) { - String hql=" from FlowCheck "+where((FlowCheck)value)+orderBy; - List list= flowcheckdao.findByPageTable(hql, value, offset, pageSize); - return list; - } - - @Override - public List reportList(Object value, int offset, int pageSize) { - String hql="select projectid,sum(case when checkresult in ('未通过','通过') then sum else 0 end) as sum," - + "sum(case checkresult when '通过' then sum else 0 end) as pass,sum(case checkresult when '未通过' then sum else 0 end) as fail,projectid as name,projectid as per " - + "from (select projectid,checkresult,COUNT(*) sum from QA_FLOWCHECK t "+where((FlowCheck)value)+" group by projectid,checkresult) as aa " - +" group by projectid"; - List list= flowcheckdao.findByPage(hql, value, offset, pageSize); - return list; - } - - @Override - public int findRowsReport(FlowCheck flowcheck) { - String sql="select projectid,sum(case when checkresult in ('未通过','通过') then sum else 0 end) as sum," - + "sum(case checkresult when '通过' then sum else 0 end) as pass,sum(case checkresult when '未通过' then sum else 0 end) as fail,projectid as name,projectid as per " - + "from (select projectid,checkresult,COUNT(*) sum from QA_FLOWCHECK t "+where(flowcheck)+" group by projectid,checkresult) as aa " - +" group by projectid"; - return flowcheckdao.findRows(flowcheck,sql); - } - - @Override - public int findRows(FlowCheck flowcheck) { - String sql="select projectid,checkid,versionnum from QA_FLOWCHECK "+where(flowcheck)+" group by projectid,checkid,versionnum"; - return flowcheckdao.findRows(flowcheck,sql); - } - - public int findRowsTable(FlowCheck flowcheck) - { - String hql = "select count(*) from FlowCheck " + where(flowcheck); - return flowcheckdao.findRowsTable(flowcheck, hql); - } - - @Override - public List findProjectsList() { - // TODO Auto-generated method stub - return null; - } - - @Override - public void updateversion(int proid,String verold,String vernew) throws Exception { - // TODO Auto-generated method stub - this.flowcheckdao.modifyVersion("update FlowCheck set versionnum='"+vernew+"' where projectid="+proid+" and versionnum='"+verold+"'"); - } - - @Override - public List listcheckinfo(int projectid,int checkid) throws Exception { - // TODO Auto-generated method stub - return this.flowcheckdao.listcheckinfo("select id,phasename,phasenodename,checkentry from QA_FLOWINFO where id not in(select checkentry from QA_FLOWCHECK " - + "where projectid = "+projectid+" and checkid = "+checkid+") " - + "order by phaseid,phasenodeid,checkentryid"); - } - - @Override - public List listdateper(String startdate,String enddate) throws Exception { - // TODO Auto-generated method stub - return this.flowcheckdao.listcheckinfo("select projectid,sum(case checkresult when '通过' then sum else 0 end) as pass,sum(case checkresult when '未通过' then sum else 0 end) as fail " - + "from (select projectid,checkresult,COUNT(*) sum from QA_FLOWCHECK " - + "where checkdate >= '"+startdate+"' and checkdate <= '"+enddate+"' group by projectid,checkresult) as aa " - + "group by projectid"); - } - -} +package luckyweb.seagull.spring.service; + +import java.util.List; + +import javax.annotation.Resource; + +import org.springframework.stereotype.Service; + +import luckyweb.seagull.spring.dao.FlowCheckDao; +import luckyweb.seagull.spring.entity.FlowCheck; +import luckyweb.seagull.spring.entity.FlowInfo; + +@Service("flowcheckService") +public class FlowCheckServiceImpl implements FlowCheckService{ + + private FlowCheckDao flowcheckdao; + + public FlowCheckDao getFlowCheckDao() { + return flowcheckdao; + } + + @Resource(name = "flowcheckDao") + public void setFlowCheckDao(FlowCheckDao flowcheckDao) { + this.flowcheckdao = flowcheckDao; + } + + @Override + public int add(FlowCheck flowcheck) throws Exception { + return this.flowcheckdao.add(flowcheck); + } + + @Override + public void modify(FlowCheck flowcheck) throws Exception { + this.flowcheckdao.modify(flowcheck); + + } + + @Override + public void modifyState(FlowCheck flowcheck) throws Exception { + // TODO Auto-generated method stub + + } + + @Override + public void delete(int id) throws Exception { + this.flowcheckdao.delete(id); + + } + + @Override + public boolean isExist(String name, String cmdType, String planPath) + throws Exception { + // TODO Auto-generated method stub + return false; + } + + @Override + public FlowCheck load(int id) throws Exception { + // TODO Auto-generated method stub + return this.flowcheckdao.load(id); + } + + @Override + public int getid(int projectid,int checkid,String entry) throws Exception { + // TODO Auto-generated method stub + int id = Integer.valueOf(this.flowcheckdao.get("select id from QA_FLOWCHECK t where checkid = "+checkid+" and projectid = "+projectid+" and checkentry = "+entry)); + return id; + } + + @Override + public String getversionnum(int projectid,int checkid) throws Exception { + // TODO Auto-generated method stub + return this.flowcheckdao.get("select versionnum from QA_FLOWCHECK t where checkid = "+checkid+" and projectid = "+projectid); + } + + @Override + public int getcheckid(int projectid) throws Exception { + // TODO Auto-generated method stub + int id = Integer.valueOf(this.flowcheckdao.get("select IFNULL(max(checkid),0) from QA_FLOWCHECK where projectid = "+projectid)); + return id; + } + + @Override + public boolean determinerecord(int projectid,int checkid,String checkentry) throws Exception { + // TODO Auto-generated method stub + int count = Integer.valueOf(this.flowcheckdao.get("select count(*) from QA_FLOWCHECK " + + "where projectid = "+projectid+" and checkid = "+checkid+" and checkentry = "+checkentry+"")); + if(count==0){ + return true; + }else{ + return false; + } + } + + private String where(FlowCheck fc) { + String where = " where "; +/* if (!StrLib.isEmpty(String.valueOf(ss.getSectorid()))) { + where += " sectorid=:sectorid and "; + }*/ + if (fc.getId()!=0) { + where += " id=:id and "; + } + if (fc.getProjectid()!=0) { + where += " projectid=:projectid and "; + } + if (fc.getCheckid()!=0) { + where += " checkid=:checkid and "; + } + if (fc.getVersionnum()!=null&&!fc.getVersionnum().equals("")) { + where += " versionnum=:versionnum and "; + } + if (fc.getCheckenddate()!=null&&fc.getCheckstartdate()!=null&& + !fc.getCheckenddate().equals("")&&!fc.getCheckstartdate().equals("")) { + where += " checkdate>=:checkstartdate and checkdate<=:checkenddate and "; + } + if (where.length() == 7) { + where = ""; + } + else{ + where = where.substring(0, where.length() - 5); + } + + return where; + } + + private static String orderBy="order by checkdate desc"; + + @Override + public List findByPage(Object value, int offset, int pageSize) { + String hql="select projectid,checkid,min(checkdate),sum(case when checkresult in ('未通过','通过') then sum else 0 end) as sum," + + "sum(case checkresult when '通过' then sum else 0 end) as pass,sum(case checkresult when '未通过' then sum else 0 end) as fail,versionnum,projectid as name,projectid as per," + + "sum(case checkresult when '未检查' then sum else 0 end) as uncheck" + + " from (select projectid,versionnum,checkid,checkdate ,checkresult,COUNT(*) sum from QA_FLOWCHECK t "+where((FlowCheck)value)+" group by projectid,versionnum,checkid,checkresult,checkdate) as aa" + +" group by projectid,checkid,versionnum order by max(checkdate) desc"; + List list= flowcheckdao.findByPage(hql, value, offset, pageSize); + return list; + } + + @Override + public List findByPageTable(Object value, int offset, int pageSize) { + String hql=" from FlowCheck "+where((FlowCheck)value)+orderBy; + List list= flowcheckdao.findByPageTable(hql, value, offset, pageSize); + return list; + } + + @Override + public List reportList(Object value, int offset, int pageSize) { + String hql="select projectid,sum(case when checkresult in ('未通过','通过') then sum else 0 end) as sum," + + "sum(case checkresult when '通过' then sum else 0 end) as pass,sum(case checkresult when '未通过' then sum else 0 end) as fail,projectid as name,projectid as per " + + "from (select projectid,checkresult,COUNT(*) sum from QA_FLOWCHECK t "+where((FlowCheck)value)+" group by projectid,checkresult) as aa " + +" group by projectid"; + List list= flowcheckdao.findByPage(hql, value, offset, pageSize); + return list; + } + + @Override + public int findRowsReport(FlowCheck flowcheck) { + String sql="select projectid,sum(case when checkresult in ('未通过','通过') then sum else 0 end) as sum," + + "sum(case checkresult when '通过' then sum else 0 end) as pass,sum(case checkresult when '未通过' then sum else 0 end) as fail,projectid as name,projectid as per " + + "from (select projectid,checkresult,COUNT(*) sum from QA_FLOWCHECK t "+where(flowcheck)+" group by projectid,checkresult) as aa " + +" group by projectid"; + return flowcheckdao.findRows(flowcheck,sql); + } + + @Override + public int findRows(FlowCheck flowcheck) { + String sql="select projectid,checkid,versionnum from QA_FLOWCHECK "+where(flowcheck)+" group by projectid,checkid,versionnum"; + return flowcheckdao.findRows(flowcheck,sql); + } + + public int findRowsTable(FlowCheck flowcheck) + { + String hql = "select count(*) from FlowCheck " + where(flowcheck); + return flowcheckdao.findRowsTable(flowcheck, hql); + } + + @Override + public List findProjectsList() { + // TODO Auto-generated method stub + return null; + } + + @Override + public void updateversion(int proid,String verold,String vernew) throws Exception { + // TODO Auto-generated method stub + this.flowcheckdao.modifyVersion("update FlowCheck set versionnum='"+vernew+"' where projectid="+proid+" and versionnum='"+verold+"'"); + } + + @Override + public List listcheckinfo(int projectid,int checkid) throws Exception { + // TODO Auto-generated method stub + return this.flowcheckdao.listcheckinfo("select id,phasename,phasenodename,checkentry from QA_FLOWINFO where id not in(select checkentry from QA_FLOWCHECK " + + "where projectid = "+projectid+" and checkid = "+checkid+") " + + "order by phaseid,phasenodeid,checkentryid"); + } + + @Override + public List listdateper(String startdate,String enddate) throws Exception { + // TODO Auto-generated method stub + return this.flowcheckdao.listcheckinfo("select projectid,sum(case checkresult when '通过' then sum else 0 end) as pass,sum(case checkresult when '未通过' then sum else 0 end) as fail " + + "from (select projectid,checkresult,COUNT(*) sum from QA_FLOWCHECK " + + "where checkdate >= '"+startdate+"' and checkdate <= '"+enddate+"' group by projectid,checkresult) as aa " + + "group by projectid"); + } + +} diff --git a/src/main/java/luckyweb/seagull/spring/service/FlowInfoService.java b/src/main/java/luckyweb/seagull/spring/service/FlowInfoService.java index 49f684c..b4ad45b 100644 --- a/src/main/java/luckyweb/seagull/spring/service/FlowInfoService.java +++ b/src/main/java/luckyweb/seagull/spring/service/FlowInfoService.java @@ -1,32 +1,32 @@ -package luckyweb.seagull.spring.service; - -import java.util.List; - -import org.springframework.transaction.annotation.Propagation; -import org.springframework.transaction.annotation.Transactional; - -import luckyweb.seagull.spring.entity.FlowInfo; - -@Transactional -public interface FlowInfoService { - - @Transactional(propagation=Propagation.NOT_SUPPORTED) - public List listphaseinfo()throws Exception; - - @Transactional(propagation=Propagation.NOT_SUPPORTED) - public List listnodeinfo(int id)throws Exception; - - @Transactional(propagation=Propagation.NOT_SUPPORTED) - public List listentryinfo(int id)throws Exception; - - @Transactional(propagation=Propagation.NOT_SUPPORTED) - public List listphaseallinfo()throws Exception; - - @Transactional(propagation=Propagation.NOT_SUPPORTED) - public List listnodeallinfo()throws Exception; - - @Transactional(propagation=Propagation.NOT_SUPPORTED) - public List listentryallinfo()throws Exception; - - public FlowInfo load(int id) throws Exception; -} +package luckyweb.seagull.spring.service; + +import java.util.List; + +import org.springframework.transaction.annotation.Propagation; +import org.springframework.transaction.annotation.Transactional; + +import luckyweb.seagull.spring.entity.FlowInfo; + +@Transactional +public interface FlowInfoService { + + @Transactional(propagation=Propagation.NOT_SUPPORTED) + public List listphaseinfo()throws Exception; + + @Transactional(propagation=Propagation.NOT_SUPPORTED) + public List listnodeinfo(int id)throws Exception; + + @Transactional(propagation=Propagation.NOT_SUPPORTED) + public List listentryinfo(int id)throws Exception; + + @Transactional(propagation=Propagation.NOT_SUPPORTED) + public List listphaseallinfo()throws Exception; + + @Transactional(propagation=Propagation.NOT_SUPPORTED) + public List listnodeallinfo()throws Exception; + + @Transactional(propagation=Propagation.NOT_SUPPORTED) + public List listentryallinfo()throws Exception; + + public FlowInfo load(int id) throws Exception; +} diff --git a/src/main/java/luckyweb/seagull/spring/service/FlowInfoServiceImpl.java b/src/main/java/luckyweb/seagull/spring/service/FlowInfoServiceImpl.java index 69e5ca0..f7ef884 100644 --- a/src/main/java/luckyweb/seagull/spring/service/FlowInfoServiceImpl.java +++ b/src/main/java/luckyweb/seagull/spring/service/FlowInfoServiceImpl.java @@ -1,65 +1,65 @@ -package luckyweb.seagull.spring.service; - -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import luckyweb.seagull.spring.dao.FlowInfoDao; -import luckyweb.seagull.spring.entity.FlowInfo; - -@Service("flowinfoService") -public class FlowInfoServiceImpl implements FlowInfoService{ - - private FlowInfoDao flowinfodao; - - public FlowInfoDao getFlowInfoDao() { - return flowinfodao; - } - - @Resource(name = "flowinfoDao") - public void setFlowInfoDao(FlowInfoDao flowinfoDao) { - this.flowinfodao = flowinfoDao; - } - - public List listphaseinfo() throws Exception { - // TODO Auto-generated method stub - return this.flowinfodao.listcheckinfo("select min(id),phasename from QA_FLOWINFO group by phasename order by min(id)"); - } - - public List listnodeinfo(int id) throws Exception { - // TODO Auto-generated method stub - return this.flowinfodao.listcheckinfo("select min(id),phasenodename from QA_FLOWINFO " - + "where phaseid = (select phaseid from QA_FLOWINFO where id = "+id+") group by phasenodename order by min(id)"); - } - - public List listentryinfo(int id) throws Exception { - // TODO Auto-generated method stub - return this.flowinfodao.listcheckinfo("select min(id),checkentry from QA_FLOWINFO " - + "where phaseid = (select phaseid from QA_FLOWINFO where id = "+id+") and " - + "phasenodeid = (select phasenodeid from QA_FLOWINFO where id = "+id+") group by checkentry order by min(id)"); - } - - public List listphaseallinfo() throws Exception { - // TODO Auto-generated method stub - return this.flowinfodao.listcheckinfo("select id,phasename from QA_FLOWINFO"); - } - - public List listnodeallinfo() throws Exception { - // TODO Auto-generated method stub - return this.flowinfodao.listcheckinfo("select id,phasenodename from QA_FLOWINFO"); - } - - public List listentryallinfo() throws Exception { - // TODO Auto-generated method stub - return this.flowinfodao.listcheckinfo("select id,checkentry from QA_FLOWINFO"); - } - - @Override - public FlowInfo load(int id) throws Exception { - // TODO Auto-generated method stub - return this.flowinfodao.get(id); - } - -} +package luckyweb.seagull.spring.service; + +import java.util.List; + +import javax.annotation.Resource; + +import org.springframework.stereotype.Service; + +import luckyweb.seagull.spring.dao.FlowInfoDao; +import luckyweb.seagull.spring.entity.FlowInfo; + +@Service("flowinfoService") +public class FlowInfoServiceImpl implements FlowInfoService{ + + private FlowInfoDao flowinfodao; + + public FlowInfoDao getFlowInfoDao() { + return flowinfodao; + } + + @Resource(name = "flowinfoDao") + public void setFlowInfoDao(FlowInfoDao flowinfoDao) { + this.flowinfodao = flowinfoDao; + } + + public List listphaseinfo() throws Exception { + // TODO Auto-generated method stub + return this.flowinfodao.listcheckinfo("select min(id),phasename from QA_FLOWINFO group by phasename order by min(id)"); + } + + public List listnodeinfo(int id) throws Exception { + // TODO Auto-generated method stub + return this.flowinfodao.listcheckinfo("select min(id),phasenodename from QA_FLOWINFO " + + "where phaseid = (select phaseid from QA_FLOWINFO where id = "+id+") group by phasenodename order by min(id)"); + } + + public List listentryinfo(int id) throws Exception { + // TODO Auto-generated method stub + return this.flowinfodao.listcheckinfo("select min(id),checkentry from QA_FLOWINFO " + + "where phaseid = (select phaseid from QA_FLOWINFO where id = "+id+") and " + + "phasenodeid = (select phasenodeid from QA_FLOWINFO where id = "+id+") group by checkentry order by min(id)"); + } + + public List listphaseallinfo() throws Exception { + // TODO Auto-generated method stub + return this.flowinfodao.listcheckinfo("select id,phasename from QA_FLOWINFO"); + } + + public List listnodeallinfo() throws Exception { + // TODO Auto-generated method stub + return this.flowinfodao.listcheckinfo("select id,phasenodename from QA_FLOWINFO"); + } + + public List listentryallinfo() throws Exception { + // TODO Auto-generated method stub + return this.flowinfodao.listcheckinfo("select id,checkentry from QA_FLOWINFO"); + } + + @Override + public FlowInfo load(int id) throws Exception { + // TODO Auto-generated method stub + return this.flowinfodao.get(id); + } + +} diff --git a/src/main/java/luckyweb/seagull/spring/service/LogDetailService.java b/src/main/java/luckyweb/seagull/spring/service/LogDetailService.java index 1d87e54..22dc8d8 100644 --- a/src/main/java/luckyweb/seagull/spring/service/LogDetailService.java +++ b/src/main/java/luckyweb/seagull/spring/service/LogDetailService.java @@ -1,22 +1,22 @@ -package luckyweb.seagull.spring.service; - -import java.util.List; - -import org.springframework.transaction.annotation.Propagation; -import org.springframework.transaction.annotation.Transactional; - -import luckyweb.seagull.spring.entity.TestLogdetail; - -@Transactional -public interface LogDetailService { - public void add(TestLogdetail log); - - @Transactional(propagation=Propagation.NOT_SUPPORTED) - public List list(TestLogdetail log); - - public TestLogdetail load(int id); - public List findByPage(Object value, int offset, int pageSize); - public int findRows(TestLogdetail logs) ; - public void delete(int id) throws Exception; - -} +package luckyweb.seagull.spring.service; + +import java.util.List; + +import org.springframework.transaction.annotation.Propagation; +import org.springframework.transaction.annotation.Transactional; + +import luckyweb.seagull.spring.entity.TestLogdetail; + +@Transactional +public interface LogDetailService { + public void add(TestLogdetail log); + + @Transactional(propagation=Propagation.NOT_SUPPORTED) + public List list(TestLogdetail log); + + public TestLogdetail load(int id); + public List findByPage(Object value, int offset, int pageSize); + public int findRows(TestLogdetail logs) ; + public void delete(int id) throws Exception; + +} diff --git a/src/main/java/luckyweb/seagull/spring/service/LogDetailServiceImpl.java b/src/main/java/luckyweb/seagull/spring/service/LogDetailServiceImpl.java index 0b3be67..7b6aee7 100644 --- a/src/main/java/luckyweb/seagull/spring/service/LogDetailServiceImpl.java +++ b/src/main/java/luckyweb/seagull/spring/service/LogDetailServiceImpl.java @@ -1,88 +1,88 @@ -package luckyweb.seagull.spring.service; - -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import luckyweb.seagull.spring.dao.TestLogdetailDao; -import luckyweb.seagull.spring.entity.TestLogdetail; - -@Service("logdetailService") -public class LogDetailServiceImpl implements LogDetailService { - - @Resource(name="logdetailDao") - private TestLogdetailDao logdetailDao; - - - public TestLogdetailDao getLogdetailDao() { - return logdetailDao; - } - - public void setLogdetailDao(TestLogdetailDao logdetailDao) { - this.logdetailDao = logdetailDao; - } - - @Override - public TestLogdetail load(int id) { - return this.logdetailDao.load(id); - } - - @Override - public void add(TestLogdetail log) { - this.logdetailDao.add(log); - } - - @Override - public List list(TestLogdetail log) { - List list=this.logdetailDao.list(log); - - return list; - } - - private static String orderBy = " order by id "; - - @SuppressWarnings("unchecked") - @Override - public List findByPage(Object value, int offset, int pageSize) - { - String hql = " from TestLogdetail " + where((TestLogdetail) value) + orderBy; - List list = logdetailDao.findByPage(hql, value, offset, pageSize); - return list; - } - - public int findRows(TestLogdetail logs) - { - String hql = "select count(*) from TestLogdetail " + where(logs); - return logdetailDao.findRows(hql, logs); - } - - - @Override - public void delete(int id) throws Exception { - String hql="delete from TestLogdetail where taskId=:taskId "; - this.logdetailDao.delete(hql,id); - } - - private String where(TestLogdetail logs) - { - String where = " where "; - if (logs.getCaseid()!=0){ - where += " caseid=:caseid and "; - } - if (logs.getTaskid()!=0){ - where += " taskid=:taskid and "; - } - if (where.length() == 7) - { - where = ""; - } - else - { - where = where.substring(0, where.length() - 5); - } - - return where; - } -} +package luckyweb.seagull.spring.service; + +import java.util.List; + +import javax.annotation.Resource; + +import org.springframework.stereotype.Service; + +import luckyweb.seagull.spring.dao.TestLogdetailDao; +import luckyweb.seagull.spring.entity.TestLogdetail; + +@Service("logdetailService") +public class LogDetailServiceImpl implements LogDetailService { + + @Resource(name="logdetailDao") + private TestLogdetailDao logdetailDao; + + + public TestLogdetailDao getLogdetailDao() { + return logdetailDao; + } + + public void setLogdetailDao(TestLogdetailDao logdetailDao) { + this.logdetailDao = logdetailDao; + } + + @Override + public TestLogdetail load(int id) { + return this.logdetailDao.load(id); + } + + @Override + public void add(TestLogdetail log) { + this.logdetailDao.add(log); + } + + @Override + public List list(TestLogdetail log) { + List list=this.logdetailDao.list(log); + + return list; + } + + private static String orderBy = " order by id "; + + @SuppressWarnings("unchecked") + @Override + public List findByPage(Object value, int offset, int pageSize) + { + String hql = " from TestLogdetail " + where((TestLogdetail) value) + orderBy; + List list = logdetailDao.findByPage(hql, value, offset, pageSize); + return list; + } + + public int findRows(TestLogdetail logs) + { + String hql = "select count(*) from TestLogdetail " + where(logs); + return logdetailDao.findRows(hql, logs); + } + + + @Override + public void delete(int id) throws Exception { + String hql="delete from TestLogdetail where taskId=:taskId "; + this.logdetailDao.delete(hql,id); + } + + private String where(TestLogdetail logs) + { + String where = " where "; + if (logs.getCaseid()!=0){ + where += " caseid=:caseid and "; + } + if (logs.getTaskid()!=0){ + where += " taskid=:taskid and "; + } + if (where.length() == 7) + { + where = ""; + } + else + { + where = where.substring(0, where.length() - 5); + } + + return where; + } +} diff --git a/src/main/java/luckyweb/seagull/spring/service/LogServiceImpl.java b/src/main/java/luckyweb/seagull/spring/service/LogServiceImpl.java index d3ca5fc..44fe55b 100644 --- a/src/main/java/luckyweb/seagull/spring/service/LogServiceImpl.java +++ b/src/main/java/luckyweb/seagull/spring/service/LogServiceImpl.java @@ -1,40 +1,40 @@ -package luckyweb.seagull.spring.service; - -import org.apache.log4j.Logger; -import org.aspectj.lang.JoinPoint; -import org.aspectj.lang.annotation.After; -import org.aspectj.lang.annotation.Around; -import org.aspectj.lang.annotation.Aspect; -import org.aspectj.lang.annotation.Before; -import org.aspectj.lang.annotation.Pointcut; - -@Aspect -public class LogServiceImpl -{ - Logger log = Logger.getLogger(LogServiceImpl.class); - - @Pointcut("execution(* com.yangl.spring.dao..*.*(..))") - public void pointcut() - { - System.out.println("pointcut function exec .. "); - } - - @Before("pointcut()") - public void before(String name) - { - log.info("开始执行:" + name); - } - - @After("pointcut()") - public void after(String name) - { - log.info("结束执行:" + name); - } - - @Around("") - public void around(JoinPoint point, Object returnObj) - { - - } - -} +package luckyweb.seagull.spring.service; + +import org.apache.log4j.Logger; +import org.aspectj.lang.JoinPoint; +import org.aspectj.lang.annotation.After; +import org.aspectj.lang.annotation.Around; +import org.aspectj.lang.annotation.Aspect; +import org.aspectj.lang.annotation.Before; +import org.aspectj.lang.annotation.Pointcut; + +@Aspect +public class LogServiceImpl +{ + Logger log = Logger.getLogger(LogServiceImpl.class); + + @Pointcut("execution(* com.yangl.spring.dao..*.*(..))") + public void pointcut() + { + System.out.println("pointcut function exec .. "); + } + + @Before("pointcut()") + public void before(String name) + { + log.info("开始执行:" + name); + } + + @After("pointcut()") + public void after(String name) + { + log.info("结束执行:" + name); + } + + @Around("") + public void around(JoinPoint point, Object returnObj) + { + + } + +} diff --git a/src/main/java/luckyweb/seagull/spring/service/OperationLogService.java b/src/main/java/luckyweb/seagull/spring/service/OperationLogService.java index b928da2..b307867 100644 --- a/src/main/java/luckyweb/seagull/spring/service/OperationLogService.java +++ b/src/main/java/luckyweb/seagull/spring/service/OperationLogService.java @@ -1,20 +1,20 @@ -package luckyweb.seagull.spring.service; - - -import java.util.List; - -import javax.servlet.http.HttpServletRequest; - -import org.springframework.transaction.annotation.Transactional; - -import luckyweb.seagull.spring.entity.OperationLog; - - -@Transactional -public interface OperationLogService { - public int add(HttpServletRequest req,String tablename,int tableid,int id,String operation_description)throws Exception; - public OperationLog load(int id)throws Exception; - public List findByPage( final Object value,final int offset, final int pageSize); - public int findRows(OperationLog oplog); - public void delete(int id) throws Exception; -} +package luckyweb.seagull.spring.service; + + +import java.util.List; + +import javax.servlet.http.HttpServletRequest; + +import org.springframework.transaction.annotation.Transactional; + +import luckyweb.seagull.spring.entity.OperationLog; + + +@Transactional +public interface OperationLogService { + public int add(HttpServletRequest req,String tablename,int tableid,int id,String operation_description)throws Exception; + public OperationLog load(int id)throws Exception; + public List findByPage( final Object value,final int offset, final int pageSize); + public int findRows(OperationLog oplog); + public void delete(int id) throws Exception; +} diff --git a/src/main/java/luckyweb/seagull/spring/service/OperationLogServiceImpl.java b/src/main/java/luckyweb/seagull/spring/service/OperationLogServiceImpl.java index da7e89a..5f58172 100644 --- a/src/main/java/luckyweb/seagull/spring/service/OperationLogServiceImpl.java +++ b/src/main/java/luckyweb/seagull/spring/service/OperationLogServiceImpl.java @@ -1,100 +1,100 @@ -package luckyweb.seagull.spring.service; - -import java.text.SimpleDateFormat; -import java.util.Date; -import java.util.List; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; - -import org.springframework.stereotype.Service; - -import luckyweb.seagull.spring.dao.OperationLogDao; -import luckyweb.seagull.spring.entity.OperationLog; -import luckyweb.seagull.spring.entity.SectorProjects; - - - -@Service("operationlogService") -public class OperationLogServiceImpl implements OperationLogService{ - - private OperationLogDao operationlogdao; - - public OperationLogDao getOperationLogDao() { - return operationlogdao; - } - - @Resource(name = "operationlogDao") - public void setOperationLogDao(OperationLogDao operationlogDao) { - this.operationlogdao = operationlogDao; - } - - @Override - public OperationLog load(int id) throws Exception { - // TODO Auto-generated method stub - return this.operationlogdao.load(id); - } - - private String where(OperationLog oplog) { - String where = " where "; - if (oplog.getStarttime()!=null&&oplog.getEndtime()!=null - &&!oplog.getStarttime().equals("")&&!oplog.getEndtime().equals("")) { - where += " operation_time>=:starttime and operation_time<=:endtime and "; - } - if (oplog.getProjectid()!=0) { - where += " projectid=:projectid and "; - } - if (oplog.getOperationer()!=null&&!oplog.getOperationer().equals("")) { - where += " (operationer like :operationer or "; - } - if (oplog.getOperation_description()!=null&&!oplog.getOperation_description().equals("")) { - where += " operation_description like :operation_description) or "; - } - if (where.length() == 7) { - where = ""; - } - else{ - where = where.substring(0, where.length() - 5); - } - - return where; - } - - private static String orderBy=" order by id desc "; - - @Override - public List findByPage(Object value, int offset, int pageSize) { - String hql=" from OperationLog "+where((OperationLog)value)+orderBy; - List list= operationlogdao.findByPage(hql, value, offset, pageSize); - return list; - } - - @Override - public int findRows(OperationLog oplog) { - String hql="select count(*) from OperationLog "+where(oplog); - return operationlogdao.findRows(oplog, hql); - } - - - @Override - public int add(HttpServletRequest req,String tablename,int tableid,int id,String operation_description) throws Exception { - SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); - OperationLog op_log = new OperationLog(); - String operation_time = df.format(new Date()).toString(); - op_log.setTableid(tableid); - op_log.setOperation_time(operation_time); - op_log.setOperationer(req.getSession().getAttribute("username").toString()); - op_log.setTablename(tablename); - SectorProjects p = new SectorProjects(); - p.setProjectid(id); - op_log.setSectorProjects(p); - op_log.setOperation_description(operation_description); - return this.operationlogdao.add(op_log); - } - - @Override - public void delete(int id) throws Exception { - String hql="delete from OperationLog where projectid="+id; - this.operationlogdao.delete(hql); - } -} +package luckyweb.seagull.spring.service; + +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.List; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; + +import org.springframework.stereotype.Service; + +import luckyweb.seagull.spring.dao.OperationLogDao; +import luckyweb.seagull.spring.entity.OperationLog; +import luckyweb.seagull.spring.entity.SectorProjects; + + + +@Service("operationlogService") +public class OperationLogServiceImpl implements OperationLogService{ + + private OperationLogDao operationlogdao; + + public OperationLogDao getOperationLogDao() { + return operationlogdao; + } + + @Resource(name = "operationlogDao") + public void setOperationLogDao(OperationLogDao operationlogDao) { + this.operationlogdao = operationlogDao; + } + + @Override + public OperationLog load(int id) throws Exception { + // TODO Auto-generated method stub + return this.operationlogdao.load(id); + } + + private String where(OperationLog oplog) { + String where = " where "; + if (oplog.getStarttime()!=null&&oplog.getEndtime()!=null + &&!oplog.getStarttime().equals("")&&!oplog.getEndtime().equals("")) { + where += " operation_time>=:starttime and operation_time<=:endtime and "; + } + if (oplog.getProjectid()!=0) { + where += " projectid=:projectid and "; + } + if (oplog.getOperationer()!=null&&!oplog.getOperationer().equals("")) { + where += " (operationer like :operationer or "; + } + if (oplog.getOperation_description()!=null&&!oplog.getOperation_description().equals("")) { + where += " operation_description like :operation_description) or "; + } + if (where.length() == 7) { + where = ""; + } + else{ + where = where.substring(0, where.length() - 5); + } + + return where; + } + + private static String orderBy=" order by id desc "; + + @Override + public List findByPage(Object value, int offset, int pageSize) { + String hql=" from OperationLog "+where((OperationLog)value)+orderBy; + List list= operationlogdao.findByPage(hql, value, offset, pageSize); + return list; + } + + @Override + public int findRows(OperationLog oplog) { + String hql="select count(*) from OperationLog "+where(oplog); + return operationlogdao.findRows(oplog, hql); + } + + + @Override + public int add(HttpServletRequest req,String tablename,int tableid,int id,String operation_description) throws Exception { + SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + OperationLog op_log = new OperationLog(); + String operation_time = df.format(new Date()).toString(); + op_log.setTableid(tableid); + op_log.setOperation_time(operation_time); + op_log.setOperationer(req.getSession().getAttribute("username").toString()); + op_log.setTablename(tablename); + SectorProjects p = new SectorProjects(); + p.setProjectid(id); + op_log.setSectorProjects(p); + op_log.setOperation_description(operation_description); + return this.operationlogdao.add(op_log); + } + + @Override + public void delete(int id) throws Exception { + String hql="delete from OperationLog where projectid="+id; + this.operationlogdao.delete(hql); + } +} diff --git a/src/main/java/luckyweb/seagull/spring/service/PlanFlowCheckService.java b/src/main/java/luckyweb/seagull/spring/service/PlanFlowCheckService.java index b3797c0..4be85b5 100644 --- a/src/main/java/luckyweb/seagull/spring/service/PlanFlowCheckService.java +++ b/src/main/java/luckyweb/seagull/spring/service/PlanFlowCheckService.java @@ -1,22 +1,22 @@ -package luckyweb.seagull.spring.service; - -import java.util.List; - -import org.springframework.transaction.annotation.Transactional; - -import luckyweb.seagull.spring.entity.PlanFlowCheck; - - -@Transactional -public interface PlanFlowCheckService { - public int add(PlanFlowCheck pfc)throws Exception; - public void modify(PlanFlowCheck pfc)throws Exception; - public void delete(int id)throws Exception; - - - public PlanFlowCheck load(int id)throws Exception; - - public List findByPage( final Object value,final int offset, final int pageSize); - - public int findRows(PlanFlowCheck pfc) ; -} +package luckyweb.seagull.spring.service; + +import java.util.List; + +import org.springframework.transaction.annotation.Transactional; + +import luckyweb.seagull.spring.entity.PlanFlowCheck; + + +@Transactional +public interface PlanFlowCheckService { + public int add(PlanFlowCheck pfc)throws Exception; + public void modify(PlanFlowCheck pfc)throws Exception; + public void delete(int id)throws Exception; + + + public PlanFlowCheck load(int id)throws Exception; + + public List findByPage( final Object value,final int offset, final int pageSize); + + public int findRows(PlanFlowCheck pfc) ; +} diff --git a/src/main/java/luckyweb/seagull/spring/service/PlanFlowCheckServiceImpl.java b/src/main/java/luckyweb/seagull/spring/service/PlanFlowCheckServiceImpl.java index 6ce7ca2..cc36444 100644 --- a/src/main/java/luckyweb/seagull/spring/service/PlanFlowCheckServiceImpl.java +++ b/src/main/java/luckyweb/seagull/spring/service/PlanFlowCheckServiceImpl.java @@ -1,86 +1,86 @@ -package luckyweb.seagull.spring.service; - -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import luckyweb.seagull.spring.dao.PlanFlowCheckDao; -import luckyweb.seagull.spring.entity.PlanFlowCheck; - - -@Service("planflowcheckService") -public class PlanFlowCheckServiceImpl implements PlanFlowCheckService{ - - private PlanFlowCheckDao planflowcheckdao; - - public PlanFlowCheckDao getPlanFlowCheckDao() { - return planflowcheckdao; - } - - @Resource(name = "planflowcheckDao") - public void setPlanFlowCheckDao(PlanFlowCheckDao planflowcheckDao) { - this.planflowcheckdao = planflowcheckDao; - } - - @Override - public int add(PlanFlowCheck pfc) throws Exception { - return this.planflowcheckdao.add(pfc); - } - - @Override - public void modify(PlanFlowCheck pfc) throws Exception { - this.planflowcheckdao.modify(pfc); - - } - - @Override - public void delete(int id) throws Exception { - this.planflowcheckdao.delete(id); - - } - - @Override - public PlanFlowCheck load(int id) throws Exception { - // TODO Auto-generated method stub - return this.planflowcheckdao.load(id); - } - - private String where(PlanFlowCheck pfc) { - String where = " where "; -/* if (!StrLib.isEmpty(String.valueOf(ss.getSectorid()))) { - where += " sectorid=:sectorid and "; - }*/ - if (pfc.getId()!=0) { - where += " id=:id and "; - } - if (pfc.getStatus()!=0) { - where += " status=:status and "; - } - if (where.length() == 7) { - where = ""; - } - else{ - where = where.substring(0, where.length() - 5); - } - - return where; - } - - private static String orderBy="order by id desc"; - - @Override - public List findByPage(Object value, int offset, int pageSize) { - String hql="from PlanFlowCheck t "+where((PlanFlowCheck)value)+orderBy; - List list= planflowcheckdao.findByPage(hql, value, offset, pageSize); - return list; - } - - @Override - public int findRows(PlanFlowCheck pfc) { - String hql="select count(*) from PlanFlowCheck t "+where(pfc)+orderBy; - return planflowcheckdao.findRows(pfc,hql); - } - -} +package luckyweb.seagull.spring.service; + +import java.util.List; + +import javax.annotation.Resource; + +import org.springframework.stereotype.Service; + +import luckyweb.seagull.spring.dao.PlanFlowCheckDao; +import luckyweb.seagull.spring.entity.PlanFlowCheck; + + +@Service("planflowcheckService") +public class PlanFlowCheckServiceImpl implements PlanFlowCheckService{ + + private PlanFlowCheckDao planflowcheckdao; + + public PlanFlowCheckDao getPlanFlowCheckDao() { + return planflowcheckdao; + } + + @Resource(name = "planflowcheckDao") + public void setPlanFlowCheckDao(PlanFlowCheckDao planflowcheckDao) { + this.planflowcheckdao = planflowcheckDao; + } + + @Override + public int add(PlanFlowCheck pfc) throws Exception { + return this.planflowcheckdao.add(pfc); + } + + @Override + public void modify(PlanFlowCheck pfc) throws Exception { + this.planflowcheckdao.modify(pfc); + + } + + @Override + public void delete(int id) throws Exception { + this.planflowcheckdao.delete(id); + + } + + @Override + public PlanFlowCheck load(int id) throws Exception { + // TODO Auto-generated method stub + return this.planflowcheckdao.load(id); + } + + private String where(PlanFlowCheck pfc) { + String where = " where "; +/* if (!StrLib.isEmpty(String.valueOf(ss.getSectorid()))) { + where += " sectorid=:sectorid and "; + }*/ + if (pfc.getId()!=0) { + where += " id=:id and "; + } + if (pfc.getStatus()!=0) { + where += " status=:status and "; + } + if (where.length() == 7) { + where = ""; + } + else{ + where = where.substring(0, where.length() - 5); + } + + return where; + } + + private static String orderBy="order by id desc"; + + @Override + public List findByPage(Object value, int offset, int pageSize) { + String hql="from PlanFlowCheck t "+where((PlanFlowCheck)value)+orderBy; + List list= planflowcheckdao.findByPage(hql, value, offset, pageSize); + return list; + } + + @Override + public int findRows(PlanFlowCheck pfc) { + String hql="select count(*) from PlanFlowCheck t "+where(pfc)+orderBy; + return planflowcheckdao.findRows(pfc,hql); + } + +} diff --git a/src/main/java/luckyweb/seagull/spring/service/ProjectCaseService.java b/src/main/java/luckyweb/seagull/spring/service/ProjectCaseService.java index 7233e21..652e813 100644 --- a/src/main/java/luckyweb/seagull/spring/service/ProjectCaseService.java +++ b/src/main/java/luckyweb/seagull/spring/service/ProjectCaseService.java @@ -1,20 +1,20 @@ -package luckyweb.seagull.spring.service; - -import java.util.List; - -import org.springframework.transaction.annotation.Transactional; - -import luckyweb.seagull.spring.entity.ProjectCase; - -@Transactional -public interface ProjectCaseService { - public int add(ProjectCase projectcase)throws Exception; - public void delete(int id)throws Exception; - public void modify(ProjectCase projectcase)throws Exception; - public ProjectCase load(int id)throws Exception; - - public List findByPage( final Object value,final int offset, final int pageSize); - public int findRows(ProjectCase projectcase) ; - public ProjectCase getCaseBySign(String sign) throws Exception; - public String getCaseMaxIndex(int projectid) throws Exception; -} +package luckyweb.seagull.spring.service; + +import java.util.List; + +import org.springframework.transaction.annotation.Transactional; + +import luckyweb.seagull.spring.entity.ProjectCase; + +@Transactional +public interface ProjectCaseService { + public int add(ProjectCase projectcase)throws Exception; + public void delete(int id)throws Exception; + public void modify(ProjectCase projectcase)throws Exception; + public ProjectCase load(int id)throws Exception; + + public List findByPage( final Object value,final int offset, final int pageSize); + public int findRows(ProjectCase projectcase) ; + public ProjectCase getCaseBySign(String sign) throws Exception; + public String getCaseMaxIndex(int projectid) throws Exception; +} diff --git a/src/main/java/luckyweb/seagull/spring/service/ProjectCaseServiceImpl.java b/src/main/java/luckyweb/seagull/spring/service/ProjectCaseServiceImpl.java index f517de8..11aad57 100644 --- a/src/main/java/luckyweb/seagull/spring/service/ProjectCaseServiceImpl.java +++ b/src/main/java/luckyweb/seagull/spring/service/ProjectCaseServiceImpl.java @@ -1,99 +1,99 @@ -package luckyweb.seagull.spring.service; - -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import luckyweb.seagull.spring.dao.ProjectCaseDao; -import luckyweb.seagull.spring.entity.ProjectCase; - -@Service("projectCaseService") -public class ProjectCaseServiceImpl implements ProjectCaseService{ - - private ProjectCaseDao projectcaseDao; - - public ProjectCaseDao getProjectCaseDao() { - return projectcaseDao; - } - - @Resource(name = "projectCaseDao") - public void setProjectCaseDao(ProjectCaseDao projectcaseDao) { - this.projectcaseDao = projectcaseDao; - } - - @Override - public int add(ProjectCase projectcase) throws Exception { - return this.projectcaseDao.add(projectcase); - } - - @Override - public void delete(int id) throws Exception { - this.projectcaseDao.delete(id); - } - - @Override - public void modify(ProjectCase projectcase) throws Exception { - this.projectcaseDao.modify(projectcase); - - } - - @Override - public ProjectCase load(int id) throws Exception { - // TODO Auto-generated method stub - return this.projectcaseDao.load(id); - } - - private String where(ProjectCase projectcase) { - String where = " where "; - if (projectcase.getProjectid()!=0&&projectcase.getProjectid()!=99) { - where += " projectid =:projectid and "; - }if (projectcase.getModuleid()!=0&&projectcase.getModuleidarr().length>0) { - where += " moduleid in (:moduleid) and "; - }if (null!=projectcase.getSign()&&!"".equals(projectcase.getSign())) { - where += " (sign like :sign or "; - }if (null!=projectcase.getName()&&!"".equals(projectcase.getName())) { - where += " name like :name or "; - }if (null!=projectcase.getOperationer()&&!"".equals(projectcase.getOperationer())) { - where += " operationer like :operationer or "; - }if (null!=projectcase.getRemark()&&!"".equals(projectcase.getRemark())) { - where += " remark like :remark) or "; - } - if (where.length() == 7) { - where = ""; - } - else{ - where = where.substring(0, where.length() - 5); - } - - return where; - } - - private static String orderBy=" order by id desc "; - - @Override - public List findByPage(Object value, int offset, int pageSize) { - String hql=" from ProjectCase "+where((ProjectCase)value)+orderBy; - List list= projectcaseDao.findByPage(hql, value, offset, pageSize); - return list; - } - - @Override - public int findRows(ProjectCase projectcase) { - String hql="select count(*) from ProjectCase "+where(projectcase); - return projectcaseDao.findRows(projectcase, hql); - } - - @Override - public ProjectCase getCaseBySign(String sign) throws Exception { - // TODO Auto-generated method stub - return this.projectcaseDao.getList(" from ProjectCase where sign='"+sign+"' order by id").get(0); - } - - @Override - public String getCaseMaxIndex(int projectid) throws Exception { - // TODO Auto-generated method stub - return this.projectcaseDao.getCaseMaxIndex("select IFNULL(MAX(projectindex),0) from project_case where projectid="+projectid); - } -} +package luckyweb.seagull.spring.service; + +import java.util.List; + +import javax.annotation.Resource; + +import org.springframework.stereotype.Service; + +import luckyweb.seagull.spring.dao.ProjectCaseDao; +import luckyweb.seagull.spring.entity.ProjectCase; + +@Service("projectCaseService") +public class ProjectCaseServiceImpl implements ProjectCaseService{ + + private ProjectCaseDao projectcaseDao; + + public ProjectCaseDao getProjectCaseDao() { + return projectcaseDao; + } + + @Resource(name = "projectCaseDao") + public void setProjectCaseDao(ProjectCaseDao projectcaseDao) { + this.projectcaseDao = projectcaseDao; + } + + @Override + public int add(ProjectCase projectcase) throws Exception { + return this.projectcaseDao.add(projectcase); + } + + @Override + public void delete(int id) throws Exception { + this.projectcaseDao.delete(id); + } + + @Override + public void modify(ProjectCase projectcase) throws Exception { + this.projectcaseDao.modify(projectcase); + + } + + @Override + public ProjectCase load(int id) throws Exception { + // TODO Auto-generated method stub + return this.projectcaseDao.load(id); + } + + private String where(ProjectCase projectcase) { + String where = " where "; + if (projectcase.getProjectid()!=0&&projectcase.getProjectid()!=99) { + where += " projectid =:projectid and "; + }if (projectcase.getModuleid()!=0&&projectcase.getModuleidarr().length>0) { + where += " moduleid in (:moduleid) and "; + }if (null!=projectcase.getSign()&&!"".equals(projectcase.getSign())) { + where += " (sign like :sign or "; + }if (null!=projectcase.getName()&&!"".equals(projectcase.getName())) { + where += " name like :name or "; + }if (null!=projectcase.getOperationer()&&!"".equals(projectcase.getOperationer())) { + where += " operationer like :operationer or "; + }if (null!=projectcase.getRemark()&&!"".equals(projectcase.getRemark())) { + where += " remark like :remark) or "; + } + if (where.length() == 7) { + where = ""; + } + else{ + where = where.substring(0, where.length() - 5); + } + + return where; + } + + private static String orderBy=" order by id desc "; + + @Override + public List findByPage(Object value, int offset, int pageSize) { + String hql=" from ProjectCase "+where((ProjectCase)value)+orderBy; + List list= projectcaseDao.findByPage(hql, value, offset, pageSize); + return list; + } + + @Override + public int findRows(ProjectCase projectcase) { + String hql="select count(*) from ProjectCase "+where(projectcase); + return projectcaseDao.findRows(projectcase, hql); + } + + @Override + public ProjectCase getCaseBySign(String sign) throws Exception { + // TODO Auto-generated method stub + return this.projectcaseDao.getList(" from ProjectCase where sign='"+sign+"' order by id").get(0); + } + + @Override + public String getCaseMaxIndex(int projectid) throws Exception { + // TODO Auto-generated method stub + return this.projectcaseDao.getCaseMaxIndex("select IFNULL(MAX(projectindex),0) from project_case where projectid="+projectid); + } +} diff --git a/src/main/java/luckyweb/seagull/spring/service/ProjectCasestepsService.java b/src/main/java/luckyweb/seagull/spring/service/ProjectCasestepsService.java index a3c432a..e4b9c2a 100644 --- a/src/main/java/luckyweb/seagull/spring/service/ProjectCasestepsService.java +++ b/src/main/java/luckyweb/seagull/spring/service/ProjectCasestepsService.java @@ -1,17 +1,17 @@ -package luckyweb.seagull.spring.service; - -import java.util.List; - -import org.springframework.transaction.annotation.Transactional; - -import luckyweb.seagull.spring.entity.ProjectCasesteps; - -@Transactional -public interface ProjectCasestepsService { - public int add(ProjectCasesteps casesteps)throws Exception; - public void delete(int id)throws Exception; - public void delforcaseid(int id) throws Exception; - public void modify(ProjectCasesteps casesteps)throws Exception; - public ProjectCasesteps load(int id)throws Exception; - public List getSteps(int caseid)throws Exception; -} +package luckyweb.seagull.spring.service; + +import java.util.List; + +import org.springframework.transaction.annotation.Transactional; + +import luckyweb.seagull.spring.entity.ProjectCasesteps; + +@Transactional +public interface ProjectCasestepsService { + public int add(ProjectCasesteps casesteps)throws Exception; + public void delete(int id)throws Exception; + public void delforcaseid(int id) throws Exception; + public void modify(ProjectCasesteps casesteps)throws Exception; + public ProjectCasesteps load(int id)throws Exception; + public List getSteps(int caseid)throws Exception; +} diff --git a/src/main/java/luckyweb/seagull/spring/service/ProjectCasestepsServiceImpl.java b/src/main/java/luckyweb/seagull/spring/service/ProjectCasestepsServiceImpl.java index d51ca64..cb5c864 100644 --- a/src/main/java/luckyweb/seagull/spring/service/ProjectCasestepsServiceImpl.java +++ b/src/main/java/luckyweb/seagull/spring/service/ProjectCasestepsServiceImpl.java @@ -1,59 +1,59 @@ -package luckyweb.seagull.spring.service; - -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import luckyweb.seagull.spring.dao.ProjectCasestepsDao; -import luckyweb.seagull.spring.entity.ProjectCasesteps; - -@Service("projectCasestepsService") -public class ProjectCasestepsServiceImpl implements ProjectCasestepsService{ - - private ProjectCasestepsDao casestepsDao; - - public ProjectCasestepsDao getProjectCasestepsDao() { - return casestepsDao; - } - - @Resource(name = "projectCasestepsDao") - public void setProjectCasestepsDao(ProjectCasestepsDao casestepsDao) { - this.casestepsDao = casestepsDao; - } - - @Override - public int add(ProjectCasesteps casesteps) throws Exception { - return this.casestepsDao.add(casesteps); - } - - @Override - public void delete(int id) throws Exception { - this.casestepsDao.delete(id); - } - - @Override - public void modify(ProjectCasesteps casesteps) throws Exception { - this.casestepsDao.modify(casesteps); - - } - - @Override - public ProjectCasesteps load(int id) throws Exception { - // TODO Auto-generated method stub - return this.casestepsDao.load(id); - } - - @Override - public List getSteps(int caseid) throws Exception { - // TODO Auto-generated method stub - return this.casestepsDao.steps(" from ProjectCasesteps where caseid="+caseid+" order by stepnum"); - } - - @Override - public void delforcaseid(int id) throws Exception { - String hql="delete from ProjectCasesteps where caseid=:caseId"; - this.casestepsDao.delete(hql, id); - } -} +package luckyweb.seagull.spring.service; + +import java.util.List; + +import javax.annotation.Resource; + +import org.springframework.stereotype.Service; + +import luckyweb.seagull.spring.dao.ProjectCasestepsDao; +import luckyweb.seagull.spring.entity.ProjectCasesteps; + +@Service("projectCasestepsService") +public class ProjectCasestepsServiceImpl implements ProjectCasestepsService{ + + private ProjectCasestepsDao casestepsDao; + + public ProjectCasestepsDao getProjectCasestepsDao() { + return casestepsDao; + } + + @Resource(name = "projectCasestepsDao") + public void setProjectCasestepsDao(ProjectCasestepsDao casestepsDao) { + this.casestepsDao = casestepsDao; + } + + @Override + public int add(ProjectCasesteps casesteps) throws Exception { + return this.casestepsDao.add(casesteps); + } + + @Override + public void delete(int id) throws Exception { + this.casestepsDao.delete(id); + } + + @Override + public void modify(ProjectCasesteps casesteps) throws Exception { + this.casestepsDao.modify(casesteps); + + } + + @Override + public ProjectCasesteps load(int id) throws Exception { + // TODO Auto-generated method stub + return this.casestepsDao.load(id); + } + + @Override + public List getSteps(int caseid) throws Exception { + // TODO Auto-generated method stub + return this.casestepsDao.steps(" from ProjectCasesteps where caseid="+caseid+" order by stepnum"); + } + + @Override + public void delforcaseid(int id) throws Exception { + String hql="delete from ProjectCasesteps where caseid=:caseId"; + this.casestepsDao.delete(hql, id); + } +} diff --git a/src/main/java/luckyweb/seagull/spring/service/ProjectModuleService.java b/src/main/java/luckyweb/seagull/spring/service/ProjectModuleService.java index dba19e0..66c14a7 100644 --- a/src/main/java/luckyweb/seagull/spring/service/ProjectModuleService.java +++ b/src/main/java/luckyweb/seagull/spring/service/ProjectModuleService.java @@ -1,23 +1,23 @@ -package luckyweb.seagull.spring.service; - -import java.util.List; - -import org.springframework.transaction.annotation.Transactional; - -import luckyweb.seagull.spring.entity.ProjectModule; - -@Transactional -public interface ProjectModuleService { - public int add(ProjectModule projectmodule)throws Exception; - public void delete(ProjectModule projectmodule)throws Exception; - public void modify(ProjectModule projectmodule)throws Exception; - public ProjectModule load(int id)throws Exception; - - public List findByPage( final Object value,final int offset, final int pageSize); - public int findRows(ProjectModule projectmodule) ; - public List getModuleList(); - public List getModuleListByProjectid(int projectid,int id); - public boolean getModuleIsParent(int id); - public List getModuleAllListByProjectid(int projectid); - public int getModuleIdByName(String modulename) throws Exception; -} +package luckyweb.seagull.spring.service; + +import java.util.List; + +import org.springframework.transaction.annotation.Transactional; + +import luckyweb.seagull.spring.entity.ProjectModule; + +@Transactional +public interface ProjectModuleService { + public int add(ProjectModule projectmodule)throws Exception; + public void delete(ProjectModule projectmodule)throws Exception; + public void modify(ProjectModule projectmodule)throws Exception; + public ProjectModule load(int id)throws Exception; + + public List findByPage( final Object value,final int offset, final int pageSize); + public int findRows(ProjectModule projectmodule) ; + public List getModuleList(); + public List getModuleListByProjectid(int projectid,int id); + public boolean getModuleIsParent(int id); + public List getModuleAllListByProjectid(int projectid); + public int getModuleIdByName(String modulename) throws Exception; +} diff --git a/src/main/java/luckyweb/seagull/spring/service/ProjectModuleServiceImpl.java b/src/main/java/luckyweb/seagull/spring/service/ProjectModuleServiceImpl.java index 745079e..dee013a 100644 --- a/src/main/java/luckyweb/seagull/spring/service/ProjectModuleServiceImpl.java +++ b/src/main/java/luckyweb/seagull/spring/service/ProjectModuleServiceImpl.java @@ -1,146 +1,146 @@ -package luckyweb.seagull.spring.service; - -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import luckyweb.seagull.spring.dao.ProjectModuleDao; -import luckyweb.seagull.spring.entity.ProjectModule; -import luckyweb.seagull.util.StrLib; - -@Service("projectModuleService") -public class ProjectModuleServiceImpl implements ProjectModuleService{ - - private ProjectModuleDao projectmoduleDao; - - public ProjectModuleDao getProjectModuleDao() { - return projectmoduleDao; - } - - @Resource(name = "projectModuleDao") - public void setProjectModuleDao(ProjectModuleDao projectmoduleDao) { - this.projectmoduleDao = projectmoduleDao; - } - - @Override - public int add(ProjectModule projectmodule) throws Exception { - return this.projectmoduleDao.add(projectmodule); - } - - @Override - public void delete(ProjectModule projectmodule) throws Exception { - this.projectmoduleDao.delete(projectmodule); - } - - @Override - public void modify(ProjectModule projectmodule) throws Exception { - this.projectmoduleDao.modify(projectmodule); - - } - - @Override - public ProjectModule load(int id) throws Exception { - // TODO Auto-generated method stub - return this.projectmoduleDao.load(id); - } - - private String where(ProjectModule projectmodule) { - String where = " where "; - if (projectmodule.getProjectid()!=0&&projectmodule.getProjectid()!=99) { - where += " projectid =:projectid and "; - } - if (where.length() == 7) { - where = ""; - } - else{ - where = where.substring(0, where.length() - 5); - } - - return where; - } - - private static String orderBy=" order by id desc "; - - @Override - public List findByPage(Object value, int offset, int pageSize) { - String hql=" from ProjectModule "+where((ProjectModule)value)+orderBy; - List list= projectmoduleDao.findByPage(hql, value, offset, pageSize); - return list; - } - - @Override - public int findRows(ProjectModule projectmodule) { - String hql="select count(*) from ProjectModule "+where(projectmodule); - return projectmoduleDao.findRows(projectmodule, hql); - } - - @Override - public List getModuleList(){ - // TODO Auto-generated method stub - List list= null; - try { - list=this.projectmoduleDao.getList(" from ProjectModule order by id"); - } catch (Exception e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - return list; - } - - @Override - public List getModuleListByProjectid(int projectid,int id){ - // TODO Auto-generated method stub - List list= null; - try { - list=this.projectmoduleDao.getList(" from ProjectModule where projectid="+projectid+" and pid="+id+" order by id"); - } catch (Exception e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - return list; - } - - @Override - public List getModuleAllListByProjectid(int projectid){ - // TODO Auto-generated method stub - List list= null; - try { - list=this.projectmoduleDao.getList(" from ProjectModule where projectid="+projectid+" order by id"); - } catch (Exception e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - return list; - } - - @Override - public boolean getModuleIsParent(int id){ - // TODO Auto-generated method stub - boolean result=false; - try { - List list= null; - list=this.projectmoduleDao.getList(" from ProjectModule where pid="+id+" order by id"); - if(null!=list&&list.size()>0){ - result=true; - } - } catch (Exception e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - return result; - } - - @Override - public int getModuleIdByName(String modulename) throws Exception { - // TODO Auto-generated method stub - String id= this.projectmoduleDao.getModuleIdByName("select IFNULL(MAX(id),0) from project_module where modulename='"+modulename+"'"); - if(!StrLib.isEmpty(id)){ - return Integer.valueOf(id); - }else{ - return 0; - } - - } -} +package luckyweb.seagull.spring.service; + +import java.util.List; + +import javax.annotation.Resource; + +import org.springframework.stereotype.Service; + +import luckyweb.seagull.spring.dao.ProjectModuleDao; +import luckyweb.seagull.spring.entity.ProjectModule; +import luckyweb.seagull.util.StrLib; + +@Service("projectModuleService") +public class ProjectModuleServiceImpl implements ProjectModuleService{ + + private ProjectModuleDao projectmoduleDao; + + public ProjectModuleDao getProjectModuleDao() { + return projectmoduleDao; + } + + @Resource(name = "projectModuleDao") + public void setProjectModuleDao(ProjectModuleDao projectmoduleDao) { + this.projectmoduleDao = projectmoduleDao; + } + + @Override + public int add(ProjectModule projectmodule) throws Exception { + return this.projectmoduleDao.add(projectmodule); + } + + @Override + public void delete(ProjectModule projectmodule) throws Exception { + this.projectmoduleDao.delete(projectmodule); + } + + @Override + public void modify(ProjectModule projectmodule) throws Exception { + this.projectmoduleDao.modify(projectmodule); + + } + + @Override + public ProjectModule load(int id) throws Exception { + // TODO Auto-generated method stub + return this.projectmoduleDao.load(id); + } + + private String where(ProjectModule projectmodule) { + String where = " where "; + if (projectmodule.getProjectid()!=0&&projectmodule.getProjectid()!=99) { + where += " projectid =:projectid and "; + } + if (where.length() == 7) { + where = ""; + } + else{ + where = where.substring(0, where.length() - 5); + } + + return where; + } + + private static String orderBy=" order by id desc "; + + @Override + public List findByPage(Object value, int offset, int pageSize) { + String hql=" from ProjectModule "+where((ProjectModule)value)+orderBy; + List list= projectmoduleDao.findByPage(hql, value, offset, pageSize); + return list; + } + + @Override + public int findRows(ProjectModule projectmodule) { + String hql="select count(*) from ProjectModule "+where(projectmodule); + return projectmoduleDao.findRows(projectmodule, hql); + } + + @Override + public List getModuleList(){ + // TODO Auto-generated method stub + List list= null; + try { + list=this.projectmoduleDao.getList(" from ProjectModule order by id"); + } catch (Exception e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + return list; + } + + @Override + public List getModuleListByProjectid(int projectid,int id){ + // TODO Auto-generated method stub + List list= null; + try { + list=this.projectmoduleDao.getList(" from ProjectModule where projectid="+projectid+" and pid="+id+" order by id"); + } catch (Exception e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + return list; + } + + @Override + public List getModuleAllListByProjectid(int projectid){ + // TODO Auto-generated method stub + List list= null; + try { + list=this.projectmoduleDao.getList(" from ProjectModule where projectid="+projectid+" order by id"); + } catch (Exception e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + return list; + } + + @Override + public boolean getModuleIsParent(int id){ + // TODO Auto-generated method stub + boolean result=false; + try { + List list= null; + list=this.projectmoduleDao.getList(" from ProjectModule where pid="+id+" order by id"); + if(null!=list&&list.size()>0){ + result=true; + } + } catch (Exception e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + return result; + } + + @Override + public int getModuleIdByName(String modulename) throws Exception { + // TODO Auto-generated method stub + String id= this.projectmoduleDao.getModuleIdByName("select IFNULL(MAX(id),0) from project_module where modulename='"+modulename+"'"); + if(!StrLib.isEmpty(id)){ + return Integer.valueOf(id); + }else{ + return 0; + } + + } +} diff --git a/src/main/java/luckyweb/seagull/spring/service/ProjectPlanCaseService.java b/src/main/java/luckyweb/seagull/spring/service/ProjectPlanCaseService.java index cccffa4..487a79c 100644 --- a/src/main/java/luckyweb/seagull/spring/service/ProjectPlanCaseService.java +++ b/src/main/java/luckyweb/seagull/spring/service/ProjectPlanCaseService.java @@ -1,21 +1,21 @@ -package luckyweb.seagull.spring.service; - -import java.util.List; - -import org.springframework.transaction.annotation.Transactional; - -import luckyweb.seagull.spring.entity.ProjectPlanCase; - - -@Transactional -public interface ProjectPlanCaseService { - public int add(ProjectPlanCase projectplancase)throws Exception; - public void delete(ProjectPlanCase projectplancase)throws Exception; - public void delforplanid(int id) throws Exception; - public void modify(ProjectPlanCase projectplancase)throws Exception; - public ProjectPlanCase load(int id)throws Exception; - - public List findByPage( final Object value,final int offset, final int pageSize); - public int findRows(ProjectPlanCase projectplancase) ; - public List getcases(int planid) throws Exception; -} +package luckyweb.seagull.spring.service; + +import java.util.List; + +import org.springframework.transaction.annotation.Transactional; + +import luckyweb.seagull.spring.entity.ProjectPlanCase; + + +@Transactional +public interface ProjectPlanCaseService { + public int add(ProjectPlanCase projectplancase)throws Exception; + public void delete(ProjectPlanCase projectplancase)throws Exception; + public void delforplanid(int id) throws Exception; + public void modify(ProjectPlanCase projectplancase)throws Exception; + public ProjectPlanCase load(int id)throws Exception; + + public List findByPage( final Object value,final int offset, final int pageSize); + public int findRows(ProjectPlanCase projectplancase) ; + public List getcases(int planid) throws Exception; +} diff --git a/src/main/java/luckyweb/seagull/spring/service/ProjectPlanCaseServiceImpl.java b/src/main/java/luckyweb/seagull/spring/service/ProjectPlanCaseServiceImpl.java index 1e5e26f..e36c143 100644 --- a/src/main/java/luckyweb/seagull/spring/service/ProjectPlanCaseServiceImpl.java +++ b/src/main/java/luckyweb/seagull/spring/service/ProjectPlanCaseServiceImpl.java @@ -1,93 +1,93 @@ -package luckyweb.seagull.spring.service; - -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import luckyweb.seagull.spring.dao.ProjectPlanCaseDao; -import luckyweb.seagull.spring.entity.ProjectPlanCase; - -@Service("projectPlanCaseService") -public class ProjectPlanCaseServiceImpl implements ProjectPlanCaseService{ - - private ProjectPlanCaseDao projectplancaseDao; - - public ProjectPlanCaseDao getProjectPlanDao() { - return projectplancaseDao; - } - - @Resource(name = "projectPlanCaseDao") - public void setProjectPlanDao(ProjectPlanCaseDao projectplancaseDao) { - this.projectplancaseDao = projectplancaseDao; - } - - @Override - public int add(ProjectPlanCase projectplancase) throws Exception { - return this.projectplancaseDao.add(projectplancase); - } - - @Override - public void delete(ProjectPlanCase projectplancase) throws Exception { - this.projectplancaseDao.delete(projectplancase); - } - - @Override - public void delforplanid(int id) throws Exception { - String hql="delete from ProjectPlanCase where planid=:planId"; - this.projectplancaseDao.delete(hql, id); - } - - @Override - public void modify(ProjectPlanCase projectplancase) throws Exception { - this.projectplancaseDao.modify(projectplancase); - - } - - @Override - public ProjectPlanCase load(int id) throws Exception { - // TODO Auto-generated method stub - return this.projectplancaseDao.load(id); - } - - private String where(ProjectPlanCase projectplancase) { - String where = " where "; - if (projectplancase.getCaseid()!=0) { - where += " caseid =:caseid and "; - }if (projectplancase.getPlanid()!=0) { - where += " planid =:planid and "; - } - if (where.length() == 7) { - where = ""; - } - else{ - where = where.substring(0, where.length() - 5); - } - - return where; - } - - private static String orderBy=" order by caseid desc "; - - @Override - public List findByPage(Object value, int offset, int pageSize) { - String hql=" from ProjectPlanCase "+where((ProjectPlanCase)value)+orderBy; - List list= projectplancaseDao.findByPage(hql, value, offset, pageSize); - return list; - } - - @Override - public int findRows(ProjectPlanCase projectplancase) { - String hql="select count(*) from ProjectPlanCase "+where(projectplancase); - return projectplancaseDao.findRows(projectplancase, hql); - } - - @SuppressWarnings("unchecked") - @Override - public List getcases(int planid) throws Exception { - // TODO Auto-generated method stub - return this.projectplancaseDao.getList(" from ProjectPlanCase where planid="+planid+" order by priority,caseid"); - } - -} +package luckyweb.seagull.spring.service; + +import java.util.List; + +import javax.annotation.Resource; + +import org.springframework.stereotype.Service; + +import luckyweb.seagull.spring.dao.ProjectPlanCaseDao; +import luckyweb.seagull.spring.entity.ProjectPlanCase; + +@Service("projectPlanCaseService") +public class ProjectPlanCaseServiceImpl implements ProjectPlanCaseService{ + + private ProjectPlanCaseDao projectplancaseDao; + + public ProjectPlanCaseDao getProjectPlanDao() { + return projectplancaseDao; + } + + @Resource(name = "projectPlanCaseDao") + public void setProjectPlanDao(ProjectPlanCaseDao projectplancaseDao) { + this.projectplancaseDao = projectplancaseDao; + } + + @Override + public int add(ProjectPlanCase projectplancase) throws Exception { + return this.projectplancaseDao.add(projectplancase); + } + + @Override + public void delete(ProjectPlanCase projectplancase) throws Exception { + this.projectplancaseDao.delete(projectplancase); + } + + @Override + public void delforplanid(int id) throws Exception { + String hql="delete from ProjectPlanCase where planid=:planId"; + this.projectplancaseDao.delete(hql, id); + } + + @Override + public void modify(ProjectPlanCase projectplancase) throws Exception { + this.projectplancaseDao.modify(projectplancase); + + } + + @Override + public ProjectPlanCase load(int id) throws Exception { + // TODO Auto-generated method stub + return this.projectplancaseDao.load(id); + } + + private String where(ProjectPlanCase projectplancase) { + String where = " where "; + if (projectplancase.getCaseid()!=0) { + where += " caseid =:caseid and "; + }if (projectplancase.getPlanid()!=0) { + where += " planid =:planid and "; + } + if (where.length() == 7) { + where = ""; + } + else{ + where = where.substring(0, where.length() - 5); + } + + return where; + } + + private static String orderBy=" order by caseid desc "; + + @Override + public List findByPage(Object value, int offset, int pageSize) { + String hql=" from ProjectPlanCase "+where((ProjectPlanCase)value)+orderBy; + List list= projectplancaseDao.findByPage(hql, value, offset, pageSize); + return list; + } + + @Override + public int findRows(ProjectPlanCase projectplancase) { + String hql="select count(*) from ProjectPlanCase "+where(projectplancase); + return projectplancaseDao.findRows(projectplancase, hql); + } + + @SuppressWarnings("unchecked") + @Override + public List getcases(int planid) throws Exception { + // TODO Auto-generated method stub + return this.projectplancaseDao.getList(" from ProjectPlanCase where planid="+planid+" order by priority,caseid"); + } + +} diff --git a/src/main/java/luckyweb/seagull/spring/service/ProjectPlanService.java b/src/main/java/luckyweb/seagull/spring/service/ProjectPlanService.java index 166a9ef..75edd71 100644 --- a/src/main/java/luckyweb/seagull/spring/service/ProjectPlanService.java +++ b/src/main/java/luckyweb/seagull/spring/service/ProjectPlanService.java @@ -1,20 +1,20 @@ -package luckyweb.seagull.spring.service; - -import java.util.List; - -import org.springframework.transaction.annotation.Transactional; - -import luckyweb.seagull.spring.entity.ProjectPlan; - - -@Transactional -public interface ProjectPlanService { - public int add(ProjectPlan projectplan)throws Exception; - public void delete(ProjectPlan projectplan)throws Exception; - public void modify(ProjectPlan projectplan)throws Exception; - public ProjectPlan load(int id)throws Exception; - - public List findByPage( final Object value,final int offset, final int pageSize); - public int findRows(ProjectPlan projectplan) ; - public ProjectPlan getcases(String name) throws Exception; -} +package luckyweb.seagull.spring.service; + +import java.util.List; + +import org.springframework.transaction.annotation.Transactional; + +import luckyweb.seagull.spring.entity.ProjectPlan; + + +@Transactional +public interface ProjectPlanService { + public int add(ProjectPlan projectplan)throws Exception; + public void delete(ProjectPlan projectplan)throws Exception; + public void modify(ProjectPlan projectplan)throws Exception; + public ProjectPlan load(int id)throws Exception; + + public List findByPage( final Object value,final int offset, final int pageSize); + public int findRows(ProjectPlan projectplan) ; + public ProjectPlan getcases(String name) throws Exception; +} diff --git a/src/main/java/luckyweb/seagull/spring/service/ProjectPlanServiceImpl.java b/src/main/java/luckyweb/seagull/spring/service/ProjectPlanServiceImpl.java index 0ab18d0..e5e523e 100644 --- a/src/main/java/luckyweb/seagull/spring/service/ProjectPlanServiceImpl.java +++ b/src/main/java/luckyweb/seagull/spring/service/ProjectPlanServiceImpl.java @@ -1,92 +1,92 @@ -package luckyweb.seagull.spring.service; - -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import luckyweb.seagull.spring.dao.ProjectPlanDao; -import luckyweb.seagull.spring.entity.ProjectPlan; - -@Service("projectPlanService") -public class ProjectPlanServiceImpl implements ProjectPlanService{ - - private ProjectPlanDao projectplanDao; - - public ProjectPlanDao getProjectPlanDao() { - return projectplanDao; - } - - @Resource(name = "projectPlanDao") - public void setProjectPlanDao(ProjectPlanDao projectplanDao) { - this.projectplanDao = projectplanDao; - } - - @Override - public int add(ProjectPlan projectplan) throws Exception { - return this.projectplanDao.add(projectplan); - } - - @Override - public void delete(ProjectPlan projectplan) throws Exception { - this.projectplanDao.delete(projectplan); - } - - @Override - public void modify(ProjectPlan projectplan) throws Exception { - this.projectplanDao.modify(projectplan); - - } - - @Override - public ProjectPlan load(int id) throws Exception { - // TODO Auto-generated method stub - return this.projectplanDao.load(id); - } - - private String where(ProjectPlan projectplan) { - String where = " where "; - if (projectplan.getProjectid()!=0&&projectplan.getProjectid()!=99) { - where += " projectid =:projectid and "; - }if (null!=projectplan.getName()&&!"".equals(projectplan.getName())) { - where += " (name like :name or "; - }if (null!=projectplan.getOperationer()&&!"".equals(projectplan.getOperationer())) { - where += " operationer like :operationer or "; - }if (null!=projectplan.getRemark()&&!"".equals(projectplan.getRemark())) { - where += " remark like :remark) or "; - } - if (where.length() == 7) { - where = ""; - } - else{ - where = where.substring(0, where.length() - 5); - } - - return where; - } - - private static String orderBy=" order by id desc "; - - @Override - public List findByPage(Object value, int offset, int pageSize) { - String hql=" from ProjectPlan "+where((ProjectPlan)value)+orderBy; - List list= projectplanDao.findByPage(hql, value, offset, pageSize); - return list; - } - - @Override - public int findRows(ProjectPlan projectplan) { - String hql="select count(*) from ProjectPlan "+where(projectplan); - return projectplanDao.findRows(projectplan, hql); - } - - @SuppressWarnings("unchecked") - @Override - public ProjectPlan getcases(String name) throws Exception { - // TODO Auto-generated method stub - List pps=projectplanDao.getList(" from ProjectPlan where name='"+name+"' order by id"); - return pps.get(0); - } - -} +package luckyweb.seagull.spring.service; + +import java.util.List; + +import javax.annotation.Resource; + +import org.springframework.stereotype.Service; + +import luckyweb.seagull.spring.dao.ProjectPlanDao; +import luckyweb.seagull.spring.entity.ProjectPlan; + +@Service("projectPlanService") +public class ProjectPlanServiceImpl implements ProjectPlanService{ + + private ProjectPlanDao projectplanDao; + + public ProjectPlanDao getProjectPlanDao() { + return projectplanDao; + } + + @Resource(name = "projectPlanDao") + public void setProjectPlanDao(ProjectPlanDao projectplanDao) { + this.projectplanDao = projectplanDao; + } + + @Override + public int add(ProjectPlan projectplan) throws Exception { + return this.projectplanDao.add(projectplan); + } + + @Override + public void delete(ProjectPlan projectplan) throws Exception { + this.projectplanDao.delete(projectplan); + } + + @Override + public void modify(ProjectPlan projectplan) throws Exception { + this.projectplanDao.modify(projectplan); + + } + + @Override + public ProjectPlan load(int id) throws Exception { + // TODO Auto-generated method stub + return this.projectplanDao.load(id); + } + + private String where(ProjectPlan projectplan) { + String where = " where "; + if (projectplan.getProjectid()!=0&&projectplan.getProjectid()!=99) { + where += " projectid =:projectid and "; + }if (null!=projectplan.getName()&&!"".equals(projectplan.getName())) { + where += " (name like :name or "; + }if (null!=projectplan.getOperationer()&&!"".equals(projectplan.getOperationer())) { + where += " operationer like :operationer or "; + }if (null!=projectplan.getRemark()&&!"".equals(projectplan.getRemark())) { + where += " remark like :remark) or "; + } + if (where.length() == 7) { + where = ""; + } + else{ + where = where.substring(0, where.length() - 5); + } + + return where; + } + + private static String orderBy=" order by id desc "; + + @Override + public List findByPage(Object value, int offset, int pageSize) { + String hql=" from ProjectPlan "+where((ProjectPlan)value)+orderBy; + List list= projectplanDao.findByPage(hql, value, offset, pageSize); + return list; + } + + @Override + public int findRows(ProjectPlan projectplan) { + String hql="select count(*) from ProjectPlan "+where(projectplan); + return projectplanDao.findRows(projectplan, hql); + } + + @SuppressWarnings("unchecked") + @Override + public ProjectPlan getcases(String name) throws Exception { + // TODO Auto-generated method stub + List pps=projectplanDao.getList(" from ProjectPlan where name='"+name+"' order by id"); + return pps.get(0); + } + +} diff --git a/src/main/java/luckyweb/seagull/spring/service/ProjectProtocolTemplateImpl.java b/src/main/java/luckyweb/seagull/spring/service/ProjectProtocolTemplateImpl.java index 12d0479..b43acf5 100644 --- a/src/main/java/luckyweb/seagull/spring/service/ProjectProtocolTemplateImpl.java +++ b/src/main/java/luckyweb/seagull/spring/service/ProjectProtocolTemplateImpl.java @@ -1,106 +1,106 @@ -package luckyweb.seagull.spring.service; - -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import luckyweb.seagull.spring.dao.ProjectProtocolTemplateDao; -import luckyweb.seagull.spring.entity.ProjectPlan; -import luckyweb.seagull.spring.entity.ProjectProtocolTemplate; -import luckyweb.seagull.util.StrLib; - - - -@Service("projectprotocoltemplateService") -public class ProjectProtocolTemplateImpl implements ProjectProtocolTemplateService{ - - private ProjectProtocolTemplateDao projectprotocoltemplatedao; - - public ProjectProtocolTemplateDao getProjectProtocolTemplateDao() { - return projectprotocoltemplatedao; - } - - @Resource(name = "projectprotocoltemplateDao") - public void setProjectProtocolTemplateDao(ProjectProtocolTemplateDao projectprotocoltemplatedao) { - this.projectprotocoltemplatedao = projectprotocoltemplatedao; - } - - @Override - public ProjectProtocolTemplate load(int id) throws Exception { - // TODO Auto-generated method stub - return this.projectprotocoltemplatedao.load(id); - } - - private String where(ProjectProtocolTemplate ppt) { - String where = " where "; - if (ppt.getProjectid()!=0&&ppt.getProjectid()!=99) { - where += " projectid=:projectid and "; - } - if (!StrLib.isEmpty(ppt.getProtocoltype())) { - where += " protocoltype=:protocoltype and "; - } - if (ppt.getOperationer()!=null&&!ppt.getOperationer().equals("")) { - where += " (operationer like :operationer or "; - } - if (ppt.getName()!=null&&!ppt.getName().equals("")) { - where += " name like :name or "; - } - if (ppt.getRemark()!=null&&!ppt.getRemark().equals("")) { - where += " remark like :remark) or "; - } - if (where.length() == 7) { - where = ""; - } - else{ - where = where.substring(0, where.length() - 5); - } - - return where; - } - - private static String orderBy=" order by id desc "; - - @Override - public List findByPage(Object value, int offset, int pageSize) { - String hql=" from ProjectProtocolTemplate "+where((ProjectProtocolTemplate)value)+orderBy; - List list= projectprotocoltemplatedao.findByPage(hql, value, offset, pageSize); - return list; - } - - @Override - public int findRows(ProjectProtocolTemplate ppt) { - String hql="select count(*) from ProjectProtocolTemplate "+where(ppt); - return projectprotocoltemplatedao.findRows(ppt, hql); - } - - - @Override - public int add(ProjectProtocolTemplate ppt) throws Exception { - return this.projectprotocoltemplatedao.add(ppt); - } - - @Override - public void modify(ProjectProtocolTemplate ppt) throws Exception { - this.projectprotocoltemplatedao.modify(ppt); - - } - - @Override - public void delete(int id) throws Exception { - String hql="delete from ProjectProtocolTemplate where templateid="+id; - this.projectprotocoltemplatedao.delete(hql); - } - - @Override - public void deleteforob(ProjectProtocolTemplate ppt) throws Exception { - this.projectprotocoltemplatedao.deleteforob(ppt); - } - - @Override - public List findstepsparamList(int steptype,int parentid,String fieldname) throws Exception { - String sql="select paramvalue,description FROM project_casestepsparams where steptype="+steptype+" and parentid="+parentid+" and fieldname='"+fieldname+"'"; - return this.projectprotocoltemplatedao.findstepsparamList(sql); - } -} +package luckyweb.seagull.spring.service; + +import java.util.List; + +import javax.annotation.Resource; + +import org.springframework.stereotype.Service; + +import luckyweb.seagull.spring.dao.ProjectProtocolTemplateDao; +import luckyweb.seagull.spring.entity.ProjectPlan; +import luckyweb.seagull.spring.entity.ProjectProtocolTemplate; +import luckyweb.seagull.util.StrLib; + + + +@Service("projectprotocoltemplateService") +public class ProjectProtocolTemplateImpl implements ProjectProtocolTemplateService{ + + private ProjectProtocolTemplateDao projectprotocoltemplatedao; + + public ProjectProtocolTemplateDao getProjectProtocolTemplateDao() { + return projectprotocoltemplatedao; + } + + @Resource(name = "projectprotocoltemplateDao") + public void setProjectProtocolTemplateDao(ProjectProtocolTemplateDao projectprotocoltemplatedao) { + this.projectprotocoltemplatedao = projectprotocoltemplatedao; + } + + @Override + public ProjectProtocolTemplate load(int id) throws Exception { + // TODO Auto-generated method stub + return this.projectprotocoltemplatedao.load(id); + } + + private String where(ProjectProtocolTemplate ppt) { + String where = " where "; + if (ppt.getProjectid()!=0&&ppt.getProjectid()!=99) { + where += " projectid=:projectid and "; + } + if (!StrLib.isEmpty(ppt.getProtocoltype())) { + where += " protocoltype=:protocoltype and "; + } + if (ppt.getOperationer()!=null&&!ppt.getOperationer().equals("")) { + where += " (operationer like :operationer or "; + } + if (ppt.getName()!=null&&!ppt.getName().equals("")) { + where += " name like :name or "; + } + if (ppt.getRemark()!=null&&!ppt.getRemark().equals("")) { + where += " remark like :remark) or "; + } + if (where.length() == 7) { + where = ""; + } + else{ + where = where.substring(0, where.length() - 5); + } + + return where; + } + + private static String orderBy=" order by id desc "; + + @Override + public List findByPage(Object value, int offset, int pageSize) { + String hql=" from ProjectProtocolTemplate "+where((ProjectProtocolTemplate)value)+orderBy; + List list= projectprotocoltemplatedao.findByPage(hql, value, offset, pageSize); + return list; + } + + @Override + public int findRows(ProjectProtocolTemplate ppt) { + String hql="select count(*) from ProjectProtocolTemplate "+where(ppt); + return projectprotocoltemplatedao.findRows(ppt, hql); + } + + + @Override + public int add(ProjectProtocolTemplate ppt) throws Exception { + return this.projectprotocoltemplatedao.add(ppt); + } + + @Override + public void modify(ProjectProtocolTemplate ppt) throws Exception { + this.projectprotocoltemplatedao.modify(ppt); + + } + + @Override + public void delete(int id) throws Exception { + String hql="delete from ProjectProtocolTemplate where templateid="+id; + this.projectprotocoltemplatedao.delete(hql); + } + + @Override + public void deleteforob(ProjectProtocolTemplate ppt) throws Exception { + this.projectprotocoltemplatedao.deleteforob(ppt); + } + + @Override + public List findstepsparamList(int steptype,int parentid,String fieldname) throws Exception { + String sql="select paramvalue,description FROM project_casestepsparams where steptype="+steptype+" and parentid="+parentid+" and fieldname='"+fieldname+"'"; + return this.projectprotocoltemplatedao.findstepsparamList(sql); + } +} diff --git a/src/main/java/luckyweb/seagull/spring/service/ProjectProtocolTemplateService.java b/src/main/java/luckyweb/seagull/spring/service/ProjectProtocolTemplateService.java index 76691ce..4d72335 100644 --- a/src/main/java/luckyweb/seagull/spring/service/ProjectProtocolTemplateService.java +++ b/src/main/java/luckyweb/seagull/spring/service/ProjectProtocolTemplateService.java @@ -1,21 +1,21 @@ -package luckyweb.seagull.spring.service; - - -import java.util.List; - -import org.springframework.transaction.annotation.Transactional; - -import luckyweb.seagull.spring.entity.ProjectProtocolTemplate; - - -@Transactional -public interface ProjectProtocolTemplateService { - public int add(ProjectProtocolTemplate ppt)throws Exception; - public void modify(ProjectProtocolTemplate ppt) throws Exception; - public ProjectProtocolTemplate load(int id)throws Exception; - public List findByPage( final Object value,final int offset, final int pageSize); - public int findRows(ProjectProtocolTemplate ppt); - public void delete(int id) throws Exception; - public void deleteforob(ProjectProtocolTemplate ppt) throws Exception; - public List findstepsparamList(int steptype,int parentid,String fieldname) throws Exception; -} +package luckyweb.seagull.spring.service; + + +import java.util.List; + +import org.springframework.transaction.annotation.Transactional; + +import luckyweb.seagull.spring.entity.ProjectProtocolTemplate; + + +@Transactional +public interface ProjectProtocolTemplateService { + public int add(ProjectProtocolTemplate ppt)throws Exception; + public void modify(ProjectProtocolTemplate ppt) throws Exception; + public ProjectProtocolTemplate load(int id)throws Exception; + public List findByPage( final Object value,final int offset, final int pageSize); + public int findRows(ProjectProtocolTemplate ppt); + public void delete(int id) throws Exception; + public void deleteforob(ProjectProtocolTemplate ppt) throws Exception; + public List findstepsparamList(int steptype,int parentid,String fieldname) throws Exception; +} diff --git a/src/main/java/luckyweb/seagull/spring/service/ProjectTemplateParamsImpl.java b/src/main/java/luckyweb/seagull/spring/service/ProjectTemplateParamsImpl.java index 06d6a06..375aec3 100644 --- a/src/main/java/luckyweb/seagull/spring/service/ProjectTemplateParamsImpl.java +++ b/src/main/java/luckyweb/seagull/spring/service/ProjectTemplateParamsImpl.java @@ -1,92 +1,92 @@ -package luckyweb.seagull.spring.service; - -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import luckyweb.seagull.spring.dao.ProjectTemplateParamsDao; -import luckyweb.seagull.spring.entity.ProjectCasesteps; -import luckyweb.seagull.spring.entity.ProjectTemplateParams; - - - -@Service("projecttemplateparamsService") -public class ProjectTemplateParamsImpl implements ProjectTemplateParamsService{ - - private ProjectTemplateParamsDao projecttemplateparamsdao; - - public ProjectTemplateParamsDao getProjectTemplateParamsDao() { - return projecttemplateparamsdao; - } - - @Resource(name = "projecttemplateparamsDao") - public void setProjectTemplateParamsDao(ProjectTemplateParamsDao projecttemplateparamsdao) { - this.projecttemplateparamsdao = projecttemplateparamsdao; - } - - @Override - public ProjectTemplateParams load(int id) throws Exception { - // TODO Auto-generated method stub - return this.projecttemplateparamsdao.load(id); - } - - private String where(ProjectTemplateParams ptp) { - String where = " where "; - if (ptp.getTemplateid()!=0) { - where += " templateid=:templateid and "; - } - if (where.length() == 7) { - where = ""; - } - else{ - where = where.substring(0, where.length() - 5); - } - - return where; - } - - private static String orderBy=" order by id desc "; - - @Override - public List findByPage(Object value, int offset, int pageSize) { - String hql=" from ProjectTemplateParams "+where((ProjectTemplateParams)value)+orderBy; - List list= projecttemplateparamsdao.findByPage(hql, value, offset, pageSize); - return list; - } - - @Override - public int findRows(ProjectTemplateParams ptp) { - String hql="select count(*) from ProjectTemplateParams "+where(ptp); - return projecttemplateparamsdao.findRows(ptp, hql); - } - - - @Override - public int add(ProjectTemplateParams ptp) throws Exception { - return this.projecttemplateparamsdao.add(ptp); - } - - @Override - public void delete(int templateid) throws Exception { - String hql="delete from ProjectTemplateParams where templateid="+templateid; - this.projecttemplateparamsdao.delete(hql); - } - - @Override - public void deleteforob(ProjectTemplateParams ptp) throws Exception{ - this.projecttemplateparamsdao.deleteforob(ptp); - } - - @Override - public void modify(ProjectTemplateParams ptp) throws Exception{ - this.projecttemplateparamsdao.modify(ptp); - } - - @Override - public List getParamsList(int templateid) throws Exception { - // TODO Auto-generated method stub - return this.projecttemplateparamsdao.getParamsList(" from ProjectTemplateParams where templateid="+templateid+" order by id"); - } -} +package luckyweb.seagull.spring.service; + +import java.util.List; + +import javax.annotation.Resource; + +import org.springframework.stereotype.Service; + +import luckyweb.seagull.spring.dao.ProjectTemplateParamsDao; +import luckyweb.seagull.spring.entity.ProjectCasesteps; +import luckyweb.seagull.spring.entity.ProjectTemplateParams; + + + +@Service("projecttemplateparamsService") +public class ProjectTemplateParamsImpl implements ProjectTemplateParamsService{ + + private ProjectTemplateParamsDao projecttemplateparamsdao; + + public ProjectTemplateParamsDao getProjectTemplateParamsDao() { + return projecttemplateparamsdao; + } + + @Resource(name = "projecttemplateparamsDao") + public void setProjectTemplateParamsDao(ProjectTemplateParamsDao projecttemplateparamsdao) { + this.projecttemplateparamsdao = projecttemplateparamsdao; + } + + @Override + public ProjectTemplateParams load(int id) throws Exception { + // TODO Auto-generated method stub + return this.projecttemplateparamsdao.load(id); + } + + private String where(ProjectTemplateParams ptp) { + String where = " where "; + if (ptp.getTemplateid()!=0) { + where += " templateid=:templateid and "; + } + if (where.length() == 7) { + where = ""; + } + else{ + where = where.substring(0, where.length() - 5); + } + + return where; + } + + private static String orderBy=" order by id desc "; + + @Override + public List findByPage(Object value, int offset, int pageSize) { + String hql=" from ProjectTemplateParams "+where((ProjectTemplateParams)value)+orderBy; + List list= projecttemplateparamsdao.findByPage(hql, value, offset, pageSize); + return list; + } + + @Override + public int findRows(ProjectTemplateParams ptp) { + String hql="select count(*) from ProjectTemplateParams "+where(ptp); + return projecttemplateparamsdao.findRows(ptp, hql); + } + + + @Override + public int add(ProjectTemplateParams ptp) throws Exception { + return this.projecttemplateparamsdao.add(ptp); + } + + @Override + public void delete(int templateid) throws Exception { + String hql="delete from ProjectTemplateParams where templateid="+templateid; + this.projecttemplateparamsdao.delete(hql); + } + + @Override + public void deleteforob(ProjectTemplateParams ptp) throws Exception{ + this.projecttemplateparamsdao.deleteforob(ptp); + } + + @Override + public void modify(ProjectTemplateParams ptp) throws Exception{ + this.projecttemplateparamsdao.modify(ptp); + } + + @Override + public List getParamsList(int templateid) throws Exception { + // TODO Auto-generated method stub + return this.projecttemplateparamsdao.getParamsList(" from ProjectTemplateParams where templateid="+templateid+" order by id"); + } +} diff --git a/src/main/java/luckyweb/seagull/spring/service/ProjectTemplateParamsService.java b/src/main/java/luckyweb/seagull/spring/service/ProjectTemplateParamsService.java index c2f0d30..4567740 100644 --- a/src/main/java/luckyweb/seagull/spring/service/ProjectTemplateParamsService.java +++ b/src/main/java/luckyweb/seagull/spring/service/ProjectTemplateParamsService.java @@ -1,21 +1,21 @@ -package luckyweb.seagull.spring.service; - - -import java.util.List; - -import org.springframework.transaction.annotation.Transactional; - -import luckyweb.seagull.spring.entity.ProjectTemplateParams; - - -@Transactional -public interface ProjectTemplateParamsService { - public int add(ProjectTemplateParams ptp)throws Exception; - public ProjectTemplateParams load(int id)throws Exception; - public List findByPage( final Object value,final int offset, final int pageSize); - public int findRows(ProjectTemplateParams ptp); - public void delete(int templateid) throws Exception; - public void deleteforob(ProjectTemplateParams ptp) throws Exception; - public void modify(ProjectTemplateParams ptp) throws Exception; - public List getParamsList(int templateid) throws Exception; -} +package luckyweb.seagull.spring.service; + + +import java.util.List; + +import org.springframework.transaction.annotation.Transactional; + +import luckyweb.seagull.spring.entity.ProjectTemplateParams; + + +@Transactional +public interface ProjectTemplateParamsService { + public int add(ProjectTemplateParams ptp)throws Exception; + public ProjectTemplateParams load(int id)throws Exception; + public List findByPage( final Object value,final int offset, final int pageSize); + public int findRows(ProjectTemplateParams ptp); + public void delete(int templateid) throws Exception; + public void deleteforob(ProjectTemplateParams ptp) throws Exception; + public void modify(ProjectTemplateParams ptp) throws Exception; + public List getParamsList(int templateid) throws Exception; +} diff --git a/src/main/java/luckyweb/seagull/spring/service/ProjectVersionServiceImpl.java b/src/main/java/luckyweb/seagull/spring/service/ProjectVersionServiceImpl.java index 8559baf..1e298ab 100644 --- a/src/main/java/luckyweb/seagull/spring/service/ProjectVersionServiceImpl.java +++ b/src/main/java/luckyweb/seagull/spring/service/ProjectVersionServiceImpl.java @@ -1,177 +1,177 @@ -package luckyweb.seagull.spring.service; - -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import luckyweb.seagull.spring.dao.ProjectVersionDao; -import luckyweb.seagull.spring.dao.SectorProjectsDao; -import luckyweb.seagull.spring.entity.ProjectVersion; -import luckyweb.seagull.spring.entity.SectorProjects; -import luckyweb.seagull.util.StrLib; - -@Service("projectversionService") -public class ProjectVersionServiceImpl implements ProjectsVersionService{ - - private ProjectVersionDao projectversiondao; - - public ProjectVersionDao getProjectVersionDao() { - return projectversiondao; - } - - @Resource(name = "projectversionDao") - public void setProjectVersionDao(ProjectVersionDao projectversiondao) { - this.projectversiondao = projectversiondao; - } - - @Override - public int add(ProjectVersion projectversion) throws Exception { - return this.projectversiondao.add(projectversion); - } - - @Override - public void modify(ProjectVersion projectversion) throws Exception { - this.projectversiondao.modify(projectversion); - - } - - @Override - public void modifyState(ProjectVersion projectversion) throws Exception { - // TODO Auto-generated method stub - - } - - @Override - public void delete(int id) throws Exception { - this.projectversiondao.delete(id); - - } - - @Override - public List list(ProjectVersion projectversion) throws Exception { - // TODO Auto-generated method stub - return this.projectversiondao.list(projectversion); - } - - @Override - public List list(int projectid) throws Exception { - // TODO Auto-generated method stub - return this.projectversiondao.list("from ProjectVersion t where versiontype = 1 and projectid="+projectid+" order by versionid desc"); - } - - @Override - public List list(int projectid,String startdate,String enddate) throws Exception { - // TODO Auto-generated method stub - if(startdate==""||startdate==null){ - startdate = "0"; - } - if(enddate==""||enddate==null){ - enddate = "9999-99-99"; - } - return this.projectversiondao.list("from ProjectVersion t where versiontype = 1 and projectid="+projectid+"and t.actually_launchdate >= '"+startdate+"' and t.actually_launchdate<='"+enddate+"' order by versionid"); - } - - @Override - public boolean isExist(String name, String cmdType, String planPath) - throws Exception { - // TODO Auto-generated method stub - return false; - } - - @Override - public ProjectVersion load(int versionid) throws Exception { - // TODO Auto-generated method stub - return this.projectversiondao.load(versionid); - } - - @Override - public ProjectVersion get(int id) throws Exception { - // TODO Auto-generated method stub - return null; - } - - private String where(ProjectVersion pv) { - String where = " where "; -/* if (!StrLib.isEmpty(String.valueOf(ss.getSectorid()))) { - where += " sectorid=:sectorid and "; - }*/ - if (pv.getProjectid()!=0&&pv.getProjectid()!=99) { - where += " projectid=:projectid and "; - } - if (!StrLib.isEmpty(pv.getStartactually_launchdate())) { - where += " actually_launchdate>=:startactually_launchdate and "; - } - if (!StrLib.isEmpty(pv.getEndactually_launchdate())) { - where += " actually_launchdate<=:endactually_launchdate and "; - } - if (!StrLib.isEmpty(pv.getVersionnumber())){ - where += " (versionnumber like :versionnumber or "; - } - if (!StrLib.isEmpty(pv.getImprint())){ - where += " imprint like :imprint) or "; - } - - if (where.length() == 7) { - where = ""; - } - else{ - where = where.substring(0, where.length() - 5); - } - - return where; - } - - private static String orderBy=" order by versiontype,actually_launchdate desc,versionid desc "; - - @Override - public List findByPage(Object value, int offset, int pageSize) { - String hql=" from ProjectVersion "+where((ProjectVersion)value)+orderBy; - List list= projectversiondao.findByPage(hql, value, offset, pageSize); - return list; - } - - @Override - public int findRows(ProjectVersion projectversion) { - String hql="select count(*) from ProjectVersion "+where(projectversion); - return projectversiondao.findRows(projectversion, hql); - } - - @Override - public List findProjectsList() { - // TODO Auto-generated method stub - return null; - } - - @Override - public List listavgpro(String startdate,String enddate) throws Exception { - // TODO Auto-generated method stub - if(startdate==""||startdate==null){ - startdate = "0"; - } - if(enddate==""||enddate==null){ - enddate = "9999-99-99"; - } - return this.projectversiondao.listavgpro("select t.projectid,count(projectid)," - + "ROUND(avg(cast(t.per_dev as DECIMAL)),2),ROUND(avg(cast(t.per_test as DECIMAL)),2),ROUND(avg(cast(t.protime_deviation as DECIMAL)),2),ROUND(avg(cast(t.code_di as DECIMAL)),2),ROUND(avg(cast(t.actually_demand as DECIMAL)/cast(t.plan_demand as DECIMAL)),4)*100 " - + "from QA_PROJECTVERSION t where t.versiontype = 1 and t.actually_launchdate >= '"+startdate+"' and t.actually_launchdate<='"+enddate+"' group by t.projectid order by t.projectid "); - } - - public List findByPagereport(int offset, int pageSize,String startdate,String enddate) throws Exception { - // TODO Auto-generated method stub - String hql = "select projectid,sum(t.plan_demand),sum(t.actually_demand)," - + "COUNT(CASE WHEN cast(t.prodelay_days as SIGNED)>0 THEN 1 ELSE NULL END) 延迟版本," - + "COUNT(CASE WHEN cast(t.prodelay_days as SIGNED)<=0 THEN 1 ELSE NULL END) 未延迟版本," - + "sum(t.changetestingreturn),sum(t.bug_zm),sum(t.bug_yz),sum(t.bug_yb),sum(t.bug_ts),sum(t.human_costdev),sum(t.human_costtest),0 as perdemand,0 as perdelay " - + "from QA_PROJECTVERSION t where t.versiontype = 1 and t.actually_launchdate >= '"+startdate+"' and t.actually_launchdate<='"+enddate+"' group by t.projectid order by t.projectid"; - return this.projectversiondao.findByPagereport(hql, offset, pageSize); - } - - @Override - public int findRowsreport(String startdate,String enddate) { - String hql="select projectid from QA_PROJECTVERSION t where t.versiontype = 1 and t.actually_launchdate >= '"+startdate+"' and t.actually_launchdate<='"+enddate+"' group by t.projectid"; - return projectversiondao.findRowsreport(hql); - } - -} +package luckyweb.seagull.spring.service; + +import java.util.List; + +import javax.annotation.Resource; + +import org.springframework.stereotype.Service; + +import luckyweb.seagull.spring.dao.ProjectVersionDao; +import luckyweb.seagull.spring.dao.SectorProjectsDao; +import luckyweb.seagull.spring.entity.ProjectVersion; +import luckyweb.seagull.spring.entity.SectorProjects; +import luckyweb.seagull.util.StrLib; + +@Service("projectversionService") +public class ProjectVersionServiceImpl implements ProjectsVersionService{ + + private ProjectVersionDao projectversiondao; + + public ProjectVersionDao getProjectVersionDao() { + return projectversiondao; + } + + @Resource(name = "projectversionDao") + public void setProjectVersionDao(ProjectVersionDao projectversiondao) { + this.projectversiondao = projectversiondao; + } + + @Override + public int add(ProjectVersion projectversion) throws Exception { + return this.projectversiondao.add(projectversion); + } + + @Override + public void modify(ProjectVersion projectversion) throws Exception { + this.projectversiondao.modify(projectversion); + + } + + @Override + public void modifyState(ProjectVersion projectversion) throws Exception { + // TODO Auto-generated method stub + + } + + @Override + public void delete(int id) throws Exception { + this.projectversiondao.delete(id); + + } + + @Override + public List list(ProjectVersion projectversion) throws Exception { + // TODO Auto-generated method stub + return this.projectversiondao.list(projectversion); + } + + @Override + public List list(int projectid) throws Exception { + // TODO Auto-generated method stub + return this.projectversiondao.list("from ProjectVersion t where versiontype = 1 and projectid="+projectid+" order by versionid desc"); + } + + @Override + public List list(int projectid,String startdate,String enddate) throws Exception { + // TODO Auto-generated method stub + if(startdate==""||startdate==null){ + startdate = "0"; + } + if(enddate==""||enddate==null){ + enddate = "9999-99-99"; + } + return this.projectversiondao.list("from ProjectVersion t where versiontype = 1 and projectid="+projectid+"and t.actually_launchdate >= '"+startdate+"' and t.actually_launchdate<='"+enddate+"' order by versionid"); + } + + @Override + public boolean isExist(String name, String cmdType, String planPath) + throws Exception { + // TODO Auto-generated method stub + return false; + } + + @Override + public ProjectVersion load(int versionid) throws Exception { + // TODO Auto-generated method stub + return this.projectversiondao.load(versionid); + } + + @Override + public ProjectVersion get(int id) throws Exception { + // TODO Auto-generated method stub + return null; + } + + private String where(ProjectVersion pv) { + String where = " where "; +/* if (!StrLib.isEmpty(String.valueOf(ss.getSectorid()))) { + where += " sectorid=:sectorid and "; + }*/ + if (pv.getProjectid()!=0&&pv.getProjectid()!=99) { + where += " projectid=:projectid and "; + } + if (!StrLib.isEmpty(pv.getStartactually_launchdate())) { + where += " actually_launchdate>=:startactually_launchdate and "; + } + if (!StrLib.isEmpty(pv.getEndactually_launchdate())) { + where += " actually_launchdate<=:endactually_launchdate and "; + } + if (!StrLib.isEmpty(pv.getVersionnumber())){ + where += " (versionnumber like :versionnumber or "; + } + if (!StrLib.isEmpty(pv.getImprint())){ + where += " imprint like :imprint) or "; + } + + if (where.length() == 7) { + where = ""; + } + else{ + where = where.substring(0, where.length() - 5); + } + + return where; + } + + private static String orderBy=" order by versiontype,actually_launchdate desc,versionid desc "; + + @Override + public List findByPage(Object value, int offset, int pageSize) { + String hql=" from ProjectVersion "+where((ProjectVersion)value)+orderBy; + List list= projectversiondao.findByPage(hql, value, offset, pageSize); + return list; + } + + @Override + public int findRows(ProjectVersion projectversion) { + String hql="select count(*) from ProjectVersion "+where(projectversion); + return projectversiondao.findRows(projectversion, hql); + } + + @Override + public List findProjectsList() { + // TODO Auto-generated method stub + return null; + } + + @Override + public List listavgpro(String startdate,String enddate) throws Exception { + // TODO Auto-generated method stub + if(startdate==""||startdate==null){ + startdate = "0"; + } + if(enddate==""||enddate==null){ + enddate = "9999-99-99"; + } + return this.projectversiondao.listavgpro("select t.projectid,count(projectid)," + + "ROUND(avg(cast(t.per_dev as DECIMAL)),2),ROUND(avg(cast(t.per_test as DECIMAL)),2),ROUND(avg(cast(t.protime_deviation as DECIMAL)),2),ROUND(avg(cast(t.code_di as DECIMAL)),2),ROUND(avg(cast(t.actually_demand as DECIMAL)/cast(t.plan_demand as DECIMAL)),4)*100 " + + "from QA_PROJECTVERSION t where t.versiontype = 1 and t.actually_launchdate >= '"+startdate+"' and t.actually_launchdate<='"+enddate+"' group by t.projectid order by t.projectid "); + } + + public List findByPagereport(int offset, int pageSize,String startdate,String enddate) throws Exception { + // TODO Auto-generated method stub + String hql = "select projectid,sum(t.plan_demand),sum(t.actually_demand)," + + "COUNT(CASE WHEN cast(t.prodelay_days as SIGNED)>0 THEN 1 ELSE NULL END) 延迟版本," + + "COUNT(CASE WHEN cast(t.prodelay_days as SIGNED)<=0 THEN 1 ELSE NULL END) 未延迟版本," + + "sum(t.changetestingreturn),sum(t.bug_zm),sum(t.bug_yz),sum(t.bug_yb),sum(t.bug_ts),sum(t.human_costdev),sum(t.human_costtest),0 as perdemand,0 as perdelay " + + "from QA_PROJECTVERSION t where t.versiontype = 1 and t.actually_launchdate >= '"+startdate+"' and t.actually_launchdate<='"+enddate+"' group by t.projectid order by t.projectid"; + return this.projectversiondao.findByPagereport(hql, offset, pageSize); + } + + @Override + public int findRowsreport(String startdate,String enddate) { + String hql="select projectid from QA_PROJECTVERSION t where t.versiontype = 1 and t.actually_launchdate >= '"+startdate+"' and t.actually_launchdate<='"+enddate+"' group by t.projectid"; + return projectversiondao.findRowsreport(hql); + } + +} diff --git a/src/main/java/luckyweb/seagull/spring/service/ProjectsVersionService.java b/src/main/java/luckyweb/seagull/spring/service/ProjectsVersionService.java index 8c58c41..253cef9 100644 --- a/src/main/java/luckyweb/seagull/spring/service/ProjectsVersionService.java +++ b/src/main/java/luckyweb/seagull/spring/service/ProjectsVersionService.java @@ -1,49 +1,49 @@ -package luckyweb.seagull.spring.service; - -import java.util.List; - -import org.springframework.transaction.annotation.Propagation; -import org.springframework.transaction.annotation.Transactional; - -import luckyweb.seagull.spring.entity.ProjectVersion; - -@Transactional -public interface ProjectsVersionService { - public int add(ProjectVersion projectversion)throws Exception; - public void modify(ProjectVersion projectversion)throws Exception; - public void modifyState(ProjectVersion projectversion)throws Exception; - public void delete(int id)throws Exception; - - @Transactional(propagation=Propagation.NOT_SUPPORTED) - public List list(ProjectVersion projectversion)throws Exception; - - @Transactional(propagation=Propagation.NOT_SUPPORTED) - public List list(int projectid)throws Exception; - - @Transactional(propagation=Propagation.NOT_SUPPORTED) - public List list(int projectid,String startdate,String enddate)throws Exception; - - @Transactional(propagation=Propagation.NOT_SUPPORTED) - public List listavgpro(String startdate,String enddate)throws Exception; - - public boolean isExist(String name,String cmdType,String planPath)throws Exception; - - public ProjectVersion load(int id)throws Exception; - public ProjectVersion get(int id)throws Exception; - - -// public List findByPage( final int offset,final int pageSize); -// -// public List findByPage( final Object[] values,final int offset, final int pageSize); - - public List findByPage( final Object value,final int offset, final int pageSize); - - public List findByPagereport(int offset, int pageSize,String startdate,String enddate)throws Exception; - - public int findRows(ProjectVersion projectversion) ; - - public int findRowsreport(String startdate,String enddate) ; -// public List getListForPage( final int offset,final int lengh); - - public List findProjectsList(); -} +package luckyweb.seagull.spring.service; + +import java.util.List; + +import org.springframework.transaction.annotation.Propagation; +import org.springframework.transaction.annotation.Transactional; + +import luckyweb.seagull.spring.entity.ProjectVersion; + +@Transactional +public interface ProjectsVersionService { + public int add(ProjectVersion projectversion)throws Exception; + public void modify(ProjectVersion projectversion)throws Exception; + public void modifyState(ProjectVersion projectversion)throws Exception; + public void delete(int id)throws Exception; + + @Transactional(propagation=Propagation.NOT_SUPPORTED) + public List list(ProjectVersion projectversion)throws Exception; + + @Transactional(propagation=Propagation.NOT_SUPPORTED) + public List list(int projectid)throws Exception; + + @Transactional(propagation=Propagation.NOT_SUPPORTED) + public List list(int projectid,String startdate,String enddate)throws Exception; + + @Transactional(propagation=Propagation.NOT_SUPPORTED) + public List listavgpro(String startdate,String enddate)throws Exception; + + public boolean isExist(String name,String cmdType,String planPath)throws Exception; + + public ProjectVersion load(int id)throws Exception; + public ProjectVersion get(int id)throws Exception; + + +// public List findByPage( final int offset,final int pageSize); +// +// public List findByPage( final Object[] values,final int offset, final int pageSize); + + public List findByPage( final Object value,final int offset, final int pageSize); + + public List findByPagereport(int offset, int pageSize,String startdate,String enddate)throws Exception; + + public int findRows(ProjectVersion projectversion) ; + + public int findRowsreport(String startdate,String enddate) ; +// public List getListForPage( final int offset,final int lengh); + + public List findProjectsList(); +} diff --git a/src/main/java/luckyweb/seagull/spring/service/ReviewInfoService.java b/src/main/java/luckyweb/seagull/spring/service/ReviewInfoService.java index 95ed7c0..44cdf26 100644 --- a/src/main/java/luckyweb/seagull/spring/service/ReviewInfoService.java +++ b/src/main/java/luckyweb/seagull/spring/service/ReviewInfoService.java @@ -1,23 +1,23 @@ -package luckyweb.seagull.spring.service; - -import java.util.List; - -import org.springframework.transaction.annotation.Transactional; - -import luckyweb.seagull.spring.entity.ReviewInfo; - -@Transactional -public interface ReviewInfoService { - public int add(ReviewInfo reviewinfo)throws Exception; - - public void delete(int id)throws Exception; - - public void modify(ReviewInfo reviewinfo)throws Exception; - public ReviewInfo load(int id)throws Exception; - - public List findByPage( final Object value,final int offset, final int pageSize); - - public int findRows(ReviewInfo reviewinfo) ; - - public void delete_reviewid(int reviewid) throws Exception; -} +package luckyweb.seagull.spring.service; + +import java.util.List; + +import org.springframework.transaction.annotation.Transactional; + +import luckyweb.seagull.spring.entity.ReviewInfo; + +@Transactional +public interface ReviewInfoService { + public int add(ReviewInfo reviewinfo)throws Exception; + + public void delete(int id)throws Exception; + + public void modify(ReviewInfo reviewinfo)throws Exception; + public ReviewInfo load(int id)throws Exception; + + public List findByPage( final Object value,final int offset, final int pageSize); + + public int findRows(ReviewInfo reviewinfo) ; + + public void delete_reviewid(int reviewid) throws Exception; +} diff --git a/src/main/java/luckyweb/seagull/spring/service/ReviewInfoServiceImpl.java b/src/main/java/luckyweb/seagull/spring/service/ReviewInfoServiceImpl.java index 534c057..6c2cfc9 100644 --- a/src/main/java/luckyweb/seagull/spring/service/ReviewInfoServiceImpl.java +++ b/src/main/java/luckyweb/seagull/spring/service/ReviewInfoServiceImpl.java @@ -1,85 +1,85 @@ -package luckyweb.seagull.spring.service; - -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import luckyweb.seagull.spring.dao.ReviewInfoDao; -import luckyweb.seagull.spring.entity.ReviewInfo; - - -@Service("reviewInfoService") -public class ReviewInfoServiceImpl implements ReviewInfoService{ - - private ReviewInfoDao reviewinfodao; - - public ReviewInfoDao getReviewinfoDao() { - return reviewinfodao; - } - - @Resource(name = "reviewInfoDao") - public void setAccidentDao(ReviewInfoDao reviewinfodao) { - this.reviewinfodao = reviewinfodao; - } - - @Override - public int add(ReviewInfo reviewinfo) throws Exception { - return this.reviewinfodao.add(reviewinfo); - } - - @Override - public void delete(int id) throws Exception { - this.reviewinfodao.delete(id); - } - - @Override - public void modify(ReviewInfo reviewinfo) throws Exception { - this.reviewinfodao.modify(reviewinfo); - - } - - @Override - public ReviewInfo load(int id) throws Exception { - // TODO Auto-generated method stub - return this.reviewinfodao.get(id); - } - - private String where(ReviewInfo reviewinfo) { - String where = " where "; - if (reviewinfo.getReview_id()!=0) { - where += " review_id=:review_id and "; - } - if (where.length() == 7) { - where = ""; - } - else{ - where = where.substring(0, where.length() - 5); - } - - return where; - } - - private static String orderBy=" order by id desc"; - - @Override - public List findByPage(Object value, int offset, int pageSize) { - String hql=" from ReviewInfo "+where((ReviewInfo)value)+orderBy; - List list= reviewinfodao.findByPage(hql, value, offset, pageSize); - return list; - } - - @Override - public int findRows(ReviewInfo reviewinfo) { - String hql="select count(*) from ReviewInfo "+where(reviewinfo); - return reviewinfodao.findRows(reviewinfo, hql); - } - - @Override - public void delete_reviewid(int reviewid) throws Exception{ - String hql="delete from ReviewInfo where review_id="+reviewid; - this.reviewinfodao.update(hql); - } - -} +package luckyweb.seagull.spring.service; + +import java.util.List; + +import javax.annotation.Resource; + +import org.springframework.stereotype.Service; + +import luckyweb.seagull.spring.dao.ReviewInfoDao; +import luckyweb.seagull.spring.entity.ReviewInfo; + + +@Service("reviewInfoService") +public class ReviewInfoServiceImpl implements ReviewInfoService{ + + private ReviewInfoDao reviewinfodao; + + public ReviewInfoDao getReviewinfoDao() { + return reviewinfodao; + } + + @Resource(name = "reviewInfoDao") + public void setAccidentDao(ReviewInfoDao reviewinfodao) { + this.reviewinfodao = reviewinfodao; + } + + @Override + public int add(ReviewInfo reviewinfo) throws Exception { + return this.reviewinfodao.add(reviewinfo); + } + + @Override + public void delete(int id) throws Exception { + this.reviewinfodao.delete(id); + } + + @Override + public void modify(ReviewInfo reviewinfo) throws Exception { + this.reviewinfodao.modify(reviewinfo); + + } + + @Override + public ReviewInfo load(int id) throws Exception { + // TODO Auto-generated method stub + return this.reviewinfodao.get(id); + } + + private String where(ReviewInfo reviewinfo) { + String where = " where "; + if (reviewinfo.getReview_id()!=0) { + where += " review_id=:review_id and "; + } + if (where.length() == 7) { + where = ""; + } + else{ + where = where.substring(0, where.length() - 5); + } + + return where; + } + + private static String orderBy=" order by id desc"; + + @Override + public List findByPage(Object value, int offset, int pageSize) { + String hql=" from ReviewInfo "+where((ReviewInfo)value)+orderBy; + List list= reviewinfodao.findByPage(hql, value, offset, pageSize); + return list; + } + + @Override + public int findRows(ReviewInfo reviewinfo) { + String hql="select count(*) from ReviewInfo "+where(reviewinfo); + return reviewinfodao.findRows(reviewinfo, hql); + } + + @Override + public void delete_reviewid(int reviewid) throws Exception{ + String hql="delete from ReviewInfo where review_id="+reviewid; + this.reviewinfodao.update(hql); + } + +} diff --git a/src/main/java/luckyweb/seagull/spring/service/ReviewService.java b/src/main/java/luckyweb/seagull/spring/service/ReviewService.java index 191aa0c..cbe52b7 100644 --- a/src/main/java/luckyweb/seagull/spring/service/ReviewService.java +++ b/src/main/java/luckyweb/seagull/spring/service/ReviewService.java @@ -1,19 +1,19 @@ -package luckyweb.seagull.spring.service; - -import java.util.List; - -import org.springframework.transaction.annotation.Transactional; - -import luckyweb.seagull.spring.entity.Review; - -@Transactional -public interface ReviewService { - public int add(Review review)throws Exception; - public void delete(int id)throws Exception; - public void modify(Review review)throws Exception; - public Review load(int id)throws Exception; - - public List findByPage( final Object value,final int offset, final int pageSize); - - public int findRows(Review review) ; -} +package luckyweb.seagull.spring.service; + +import java.util.List; + +import org.springframework.transaction.annotation.Transactional; + +import luckyweb.seagull.spring.entity.Review; + +@Transactional +public interface ReviewService { + public int add(Review review)throws Exception; + public void delete(int id)throws Exception; + public void modify(Review review)throws Exception; + public Review load(int id)throws Exception; + + public List findByPage( final Object value,final int offset, final int pageSize); + + public int findRows(Review review) ; +} diff --git a/src/main/java/luckyweb/seagull/spring/service/ReviewServiceImpl.java b/src/main/java/luckyweb/seagull/spring/service/ReviewServiceImpl.java index e998888..e195c53 100644 --- a/src/main/java/luckyweb/seagull/spring/service/ReviewServiceImpl.java +++ b/src/main/java/luckyweb/seagull/spring/service/ReviewServiceImpl.java @@ -1,97 +1,97 @@ -package luckyweb.seagull.spring.service; - -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import luckyweb.seagull.spring.dao.ReviewDao; -import luckyweb.seagull.spring.entity.Review; - - -@Service("reviewService") -public class ReviewServiceImpl implements ReviewService{ - - private ReviewDao reviewdao; - - public ReviewDao getReviewDao() { - return reviewdao; - } - - @Resource(name = "reviewDao") - public void setAccidentDao(ReviewDao reviewdao) { - this.reviewdao = reviewdao; - } - - @Override - public int add(Review review) throws Exception { - return this.reviewdao.add(review); - } - - @Override - public void delete(int id) throws Exception { - this.reviewdao.delete(id); - } - - @Override - public void modify(Review review) throws Exception { - this.reviewdao.modify(review); - - } - - @Override - public Review load(int id) throws Exception { - // TODO Auto-generated method stub - return this.reviewdao.get(id); - } - - private String where(Review review) { - String where = " where "; - if (review.getProjectid()!=0) { - where += " projectid=:projectid and "; - } - if (review.getReview_startdate()!=null&&!"".equals(review.getReview_startdate())) { - where += " review_date>=:review_startdate and "; - } - if (review.getReview_enddate()!=null&&!"".equals(review.getReview_enddate())) { - where += " review_date<=:review_enddate and "; - } - if (review.getReview_enddate()!=null&&!"".equals(review.getReview_enddate())) { - where += " review_date<=:review_enddate and "; - } - if (null!=review.getVersion()&&!"".equals(review.getVersion())) { - where += " (version like :version or "; - } - if (null!=review.getReview_type()&&!"".equals(review.getReview_type())) { - where += " review_type like :review_type or "; - } - if (null!=review.getReview_result()&&!"".equals(review.getReview_result())) { - where += " review_result like :review_result) or "; - } - if (where.length() == 7) { - where = ""; - } - else{ - where = where.substring(0, where.length() - 5); - } - - return where; - } - - private static String orderBy=" order by id desc"; - - @Override - public List findByPage(Object value, int offset, int pageSize) { - String hql=" from Review "+where((Review)value)+orderBy; - List list= reviewdao.findByPage(hql, value, offset, pageSize); - return list; - } - - @Override - public int findRows(Review review) { - String hql="select count(*) from Review "+where(review); - return reviewdao.findRows(review, hql); - } - -} +package luckyweb.seagull.spring.service; + +import java.util.List; + +import javax.annotation.Resource; + +import org.springframework.stereotype.Service; + +import luckyweb.seagull.spring.dao.ReviewDao; +import luckyweb.seagull.spring.entity.Review; + + +@Service("reviewService") +public class ReviewServiceImpl implements ReviewService{ + + private ReviewDao reviewdao; + + public ReviewDao getReviewDao() { + return reviewdao; + } + + @Resource(name = "reviewDao") + public void setAccidentDao(ReviewDao reviewdao) { + this.reviewdao = reviewdao; + } + + @Override + public int add(Review review) throws Exception { + return this.reviewdao.add(review); + } + + @Override + public void delete(int id) throws Exception { + this.reviewdao.delete(id); + } + + @Override + public void modify(Review review) throws Exception { + this.reviewdao.modify(review); + + } + + @Override + public Review load(int id) throws Exception { + // TODO Auto-generated method stub + return this.reviewdao.get(id); + } + + private String where(Review review) { + String where = " where "; + if (review.getProjectid()!=0) { + where += " projectid=:projectid and "; + } + if (review.getReview_startdate()!=null&&!"".equals(review.getReview_startdate())) { + where += " review_date>=:review_startdate and "; + } + if (review.getReview_enddate()!=null&&!"".equals(review.getReview_enddate())) { + where += " review_date<=:review_enddate and "; + } + if (review.getReview_enddate()!=null&&!"".equals(review.getReview_enddate())) { + where += " review_date<=:review_enddate and "; + } + if (null!=review.getVersion()&&!"".equals(review.getVersion())) { + where += " (version like :version or "; + } + if (null!=review.getReview_type()&&!"".equals(review.getReview_type())) { + where += " review_type like :review_type or "; + } + if (null!=review.getReview_result()&&!"".equals(review.getReview_result())) { + where += " review_result like :review_result) or "; + } + if (where.length() == 7) { + where = ""; + } + else{ + where = where.substring(0, where.length() - 5); + } + + return where; + } + + private static String orderBy=" order by id desc"; + + @Override + public List findByPage(Object value, int offset, int pageSize) { + String hql=" from Review "+where((Review)value)+orderBy; + List list= reviewdao.findByPage(hql, value, offset, pageSize); + return list; + } + + @Override + public int findRows(Review review) { + String hql="select count(*) from Review "+where(review); + return reviewdao.findRows(review, hql); + } + +} diff --git a/src/main/java/luckyweb/seagull/spring/service/SecondarySectorService.java b/src/main/java/luckyweb/seagull/spring/service/SecondarySectorService.java index 8ea1ec4..3f9e83d 100644 --- a/src/main/java/luckyweb/seagull/spring/service/SecondarySectorService.java +++ b/src/main/java/luckyweb/seagull/spring/service/SecondarySectorService.java @@ -1,38 +1,38 @@ -package luckyweb.seagull.spring.service; - -import java.util.List; - -import org.springframework.transaction.annotation.Propagation; -import org.springframework.transaction.annotation.Transactional; - -import luckyweb.seagull.spring.entity.SecondarySector; - -@Transactional -public interface SecondarySectorService { - public int add(SecondarySector Sector)throws Exception; - public void modify(SecondarySector Sector)throws Exception; - public void modifyState(SecondarySector Sector)throws Exception; - public void delete(SecondarySector Sector)throws Exception; - - @Transactional(propagation=Propagation.NOT_SUPPORTED) - public List list(SecondarySector Sector)throws Exception; - - @Transactional(propagation=Propagation.NOT_SUPPORTED) - public List listall()throws Exception; - - public boolean isExist(String name,String cmdType,String planPath)throws Exception; - - public SecondarySector load(int id)throws Exception; - - -// public List findByPage( final int offset,final int pageSize); -// -// public List findByPage( final Object[] values,final int offset, final int pageSize); - - public List findByPage( final Object value,final int offset, final int pageSize); - - public int findRows(SecondarySector Sector) ; -// public List getListForPage( final int offset,final int lengh); - - public List findSecotorList() throws Exception ; -} +package luckyweb.seagull.spring.service; + +import java.util.List; + +import org.springframework.transaction.annotation.Propagation; +import org.springframework.transaction.annotation.Transactional; + +import luckyweb.seagull.spring.entity.SecondarySector; + +@Transactional +public interface SecondarySectorService { + public int add(SecondarySector Sector)throws Exception; + public void modify(SecondarySector Sector)throws Exception; + public void modifyState(SecondarySector Sector)throws Exception; + public void delete(SecondarySector Sector)throws Exception; + + @Transactional(propagation=Propagation.NOT_SUPPORTED) + public List list(SecondarySector Sector)throws Exception; + + @Transactional(propagation=Propagation.NOT_SUPPORTED) + public List listall()throws Exception; + + public boolean isExist(String name,String cmdType,String planPath)throws Exception; + + public SecondarySector load(int id)throws Exception; + + +// public List findByPage( final int offset,final int pageSize); +// +// public List findByPage( final Object[] values,final int offset, final int pageSize); + + public List findByPage( final Object value,final int offset, final int pageSize); + + public int findRows(SecondarySector Sector) ; +// public List getListForPage( final int offset,final int lengh); + + public List findSecotorList() throws Exception ; +} diff --git a/src/main/java/luckyweb/seagull/spring/service/SecondarySectorServiceImpl.java b/src/main/java/luckyweb/seagull/spring/service/SecondarySectorServiceImpl.java index ec28a50..1c8a26b 100644 --- a/src/main/java/luckyweb/seagull/spring/service/SecondarySectorServiceImpl.java +++ b/src/main/java/luckyweb/seagull/spring/service/SecondarySectorServiceImpl.java @@ -1,121 +1,121 @@ -package luckyweb.seagull.spring.service; - -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import luckyweb.seagull.spring.dao.SecondarySectorDao; -import luckyweb.seagull.spring.entity.SecondarySector; -import luckyweb.seagull.spring.entity.TestJobs; -import luckyweb.seagull.util.StrLib; - -@Service("secondarysectorService") -public class SecondarySectorServiceImpl implements SecondarySectorService{ - - private SecondarySectorDao secondarysectordao; - - public SecondarySectorDao getTestJobsDao() { - return secondarysectordao; - } - - @Resource(name = "secondarysectorDao") - public void setSecondarySectorDao(SecondarySectorDao secondarysectordao) { - this.secondarysectordao = secondarysectordao; - } - - @Override - public int add(SecondarySector Sector) throws Exception { - // TODO Auto-generated method stub - return this.secondarysectordao.add(Sector); - } - - @Override - public void modify(SecondarySector Sector) throws Exception { - this.secondarysectordao.modify(Sector); - - } - - @Override - public void modifyState(SecondarySector Sector) throws Exception { - // TODO Auto-generated method stub - - } - - @Override - public void delete(SecondarySector Sector) throws Exception { - // TODO Auto-generated method stub - this.secondarysectordao.delete(Sector); - } - - @Override - public List list(SecondarySector sector) throws Exception { - // TODO Auto-generated method stub - return this.secondarysectordao.list(sector); - } - - @Override - public List listall() throws Exception { - // TODO Auto-generated method stub - return this.secondarysectordao.list(); - } - - @Override - public boolean isExist(String name, String cmdType, String planPath) - throws Exception { - // TODO Auto-generated method stub - return false; - } - - @Override - public SecondarySector load(int id) throws Exception { - // TODO Auto-generated method stub - return this.secondarysectordao.load(id); - } - - private String where(SecondarySector ss) { - String where = " where "; -/* if (!StrLib.isEmpty(String.valueOf(ss.getSectorid()))) { - where += " sectorid=:sectorid and "; - }*/ - if (!StrLib.isEmpty(ss.getDepartmenthead())) { - where += " departmenthead like :departmenthead or "; - } - else if (!StrLib.isEmpty(ss.getDepartmentname())) { - where += " departmentname like :departmentname or "; - } - - - if (where.length() == 7) { - where = ""; - } - else{ - where = where.substring(0, where.length() - 5); - } - - return where; - } - - private static String orderBy=" order by sectorid asc "; - - @Override - public List findByPage(Object value, int offset, int pageSize) { - String hql=" from SecondarySector "+where((SecondarySector)value)+orderBy; - List list= secondarysectordao.findByPage(hql, value, offset, pageSize); - return list; - } - - @Override - public int findRows(SecondarySector Sector) { - String hql="select count(*) from SecondarySector "+where(Sector); - return secondarysectordao.findRows(Sector,hql); - } - - @Override - public List findSecotorList() throws Exception { - // TODO Auto-generated method stub - return secondarysectordao.findSectorList(); - } - -} +package luckyweb.seagull.spring.service; + +import java.util.List; + +import javax.annotation.Resource; + +import org.springframework.stereotype.Service; + +import luckyweb.seagull.spring.dao.SecondarySectorDao; +import luckyweb.seagull.spring.entity.SecondarySector; +import luckyweb.seagull.spring.entity.TestJobs; +import luckyweb.seagull.util.StrLib; + +@Service("secondarysectorService") +public class SecondarySectorServiceImpl implements SecondarySectorService{ + + private SecondarySectorDao secondarysectordao; + + public SecondarySectorDao getTestJobsDao() { + return secondarysectordao; + } + + @Resource(name = "secondarysectorDao") + public void setSecondarySectorDao(SecondarySectorDao secondarysectordao) { + this.secondarysectordao = secondarysectordao; + } + + @Override + public int add(SecondarySector Sector) throws Exception { + // TODO Auto-generated method stub + return this.secondarysectordao.add(Sector); + } + + @Override + public void modify(SecondarySector Sector) throws Exception { + this.secondarysectordao.modify(Sector); + + } + + @Override + public void modifyState(SecondarySector Sector) throws Exception { + // TODO Auto-generated method stub + + } + + @Override + public void delete(SecondarySector Sector) throws Exception { + // TODO Auto-generated method stub + this.secondarysectordao.delete(Sector); + } + + @Override + public List list(SecondarySector sector) throws Exception { + // TODO Auto-generated method stub + return this.secondarysectordao.list(sector); + } + + @Override + public List listall() throws Exception { + // TODO Auto-generated method stub + return this.secondarysectordao.list(); + } + + @Override + public boolean isExist(String name, String cmdType, String planPath) + throws Exception { + // TODO Auto-generated method stub + return false; + } + + @Override + public SecondarySector load(int id) throws Exception { + // TODO Auto-generated method stub + return this.secondarysectordao.load(id); + } + + private String where(SecondarySector ss) { + String where = " where "; +/* if (!StrLib.isEmpty(String.valueOf(ss.getSectorid()))) { + where += " sectorid=:sectorid and "; + }*/ + if (!StrLib.isEmpty(ss.getDepartmenthead())) { + where += " departmenthead like :departmenthead or "; + } + else if (!StrLib.isEmpty(ss.getDepartmentname())) { + where += " departmentname like :departmentname or "; + } + + + if (where.length() == 7) { + where = ""; + } + else{ + where = where.substring(0, where.length() - 5); + } + + return where; + } + + private static String orderBy=" order by sectorid asc "; + + @Override + public List findByPage(Object value, int offset, int pageSize) { + String hql=" from SecondarySector "+where((SecondarySector)value)+orderBy; + List list= secondarysectordao.findByPage(hql, value, offset, pageSize); + return list; + } + + @Override + public int findRows(SecondarySector Sector) { + String hql="select count(*) from SecondarySector "+where(Sector); + return secondarysectordao.findRows(Sector,hql); + } + + @Override + public List findSecotorList() throws Exception { + // TODO Auto-generated method stub + return secondarysectordao.findSectorList(); + } + +} diff --git a/src/main/java/luckyweb/seagull/spring/service/SectorProjectsService.java b/src/main/java/luckyweb/seagull/spring/service/SectorProjectsService.java index 835fc2e..125b012 100644 --- a/src/main/java/luckyweb/seagull/spring/service/SectorProjectsService.java +++ b/src/main/java/luckyweb/seagull/spring/service/SectorProjectsService.java @@ -1,45 +1,45 @@ -package luckyweb.seagull.spring.service; - -import java.util.List; - -import org.springframework.transaction.annotation.Propagation; -import org.springframework.transaction.annotation.Transactional; - -import luckyweb.seagull.spring.entity.SectorProjects; - -@Transactional -public interface SectorProjectsService { - public int add(SectorProjects sectorprojects)throws Exception; - public void modify(SectorProjects sectorprojects)throws Exception; - public void modifyState(SectorProjects sectorprojects)throws Exception; - public void delete(SectorProjects sectorprojects)throws Exception; - - @Transactional(propagation=Propagation.NOT_SUPPORTED) - public List list(SectorProjects sectorprojects)throws Exception; - - @Transactional(propagation=Propagation.NOT_SUPPORTED) - public List list()throws Exception; - - - public boolean isExist(String name,String cmdType,String planPath)throws Exception; - - public Object load(int projectid)throws Exception; - - public SectorProjects get(int id)throws Exception; - public int getid(String projectname) throws Exception; - -// public List findByPage( final int offset,final int pageSize); -// -// public List findByPage( final Object[] values,final int offset, final int pageSize); - - public List findByPage( final Object value,final int offset, final int pageSize); - - public int findRows(SectorProjects sectorprojects) ; -// public List getListForPage( final int offset,final int lengh); - - public List findProjectsList(); - public SectorProjects loadob(int projectid) throws Exception; - public int projectrow(int id); - public List getAllProject(); - public int projectrowfordmtp(int sectorid); -} +package luckyweb.seagull.spring.service; + +import java.util.List; + +import org.springframework.transaction.annotation.Propagation; +import org.springframework.transaction.annotation.Transactional; + +import luckyweb.seagull.spring.entity.SectorProjects; + +@Transactional +public interface SectorProjectsService { + public int add(SectorProjects sectorprojects)throws Exception; + public void modify(SectorProjects sectorprojects)throws Exception; + public void modifyState(SectorProjects sectorprojects)throws Exception; + public void delete(SectorProjects sectorprojects)throws Exception; + + @Transactional(propagation=Propagation.NOT_SUPPORTED) + public List list(SectorProjects sectorprojects)throws Exception; + + @Transactional(propagation=Propagation.NOT_SUPPORTED) + public List list()throws Exception; + + + public boolean isExist(String name,String cmdType,String planPath)throws Exception; + + public Object load(int projectid)throws Exception; + + public SectorProjects get(int id)throws Exception; + public int getid(String projectname) throws Exception; + +// public List findByPage( final int offset,final int pageSize); +// +// public List findByPage( final Object[] values,final int offset, final int pageSize); + + public List findByPage( final Object value,final int offset, final int pageSize); + + public int findRows(SectorProjects sectorprojects) ; +// public List getListForPage( final int offset,final int lengh); + + public List findProjectsList(); + public SectorProjects loadob(int projectid) throws Exception; + public int projectrow(int id); + public List getAllProject(); + public int projectrowfordmtp(int sectorid); +} diff --git a/src/main/java/luckyweb/seagull/spring/service/SectorProjectsServiceImpl.java b/src/main/java/luckyweb/seagull/spring/service/SectorProjectsServiceImpl.java index 0894277..548293a 100644 --- a/src/main/java/luckyweb/seagull/spring/service/SectorProjectsServiceImpl.java +++ b/src/main/java/luckyweb/seagull/spring/service/SectorProjectsServiceImpl.java @@ -1,158 +1,158 @@ -package luckyweb.seagull.spring.service; - -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import luckyweb.seagull.spring.dao.SectorProjectsDao; -import luckyweb.seagull.spring.entity.SectorProjects; -import luckyweb.seagull.util.StrLib; - -@Service("sectorprojectsService") -public class SectorProjectsServiceImpl implements SectorProjectsService{ - - private SectorProjectsDao sectorprojectsdao; - - public SectorProjectsDao getSectorProjectsDao() { - return sectorprojectsdao; - } - - @Resource(name = "sectorprojectsDao") - public void setSectorProjectsDao(SectorProjectsDao sectorprojectsdao) { - this.sectorprojectsdao = sectorprojectsdao; - } - - @Override - public int add(SectorProjects sectorprojects) throws Exception { - // TODO Auto-generated method stub - return this.sectorprojectsdao.add(sectorprojects); - } - - @Override - public void modify(SectorProjects sectorprojects) throws Exception { - // TODO Auto-generated method stub - this.sectorprojectsdao.modify(sectorprojects); - } - - @Override - public void modifyState(SectorProjects sectorprojects) throws Exception { - // TODO Auto-generated method stub - - } - - @Override - public void delete(SectorProjects sectorprojects) throws Exception { - // TODO Auto-generated method stub - this.sectorprojectsdao.delete(sectorprojects); - } - - @Override - public List list(SectorProjects sectorprojects) throws Exception { - // TODO Auto-generated method stub - return this.sectorprojectsdao.list(sectorprojects); - } - - @Override - public List list() throws Exception { - // TODO Auto-generated method stub - return this.sectorprojectsdao.list(); - } - - @Override - public boolean isExist(String name, String cmdType, String planPath) - throws Exception { - // TODO Auto-generated method stub - return false; - } - - @Override - public Object load(int projectid) throws Exception { - // TODO Auto-generated method stub - return this.sectorprojectsdao.findproject(projectid); - } - - @Override - public SectorProjects loadob(int projectid) throws Exception { - // TODO Auto-generated method stub - return this.sectorprojectsdao.load(projectid); - } - - @Override - public int getid(String projectname) throws Exception { - // TODO Auto-generated method stub - return this.sectorprojectsdao.getid(projectname); - } - - @Override - public SectorProjects get(int id) throws Exception { - // TODO Auto-generated method stub - return null; - } - - private String where(SectorProjects sp) { - String where = " where "; -/* if (!StrLib.isEmpty(String.valueOf(ss.getSectorid()))) { - where += " sectorid=:sectorid and "; - }*/ - if (!StrLib.isEmpty(sp.getProjectmanager())) { - where += " projectname like :projectname or "; - }if (!StrLib.isEmpty(sp.getProjectname())) { - where += " projectmanager like :projectmanager or "; - }if (!StrLib.isEmpty(sp.getProjectname())) { - where += " projectsign like :projectsign or "; - }if (where.length() == 7) { - where = ""; - } - else{ - where = where.substring(0, where.length() - 5); - } - - return where; - } - - private static String orderBy=" order by projectid asc "; - - @Override - public List findByPage(Object value, int offset, int pageSize) { - String hql=" from SectorProjects "+where((SectorProjects)value)+orderBy; - List list= sectorprojectsdao.findByPage(hql, value, offset, pageSize); - return list; - } - - @Override - public int findRows(SectorProjects sectorprojects) { - String hql="select count(*) from SectorProjects "+where(sectorprojects); - return sectorprojectsdao.findRows(sectorprojects,hql); - } - - @Override - public List findProjectsList() { - // TODO Auto-generated method stub - return null; - } - - @Override - public int projectrow(int id) { - int row=0; - row=sectorprojectsdao.projectrow("SELECT projectid from qa_accident where projectid="+id); - row=sectorprojectsdao.projectrow("SELECT projectid from qa_flowcheck where projectid="+id)+row; - row=sectorprojectsdao.projectrow("SELECT projectid from qa_planflowcheck where projectid="+id)+row; - row=sectorprojectsdao.projectrow("SELECT projectid from qa_projectversion where projectid="+id)+row; - row=sectorprojectsdao.projectrow("SELECT projectid from qa_review where projectid="+id)+row; - return row; - } - - @Override - public int projectrowfordmtp(int sectorid) { - int row=0; - row=sectorprojectsdao.projectrow("SELECT projectid from QA_SECTORPROJECTS where sectorid="+sectorid); - return row; - } - - @Override - public List getAllProject(){ - return sectorprojectsdao.getAllProject(); - } -} +package luckyweb.seagull.spring.service; + +import java.util.List; + +import javax.annotation.Resource; + +import org.springframework.stereotype.Service; + +import luckyweb.seagull.spring.dao.SectorProjectsDao; +import luckyweb.seagull.spring.entity.SectorProjects; +import luckyweb.seagull.util.StrLib; + +@Service("sectorprojectsService") +public class SectorProjectsServiceImpl implements SectorProjectsService{ + + private SectorProjectsDao sectorprojectsdao; + + public SectorProjectsDao getSectorProjectsDao() { + return sectorprojectsdao; + } + + @Resource(name = "sectorprojectsDao") + public void setSectorProjectsDao(SectorProjectsDao sectorprojectsdao) { + this.sectorprojectsdao = sectorprojectsdao; + } + + @Override + public int add(SectorProjects sectorprojects) throws Exception { + // TODO Auto-generated method stub + return this.sectorprojectsdao.add(sectorprojects); + } + + @Override + public void modify(SectorProjects sectorprojects) throws Exception { + // TODO Auto-generated method stub + this.sectorprojectsdao.modify(sectorprojects); + } + + @Override + public void modifyState(SectorProjects sectorprojects) throws Exception { + // TODO Auto-generated method stub + + } + + @Override + public void delete(SectorProjects sectorprojects) throws Exception { + // TODO Auto-generated method stub + this.sectorprojectsdao.delete(sectorprojects); + } + + @Override + public List list(SectorProjects sectorprojects) throws Exception { + // TODO Auto-generated method stub + return this.sectorprojectsdao.list(sectorprojects); + } + + @Override + public List list() throws Exception { + // TODO Auto-generated method stub + return this.sectorprojectsdao.list(); + } + + @Override + public boolean isExist(String name, String cmdType, String planPath) + throws Exception { + // TODO Auto-generated method stub + return false; + } + + @Override + public Object load(int projectid) throws Exception { + // TODO Auto-generated method stub + return this.sectorprojectsdao.findproject(projectid); + } + + @Override + public SectorProjects loadob(int projectid) throws Exception { + // TODO Auto-generated method stub + return this.sectorprojectsdao.load(projectid); + } + + @Override + public int getid(String projectname) throws Exception { + // TODO Auto-generated method stub + return this.sectorprojectsdao.getid(projectname); + } + + @Override + public SectorProjects get(int id) throws Exception { + // TODO Auto-generated method stub + return null; + } + + private String where(SectorProjects sp) { + String where = " where "; +/* if (!StrLib.isEmpty(String.valueOf(ss.getSectorid()))) { + where += " sectorid=:sectorid and "; + }*/ + if (!StrLib.isEmpty(sp.getProjectmanager())) { + where += " projectname like :projectname or "; + }if (!StrLib.isEmpty(sp.getProjectname())) { + where += " projectmanager like :projectmanager or "; + }if (!StrLib.isEmpty(sp.getProjectname())) { + where += " projectsign like :projectsign or "; + }if (where.length() == 7) { + where = ""; + } + else{ + where = where.substring(0, where.length() - 5); + } + + return where; + } + + private static String orderBy=" order by projectid asc "; + + @Override + public List findByPage(Object value, int offset, int pageSize) { + String hql=" from SectorProjects "+where((SectorProjects)value)+orderBy; + List list= sectorprojectsdao.findByPage(hql, value, offset, pageSize); + return list; + } + + @Override + public int findRows(SectorProjects sectorprojects) { + String hql="select count(*) from SectorProjects "+where(sectorprojects); + return sectorprojectsdao.findRows(sectorprojects,hql); + } + + @Override + public List findProjectsList() { + // TODO Auto-generated method stub + return null; + } + + @Override + public int projectrow(int id) { + int row=0; + row=sectorprojectsdao.projectrow("SELECT projectid from qa_accident where projectid="+id); + row=sectorprojectsdao.projectrow("SELECT projectid from qa_flowcheck where projectid="+id)+row; + row=sectorprojectsdao.projectrow("SELECT projectid from qa_planflowcheck where projectid="+id)+row; + row=sectorprojectsdao.projectrow("SELECT projectid from qa_projectversion where projectid="+id)+row; + row=sectorprojectsdao.projectrow("SELECT projectid from qa_review where projectid="+id)+row; + return row; + } + + @Override + public int projectrowfordmtp(int sectorid) { + int row=0; + row=sectorprojectsdao.projectrow("SELECT projectid from QA_SECTORPROJECTS where sectorid="+sectorid); + return row; + } + + @Override + public List getAllProject(){ + return sectorprojectsdao.getAllProject(); + } +} diff --git a/src/main/java/luckyweb/seagull/spring/service/TempCasestepDebugImpl.java b/src/main/java/luckyweb/seagull/spring/service/TempCasestepDebugImpl.java index 4710eba..6fb9c1d 100644 --- a/src/main/java/luckyweb/seagull/spring/service/TempCasestepDebugImpl.java +++ b/src/main/java/luckyweb/seagull/spring/service/TempCasestepDebugImpl.java @@ -1,95 +1,95 @@ -package luckyweb.seagull.spring.service; - -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import luckyweb.seagull.spring.dao.TempCasestepDebugDao; -import luckyweb.seagull.spring.entity.TempCasestepDebug; -import luckyweb.seagull.util.StrLib; - - - -@Service("tempcasestepdebugService") -public class TempCasestepDebugImpl implements TempCasestepDebugService{ - - private TempCasestepDebugDao tempcasestepdebugdao; - - public TempCasestepDebugDao getTempCasestepDebugDao() { - return tempcasestepdebugdao; - } - - @Resource(name = "tempcasestepdebugDao") - public void setTempCasestepDebugDao(TempCasestepDebugDao tempcasestepdebugdao) { - this.tempcasestepdebugdao = tempcasestepdebugdao; - } - - @Override - public TempCasestepDebug load(int id) throws Exception { - // TODO Auto-generated method stub - return this.tempcasestepdebugdao.load(id); - } - - private String where(TempCasestepDebug tcd) { - String where = " where "; - if (!StrLib.isEmpty(tcd.getSign())) { - where += " sign=:sign and "; - } - if (!StrLib.isEmpty(tcd.getExecutor())) { - where += " executor=:executor and "; - } - if (where.length() == 7) { - where = ""; - } - else{ - where = where.substring(0, where.length() - 5); - } - - return where; - } - - private static String orderBy=" order by id desc "; - - @Override - public List findByPage(Object value, int offset, int pageSize) { - String hql=" from TempCasestepDebug "+where((TempCasestepDebug)value)+orderBy; - List list= tempcasestepdebugdao.findByPage(hql, value, offset, pageSize); - return list; - } - - @Override - public int findRows(TempCasestepDebug tcd) { - String hql="select count(*) from TempCasestepDebug "+where(tcd); - return tempcasestepdebugdao.findRows(tcd, hql); - } - - - @Override - public int add(TempCasestepDebug tcd) throws Exception { - return this.tempcasestepdebugdao.add(tcd); - } - - @Override - public void delete(String sign,String executor) throws Exception { - String hql="delete from TempCasestepDebug where sign='"+sign+"' and executor='"+executor+"'"; - this.tempcasestepdebugdao.delete(hql); - } - - @Override - public void deleteforob(TempCasestepDebug tcd) throws Exception{ - this.tempcasestepdebugdao.deleteforob(tcd); - } - - @Override - public void modify(TempCasestepDebug tcd) throws Exception{ - this.tempcasestepdebugdao.modify(tcd); - } - - @Override - public List getList(String sign,String executor) throws Exception { - // TODO Auto-generated method stub - return this.tempcasestepdebugdao.getParamsList(" from TempCasestepDebug where sign='"+sign+"' and executor='"+executor+"' order by id"); - } -} +package luckyweb.seagull.spring.service; + +import java.util.List; + +import javax.annotation.Resource; + +import org.springframework.stereotype.Service; + +import luckyweb.seagull.spring.dao.TempCasestepDebugDao; +import luckyweb.seagull.spring.entity.TempCasestepDebug; +import luckyweb.seagull.util.StrLib; + + + +@Service("tempcasestepdebugService") +public class TempCasestepDebugImpl implements TempCasestepDebugService{ + + private TempCasestepDebugDao tempcasestepdebugdao; + + public TempCasestepDebugDao getTempCasestepDebugDao() { + return tempcasestepdebugdao; + } + + @Resource(name = "tempcasestepdebugDao") + public void setTempCasestepDebugDao(TempCasestepDebugDao tempcasestepdebugdao) { + this.tempcasestepdebugdao = tempcasestepdebugdao; + } + + @Override + public TempCasestepDebug load(int id) throws Exception { + // TODO Auto-generated method stub + return this.tempcasestepdebugdao.load(id); + } + + private String where(TempCasestepDebug tcd) { + String where = " where "; + if (!StrLib.isEmpty(tcd.getSign())) { + where += " sign=:sign and "; + } + if (!StrLib.isEmpty(tcd.getExecutor())) { + where += " executor=:executor and "; + } + if (where.length() == 7) { + where = ""; + } + else{ + where = where.substring(0, where.length() - 5); + } + + return where; + } + + private static String orderBy=" order by id desc "; + + @Override + public List findByPage(Object value, int offset, int pageSize) { + String hql=" from TempCasestepDebug "+where((TempCasestepDebug)value)+orderBy; + List list= tempcasestepdebugdao.findByPage(hql, value, offset, pageSize); + return list; + } + + @Override + public int findRows(TempCasestepDebug tcd) { + String hql="select count(*) from TempCasestepDebug "+where(tcd); + return tempcasestepdebugdao.findRows(tcd, hql); + } + + + @Override + public int add(TempCasestepDebug tcd) throws Exception { + return this.tempcasestepdebugdao.add(tcd); + } + + @Override + public void delete(String sign,String executor) throws Exception { + String hql="delete from TempCasestepDebug where sign='"+sign+"' and executor='"+executor+"'"; + this.tempcasestepdebugdao.delete(hql); + } + + @Override + public void deleteforob(TempCasestepDebug tcd) throws Exception{ + this.tempcasestepdebugdao.deleteforob(tcd); + } + + @Override + public void modify(TempCasestepDebug tcd) throws Exception{ + this.tempcasestepdebugdao.modify(tcd); + } + + @Override + public List getList(String sign,String executor) throws Exception { + // TODO Auto-generated method stub + return this.tempcasestepdebugdao.getParamsList(" from TempCasestepDebug where sign='"+sign+"' and executor='"+executor+"' order by id"); + } +} diff --git a/src/main/java/luckyweb/seagull/spring/service/TempCasestepDebugService.java b/src/main/java/luckyweb/seagull/spring/service/TempCasestepDebugService.java index 55c78b1..b74fd17 100644 --- a/src/main/java/luckyweb/seagull/spring/service/TempCasestepDebugService.java +++ b/src/main/java/luckyweb/seagull/spring/service/TempCasestepDebugService.java @@ -1,21 +1,21 @@ -package luckyweb.seagull.spring.service; - - -import java.util.List; - -import org.springframework.transaction.annotation.Transactional; - -import luckyweb.seagull.spring.entity.TempCasestepDebug; - - -@Transactional -public interface TempCasestepDebugService { - public int add(TempCasestepDebug tcd)throws Exception; - public TempCasestepDebug load(int id)throws Exception; - public List findByPage( final Object value,final int offset, final int pageSize); - public int findRows(TempCasestepDebug tcd); - public void delete(String sign,String executor) throws Exception; - public void deleteforob(TempCasestepDebug tcd) throws Exception; - public void modify(TempCasestepDebug tcd) throws Exception; - public List getList(String sign,String executor) throws Exception; -} +package luckyweb.seagull.spring.service; + + +import java.util.List; + +import org.springframework.transaction.annotation.Transactional; + +import luckyweb.seagull.spring.entity.TempCasestepDebug; + + +@Transactional +public interface TempCasestepDebugService { + public int add(TempCasestepDebug tcd)throws Exception; + public TempCasestepDebug load(int id)throws Exception; + public List findByPage( final Object value,final int offset, final int pageSize); + public int findRows(TempCasestepDebug tcd); + public void delete(String sign,String executor) throws Exception; + public void deleteforob(TempCasestepDebug tcd) throws Exception; + public void modify(TempCasestepDebug tcd) throws Exception; + public List getList(String sign,String executor) throws Exception; +} diff --git a/src/main/java/luckyweb/seagull/spring/service/TestClientService.java b/src/main/java/luckyweb/seagull/spring/service/TestClientService.java index ebaeaed..2c12187 100644 --- a/src/main/java/luckyweb/seagull/spring/service/TestClientService.java +++ b/src/main/java/luckyweb/seagull/spring/service/TestClientService.java @@ -1,25 +1,25 @@ -package luckyweb.seagull.spring.service; - - -import java.util.List; - -import org.springframework.transaction.annotation.Transactional; - -import luckyweb.seagull.spring.entity.TestClient; - - -@Transactional -public interface TestClientService { - - public TestClient load(int id)throws Exception; - public int add(TestClient tc) throws Exception; - public void modify(TestClient tc) throws Exception; - public void delete(TestClient tc) throws Exception; - - public List findByPage( final Object value,final int offset, final int pageSize); - - public int findRows(TestClient tc) ; - public List getClientListForProid(int projectid) throws Exception; - public List getClientList() throws Exception; - public TestClient getClient(String ip) throws Exception; -} +package luckyweb.seagull.spring.service; + + +import java.util.List; + +import org.springframework.transaction.annotation.Transactional; + +import luckyweb.seagull.spring.entity.TestClient; + + +@Transactional +public interface TestClientService { + + public TestClient load(int id)throws Exception; + public int add(TestClient tc) throws Exception; + public void modify(TestClient tc) throws Exception; + public void delete(TestClient tc) throws Exception; + + public List findByPage( final Object value,final int offset, final int pageSize); + + public int findRows(TestClient tc) ; + public List getClientListForProid(int projectid) throws Exception; + public List getClientList() throws Exception; + public TestClient getClient(String ip) throws Exception; +} diff --git a/src/main/java/luckyweb/seagull/spring/service/TestClientServiceImpl.java b/src/main/java/luckyweb/seagull/spring/service/TestClientServiceImpl.java index e6e1761..4ebdc60 100644 --- a/src/main/java/luckyweb/seagull/spring/service/TestClientServiceImpl.java +++ b/src/main/java/luckyweb/seagull/spring/service/TestClientServiceImpl.java @@ -1,103 +1,103 @@ -package luckyweb.seagull.spring.service; - -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import luckyweb.seagull.spring.dao.TestClientDao; -import luckyweb.seagull.spring.entity.TestClient; - - - -@Service("testclientService") -public class TestClientServiceImpl implements TestClientService{ - - private TestClientDao tcdao; - - public TestClientDao getTestClientDao() { - return tcdao; - } - - @Resource(name = "testclientDao") - public void setTestClientDao(TestClientDao tcDao) { - this.tcdao = tcDao; - } - - @Override - public TestClient load(int id) throws Exception { - // TODO Auto-generated method stub - return this.tcdao.load(id); - } - - public int add(TestClient tc) throws Exception{ - return this.tcdao.add(tc); - } - - public void modify(TestClient tc) throws Exception{ - this.tcdao.modify(tc); - } - - public void delete(TestClient tc) throws Exception{ - this.tcdao.delete(tc); - } - - private String where(TestClient tc) { - String where = " where "; - if (null!=tc.getClientip()&&!"".equals(tc.getClientip())) { - where += " clientip like :clientip or "; - } - if (null!=tc.getName()&&!"".equals(tc.getName())) { - where += " name like :name or "; - } - if (where.length() == 7) { - where = ""; - } - else{ - where = where.substring(0, where.length() - 5); - } - - return where; - } - - private static String orderBy=" order by id desc"; - - @Override - public List findByPage(Object value, int offset, int pageSize) { - String hql=" from TestClient "+where((TestClient)value)+orderBy; - List list= tcdao.findByPage(hql, value, offset, pageSize); - return list; - } - - @Override - public int findRows(TestClient tc) { - String hql="select count(*) from TestClient "+where(tc); - return tcdao.findRows(tc, hql); - } - - @SuppressWarnings("unchecked") - @Override - public List getClientListForProid(int projectid) throws Exception { - String hql="from TestClient where projectper like '%,"+projectid+",%' order by id asc"; - return tcdao.listsql(hql); - } - - @SuppressWarnings("unchecked") - @Override - public List getClientList() throws Exception { - String hql="from TestClient order by id asc"; - return tcdao.listsql(hql); - } - - @SuppressWarnings("unchecked") - @Override - public TestClient getClient(String ip) throws Exception { - String hql="from TestClient where clientip='"+ip+"'"; - List ltc=tcdao.listsql(hql); - if(ltc.size()==0){ - return null; - } - return ltc.get(0); - } -} +package luckyweb.seagull.spring.service; + +import java.util.List; + +import javax.annotation.Resource; + +import org.springframework.stereotype.Service; + +import luckyweb.seagull.spring.dao.TestClientDao; +import luckyweb.seagull.spring.entity.TestClient; + + + +@Service("testclientService") +public class TestClientServiceImpl implements TestClientService{ + + private TestClientDao tcdao; + + public TestClientDao getTestClientDao() { + return tcdao; + } + + @Resource(name = "testclientDao") + public void setTestClientDao(TestClientDao tcDao) { + this.tcdao = tcDao; + } + + @Override + public TestClient load(int id) throws Exception { + // TODO Auto-generated method stub + return this.tcdao.load(id); + } + + public int add(TestClient tc) throws Exception{ + return this.tcdao.add(tc); + } + + public void modify(TestClient tc) throws Exception{ + this.tcdao.modify(tc); + } + + public void delete(TestClient tc) throws Exception{ + this.tcdao.delete(tc); + } + + private String where(TestClient tc) { + String where = " where "; + if (null!=tc.getClientip()&&!"".equals(tc.getClientip())) { + where += " clientip like :clientip or "; + } + if (null!=tc.getName()&&!"".equals(tc.getName())) { + where += " name like :name or "; + } + if (where.length() == 7) { + where = ""; + } + else{ + where = where.substring(0, where.length() - 5); + } + + return where; + } + + private static String orderBy=" order by id desc"; + + @Override + public List findByPage(Object value, int offset, int pageSize) { + String hql=" from TestClient "+where((TestClient)value)+orderBy; + List list= tcdao.findByPage(hql, value, offset, pageSize); + return list; + } + + @Override + public int findRows(TestClient tc) { + String hql="select count(*) from TestClient "+where(tc); + return tcdao.findRows(tc, hql); + } + + @SuppressWarnings("unchecked") + @Override + public List getClientListForProid(int projectid) throws Exception { + String hql="from TestClient where projectper like '%,"+projectid+",%' order by id asc"; + return tcdao.listsql(hql); + } + + @SuppressWarnings("unchecked") + @Override + public List getClientList() throws Exception { + String hql="from TestClient order by id asc"; + return tcdao.listsql(hql); + } + + @SuppressWarnings("unchecked") + @Override + public TestClient getClient(String ip) throws Exception { + String hql="from TestClient where clientip='"+ip+"'"; + List ltc=tcdao.listsql(hql); + if(ltc.size()==0){ + return null; + } + return ltc.get(0); + } +} diff --git a/src/main/java/luckyweb/seagull/spring/service/TestJobsService.java b/src/main/java/luckyweb/seagull/spring/service/TestJobsService.java index 4292674..efc58c2 100644 --- a/src/main/java/luckyweb/seagull/spring/service/TestJobsService.java +++ b/src/main/java/luckyweb/seagull/spring/service/TestJobsService.java @@ -1,40 +1,40 @@ -package luckyweb.seagull.spring.service; - -import java.util.List; - -import org.springframework.transaction.annotation.Propagation; -import org.springframework.transaction.annotation.Transactional; - -import luckyweb.seagull.spring.entity.TestJobs; - -@Transactional -public interface TestJobsService { - public int add(TestJobs tjob)throws Exception; - public void modify(TestJobs tjob)throws Exception; - public void modifyState(TestJobs tjob)throws Exception; - public void delete(int id)throws Exception; - - @Transactional(propagation=Propagation.NOT_SUPPORTED) - public List list(TestJobs tjob)throws Exception; - - @Transactional(propagation=Propagation.NOT_SUPPORTED) - public List list()throws Exception; - - public boolean isExist(String name,String cmdType,String planPath)throws Exception; - - public TestJobs load(int id)throws Exception; - public TestJobs get(int id)throws Exception; - - -// public List findByPage( final int offset,final int pageSize); -// -// public List findByPage( final Object[] values,final int offset, final int pageSize); - - public List findByPage( final Object value,final int offset, final int pageSize); - - public int findRows(TestJobs jobs ) ; -// public List getListForPage( final int offset,final int lengh); - - public List findJobsList(); - public List getpathList(int projectid); -} +package luckyweb.seagull.spring.service; + +import java.util.List; + +import org.springframework.transaction.annotation.Propagation; +import org.springframework.transaction.annotation.Transactional; + +import luckyweb.seagull.spring.entity.TestJobs; + +@Transactional +public interface TestJobsService { + public int add(TestJobs tjob)throws Exception; + public void modify(TestJobs tjob)throws Exception; + public void modifyState(TestJobs tjob)throws Exception; + public void delete(int id)throws Exception; + + @Transactional(propagation=Propagation.NOT_SUPPORTED) + public List list(TestJobs tjob)throws Exception; + + @Transactional(propagation=Propagation.NOT_SUPPORTED) + public List list()throws Exception; + + public boolean isExist(String name,String cmdType,String planPath)throws Exception; + + public TestJobs load(int id)throws Exception; + public TestJobs get(int id)throws Exception; + + +// public List findByPage( final int offset,final int pageSize); +// +// public List findByPage( final Object[] values,final int offset, final int pageSize); + + public List findByPage( final Object value,final int offset, final int pageSize); + + public int findRows(TestJobs jobs ) ; +// public List getListForPage( final int offset,final int lengh); + + public List findJobsList(); + public List getpathList(int projectid); +} diff --git a/src/main/java/luckyweb/seagull/spring/service/TestJobsServiceImpl.java b/src/main/java/luckyweb/seagull/spring/service/TestJobsServiceImpl.java index 6bbe38e..96338da 100644 --- a/src/main/java/luckyweb/seagull/spring/service/TestJobsServiceImpl.java +++ b/src/main/java/luckyweb/seagull/spring/service/TestJobsServiceImpl.java @@ -1,206 +1,206 @@ -package luckyweb.seagull.spring.service; - -import java.text.SimpleDateFormat; -import java.util.Date; -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import luckyweb.seagull.spring.dao.TestJobsDao; -import luckyweb.seagull.spring.entity.TestJobs; -import luckyweb.seagull.util.DateLib; -import luckyweb.seagull.util.StrLib; - -@Service("testJobsService") -public class TestJobsServiceImpl implements TestJobsService -{ - - private TestJobsDao testJobsDao; - - public TestJobsDao getTestJobsDao() - { - return testJobsDao; - } - - @Resource(name = "testJobsDao") - public void setTestJobsDao(TestJobsDao testJobsDao) - { - this.testJobsDao = testJobsDao; - } - - @Override - public int add(TestJobs tjob) throws Exception - { - return this.testJobsDao.add(tjob); - - } - - @Override - public void modify(TestJobs tjob) throws Exception - { - this.testJobsDao.modify(tjob); - - } - - @Override - public void modifyState(TestJobs tjob) throws Exception - { - this.testJobsDao.modify(tjob); - - } - - @Override - public void delete(int id) throws Exception - { - this.testJobsDao.delete(id); - } - - @Override - public List list(TestJobs tjob) throws Exception - { - List list = this.testJobsDao.list(tjob); - for (TestJobs job : list) - { - String now = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date().getTime()); - int res = DateLib.compare_date(job.getStartDate() + " " + job.getStartTime(), now); - if (job.getTaskType().equals("O")) - { - if (res == 2) - { - job.setShowRun(false); - } - } - } - return list; - } - - @Override - public List list() throws Exception - { - List list = this.testJobsDao.list(); - for (TestJobs job : list) - { - String now = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date().getTime()); - int res = DateLib.compare_date(job.getStartDate() + " " + job.getStartTime(), now); - if (job.getTaskType().equals("O")) - { - if (res < 1) - { - job.setShowRun(false); - } - } - } - return list; - } - - @Override - public TestJobs load(int id) throws Exception - { - return this.testJobsDao.load(id); - } - - @Override - public TestJobs get(int id) throws Exception - { - - return this.testJobsDao.get(id); - } - - @Override - public boolean isExist(String name, String cmdType, String planPath) throws Exception - { - if (this.testJobsDao.load(name, cmdType, planPath).size() == 0) - { - // System.out.println(false); - return false; - } - return true; - } - - private static String orderBy = " order by id desc "; - - @SuppressWarnings("unchecked") - @Override - public List findByPage(Object value, int offset, int pageSize) - { - String hql = " from TestJobs " + where((TestJobs) value) + orderBy; - List list = testJobsDao.findByPage(hql, value, offset, pageSize); - for (TestJobs jobs : (List) list) - { - jobs.setState_str(setStatus(jobs.getState())); - } - return list; - } - - public int findRows(TestJobs jobs) - { - String hql = "select count(*) from TestJobs " + where(jobs); - return testJobsDao.findRows(jobs, hql); - } - - @Override - public List findJobsList() - { - return testJobsDao.findJobsList("select id,name,planproj from Test_Jobs order by id asc "); - } - - @Override - public List getpathList(int projectid) - { - return testJobsDao.findJobsList("SELECT clientpath FROM test_jobs where projectid="+projectid+" GROUP BY clientpath "); - } - - /** - * 状态 - * - * @param status - * @return - */ - private String setStatus(String status) - { - if (StrLib.isEmpty(status)) - { - return "其他"; - } - else - { - if (status.equals("0")) - { - return "未启动"; - } - else if (status.equals("1")) - { - return "任务生效中"; - } - } - return "其他"; - } - - private String where(TestJobs jb) - { - String where = " where "; - if (jb.getProjectid()!=0&&jb.getProjectid()!=99){ - where += " projectid=:projectid and "; - } - if (!StrLib.isEmpty(jb.getTaskName())){ - where += " (name like :name or "; - } - if (!StrLib.isEmpty(jb.getPlanproj())){ - where += " planproj like :planproj) or "; - } - - if (where.length() == 7) - { - where = ""; - } - else - { - where = where.substring(0, where.length() - 5); - } - - return where; - } - -} +package luckyweb.seagull.spring.service; + +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.List; + +import javax.annotation.Resource; + +import org.springframework.stereotype.Service; + +import luckyweb.seagull.spring.dao.TestJobsDao; +import luckyweb.seagull.spring.entity.TestJobs; +import luckyweb.seagull.util.DateLib; +import luckyweb.seagull.util.StrLib; + +@Service("testJobsService") +public class TestJobsServiceImpl implements TestJobsService +{ + + private TestJobsDao testJobsDao; + + public TestJobsDao getTestJobsDao() + { + return testJobsDao; + } + + @Resource(name = "testJobsDao") + public void setTestJobsDao(TestJobsDao testJobsDao) + { + this.testJobsDao = testJobsDao; + } + + @Override + public int add(TestJobs tjob) throws Exception + { + return this.testJobsDao.add(tjob); + + } + + @Override + public void modify(TestJobs tjob) throws Exception + { + this.testJobsDao.modify(tjob); + + } + + @Override + public void modifyState(TestJobs tjob) throws Exception + { + this.testJobsDao.modify(tjob); + + } + + @Override + public void delete(int id) throws Exception + { + this.testJobsDao.delete(id); + } + + @Override + public List list(TestJobs tjob) throws Exception + { + List list = this.testJobsDao.list(tjob); + for (TestJobs job : list) + { + String now = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date().getTime()); + int res = DateLib.compare_date(job.getStartDate() + " " + job.getStartTime(), now); + if (job.getTaskType().equals("O")) + { + if (res == 2) + { + job.setShowRun(false); + } + } + } + return list; + } + + @Override + public List list() throws Exception + { + List list = this.testJobsDao.list(); + for (TestJobs job : list) + { + String now = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date().getTime()); + int res = DateLib.compare_date(job.getStartDate() + " " + job.getStartTime(), now); + if (job.getTaskType().equals("O")) + { + if (res < 1) + { + job.setShowRun(false); + } + } + } + return list; + } + + @Override + public TestJobs load(int id) throws Exception + { + return this.testJobsDao.load(id); + } + + @Override + public TestJobs get(int id) throws Exception + { + + return this.testJobsDao.get(id); + } + + @Override + public boolean isExist(String name, String cmdType, String planPath) throws Exception + { + if (this.testJobsDao.load(name, cmdType, planPath).size() == 0) + { + // System.out.println(false); + return false; + } + return true; + } + + private static String orderBy = " order by id desc "; + + @SuppressWarnings("unchecked") + @Override + public List findByPage(Object value, int offset, int pageSize) + { + String hql = " from TestJobs " + where((TestJobs) value) + orderBy; + List list = testJobsDao.findByPage(hql, value, offset, pageSize); + for (TestJobs jobs : (List) list) + { + jobs.setState_str(setStatus(jobs.getState())); + } + return list; + } + + public int findRows(TestJobs jobs) + { + String hql = "select count(*) from TestJobs " + where(jobs); + return testJobsDao.findRows(jobs, hql); + } + + @Override + public List findJobsList() + { + return testJobsDao.findJobsList("select id,name,planproj from Test_Jobs order by id asc "); + } + + @Override + public List getpathList(int projectid) + { + return testJobsDao.findJobsList("SELECT clientpath FROM test_jobs where projectid="+projectid+" GROUP BY clientpath "); + } + + /** + * 状态 + * + * @param status + * @return + */ + private String setStatus(String status) + { + if (StrLib.isEmpty(status)) + { + return "其他"; + } + else + { + if (status.equals("0")) + { + return "未启动"; + } + else if (status.equals("1")) + { + return "任务生效中"; + } + } + return "其他"; + } + + private String where(TestJobs jb) + { + String where = " where "; + if (jb.getProjectid()!=0&&jb.getProjectid()!=99){ + where += " projectid=:projectid and "; + } + if (!StrLib.isEmpty(jb.getTaskName())){ + where += " (name like :name or "; + } + if (!StrLib.isEmpty(jb.getPlanproj())){ + where += " planproj like :planproj) or "; + } + + if (where.length() == 7) + { + where = ""; + } + else + { + where = where.substring(0, where.length() - 5); + } + + return where; + } + +} diff --git a/src/main/java/luckyweb/seagull/spring/service/TestTastExcuteService.java b/src/main/java/luckyweb/seagull/spring/service/TestTastExcuteService.java index 443d583..a0bb813 100644 --- a/src/main/java/luckyweb/seagull/spring/service/TestTastExcuteService.java +++ b/src/main/java/luckyweb/seagull/spring/service/TestTastExcuteService.java @@ -1,31 +1,31 @@ -package luckyweb.seagull.spring.service; - -import java.util.List; - -import org.springframework.transaction.annotation.Propagation; -import org.springframework.transaction.annotation.Transactional; - -import luckyweb.seagull.spring.entity.TestTaskexcute; - -@Transactional -public interface TestTastExcuteService { - public void add(TestTaskexcute tast); - - @Transactional(propagation=Propagation.NOT_SUPPORTED) - public List list(TestTaskexcute tast); - - public TestTaskexcute load(int id); - - public TestTaskexcute get(int id); - - - public List findByPage( final Object value,final int offset, final int pageSize); - - public int findRows(TestTaskexcute jobs ) ; - - public List findTastList(String param,String param2, String param3); - public void delete(int id) throws Exception; - public void delete_forjobid(int jobid) throws Exception; - public List getidlist(int jobid) throws Exception; - public List listtastinfo() throws Exception; -} +package luckyweb.seagull.spring.service; + +import java.util.List; + +import org.springframework.transaction.annotation.Propagation; +import org.springframework.transaction.annotation.Transactional; + +import luckyweb.seagull.spring.entity.TestTaskexcute; + +@Transactional +public interface TestTastExcuteService { + public void add(TestTaskexcute tast); + + @Transactional(propagation=Propagation.NOT_SUPPORTED) + public List list(TestTaskexcute tast); + + public TestTaskexcute load(int id); + + public TestTaskexcute get(int id); + + + public List findByPage( final Object value,final int offset, final int pageSize); + + public int findRows(TestTaskexcute jobs ) ; + + public List findTastList(String param,String param2, String param3); + public void delete(int id) throws Exception; + public void delete_forjobid(int jobid) throws Exception; + public List getidlist(int jobid) throws Exception; + public List listtastinfo() throws Exception; +} diff --git a/src/main/java/luckyweb/seagull/spring/service/TestTastExcuteServiceImpl.java b/src/main/java/luckyweb/seagull/spring/service/TestTastExcuteServiceImpl.java index 4a7828d..00e6588 100644 --- a/src/main/java/luckyweb/seagull/spring/service/TestTastExcuteServiceImpl.java +++ b/src/main/java/luckyweb/seagull/spring/service/TestTastExcuteServiceImpl.java @@ -1,153 +1,153 @@ -package luckyweb.seagull.spring.service; - -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import luckyweb.seagull.spring.dao.TestTastExcuteDao; -import luckyweb.seagull.spring.entity.TestTaskexcute; -import luckyweb.seagull.util.StrLib; - -@Service("tastExcuteService") -public class TestTastExcuteServiceImpl implements TestTastExcuteService { - - @Resource(name="tastExcuteDao") - private TestTastExcuteDao tastExcuteDao; - public TestTastExcuteDao getTestTastExcuteDao() { - return tastExcuteDao; - } - - public void setTestTastExcuteDao(TestTastExcuteDao tastExcuteDao) { - this.tastExcuteDao = tastExcuteDao; - } - - @Override - public void add(TestTaskexcute task) { - this.tastExcuteDao.add(task); - } - - @Override - public List list(TestTaskexcute tjob) { - return this.tastExcuteDao.list(tjob); - } - - @Override - public TestTaskexcute load(int id) { - return this.tastExcuteDao.load(id); - } - - @Override - public TestTaskexcute get(int id) { - return this.tastExcuteDao.get(id); - } - - - - - - private String where(TestTaskexcute tast) { - String where = " where "; - if (!StrLib.isEmpty(tast.getStartDate())) { - where += " date_format(createTime,'%Y-%m-%d')>=? and date_format(createTime,'%Y-%m-%d')<=? and "; - } - if (tast.getJobid()!=0) { - where += " jobId=:jobId and "; - } - if (!StrLib.isEmpty(tast.getTaskId())) { - where += " taskId like :taskId and "; - } - if (!StrLib.isEmpty(tast.getTaskStatus())) { - where += " taskStatus =:taskStatus and "; - } - if (where.length() == 7) { - where = ""; - } else { - where = where.substring(0, where.length() - 5); - } - - return where; - } - private static String orderBy=" order by id desc "; - - - @SuppressWarnings("unchecked") - @Override - public List findByPage(Object value, int offset, int pageSize) { - String hql=" from TestTaskexcute "+where((TestTaskexcute)value)+orderBy; - List list= tastExcuteDao.findByPage(hql, value, offset, pageSize); - for(TestTaskexcute tast:(List)list){ - tast.setTaskStatus_str(setStatus(tast.getTaskStatus())); - } - return list; - } - - /** - * 状态 - * @param status - * @return - */ - private String setStatus(String status){ - if(StrLib.isEmpty(status)){ - return "其他"; - }else{ - if(status.equals("0")){ - return "未执行"; - }else if(status.equals("1")){ - return "执行中"; - }else if(status.equals("2")){ - return "执行成功"; - }else if(status.equals("3")){ - return "调起失败|超时"; - } - } - return "其他"; - } - - public int findRows(TestTaskexcute tast ) { - String hql="select count(*) from TestTaskexcute"+where(tast); - return tastExcuteDao.findRows(hql,tast); - } - - @Override - public List findTastList(String param,String param2, String param3) { - String sql="select id,taskid from TEST_TASKEXCUTE "; - if(!StrLib.isEmpty(param)){ - if(!StrLib.isEmpty(param3)){ - sql+=" where date_format(createTime,'%Y-%m-%d')>='"+param+"' and date_format(createTime,'%Y-%m-%d')<='"+param3+"'"; - }else{ - sql+=" where date_format(createTime,'%Y-%m-%d')='"+param+"'"; - } - } - if(!StrLib.isEmpty(param2)){ - sql+=" and jobid in (select id from TEST_JOBS t where t.projectid = '"+param2+"')"; - } - sql+=" order by id desc"; - return tastExcuteDao.findTastList(sql); - } - - @Override - public void delete(int id) throws Exception { - this.tastExcuteDao.delete(id); - } - - @Override - public void delete_forjobid(int jobid) throws Exception { - String hql="delete from TestTaskexcute where jobId=:jobId"; - this.tastExcuteDao.delete_forjobid(hql, jobid); - } - - public List getidlist(int jobid) throws Exception{ - return this.tastExcuteDao.listtastinfo("select id from TEST_TASKEXCUTE where jobid="+jobid); - } - - @SuppressWarnings("rawtypes") - public List listtastinfo() throws Exception{ - return this.tastExcuteDao.listtastinfo("select t.id,b.name,t.casetotal_count,t.casesucc_count,t.casefail_count,t.caselock_count,t.casenoexec_count,date_format(t.createtime,'%Y-%m-%d %T') " - + "from TEST_TASKEXCUTE t left join test_jobs b on t.jobid = b.id where t.id in " - + "(select max(t.id) from TEST_TASKEXCUTE t where t.taskstatus != '0' and t.taskstatus != '3' and t.taskstatus != '1' group by t.jobid) order by t.createtime desc"); - } - - -} +package luckyweb.seagull.spring.service; + +import java.util.List; + +import javax.annotation.Resource; + +import org.springframework.stereotype.Service; + +import luckyweb.seagull.spring.dao.TestTastExcuteDao; +import luckyweb.seagull.spring.entity.TestTaskexcute; +import luckyweb.seagull.util.StrLib; + +@Service("tastExcuteService") +public class TestTastExcuteServiceImpl implements TestTastExcuteService { + + @Resource(name="tastExcuteDao") + private TestTastExcuteDao tastExcuteDao; + public TestTastExcuteDao getTestTastExcuteDao() { + return tastExcuteDao; + } + + public void setTestTastExcuteDao(TestTastExcuteDao tastExcuteDao) { + this.tastExcuteDao = tastExcuteDao; + } + + @Override + public void add(TestTaskexcute task) { + this.tastExcuteDao.add(task); + } + + @Override + public List list(TestTaskexcute tjob) { + return this.tastExcuteDao.list(tjob); + } + + @Override + public TestTaskexcute load(int id) { + return this.tastExcuteDao.load(id); + } + + @Override + public TestTaskexcute get(int id) { + return this.tastExcuteDao.get(id); + } + + + + + + private String where(TestTaskexcute tast) { + String where = " where "; + if (!StrLib.isEmpty(tast.getStartDate())) { + where += " date_format(createTime,'%Y-%m-%d')>=? and date_format(createTime,'%Y-%m-%d')<=? and "; + } + if (tast.getJobid()!=0) { + where += " jobId=:jobId and "; + } + if (!StrLib.isEmpty(tast.getTaskId())) { + where += " taskId like :taskId and "; + } + if (!StrLib.isEmpty(tast.getTaskStatus())) { + where += " taskStatus =:taskStatus and "; + } + if (where.length() == 7) { + where = ""; + } else { + where = where.substring(0, where.length() - 5); + } + + return where; + } + private static String orderBy=" order by id desc "; + + + @SuppressWarnings("unchecked") + @Override + public List findByPage(Object value, int offset, int pageSize) { + String hql=" from TestTaskexcute "+where((TestTaskexcute)value)+orderBy; + List list= tastExcuteDao.findByPage(hql, value, offset, pageSize); + for(TestTaskexcute tast:(List)list){ + tast.setTaskStatus_str(setStatus(tast.getTaskStatus())); + } + return list; + } + + /** + * 状态 + * @param status + * @return + */ + private String setStatus(String status){ + if(StrLib.isEmpty(status)){ + return "其他"; + }else{ + if(status.equals("0")){ + return "未执行"; + }else if(status.equals("1")){ + return "执行中"; + }else if(status.equals("2")){ + return "执行成功"; + }else if(status.equals("3")){ + return "调起失败|超时"; + } + } + return "其他"; + } + + public int findRows(TestTaskexcute tast ) { + String hql="select count(*) from TestTaskexcute"+where(tast); + return tastExcuteDao.findRows(hql,tast); + } + + @Override + public List findTastList(String param,String param2, String param3) { + String sql="select id,taskid from TEST_TASKEXCUTE "; + if(!StrLib.isEmpty(param)){ + if(!StrLib.isEmpty(param3)){ + sql+=" where date_format(createTime,'%Y-%m-%d')>='"+param+"' and date_format(createTime,'%Y-%m-%d')<='"+param3+"'"; + }else{ + sql+=" where date_format(createTime,'%Y-%m-%d')='"+param+"'"; + } + } + if(!StrLib.isEmpty(param2)){ + sql+=" and jobid in (select id from TEST_JOBS t where t.projectid = '"+param2+"')"; + } + sql+=" order by id desc"; + return tastExcuteDao.findTastList(sql); + } + + @Override + public void delete(int id) throws Exception { + this.tastExcuteDao.delete(id); + } + + @Override + public void delete_forjobid(int jobid) throws Exception { + String hql="delete from TestTaskexcute where jobId=:jobId"; + this.tastExcuteDao.delete_forjobid(hql, jobid); + } + + public List getidlist(int jobid) throws Exception{ + return this.tastExcuteDao.listtastinfo("select id from TEST_TASKEXCUTE where jobid="+jobid); + } + + @SuppressWarnings("rawtypes") + public List listtastinfo() throws Exception{ + return this.tastExcuteDao.listtastinfo("select t.id,b.name,t.casetotal_count,t.casesucc_count,t.casefail_count,t.caselock_count,t.casenoexec_count,date_format(t.createtime,'%Y-%m-%d %T') " + + "from TEST_TASKEXCUTE t left join test_jobs b on t.jobid = b.id where t.id in " + + "(select max(t.id) from TEST_TASKEXCUTE t where t.taskstatus != '0' and t.taskstatus != '3' and t.taskstatus != '1' group by t.jobid) order by t.createtime desc"); + } + + +} diff --git a/src/main/java/luckyweb/seagull/spring/service/UserAuthorityService.java b/src/main/java/luckyweb/seagull/spring/service/UserAuthorityService.java index 40437c8..4b93cf8 100644 --- a/src/main/java/luckyweb/seagull/spring/service/UserAuthorityService.java +++ b/src/main/java/luckyweb/seagull/spring/service/UserAuthorityService.java @@ -1,16 +1,16 @@ -package luckyweb.seagull.spring.service; - - -import java.util.List; - -import org.springframework.transaction.annotation.Transactional; - -import luckyweb.seagull.spring.entity.UserAuthority; - - -@Transactional -public interface UserAuthorityService { - - public UserAuthority load(int id)throws Exception; - public List listall() throws Exception; -} +package luckyweb.seagull.spring.service; + + +import java.util.List; + +import org.springframework.transaction.annotation.Transactional; + +import luckyweb.seagull.spring.entity.UserAuthority; + + +@Transactional +public interface UserAuthorityService { + + public UserAuthority load(int id)throws Exception; + public List listall() throws Exception; +} diff --git a/src/main/java/luckyweb/seagull/spring/service/UserAuthorityServiceImpl.java b/src/main/java/luckyweb/seagull/spring/service/UserAuthorityServiceImpl.java index 11482eb..6883c52 100644 --- a/src/main/java/luckyweb/seagull/spring/service/UserAuthorityServiceImpl.java +++ b/src/main/java/luckyweb/seagull/spring/service/UserAuthorityServiceImpl.java @@ -1,37 +1,37 @@ -package luckyweb.seagull.spring.service; - -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import luckyweb.seagull.spring.dao.UserAuthorityDao; -import luckyweb.seagull.spring.entity.UserAuthority; - - - -@Service("userauthorityService") -public class UserAuthorityServiceImpl implements UserAuthorityService{ - - private UserAuthorityDao userauthoritydao; - - public UserAuthorityDao getUserInfoDao() { - return userauthoritydao; - } - - @Resource(name = "userauthorityDao") - public void setUserAuthorityDao(UserAuthorityDao userauthoritydao) { - this.userauthoritydao = userauthoritydao; - } - - @Override - public UserAuthority load(int id) throws Exception { - // TODO Auto-generated method stub - return this.userauthoritydao.load(id); - } - - public List listall() throws Exception{ - return this.userauthoritydao.listall(); - } -} +package luckyweb.seagull.spring.service; + +import java.util.List; + +import javax.annotation.Resource; + +import org.springframework.stereotype.Service; + +import luckyweb.seagull.spring.dao.UserAuthorityDao; +import luckyweb.seagull.spring.entity.UserAuthority; + + + +@Service("userauthorityService") +public class UserAuthorityServiceImpl implements UserAuthorityService{ + + private UserAuthorityDao userauthoritydao; + + public UserAuthorityDao getUserInfoDao() { + return userauthoritydao; + } + + @Resource(name = "userauthorityDao") + public void setUserAuthorityDao(UserAuthorityDao userauthoritydao) { + this.userauthoritydao = userauthoritydao; + } + + @Override + public UserAuthority load(int id) throws Exception { + // TODO Auto-generated method stub + return this.userauthoritydao.load(id); + } + + public List listall() throws Exception{ + return this.userauthoritydao.listall(); + } +} diff --git a/src/main/java/luckyweb/seagull/spring/service/UserInfoService.java b/src/main/java/luckyweb/seagull/spring/service/UserInfoService.java index 8ce90a5..498c3c5 100644 --- a/src/main/java/luckyweb/seagull/spring/service/UserInfoService.java +++ b/src/main/java/luckyweb/seagull/spring/service/UserInfoService.java @@ -1,26 +1,26 @@ -package luckyweb.seagull.spring.service; - - -import java.util.List; - -import org.springframework.transaction.annotation.Transactional; - -import luckyweb.seagull.spring.entity.UserInfo; - - -@Transactional -public interface UserInfoService { - - public UserInfo load(int id)throws Exception; - public int add(UserInfo userinfo) throws Exception; - public void modify(UserInfo userinfo) throws Exception; - public void delete(int id) throws Exception; - - public int getid(String name,String password)throws Exception; - - public List findByPage( final Object value,final int offset, final int pageSize); - - public int findRows(UserInfo userinfo) ; - public int findUsecode(String usercode); - public UserInfo getUseinfo(String usercode) throws Exception; -} +package luckyweb.seagull.spring.service; + + +import java.util.List; + +import org.springframework.transaction.annotation.Transactional; + +import luckyweb.seagull.spring.entity.UserInfo; + + +@Transactional +public interface UserInfoService { + + public UserInfo load(int id)throws Exception; + public int add(UserInfo userinfo) throws Exception; + public void modify(UserInfo userinfo) throws Exception; + public void delete(int id) throws Exception; + + public int getid(String name,String password)throws Exception; + + public List findByPage( final Object value,final int offset, final int pageSize); + + public int findRows(UserInfo userinfo) ; + public int findUsecode(String usercode); + public UserInfo getUseinfo(String usercode) throws Exception; +} diff --git a/src/main/java/luckyweb/seagull/spring/service/UserInfoServiceImpl.java b/src/main/java/luckyweb/seagull/spring/service/UserInfoServiceImpl.java index 2a86286..3625d0c 100644 --- a/src/main/java/luckyweb/seagull/spring/service/UserInfoServiceImpl.java +++ b/src/main/java/luckyweb/seagull/spring/service/UserInfoServiceImpl.java @@ -1,106 +1,106 @@ -package luckyweb.seagull.spring.service; - -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import luckyweb.seagull.spring.dao.UserInfoDao; -import luckyweb.seagull.spring.entity.UserInfo; - - - -@Service("userinfoService") -public class UserInfoServiceImpl implements UserInfoService{ - - private UserInfoDao userinfodao; - - public UserInfoDao getUserInfoDao() { - return userinfodao; - } - - @Resource(name = "userinfoDao") - public void setUserInfoDao(UserInfoDao userinfoDao) { - this.userinfodao = userinfoDao; - } - - @Override - public UserInfo load(int id) throws Exception { - // TODO Auto-generated method stub - return this.userinfodao.load(id); - } - - public int add(UserInfo userinfo) throws Exception{ - return this.userinfodao.add(userinfo); - } - - public void modify(UserInfo userinfo) throws Exception{ - this.userinfodao.modify(userinfo); - } - - public void delete(int id) throws Exception{ - this.userinfodao.delete(id); - } - - @Override - public int getid(String usercode,String password) throws Exception { - return this.userinfodao.get("select id from USERINFO where usercode='"+usercode+"' and password='"+password+"'"); - } - - private String where(UserInfo userinfo) { - String where = " where "; - if (null!=userinfo.getUsercode()&&!"".equals(userinfo.getUsercode())) { - where += " usercode like :usercode or "; - } - if (null!=userinfo.getUsername()&&!"".equals(userinfo.getUsername())) { - where += " username like :username or "; - } - if (where.length() == 7) { - where = ""; - } - else{ - where = where.substring(0, where.length() - 5); - } - - return where; - } - - private static String orderBy=" order by id desc"; - - @Override - public List findByPage(Object value, int offset, int pageSize) { - String hql=" from UserInfo "+where((UserInfo)value)+orderBy; - List list= userinfodao.findByPage(hql, value, offset, pageSize); - return list; - } - - @Override - public int findRows(UserInfo userinfo) { - String hql="select count(*) from UserInfo "+where(userinfo); - return userinfodao.findRows(userinfo, hql); - } - - @Override - public int findUsecode(String usercode) { - String sql="select * from UserInfo where usercode='"+usercode+"'"; - return userinfodao.sqlfindRows(sql); - } - - @Override - public UserInfo getUseinfo(String usercode) { - String sql = "select id from UserInfo where usercode='" + usercode + "'"; - @SuppressWarnings("unchecked") - List list; - try { - list = userinfodao.listsql(sql); - int id = Integer.valueOf(list.get(0).toString()); - UserInfo ur = userinfodao.load(id); - return ur; - } catch (Exception e) { - // TODO Auto-generated catch block - e.printStackTrace(); - return null; - } - } -} +package luckyweb.seagull.spring.service; + +import java.util.List; + +import javax.annotation.Resource; + +import org.springframework.stereotype.Service; + +import luckyweb.seagull.spring.dao.UserInfoDao; +import luckyweb.seagull.spring.entity.UserInfo; + + + +@Service("userinfoService") +public class UserInfoServiceImpl implements UserInfoService{ + + private UserInfoDao userinfodao; + + public UserInfoDao getUserInfoDao() { + return userinfodao; + } + + @Resource(name = "userinfoDao") + public void setUserInfoDao(UserInfoDao userinfoDao) { + this.userinfodao = userinfoDao; + } + + @Override + public UserInfo load(int id) throws Exception { + // TODO Auto-generated method stub + return this.userinfodao.load(id); + } + + public int add(UserInfo userinfo) throws Exception{ + return this.userinfodao.add(userinfo); + } + + public void modify(UserInfo userinfo) throws Exception{ + this.userinfodao.modify(userinfo); + } + + public void delete(int id) throws Exception{ + this.userinfodao.delete(id); + } + + @Override + public int getid(String usercode,String password) throws Exception { + return this.userinfodao.get("select id from USERINFO where usercode='"+usercode+"' and password='"+password+"'"); + } + + private String where(UserInfo userinfo) { + String where = " where "; + if (null!=userinfo.getUsercode()&&!"".equals(userinfo.getUsercode())) { + where += " usercode like :usercode or "; + } + if (null!=userinfo.getUsername()&&!"".equals(userinfo.getUsername())) { + where += " username like :username or "; + } + if (where.length() == 7) { + where = ""; + } + else{ + where = where.substring(0, where.length() - 5); + } + + return where; + } + + private static String orderBy=" order by id desc"; + + @Override + public List findByPage(Object value, int offset, int pageSize) { + String hql=" from UserInfo "+where((UserInfo)value)+orderBy; + List list= userinfodao.findByPage(hql, value, offset, pageSize); + return list; + } + + @Override + public int findRows(UserInfo userinfo) { + String hql="select count(*) from UserInfo "+where(userinfo); + return userinfodao.findRows(userinfo, hql); + } + + @Override + public int findUsecode(String usercode) { + String sql="select * from UserInfo where usercode='"+usercode+"'"; + return userinfodao.sqlfindRows(sql); + } + + @Override + public UserInfo getUseinfo(String usercode) { + String sql = "select id from UserInfo where usercode='" + usercode + "'"; + @SuppressWarnings("unchecked") + List list; + try { + list = userinfodao.listsql(sql); + int id = Integer.valueOf(list.get(0).toString()); + UserInfo ur = userinfodao.load(id); + return ur; + } catch (Exception e) { + // TODO Auto-generated catch block + e.printStackTrace(); + return null; + } + } +} diff --git a/src/main/java/luckyweb/seagull/spring/service/UserRoleService.java b/src/main/java/luckyweb/seagull/spring/service/UserRoleService.java index 790a8dc..dfe9311 100644 --- a/src/main/java/luckyweb/seagull/spring/service/UserRoleService.java +++ b/src/main/java/luckyweb/seagull/spring/service/UserRoleService.java @@ -1,20 +1,20 @@ -package luckyweb.seagull.spring.service; - - -import java.util.List; - -import org.springframework.transaction.annotation.Transactional; - -import luckyweb.seagull.spring.entity.UserRole; - - -@Transactional -public interface UserRoleService { - - public UserRole load(int id)throws Exception; - public List listall() throws Exception; - public List getalldata() throws Exception; - public int add(UserRole userrole) throws Exception; - public void modify(UserRole userrole) throws Exception; - public void delete(int id) throws Exception; -} +package luckyweb.seagull.spring.service; + + +import java.util.List; + +import org.springframework.transaction.annotation.Transactional; + +import luckyweb.seagull.spring.entity.UserRole; + + +@Transactional +public interface UserRoleService { + + public UserRole load(int id)throws Exception; + public List listall() throws Exception; + public List getalldata() throws Exception; + public int add(UserRole userrole) throws Exception; + public void modify(UserRole userrole) throws Exception; + public void delete(int id) throws Exception; +} diff --git a/src/main/java/luckyweb/seagull/spring/service/UserRoleServiceImpl.java b/src/main/java/luckyweb/seagull/spring/service/UserRoleServiceImpl.java index 2014a72..aa30bf0 100644 --- a/src/main/java/luckyweb/seagull/spring/service/UserRoleServiceImpl.java +++ b/src/main/java/luckyweb/seagull/spring/service/UserRoleServiceImpl.java @@ -1,55 +1,55 @@ -package luckyweb.seagull.spring.service; - -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import luckyweb.seagull.spring.dao.UserRoleDao; -import luckyweb.seagull.spring.entity.UserInfo; -import luckyweb.seagull.spring.entity.UserRole; - - - -@Service("userroleService") -public class UserRoleServiceImpl implements UserRoleService{ - - private UserRoleDao userroledao; - - public UserRoleDao getUserRoleDao() { - return userroledao; - } - - @Resource(name = "userroleDao") - public void setUserInfoDao(UserRoleDao userroleDao) { - this.userroledao = userroleDao; - } - - @Override - public UserRole load(int id) throws Exception { - // TODO Auto-generated method stub - return this.userroledao.load(id); - } - - public int add(UserRole userrole) throws Exception{ - return this.userroledao.add(userrole); - } - - public void modify(UserRole userrole) throws Exception{ - this.userroledao.modify(userrole); - } - - public void delete(int id) throws Exception{ - this.userroledao.delete(id); - } - - @Override - public List getalldata() throws Exception { - return this.userroledao.get("select id,role,permission from USER_ROLE"); - } - - public List listall() throws Exception{ - return this.userroledao.listall(); - } -} +package luckyweb.seagull.spring.service; + +import java.util.List; + +import javax.annotation.Resource; + +import org.springframework.stereotype.Service; + +import luckyweb.seagull.spring.dao.UserRoleDao; +import luckyweb.seagull.spring.entity.UserInfo; +import luckyweb.seagull.spring.entity.UserRole; + + + +@Service("userroleService") +public class UserRoleServiceImpl implements UserRoleService{ + + private UserRoleDao userroledao; + + public UserRoleDao getUserRoleDao() { + return userroledao; + } + + @Resource(name = "userroleDao") + public void setUserInfoDao(UserRoleDao userroleDao) { + this.userroledao = userroleDao; + } + + @Override + public UserRole load(int id) throws Exception { + // TODO Auto-generated method stub + return this.userroledao.load(id); + } + + public int add(UserRole userrole) throws Exception{ + return this.userroledao.add(userrole); + } + + public void modify(UserRole userrole) throws Exception{ + this.userroledao.modify(userrole); + } + + public void delete(int id) throws Exception{ + this.userroledao.delete(id); + } + + @Override + public List getalldata() throws Exception { + return this.userroledao.get("select id,role,permission from USER_ROLE"); + } + + public List listall() throws Exception{ + return this.userroledao.listall(); + } +} diff --git a/src/main/java/luckyweb/seagull/spring/service/ZtTaskService.java b/src/main/java/luckyweb/seagull/spring/service/ZtTaskService.java index b356c07..608b0aa 100644 --- a/src/main/java/luckyweb/seagull/spring/service/ZtTaskService.java +++ b/src/main/java/luckyweb/seagull/spring/service/ZtTaskService.java @@ -1,27 +1,27 @@ -package luckyweb.seagull.spring.service; - - -import java.util.List; - -import org.springframework.transaction.annotation.Transactional; - -import luckyweb.seagull.spring.entity.ZtTask; - - -@Transactional -public interface ZtTaskService { - - public ZtTask load(int id)throws Exception; - - public int add(ZtTask zt) throws Exception; - - public void delete(int versionid) throws Exception; - - public List findByPage(Object value, int offset, int pageSize); - - public int findRows(ZtTask zt); - - public List findByPagereport(int offset, int pageSize,String startdate,String enddate,int type) throws Exception; - - public int findRowsreport(String startdate,String enddate,int type); -} +package luckyweb.seagull.spring.service; + + +import java.util.List; + +import org.springframework.transaction.annotation.Transactional; + +import luckyweb.seagull.spring.entity.ZtTask; + + +@Transactional +public interface ZtTaskService { + + public ZtTask load(int id)throws Exception; + + public int add(ZtTask zt) throws Exception; + + public void delete(int versionid) throws Exception; + + public List findByPage(Object value, int offset, int pageSize); + + public int findRows(ZtTask zt); + + public List findByPagereport(int offset, int pageSize,String startdate,String enddate,int type) throws Exception; + + public int findRowsreport(String startdate,String enddate,int type); +} diff --git a/src/main/java/luckyweb/seagull/spring/service/ZtTaskServiceImpl.java b/src/main/java/luckyweb/seagull/spring/service/ZtTaskServiceImpl.java index 224de37..1ed06ab 100644 --- a/src/main/java/luckyweb/seagull/spring/service/ZtTaskServiceImpl.java +++ b/src/main/java/luckyweb/seagull/spring/service/ZtTaskServiceImpl.java @@ -1,115 +1,115 @@ -package luckyweb.seagull.spring.service; - -import java.util.List; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - -import luckyweb.seagull.spring.dao.ZtTaskDao; -import luckyweb.seagull.spring.entity.ZtTask; - - - -@Service("zttaskService") -public class ZtTaskServiceImpl implements ZtTaskService{ - - private ZtTaskDao zttaskdao; - - private static String orderBy=" order by versionid desc,id desc "; - - public ZtTaskDao getZtTaskDao() { - return zttaskdao; - } - - @Resource(name = "zttaskDao") - public void setZtTaskDao(ZtTaskDao zttaskdao) { - this.zttaskdao = zttaskdao; - } - - @Override - public ZtTask load(int id) throws Exception { - // TODO Auto-generated method stub - return this.zttaskdao.load(id); - } - - @Override - public int add(ZtTask zt) throws Exception { - // TODO Auto-generated method stub - return this.zttaskdao.add(zt); - } - - @Override - public void delete(int versionid) throws Exception { - String sql="delete from QA_ZTTASK where versionid="+versionid; - this.zttaskdao.delete(sql); - } - - @Override - public List findByPage(Object value, int offset, int pageSize) { - String hql=" from ZtTask "+where((ZtTask)value)+orderBy; - List list= zttaskdao.findByPage(hql, value, offset, pageSize); - return list; - } - - @Override - public int findRows(ZtTask zt) { - String hql="select count(*) from ZtTask "+where(zt); - return zttaskdao.findRows(zt, hql); - } - - private String where(ZtTask zt) { - String where = " where "; - if (zt.getVersionid()!=0) { - where += " versionid=:versionid and "; - } - if (zt.getDelaystatus()!=0&&!"".equals(zt.getDelaystatus())) { - where += " delaystatus=:delaystatus and "; - } - if (zt.getVersionname()!=null&&!"".equals(zt.getVersionname())) { - where += " versionname like :versionname and "; - } - if (zt.getFinishedname()!=null&&!"".equals(zt.getFinishedname())) { - where += " finishedname like :finishedname and "; - } - if (zt.getAssstartDate()!=null&&!"".equals(zt.getAssstartDate())) { - where += " assignedDate>=:assstartDate and "; - } - if (zt.getAssendDate()!=null&&!"".equals(zt.getAssendDate())) { - where += " assignedDate<=:assendDate and "; - } - if (where.length() == 7) { - where = ""; - } - else{ - where = where.substring(0, where.length() - 5); - } - return where; - } - - public List findByPagereport(int offset, int pageSize,String startdate,String enddate,int type) throws Exception { - String hql=""; - if(type==1){ - hql = "select finishedname,sum(t.estimate),sum(t.consumed),COUNT (CASE WHEN t.delaystatus=1 THEN 1 ELSE NULL END) 未延迟任务," - + "COUNT (CASE WHEN t.delaystatus=2 THEN 1 ELSE NULL END) 延迟任务,finishedname as pertask,finishedname as pertime from QA_ZTTASK t where t.assigneddate>= '"+startdate+" 00:00:00.0' " - + "and t.assigneddate<='"+enddate+" 24:59:59.59' group by t.finishedname"; - }else{ - hql = "select versionname,sum(t.estimate),sum(t.consumed),COUNT (CASE WHEN t.delaystatus=1 THEN 1 ELSE NULL END) 未延迟任务," - + "COUNT (CASE WHEN t.delaystatus=2 THEN 1 ELSE NULL END) 延迟任务,versionname as pertask,versionname as pertime from QA_ZTTASK t where t.assigneddate>= '"+startdate+" 00:00:00.0' " - + "and t.assigneddate<='"+enddate+" 24:59:59.59' group by t.versionname"; - } - return this.zttaskdao.findByPagereport(hql, offset, pageSize); - } - - public int findRowsreport(String startdate,String enddate,int type) { - String hql=""; - if(type==1){ - hql = "select finishedname from QA_ZTTASK t where t.assigneddate>= '"+startdate+" 00:00:00.0' " - + "and t.assigneddate<='"+enddate+" 24:59:59.59' group by t.finishedname"; - }else{ - hql = "select versionname from QA_ZTTASK t where t.assigneddate>= '"+startdate+" 00:00:00.0' " - + "and t.assigneddate<='"+enddate+" 24:59:59.59' group by t.versionname"; - } - return this.zttaskdao.findRowsreport(hql); - } -} +package luckyweb.seagull.spring.service; + +import java.util.List; + +import javax.annotation.Resource; + +import org.springframework.stereotype.Service; + +import luckyweb.seagull.spring.dao.ZtTaskDao; +import luckyweb.seagull.spring.entity.ZtTask; + + + +@Service("zttaskService") +public class ZtTaskServiceImpl implements ZtTaskService{ + + private ZtTaskDao zttaskdao; + + private static String orderBy=" order by versionid desc,id desc "; + + public ZtTaskDao getZtTaskDao() { + return zttaskdao; + } + + @Resource(name = "zttaskDao") + public void setZtTaskDao(ZtTaskDao zttaskdao) { + this.zttaskdao = zttaskdao; + } + + @Override + public ZtTask load(int id) throws Exception { + // TODO Auto-generated method stub + return this.zttaskdao.load(id); + } + + @Override + public int add(ZtTask zt) throws Exception { + // TODO Auto-generated method stub + return this.zttaskdao.add(zt); + } + + @Override + public void delete(int versionid) throws Exception { + String sql="delete from QA_ZTTASK where versionid="+versionid; + this.zttaskdao.delete(sql); + } + + @Override + public List findByPage(Object value, int offset, int pageSize) { + String hql=" from ZtTask "+where((ZtTask)value)+orderBy; + List list= zttaskdao.findByPage(hql, value, offset, pageSize); + return list; + } + + @Override + public int findRows(ZtTask zt) { + String hql="select count(*) from ZtTask "+where(zt); + return zttaskdao.findRows(zt, hql); + } + + private String where(ZtTask zt) { + String where = " where "; + if (zt.getVersionid()!=0) { + where += " versionid=:versionid and "; + } + if (zt.getDelaystatus()!=0&&!"".equals(zt.getDelaystatus())) { + where += " delaystatus=:delaystatus and "; + } + if (zt.getVersionname()!=null&&!"".equals(zt.getVersionname())) { + where += " versionname like :versionname and "; + } + if (zt.getFinishedname()!=null&&!"".equals(zt.getFinishedname())) { + where += " finishedname like :finishedname and "; + } + if (zt.getAssstartDate()!=null&&!"".equals(zt.getAssstartDate())) { + where += " assignedDate>=:assstartDate and "; + } + if (zt.getAssendDate()!=null&&!"".equals(zt.getAssendDate())) { + where += " assignedDate<=:assendDate and "; + } + if (where.length() == 7) { + where = ""; + } + else{ + where = where.substring(0, where.length() - 5); + } + return where; + } + + public List findByPagereport(int offset, int pageSize,String startdate,String enddate,int type) throws Exception { + String hql=""; + if(type==1){ + hql = "select finishedname,sum(t.estimate),sum(t.consumed),COUNT (CASE WHEN t.delaystatus=1 THEN 1 ELSE NULL END) 未延迟任务," + + "COUNT (CASE WHEN t.delaystatus=2 THEN 1 ELSE NULL END) 延迟任务,finishedname as pertask,finishedname as pertime from QA_ZTTASK t where t.assigneddate>= '"+startdate+" 00:00:00.0' " + + "and t.assigneddate<='"+enddate+" 24:59:59.59' group by t.finishedname"; + }else{ + hql = "select versionname,sum(t.estimate),sum(t.consumed),COUNT (CASE WHEN t.delaystatus=1 THEN 1 ELSE NULL END) 未延迟任务," + + "COUNT (CASE WHEN t.delaystatus=2 THEN 1 ELSE NULL END) 延迟任务,versionname as pertask,versionname as pertime from QA_ZTTASK t where t.assigneddate>= '"+startdate+" 00:00:00.0' " + + "and t.assigneddate<='"+enddate+" 24:59:59.59' group by t.versionname"; + } + return this.zttaskdao.findByPagereport(hql, offset, pageSize); + } + + public int findRowsreport(String startdate,String enddate,int type) { + String hql=""; + if(type==1){ + hql = "select finishedname from QA_ZTTASK t where t.assigneddate>= '"+startdate+" 00:00:00.0' " + + "and t.assigneddate<='"+enddate+" 24:59:59.59' group by t.finishedname"; + }else{ + hql = "select versionname from QA_ZTTASK t where t.assigneddate>= '"+startdate+" 00:00:00.0' " + + "and t.assigneddate<='"+enddate+" 24:59:59.59' group by t.versionname"; + } + return this.zttaskdao.findRowsreport(hql); + } +} diff --git a/src/main/java/luckyweb/seagull/util/DateLib.java b/src/main/java/luckyweb/seagull/util/DateLib.java index 692dba7..039a672 100644 --- a/src/main/java/luckyweb/seagull/util/DateLib.java +++ b/src/main/java/luckyweb/seagull/util/DateLib.java @@ -1,199 +1,199 @@ -package luckyweb.seagull.util; - -import java.sql.Date; -import java.text.DateFormat; -import java.text.SimpleDateFormat; -import java.util.Calendar; - -public class DateLib { - /** - * 将'yyyyMMddHHmmss' 转成 yyyy-mm-dd hh:mm:ss - * - * @param source - * @return - */ - public static String format(String source) throws Exception { - if (source != null && source.length() == 14) { - return source.substring(0, 4) + "-" + source.substring(4, 6) + "-" - + source.substring(6, 8) + " " + source.substring(8, 10) - + ":" + source.substring(10, 12) + ":" - + source.substring(12, 14); - } else { - throw new Exception("传入的字符为" + source - + "不能正常转化为yyyy-mm-dd hh:mm:ss形式"); - } - } - - /** - * 将'yyyy-MM-dd'转成'yyyyMMdd' - * - * @param source - * @return - */ - public static String format1(String source) { - return source.substring(0, 4) + source.substring(5, 7) - + source.substring(8, 10); - } - - public static String format2(String source) { - return source.substring(2, 4) + source.substring(5, 7) - + source.substring(8, 10); - } - - /** - * 取昨天的时间,并以format的形式返回 - * - * @return - * @throws Exception - */ - public static String yd_format(String format) { - String tar; - Calendar c = Calendar.getInstance(); - int date = c.get(Calendar.DATE); - date--; - c.set(Calendar.DATE, date); - Date yes_day = new Date(c.getTimeInMillis()); - tar = (new SimpleDateFormat(format)).format(yes_day); - return tar; - } - - /** - * 取前天日期,并以format传入的形式返回 - * - * @param format - * @return - */ - public static String befor_yd_format(String format) { - String tar; - Calendar c = Calendar.getInstance(); - int date = c.get(Calendar.DATE); - date = date - 2; - c.set(Calendar.DATE, date); - Date yes_day = new Date(c.getTimeInMillis()); - tar = (new SimpleDateFormat(format)).format(yes_day); - return tar; - } - - /** - * 取前N天日期,并以format传入的形式返回 - * - * @param format - * @return - */ - public static String befor_Nd_format(String format, int n) { - String tar; - Calendar c = Calendar.getInstance(); - int date = c.get(Calendar.DATE); - date = date - n; - c.set(Calendar.DATE, date); - Date yes_day = new Date(c.getTimeInMillis()); - tar = (new SimpleDateFormat(format)).format(yes_day); - return tar; - } - - /** - * 取某一天第二天的日期 - * - * @param yd - * @param format - * @return - * @throws Exception - */ - public static String to_format(String yd, String format) throws Exception { - yd = yd.replaceAll("-", ""); - String ad; - SimpleDateFormat sf = new SimpleDateFormat(); - sf.applyPattern(format); - java.util.Date y_date = sf.parse(yd); - long myTime = (y_date.getTime() / 1000) + 1 * 60 * 60 * 24;// -1表示前一天,+1表示后一天,依次类推 - y_date.setTime(myTime * 1000); - ad = sf.format(y_date); - return ad; - } - - public static String today(String format) { - java.util.Date date = new java.util.Date(); - String tar = new SimpleDateFormat(format).format(date); - return tar; - } - - public static String tomorrow(String today, String format) throws Exception { - String ad; - SimpleDateFormat sf = new SimpleDateFormat(); - sf.applyPattern(format); - java.util.Date y_date = sf.parse(today); - long myTime = (y_date.getTime() / 1000) + 1 * 60 * 60 * 24;// -1表示前一天,+1表示后一天,依次类推 - y_date.setTime(myTime * 1000); - ad = sf.format(y_date); - return ad; - } - - /** - * 获得某个月的第一天 - * - * @param date - * @return - * - */ - public static java.util.Date firstDayOfMonth(java.util.Date date) { - Calendar c = Calendar.getInstance(); - c.setTime(date); - c.set(Calendar.DAY_OF_MONTH, 1); - return c.getTime(); - } - - /** - * 获得某周的一天 - * - * @param date - * @return - * - */ - public static String weekday(String date) { - java.util.Date nowDate = java.sql.Date.valueOf(date); - java.text.SimpleDateFormat bartDateFormat = new java.text.SimpleDateFormat( - "EEE"); - String week = bartDateFormat.format(nowDate).trim(); - return week; - } - - /** - * 比较时间 - * - * @param DATE1 - * 开始时间 - * @param DATE2 - * @return - */ - public static int compare_date(String DATE1, String DATE2) { - - DateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); - try { - java.util.Date dt1 = df.parse(DATE1); - java.util.Date dt2 = df.parse(DATE2); - if (dt1.getTime() >= dt2.getTime()) { - //System.out.println("以第【1】个时间为准"); - return 1; - } - //System.out.println("以第【2】个时间为准"); - return 2; - } catch (Exception exception) { - exception.printStackTrace(); - } - return 0; - } - - public static void main(String[] args) { - //System.out.print(weekday("2012-12-10")); - - System.out.println( "12345678".substring(5,8)); - - String now=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new java.util.Date().getTime()); - System.out.println("2015-05-10 09:00:00"); - System.out.println(now); - int res=DateLib.compare_date("2015-05-10 09:00:00", now); - System.out.println(res); - - } - -} +package luckyweb.seagull.util; + +import java.sql.Date; +import java.text.DateFormat; +import java.text.SimpleDateFormat; +import java.util.Calendar; + +public class DateLib { + /** + * 将'yyyyMMddHHmmss' 转成 yyyy-mm-dd hh:mm:ss + * + * @param source + * @return + */ + public static String format(String source) throws Exception { + if (source != null && source.length() == 14) { + return source.substring(0, 4) + "-" + source.substring(4, 6) + "-" + + source.substring(6, 8) + " " + source.substring(8, 10) + + ":" + source.substring(10, 12) + ":" + + source.substring(12, 14); + } else { + throw new Exception("传入的字符为" + source + + "不能正常转化为yyyy-mm-dd hh:mm:ss形式"); + } + } + + /** + * 将'yyyy-MM-dd'转成'yyyyMMdd' + * + * @param source + * @return + */ + public static String format1(String source) { + return source.substring(0, 4) + source.substring(5, 7) + + source.substring(8, 10); + } + + public static String format2(String source) { + return source.substring(2, 4) + source.substring(5, 7) + + source.substring(8, 10); + } + + /** + * 取昨天的时间,并以format的形式返回 + * + * @return + * @throws Exception + */ + public static String yd_format(String format) { + String tar; + Calendar c = Calendar.getInstance(); + int date = c.get(Calendar.DATE); + date--; + c.set(Calendar.DATE, date); + Date yes_day = new Date(c.getTimeInMillis()); + tar = (new SimpleDateFormat(format)).format(yes_day); + return tar; + } + + /** + * 取前天日期,并以format传入的形式返回 + * + * @param format + * @return + */ + public static String befor_yd_format(String format) { + String tar; + Calendar c = Calendar.getInstance(); + int date = c.get(Calendar.DATE); + date = date - 2; + c.set(Calendar.DATE, date); + Date yes_day = new Date(c.getTimeInMillis()); + tar = (new SimpleDateFormat(format)).format(yes_day); + return tar; + } + + /** + * 取前N天日期,并以format传入的形式返回 + * + * @param format + * @return + */ + public static String befor_Nd_format(String format, int n) { + String tar; + Calendar c = Calendar.getInstance(); + int date = c.get(Calendar.DATE); + date = date - n; + c.set(Calendar.DATE, date); + Date yes_day = new Date(c.getTimeInMillis()); + tar = (new SimpleDateFormat(format)).format(yes_day); + return tar; + } + + /** + * 取某一天第二天的日期 + * + * @param yd + * @param format + * @return + * @throws Exception + */ + public static String to_format(String yd, String format) throws Exception { + yd = yd.replaceAll("-", ""); + String ad; + SimpleDateFormat sf = new SimpleDateFormat(); + sf.applyPattern(format); + java.util.Date y_date = sf.parse(yd); + long myTime = (y_date.getTime() / 1000) + 1 * 60 * 60 * 24;// -1表示前一天,+1表示后一天,依次类推 + y_date.setTime(myTime * 1000); + ad = sf.format(y_date); + return ad; + } + + public static String today(String format) { + java.util.Date date = new java.util.Date(); + String tar = new SimpleDateFormat(format).format(date); + return tar; + } + + public static String tomorrow(String today, String format) throws Exception { + String ad; + SimpleDateFormat sf = new SimpleDateFormat(); + sf.applyPattern(format); + java.util.Date y_date = sf.parse(today); + long myTime = (y_date.getTime() / 1000) + 1 * 60 * 60 * 24;// -1表示前一天,+1表示后一天,依次类推 + y_date.setTime(myTime * 1000); + ad = sf.format(y_date); + return ad; + } + + /** + * 获得某个月的第一天 + * + * @param date + * @return + * + */ + public static java.util.Date firstDayOfMonth(java.util.Date date) { + Calendar c = Calendar.getInstance(); + c.setTime(date); + c.set(Calendar.DAY_OF_MONTH, 1); + return c.getTime(); + } + + /** + * 获得某周的一天 + * + * @param date + * @return + * + */ + public static String weekday(String date) { + java.util.Date nowDate = java.sql.Date.valueOf(date); + java.text.SimpleDateFormat bartDateFormat = new java.text.SimpleDateFormat( + "EEE"); + String week = bartDateFormat.format(nowDate).trim(); + return week; + } + + /** + * 比较时间 + * + * @param DATE1 + * 开始时间 + * @param DATE2 + * @return + */ + public static int compare_date(String DATE1, String DATE2) { + + DateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + try { + java.util.Date dt1 = df.parse(DATE1); + java.util.Date dt2 = df.parse(DATE2); + if (dt1.getTime() >= dt2.getTime()) { + //System.out.println("以第【1】个时间为准"); + return 1; + } + //System.out.println("以第【2】个时间为准"); + return 2; + } catch (Exception exception) { + exception.printStackTrace(); + } + return 0; + } + + public static void main(String[] args) { + //System.out.print(weekday("2012-12-10")); + + System.out.println( "12345678".substring(5,8)); + + String now=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new java.util.Date().getTime()); + System.out.println("2015-05-10 09:00:00"); + System.out.println(now); + int res=DateLib.compare_date("2015-05-10 09:00:00", now); + System.out.println(res); + + } + +} diff --git a/src/main/java/luckyweb/seagull/util/DateUtil.java b/src/main/java/luckyweb/seagull/util/DateUtil.java index f0c4699..97fe1c9 100644 --- a/src/main/java/luckyweb/seagull/util/DateUtil.java +++ b/src/main/java/luckyweb/seagull/util/DateUtil.java @@ -1,234 +1,234 @@ -package luckyweb.seagull.util; - -import java.sql.*; -import java.text.*; -import java.util.Calendar; - - -public class DateUtil { - - /** - * ���������ת����yyyy.MM.dd��ʽ���ַ� - * @param d ������� - * @return yyyy.MM.dd��ʽ���ַ��������Ϊnull����ô���ؿ��ַ�"" - */ - public static String format(Date d) { - String str; - if (d != null) { - str = (new SimpleDateFormat("yyyy-MM-dd")).format(d); - } else { - str = ""; - } - return str; - } - - public static String format(Date d,String pattern) { - String str; - if (d != null) { - str = (new SimpleDateFormat(pattern)).format(d); - } else { - str = ""; - } - return str; - } - - - public static Date format(String str,String pattern) { - Date date; - try { - date = new Date((new SimpleDateFormat(pattern)).parse(str).getTime()); - } catch (Exception e) { - e.printStackTrace(); - date = null; - } - return date; - } - /** - * ���ַ����͵�����ת��Ϊ������ - * @param str yyyy.MM.dd����yyyy-mm-dd��ʽ���ַ� - * @return �ַ��Ӧ�����ڣ�����ַ��ǺϷ������ڣ�����null - */ - public static Date format(String str) { - Date d; - if (str != null) { - try { - d = Date.valueOf(str.replace('.','-')); - } catch (Exception e) { - d = null; - } - } else { - d = null; - } - return d; - } - - /** - * ʱ��������ת����yyyy.MM.dd HH:mm:ss��ʽ���ַ� - * @param t ʱ������ - * @return yyyy.MM.dd HH:mm:ss��ʽ���ַ����ʱ���Ϊnull����ô���ؿ��ַ�"" - */ - public static String format(Timestamp t) { - String str; - if (t != null) { - str = (new SimpleDateFormat("yyyy-MM-dd HH:mm:ss")).format(t); - } else { - str = ""; - } - return str; - } - - /** - * ȡ�õ�ǰʱ�䣬java.Timestamp��ʽ - * @return ��ǰʱ�� - */ - public static Timestamp now() { - return new Timestamp(System.currentTimeMillis()); - } - - /** - * ȡ�õ�ǰ���ڣ�java.sql.Date��ʽ - * @return �������� - */ - public static Date today() { - return new Date(System.currentTimeMillis()); - } - //昨天 - public static Date yesterday() { - Calendar c = Calendar.getInstance(); - int date = c.get(Calendar.DATE); - date--; - c.set(Calendar.DATE,date); - return new Date(c.getTimeInMillis()); - } - //前天 - public static Date beforeYesterday() { - Calendar c = Calendar.getInstance(); - int date = c.get(Calendar.DATE); - date=date-2; - c.set(Calendar.DATE,date); - return new Date(c.getTimeInMillis()); - } - /** - * 返回两个日期相差的天数 - * */ - public static long dateDiff(String d1, String d2){ - Date da1 = format(d1); - Date da2 = format(d2); - return dateDiff(da1,da2); - } - /** - * 返回两个日期相差的天数 - * */ - public static long dateDiff(Date d1, Date d2){ - long n1 = d1.getTime(); - long n2 = d2.getTime(); - - long diff = Math.abs(n1 - n2); - diff /= 3600 * 1000 * 24; - return diff; - } - - /* - * 判断是否为当前月,返回真表示在最终历史库 - */ - public static boolean isHistory(Date copitime)throws Exception{ - Calendar cal = Calendar.getInstance(); - boolean bol=false; - Date d=today(); - long currenttime = d.getTime(); - long histime=copitime.getTime(); - cal.setTimeInMillis(currenttime); - int f_year=cal.get(Calendar.YEAR); - int f_month=cal.get(Calendar.MONTH); - if(histime>currenttime) - throw new Exception("日期选择有误。"); - cal.setTimeInMillis(histime); - int s_year=cal.get(Calendar.YEAR); - int s_month=cal.get(Calendar.MONTH); - if(f_year!=s_year){ - return true; - } - if(f_month!=s_month) - bol=true; - return bol; - } - //判断是否为当前日 - public static boolean isBakDate(Date d) { - Date today = Date.valueOf(DateUtil.today().toString()); - if (d.getTime() < today.getTime()) { - return true; - } else { - return false; - } - - } - - public static String format(Timestamp t, String pattern) { - String str; - if (t != null) { - str = (new SimpleDateFormat(pattern)).format(t); - } else { - str = ""; - } - return str; - } - /*根据传进来的日期字符串,获取上一个年月yyyyMM*/ - public static String prMonth(String d)throws Exception - { - java.util.Date date = new SimpleDateFormat("yyyy-MM-dd").parse(d); - Calendar c = Calendar.getInstance(); - c.setTime(date); - c.set(Calendar.DATE,1); - int mn=c.get(Calendar.MONTH)-1; - c.set(Calendar.MONTH, mn); - return new SimpleDateFormat("yyyyMM").format(c.getTime()); - } - /* - * 以当前时间按pattern指定的格式,格式化时间为字符串返回 - * */ - public static String getCurrentTimeCharPattern(String pattern)throws Exception{ - return new SimpleDateFormat(pattern).format(new java.util.Date()); - } - - - /** - * 计算两个日期相隔的小时数 - * - * @param startdate - * @param enddate - * @return - */ - public static final long diffHour(java.util.Date startdate, - java.util.Date enddate) { - - long diff = (startdate.getTime() - enddate.getTime()) / (3600 * 1000l); - return diff; - - } - - - public static void main(String args[])throws Exception{ - - - - -// BigDecimal b1 = new BigDecimal("14.145"); -// BigDecimal b2 = new BigDecimal(1); -// System.out.println(b1.divide(b2,2,BigDecimal.ROUND_HALF_UP)); - - -// Date today = Date.valueOf(DateLib.today().toString()); -// Calendar c = Calendar.getInstance(); -// int date = c.get(Calendar.DATE); -// date=date-7; -// c.set(Calendar.DATE,date); -// System.out.println( new Date(c.getTimeInMillis())); -// -// int j=c.get(Calendar.DATE); -// j=j-45; -// c.set(Calendar.DATE,j); -// System.out.println( new Date(c.getTimeInMillis())); - //System.out.println(MD5Util.MD5Encode("20001001423011010111110yskjop120897technology2hdkf0sdfd")); - - } +package luckyweb.seagull.util; + +import java.sql.*; +import java.text.*; +import java.util.Calendar; + + +public class DateUtil { + + /** + * ���������ת����yyyy.MM.dd��ʽ���ַ� + * @param d ������� + * @return yyyy.MM.dd��ʽ���ַ��������Ϊnull����ô���ؿ��ַ�"" + */ + public static String format(Date d) { + String str; + if (d != null) { + str = (new SimpleDateFormat("yyyy-MM-dd")).format(d); + } else { + str = ""; + } + return str; + } + + public static String format(Date d,String pattern) { + String str; + if (d != null) { + str = (new SimpleDateFormat(pattern)).format(d); + } else { + str = ""; + } + return str; + } + + + public static Date format(String str,String pattern) { + Date date; + try { + date = new Date((new SimpleDateFormat(pattern)).parse(str).getTime()); + } catch (Exception e) { + e.printStackTrace(); + date = null; + } + return date; + } + /** + * ���ַ����͵�����ת��Ϊ������ + * @param str yyyy.MM.dd����yyyy-mm-dd��ʽ���ַ� + * @return �ַ��Ӧ�����ڣ�����ַ��ǺϷ������ڣ�����null + */ + public static Date format(String str) { + Date d; + if (str != null) { + try { + d = Date.valueOf(str.replace('.','-')); + } catch (Exception e) { + d = null; + } + } else { + d = null; + } + return d; + } + + /** + * ʱ��������ת����yyyy.MM.dd HH:mm:ss��ʽ���ַ� + * @param t ʱ������ + * @return yyyy.MM.dd HH:mm:ss��ʽ���ַ����ʱ���Ϊnull����ô���ؿ��ַ�"" + */ + public static String format(Timestamp t) { + String str; + if (t != null) { + str = (new SimpleDateFormat("yyyy-MM-dd HH:mm:ss")).format(t); + } else { + str = ""; + } + return str; + } + + /** + * ȡ�õ�ǰʱ�䣬java.Timestamp��ʽ + * @return ��ǰʱ�� + */ + public static Timestamp now() { + return new Timestamp(System.currentTimeMillis()); + } + + /** + * ȡ�õ�ǰ���ڣ�java.sql.Date��ʽ + * @return �������� + */ + public static Date today() { + return new Date(System.currentTimeMillis()); + } + //昨天 + public static Date yesterday() { + Calendar c = Calendar.getInstance(); + int date = c.get(Calendar.DATE); + date--; + c.set(Calendar.DATE,date); + return new Date(c.getTimeInMillis()); + } + //前天 + public static Date beforeYesterday() { + Calendar c = Calendar.getInstance(); + int date = c.get(Calendar.DATE); + date=date-2; + c.set(Calendar.DATE,date); + return new Date(c.getTimeInMillis()); + } + /** + * 返回两个日期相差的天数 + * */ + public static long dateDiff(String d1, String d2){ + Date da1 = format(d1); + Date da2 = format(d2); + return dateDiff(da1,da2); + } + /** + * 返回两个日期相差的天数 + * */ + public static long dateDiff(Date d1, Date d2){ + long n1 = d1.getTime(); + long n2 = d2.getTime(); + + long diff = Math.abs(n1 - n2); + diff /= 3600 * 1000 * 24; + return diff; + } + + /* + * 判断是否为当前月,返回真表示在最终历史库 + */ + public static boolean isHistory(Date copitime)throws Exception{ + Calendar cal = Calendar.getInstance(); + boolean bol=false; + Date d=today(); + long currenttime = d.getTime(); + long histime=copitime.getTime(); + cal.setTimeInMillis(currenttime); + int f_year=cal.get(Calendar.YEAR); + int f_month=cal.get(Calendar.MONTH); + if(histime>currenttime) + throw new Exception("日期选择有误。"); + cal.setTimeInMillis(histime); + int s_year=cal.get(Calendar.YEAR); + int s_month=cal.get(Calendar.MONTH); + if(f_year!=s_year){ + return true; + } + if(f_month!=s_month) + bol=true; + return bol; + } + //判断是否为当前日 + public static boolean isBakDate(Date d) { + Date today = Date.valueOf(DateUtil.today().toString()); + if (d.getTime() < today.getTime()) { + return true; + } else { + return false; + } + + } + + public static String format(Timestamp t, String pattern) { + String str; + if (t != null) { + str = (new SimpleDateFormat(pattern)).format(t); + } else { + str = ""; + } + return str; + } + /*根据传进来的日期字符串,获取上一个年月yyyyMM*/ + public static String prMonth(String d)throws Exception + { + java.util.Date date = new SimpleDateFormat("yyyy-MM-dd").parse(d); + Calendar c = Calendar.getInstance(); + c.setTime(date); + c.set(Calendar.DATE,1); + int mn=c.get(Calendar.MONTH)-1; + c.set(Calendar.MONTH, mn); + return new SimpleDateFormat("yyyyMM").format(c.getTime()); + } + /* + * 以当前时间按pattern指定的格式,格式化时间为字符串返回 + * */ + public static String getCurrentTimeCharPattern(String pattern)throws Exception{ + return new SimpleDateFormat(pattern).format(new java.util.Date()); + } + + + /** + * 计算两个日期相隔的小时数 + * + * @param startdate + * @param enddate + * @return + */ + public static final long diffHour(java.util.Date startdate, + java.util.Date enddate) { + + long diff = (startdate.getTime() - enddate.getTime()) / (3600 * 1000l); + return diff; + + } + + + public static void main(String args[])throws Exception{ + + + + +// BigDecimal b1 = new BigDecimal("14.145"); +// BigDecimal b2 = new BigDecimal(1); +// System.out.println(b1.divide(b2,2,BigDecimal.ROUND_HALF_UP)); + + +// Date today = Date.valueOf(DateLib.today().toString()); +// Calendar c = Calendar.getInstance(); +// int date = c.get(Calendar.DATE); +// date=date-7; +// c.set(Calendar.DATE,date); +// System.out.println( new Date(c.getTimeInMillis())); +// +// int j=c.get(Calendar.DATE); +// j=j-45; +// c.set(Calendar.DATE,j); +// System.out.println( new Date(c.getTimeInMillis())); + //System.out.println(MD5Util.MD5Encode("20001001423011010111110yskjop120897technology2hdkf0sdfd")); + + } } \ No newline at end of file diff --git a/src/main/java/luckyweb/seagull/util/Endecrypt.java b/src/main/java/luckyweb/seagull/util/Endecrypt.java index c19fab2..4892039 100644 --- a/src/main/java/luckyweb/seagull/util/Endecrypt.java +++ b/src/main/java/luckyweb/seagull/util/Endecrypt.java @@ -1,282 +1,282 @@ -package luckyweb.seagull.util; - -import java.net.URLDecoder; -import java.net.URLEncoder; -import java.security.MessageDigest; - -import javax.crypto.Cipher; -import javax.crypto.SecretKey; -import javax.crypto.SecretKeyFactory; -import javax.crypto.spec.DESedeKeySpec; -import sun.misc.BASE64Decoder; -import sun.misc.BASE64Encoder; - -public class Endecrypt { - private String SPKEY = "123456321"; - - /** - * 进行MD5加密 - * - * @param String - * 原始的SPKEY - * @return byte[] 指定加密方式为md5后的byte[] - */ - - private byte[] md5(String strSrc) { - byte[] returnByte = null; - try { - MessageDigest md5 = MessageDigest.getInstance("MD5"); - returnByte = md5.digest(strSrc.getBytes("GBK")); - } catch (Exception e) { - e.printStackTrace(); - } - return returnByte; - } - - /** - * 得到3-DES的密钥匙 根据接口规范,密钥匙为24个字节,md5加密出来的是16个字节,因此后面补8个字节的0 - * - * @param String - * 原始的SPKEY - * @return byte[] 指定加密方式为md5后的byte[] - */ - - private byte[] getEnKey(String spKey) { - byte[] desKey = null; - try { - byte[] desKey1 = md5(spKey); - desKey = new byte[24]; - int i = 0; - while (i < desKey1.length && i < 24) { - desKey[i] = desKey1[i]; - i++; - } - if (i < 24) { - desKey[i] = 0; - i++; - } - } catch (Exception e) { - e.printStackTrace(); - } - - return desKey; - } - - /** - * 3-DES加密 - * - * @param byte[] - * src 要进行3-DES加密的byte[] - * @param byte[] - * enKey 3-DES加密密钥 - * @return byte[] 3-DES加密后的byte[] - */ - - public byte[] Encrypt(byte[] src, byte[] enKey) { - byte[] encryptedData = null; - try { - DESedeKeySpec dks = new DESedeKeySpec(enKey); - SecretKeyFactory keyFactory = SecretKeyFactory.getInstance("DESede"); - SecretKey key = keyFactory.generateSecret(dks); - Cipher cipher = Cipher.getInstance("DESede"); - cipher.init(Cipher.ENCRYPT_MODE, key); - encryptedData = cipher.doFinal(src); - } catch (Exception e) { - e.printStackTrace(); - } - return encryptedData; - } - - /** - * 对字符串进行Base64编码 - * - * @param byte[] - * src 要进行编码的字符 - * - * @return String 进行编码后的字符串 - */ - - public String getBase64Encode(byte[] src) { - String requestValue = ""; - try { - BASE64Encoder base64en = new BASE64Encoder(); - requestValue = base64en.encode(src); - // System.out.println(requestValue); - } catch (Exception e) { - e.printStackTrace(); - } - - return requestValue; - } - - /** - * 去掉字符串的换行符号 base64编码3-DES的数据时,得到的字符串有换行符号 ,一定要去掉,否则uni-wise平台解析票根不会成功, - * 提示“sp验证失败”。在开发的过程中,因为这个问题让我束手无策, 一个朋友告诉我可以问联通要一段加密后 的文字,然后去和自己生成的字符串比较, - * 这是个不错的调试方法。我最后比较发现我生成的字符串唯一不同的 是多了换行。 我用c#语言也写了票根请求程序,没有发现这个问题。 - * - */ - - private String filter(String str) { - String output = null; - StringBuffer sb = new StringBuffer(); - for (int i = 0; i < str.length(); i++) { - int asc = str.charAt(i); - if (asc != 10 && asc != 13) - sb.append(str.subSequence(i, i + 1)); - } - output = new String(sb); - return output; - } - - /** - * 对字符串进行URLDecoder.encode(strEncoding)编码 - * - * @param String - * src 要进行编码的字符串 - * - * @return String 进行编码后的字符串 - */ - - public String getURLEncode(String src) { - String requestValue = ""; - try { - - requestValue = URLEncoder.encode(src); - } catch (Exception e) { - e.printStackTrace(); - } - - return requestValue; - } - - /** - * 3-DES加密 - * - * @param String - * src 要进行3-DES加密的String - * @param String - * spkey分配的SPKEY - * @return String 3-DES加密后的String - */ - - public String get3DESEncrypt(String src) { - String requestValue = ""; - try { - - // 得到3-DES的密钥匙 - byte[] enKey = getEnKey(SPKEY); - // 要进行3-DES加密的内容在进行/"UTF-16LE/"取字节 - byte[] src2 = src.getBytes("UTF-16LE"); - // 进行3-DES加密后的内容的字节 - byte[] encryptedData = Encrypt(src2, enKey); - - // 进行3-DES加密后的内容进行BASE64编码 - String base64String = getBase64Encode(encryptedData); - // BASE64编码去除换行符后 - String base64Encrypt = filter(base64String); - - // 对BASE64编码中的HTML控制码进行转义的过程 - requestValue = getURLEncode(base64Encrypt); - // System.out.println(requestValue); - } catch (Exception e) { - e.printStackTrace(); - } - - return requestValue; - } - - /** - * 对字符串进行URLDecoder.decode(strEncoding)解码 - * - * @param String - * src 要进行解码的字符串 - * - * @return String 进行解码后的字符串 - */ - - public String getURLDecoderdecode(String src) { - String requestValue = ""; - try { - - requestValue = URLDecoder.decode(src); - } catch (Exception e) { - e.printStackTrace(); - } - - return requestValue; - } - - /** - * - * 进行3-DES解密(密钥匙等同于加密的密钥匙)。 - * - * @param byte[] - * src 要进行3-DES解密byte[] - * @param String - * spkey分配的SPKEY - * @return String 3-DES解密后的String - */ - public String deCrypt(byte[] debase64, String spKey) { - String strDe = null; - Cipher cipher = null; - try { - cipher = Cipher.getInstance("DESede"); - byte[] key = getEnKey(spKey); - DESedeKeySpec dks = new DESedeKeySpec(key); - SecretKeyFactory keyFactory = SecretKeyFactory.getInstance("DESede"); - SecretKey sKey = keyFactory.generateSecret(dks); - cipher.init(Cipher.DECRYPT_MODE, sKey); - byte ciphertext[] = cipher.doFinal(debase64); - strDe = new String(ciphertext, "UTF-16LE"); - } catch (Exception ex) { - strDe = ""; - ex.printStackTrace(); - } - return strDe; - } - - /** - * 3-DES解密 - * - * @param String - * src 要进行3-DES解密的String - * @param String - * spkey分配的SPKEY - * @return String 3-DES加密后的String - */ - - public String get3DESDecrypt(String src) { - String requestValue = ""; - try { - - // 得到3-DES的密钥匙 - - // URLDecoder.decodeTML控制码进行转义的过程 - String URLValue = getURLDecoderdecode(src); - - // 进行3-DES加密后的内容进行BASE64编码 - - BASE64Decoder base64Decode = new BASE64Decoder(); - byte[] base64DValue = base64Decode.decodeBuffer(URLValue); - - // 要进行3-DES加密的内容在进行/"UTF-16LE/"取字节 - - requestValue = deCrypt(base64DValue, SPKEY); - } catch (Exception e) { - e.printStackTrace(); - } - return requestValue; - } - -/* public static void main(String[] args) { - Endecrypt test = new Endecrypt(); - String oldString = "qinhltest"; - - System.out.println("2。的内容为: " + oldString); - String reValue = test.get3DESEncrypt(oldString); - reValue = reValue.trim().intern(); - System.out.println("进行3-DES加密后的内容: " + reValue); - String reValue2 = test.get3DESDecrypt(reValue); - System.out.println("进行3-DES解密后的内容: " + reValue2); - }*/ +package luckyweb.seagull.util; + +import java.net.URLDecoder; +import java.net.URLEncoder; +import java.security.MessageDigest; + +import javax.crypto.Cipher; +import javax.crypto.SecretKey; +import javax.crypto.SecretKeyFactory; +import javax.crypto.spec.DESedeKeySpec; +import sun.misc.BASE64Decoder; +import sun.misc.BASE64Encoder; + +public class Endecrypt { + private String SPKEY = "123456321"; + + /** + * 进行MD5加密 + * + * @param String + * 原始的SPKEY + * @return byte[] 指定加密方式为md5后的byte[] + */ + + private byte[] md5(String strSrc) { + byte[] returnByte = null; + try { + MessageDigest md5 = MessageDigest.getInstance("MD5"); + returnByte = md5.digest(strSrc.getBytes("GBK")); + } catch (Exception e) { + e.printStackTrace(); + } + return returnByte; + } + + /** + * 得到3-DES的密钥匙 根据接口规范,密钥匙为24个字节,md5加密出来的是16个字节,因此后面补8个字节的0 + * + * @param String + * 原始的SPKEY + * @return byte[] 指定加密方式为md5后的byte[] + */ + + private byte[] getEnKey(String spKey) { + byte[] desKey = null; + try { + byte[] desKey1 = md5(spKey); + desKey = new byte[24]; + int i = 0; + while (i < desKey1.length && i < 24) { + desKey[i] = desKey1[i]; + i++; + } + if (i < 24) { + desKey[i] = 0; + i++; + } + } catch (Exception e) { + e.printStackTrace(); + } + + return desKey; + } + + /** + * 3-DES加密 + * + * @param byte[] + * src 要进行3-DES加密的byte[] + * @param byte[] + * enKey 3-DES加密密钥 + * @return byte[] 3-DES加密后的byte[] + */ + + public byte[] Encrypt(byte[] src, byte[] enKey) { + byte[] encryptedData = null; + try { + DESedeKeySpec dks = new DESedeKeySpec(enKey); + SecretKeyFactory keyFactory = SecretKeyFactory.getInstance("DESede"); + SecretKey key = keyFactory.generateSecret(dks); + Cipher cipher = Cipher.getInstance("DESede"); + cipher.init(Cipher.ENCRYPT_MODE, key); + encryptedData = cipher.doFinal(src); + } catch (Exception e) { + e.printStackTrace(); + } + return encryptedData; + } + + /** + * 对字符串进行Base64编码 + * + * @param byte[] + * src 要进行编码的字符 + * + * @return String 进行编码后的字符串 + */ + + public String getBase64Encode(byte[] src) { + String requestValue = ""; + try { + BASE64Encoder base64en = new BASE64Encoder(); + requestValue = base64en.encode(src); + // System.out.println(requestValue); + } catch (Exception e) { + e.printStackTrace(); + } + + return requestValue; + } + + /** + * 去掉字符串的换行符号 base64编码3-DES的数据时,得到的字符串有换行符号 ,一定要去掉,否则uni-wise平台解析票根不会成功, + * 提示“sp验证失败”。在开发的过程中,因为这个问题让我束手无策, 一个朋友告诉我可以问联通要一段加密后 的文字,然后去和自己生成的字符串比较, + * 这是个不错的调试方法。我最后比较发现我生成的字符串唯一不同的 是多了换行。 我用c#语言也写了票根请求程序,没有发现这个问题。 + * + */ + + private String filter(String str) { + String output = null; + StringBuffer sb = new StringBuffer(); + for (int i = 0; i < str.length(); i++) { + int asc = str.charAt(i); + if (asc != 10 && asc != 13) + sb.append(str.subSequence(i, i + 1)); + } + output = new String(sb); + return output; + } + + /** + * 对字符串进行URLDecoder.encode(strEncoding)编码 + * + * @param String + * src 要进行编码的字符串 + * + * @return String 进行编码后的字符串 + */ + + public String getURLEncode(String src) { + String requestValue = ""; + try { + + requestValue = URLEncoder.encode(src); + } catch (Exception e) { + e.printStackTrace(); + } + + return requestValue; + } + + /** + * 3-DES加密 + * + * @param String + * src 要进行3-DES加密的String + * @param String + * spkey分配的SPKEY + * @return String 3-DES加密后的String + */ + + public String get3DESEncrypt(String src) { + String requestValue = ""; + try { + + // 得到3-DES的密钥匙 + byte[] enKey = getEnKey(SPKEY); + // 要进行3-DES加密的内容在进行/"UTF-16LE/"取字节 + byte[] src2 = src.getBytes("UTF-16LE"); + // 进行3-DES加密后的内容的字节 + byte[] encryptedData = Encrypt(src2, enKey); + + // 进行3-DES加密后的内容进行BASE64编码 + String base64String = getBase64Encode(encryptedData); + // BASE64编码去除换行符后 + String base64Encrypt = filter(base64String); + + // 对BASE64编码中的HTML控制码进行转义的过程 + requestValue = getURLEncode(base64Encrypt); + // System.out.println(requestValue); + } catch (Exception e) { + e.printStackTrace(); + } + + return requestValue; + } + + /** + * 对字符串进行URLDecoder.decode(strEncoding)解码 + * + * @param String + * src 要进行解码的字符串 + * + * @return String 进行解码后的字符串 + */ + + public String getURLDecoderdecode(String src) { + String requestValue = ""; + try { + + requestValue = URLDecoder.decode(src); + } catch (Exception e) { + e.printStackTrace(); + } + + return requestValue; + } + + /** + * + * 进行3-DES解密(密钥匙等同于加密的密钥匙)。 + * + * @param byte[] + * src 要进行3-DES解密byte[] + * @param String + * spkey分配的SPKEY + * @return String 3-DES解密后的String + */ + public String deCrypt(byte[] debase64, String spKey) { + String strDe = null; + Cipher cipher = null; + try { + cipher = Cipher.getInstance("DESede"); + byte[] key = getEnKey(spKey); + DESedeKeySpec dks = new DESedeKeySpec(key); + SecretKeyFactory keyFactory = SecretKeyFactory.getInstance("DESede"); + SecretKey sKey = keyFactory.generateSecret(dks); + cipher.init(Cipher.DECRYPT_MODE, sKey); + byte ciphertext[] = cipher.doFinal(debase64); + strDe = new String(ciphertext, "UTF-16LE"); + } catch (Exception ex) { + strDe = ""; + ex.printStackTrace(); + } + return strDe; + } + + /** + * 3-DES解密 + * + * @param String + * src 要进行3-DES解密的String + * @param String + * spkey分配的SPKEY + * @return String 3-DES加密后的String + */ + + public String get3DESDecrypt(String src) { + String requestValue = ""; + try { + + // 得到3-DES的密钥匙 + + // URLDecoder.decodeTML控制码进行转义的过程 + String URLValue = getURLDecoderdecode(src); + + // 进行3-DES加密后的内容进行BASE64编码 + + BASE64Decoder base64Decode = new BASE64Decoder(); + byte[] base64DValue = base64Decode.decodeBuffer(URLValue); + + // 要进行3-DES加密的内容在进行/"UTF-16LE/"取字节 + + requestValue = deCrypt(base64DValue, SPKEY); + } catch (Exception e) { + e.printStackTrace(); + } + return requestValue; + } + +/* public static void main(String[] args) { + Endecrypt test = new Endecrypt(); + String oldString = "qinhltest"; + + System.out.println("2。的内容为: " + oldString); + String reValue = test.get3DESEncrypt(oldString); + reValue = reValue.trim().intern(); + System.out.println("进行3-DES加密后的内容: " + reValue); + String reValue2 = test.get3DESDecrypt(reValue); + System.out.println("进行3-DES解密后的内容: " + reValue2); + }*/ } \ No newline at end of file diff --git a/src/main/java/luckyweb/seagull/util/HibernateSessionFactoryUtil.java b/src/main/java/luckyweb/seagull/util/HibernateSessionFactoryUtil.java index cf55ab0..72ad394 100644 --- a/src/main/java/luckyweb/seagull/util/HibernateSessionFactoryUtil.java +++ b/src/main/java/luckyweb/seagull/util/HibernateSessionFactoryUtil.java @@ -1,58 +1,58 @@ -package luckyweb.seagull.util; - -import org.apache.log4j.Logger; -import org.hibernate.Session; -import org.hibernate.SessionFactory; -import org.hibernate.cfg.Configuration; - - -public class HibernateSessionFactoryUtil { - private static final Logger logger = Logger.getLogger(HibernateSessionFactoryUtil.class); - - public static SessionFactory sessionFactory = null; - - public static ThreadLocal threadLocal = new ThreadLocal(); - - public HibernateSessionFactoryUtil() { - } - - static { - sessionFactory = new Configuration().configure("./hibernate.cfg.xml").buildSessionFactory(); - } - - public static Session openSession() { - return sessionFactory.openSession(); - } - - public static Session getCurrentSession() { - - Session session = threadLocal.get(); - if (session == null) { - session = sessionFactory.openSession(); - threadLocal.set(session); - } - return session; - } - - - public static void main(String[] args) throws Exception { - -// Session s=HibernateSessionFactoryUtil.getCurrentSession(); -// Transaction tx=s.beginTransaction(); -// tx.commit(); -// closeSession(); - new Configuration().configure("hibernate.cfg.xml").buildSessionFactory().openSession(); - } - - public static void closeSession() throws Exception{ - try { - if(threadLocal.get().isOpen()){ - threadLocal.get().close(); - sessionFactory.close(); - System.out.println("close session"); - } - } catch (Exception e) { - throw new Exception("关闭sessionFacory 异常:"+e.getMessage()); - } - } -} +package luckyweb.seagull.util; + +import org.apache.log4j.Logger; +import org.hibernate.Session; +import org.hibernate.SessionFactory; +import org.hibernate.cfg.Configuration; + + +public class HibernateSessionFactoryUtil { + private static final Logger logger = Logger.getLogger(HibernateSessionFactoryUtil.class); + + public static SessionFactory sessionFactory = null; + + public static ThreadLocal threadLocal = new ThreadLocal(); + + public HibernateSessionFactoryUtil() { + } + + static { + sessionFactory = new Configuration().configure("./hibernate.cfg.xml").buildSessionFactory(); + } + + public static Session openSession() { + return sessionFactory.openSession(); + } + + public static Session getCurrentSession() { + + Session session = threadLocal.get(); + if (session == null) { + session = sessionFactory.openSession(); + threadLocal.set(session); + } + return session; + } + + + public static void main(String[] args) throws Exception { + +// Session s=HibernateSessionFactoryUtil.getCurrentSession(); +// Transaction tx=s.beginTransaction(); +// tx.commit(); +// closeSession(); + new Configuration().configure("hibernate.cfg.xml").buildSessionFactory().openSession(); + } + + public static void closeSession() throws Exception{ + try { + if(threadLocal.get().isOpen()){ + threadLocal.get().close(); + sessionFactory.close(); + System.out.println("close session"); + } + } catch (Exception e) { + throw new Exception("关闭sessionFacory 异常:"+e.getMessage()); + } + } +} diff --git a/src/main/java/luckyweb/seagull/util/MysqlLib.java b/src/main/java/luckyweb/seagull/util/MysqlLib.java index 60042f7..a6b1e26 100644 --- a/src/main/java/luckyweb/seagull/util/MysqlLib.java +++ b/src/main/java/luckyweb/seagull/util/MysqlLib.java @@ -1,90 +1,90 @@ -package luckyweb.seagull.util; - -import java.sql.Connection; -import java.sql.DriverManager; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.sql.Statement; - -public class MysqlLib { - // 驱动程序名 - public static String driver = "com.mysql.jdbc.Driver"; - - // URL指向要访问的数据库名zentao - private static String url = "jdbc:mysql://10.211.19.75:3308/zentao?zeroDateTimeBehavior=convertToNull"; - - // MySQL配置时的用户名 - private static String user = "root"; - - // MySQL配置时的密码 - private static String password = ""; - - public String[][] querydata(String proid){ - String [][]results=null; - try { - // 加载驱动程序 - Class.forName(driver); - - // 连续数据库 - Connection conn = DriverManager.getConnection(url, user, password); - - if(!conn.isClosed()) - System.out.println("Succeeded connecting to the Database!"); - - // statement用来执行SQL语句 - Statement statement = conn.createStatement(); - - // 结果集 - ResultSet rscount = statement.executeQuery("SELECT COUNT(*) as rowCount FROM zt_task a LEFT JOIN zt_project b on a.project=b.id " - + "where b.status = 'done' and a.status = 'done' and a.project = "+proid); - rscount.next(); - int rowCount = rscount.getInt("rowCount"); - if (rowCount != 0) { - // 要执行的SQL语句 - String sql = "select aa.id,aa.project,aa.projectname,aa.name,aa.assignedDate,aa.estimate,aa.consumed,c.realname,aa.finishedBy,aa.deadline " - + "from (select a.id,a.project,b.name as projectname,a.name,a.assignedDate,a.estimate,a.consumed,a.finishedBy,a.deadline " - + "from zt_task a LEFT JOIN zt_project b on a.project=b.id where b.status = 'done' and a.status = 'done' and a.project = " - + proid + ") aa " + "LEFT JOIN zt_user c on c.account=aa.finishedBy"; - - // 结果集 - ResultSet rs = statement.executeQuery(sql); - - results = new String[rowCount][10]; - while (rs.next()) { - results[rs.getRow() - 1][0] = rs.getString("id"); - results[rs.getRow() - 1][1] = rs.getString("project"); - results[rs.getRow() - 1][2] = rs.getString("projectname"); - results[rs.getRow() - 1][3] = rs.getString("name"); - results[rs.getRow() - 1][4] = rs.getString("assignedDate"); - results[rs.getRow() - 1][5] = rs.getString("estimate"); - results[rs.getRow() - 1][6] = rs.getString("consumed"); - results[rs.getRow() - 1][7] = rs.getString("realname"); - results[rs.getRow() - 1][8] = rs.getString("finishedBy"); - results[rs.getRow() - 1][9] = rs.getString("deadline"); - } - rs.close(); - } - conn.close(); - return results; - } catch(ClassNotFoundException e) { - System.out.println("Sorry,can`t find the Driver!"); - e.printStackTrace(); - return results; - } catch(SQLException e) { - e.printStackTrace(); - return results; - } catch(Exception e) { - e.printStackTrace(); - return results; - } - } - - - public static void main(String[] args) { - // TODO Auto-generated method stub - MysqlLib aaa=new MysqlLib(); - String [][]aaaq = aaa.querydata("87"); - System.out.println(aaaq.length); - } - -} +package luckyweb.seagull.util; + +import java.sql.Connection; +import java.sql.DriverManager; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.sql.Statement; + +public class MysqlLib { + // 驱动程序名 + public static String driver = "com.mysql.jdbc.Driver"; + + // URL指向要访问的数据库名zentao + private static String url = "jdbc:mysql://10.211.19.75:3308/zentao?zeroDateTimeBehavior=convertToNull"; + + // MySQL配置时的用户名 + private static String user = "root"; + + // MySQL配置时的密码 + private static String password = ""; + + public String[][] querydata(String proid){ + String [][]results=null; + try { + // 加载驱动程序 + Class.forName(driver); + + // 连续数据库 + Connection conn = DriverManager.getConnection(url, user, password); + + if(!conn.isClosed()) + System.out.println("Succeeded connecting to the Database!"); + + // statement用来执行SQL语句 + Statement statement = conn.createStatement(); + + // 结果集 + ResultSet rscount = statement.executeQuery("SELECT COUNT(*) as rowCount FROM zt_task a LEFT JOIN zt_project b on a.project=b.id " + + "where b.status = 'done' and a.status = 'done' and a.project = "+proid); + rscount.next(); + int rowCount = rscount.getInt("rowCount"); + if (rowCount != 0) { + // 要执行的SQL语句 + String sql = "select aa.id,aa.project,aa.projectname,aa.name,aa.assignedDate,aa.estimate,aa.consumed,c.realname,aa.finishedBy,aa.deadline " + + "from (select a.id,a.project,b.name as projectname,a.name,a.assignedDate,a.estimate,a.consumed,a.finishedBy,a.deadline " + + "from zt_task a LEFT JOIN zt_project b on a.project=b.id where b.status = 'done' and a.status = 'done' and a.project = " + + proid + ") aa " + "LEFT JOIN zt_user c on c.account=aa.finishedBy"; + + // 结果集 + ResultSet rs = statement.executeQuery(sql); + + results = new String[rowCount][10]; + while (rs.next()) { + results[rs.getRow() - 1][0] = rs.getString("id"); + results[rs.getRow() - 1][1] = rs.getString("project"); + results[rs.getRow() - 1][2] = rs.getString("projectname"); + results[rs.getRow() - 1][3] = rs.getString("name"); + results[rs.getRow() - 1][4] = rs.getString("assignedDate"); + results[rs.getRow() - 1][5] = rs.getString("estimate"); + results[rs.getRow() - 1][6] = rs.getString("consumed"); + results[rs.getRow() - 1][7] = rs.getString("realname"); + results[rs.getRow() - 1][8] = rs.getString("finishedBy"); + results[rs.getRow() - 1][9] = rs.getString("deadline"); + } + rs.close(); + } + conn.close(); + return results; + } catch(ClassNotFoundException e) { + System.out.println("Sorry,can`t find the Driver!"); + e.printStackTrace(); + return results; + } catch(SQLException e) { + e.printStackTrace(); + return results; + } catch(Exception e) { + e.printStackTrace(); + return results; + } + } + + + public static void main(String[] args) { + // TODO Auto-generated method stub + MysqlLib aaa=new MysqlLib(); + String [][]aaaq = aaa.querydata("87"); + System.out.println(aaaq.length); + } + +} diff --git a/src/main/java/luckyweb/seagull/util/StrLib.java b/src/main/java/luckyweb/seagull/util/StrLib.java index c08b130..d59b097 100644 --- a/src/main/java/luckyweb/seagull/util/StrLib.java +++ b/src/main/java/luckyweb/seagull/util/StrLib.java @@ -1,285 +1,285 @@ -package luckyweb.seagull.util; - - -import java.beans.IntrospectionException; -import java.beans.Introspector; -import java.beans.PropertyDescriptor; -import java.io.UnsupportedEncodingException; -import java.sql.Timestamp; -import java.text.SimpleDateFormat; -import java.util.Arrays; -import java.util.Date; -import java.util.List; -import java.util.StringTokenizer; - -import net.sf.json.JSONArray; - -public class StrLib { - private static final byte SPACE = 0x20, ZERO = 0x30; - public static final String CHARSET = "ISO-8859-1"; - - - private static StringTokenizer sto; - private static StringBuffer buf; - private static SimpleDateFormat format; - public static String format(String str) { - return (str == null ? "" : str); - } - - - public static String formatHtml(String str) { - if (str == null) return ""; - str = str.replaceAll("<","<"); - str = str.replaceAll(">",">"); - str = str.replaceAll(" ","  "); - str = str.replaceAll("\t","    "); - str = str.replaceAll("\n","
"); - return str; - } - - - public static String formatSql(String str) { - return str.replaceAll("'","''"); - } - - - public static boolean isEmpty(String str) { - return (str == null || str.length() == 0); - } - - - public static String toChinese(String str) { - if (str == null) return null; - try { - return new String(str.getBytes("ISO8859_1"), "UTF-8"); - } catch (Exception e) { - return null; - } - } - - - public static String trim(String str) { - return (str == null ? "" : str.trim()); - } - - - public static String arrayToString(String[] arr,String separator) { - int i,length; - String str = null; - if (arr != null) { - length = arr.length; - for (i = 0; i < length; i ++) { - if (StrLib.isEmpty(arr[i])) continue; - if (str == null) { - str = arr[i]; - } else { - str += separator + arr[i]; - } - } - } - return str; - } - public static String conFo(String str) - { - if(str.equals("")){return "";} - sto=new StringTokenizer(str,"-"); - buf=new StringBuffer(); - while(sto.hasMoreElements()) - { - buf.append(sto.nextElement()); - } - return buf.toString(); - - } - public static String getCurrenttime(String formatString) - { - format=new SimpleDateFormat(formatString); - return format.format(new Date()); - } - public static String getyestoday(String formatString) - { - Date today=new Date(); - format=new SimpleDateFormat(formatString); - Date yestoday=new Date(today.getTime()-24*3600*1000); - return format.format(yestoday); - } -// public static String convertDou(double b) -// { -// String te=String.valueOf(b); -// if(te.substring(te.indexOf('.')).length()<=2) -// { -// te+="0"; -// } -// return te; -// } - public static String convertTime(String str) - { - if(str==null)return ""; - if(str.trim().length()<8)return str; - return (str.substring(0,4)+"-"+str.substring(4,6)+"-"+str.substring(6,8)).trim(); - } - /** - * 随机产生一个6位的数字组合,作为密码 - * @return - */ - public static String generatePwd() { - StringBuffer pwd = new StringBuffer(6); - java.util.Random r = new java.util.Random(); - for (int i = 0;i < 6; i ++) { - pwd.append(r.nextInt(10)); - } - return pwd.toString(); - } - - /** - * 格式化一个字符串为指定的长度,长度不足的在右边补空格 rab = Right Append Blank - * - * @param src - * @param length - * @return - */ - public static final String rab(final String srcStr, final int length) { - try { - byte[] src, res; - if (srcStr == null) { - res = new byte[length]; - Arrays.fill(res, SPACE); - return new String(res, CHARSET); - } else { - src = srcStr.getBytes(CHARSET); - final int len = src.length; - if (len > length) { - return new String(src, 0, length, CHARSET); - } else if (len == length) { - return srcStr; - } else { - res = new byte[length]; - Arrays.fill(res, SPACE); - System.arraycopy(src, 0, res, 0, len); - return new String(res, CHARSET); - } - } - } catch (final UnsupportedEncodingException e) { - throw new RuntimeException(e); - } - - } - - /** - * 格式化一个字符串为指定的长度,长度不足的在左边补零 liz = Left Insert Zero - * - * @param src - * @param length - * @return - */ - public static final String liz(final String srcStr, final int length) { - try { - byte[] src, res; - if (srcStr == null) { - res = new byte[length]; - Arrays.fill(res, ZERO); - return new String(res, CHARSET); - } else { - src = srcStr.getBytes(CHARSET); - final int len = src.length; - if (len > length) { - return new String(src, 0, length, CHARSET); - } else if (len == length) { - return srcStr; - } else { - res = new byte[length]; - Arrays.fill(res, ZERO); - System.arraycopy(src, 0, res, length - len, len); - return new String(res, CHARSET); - } - } - } catch (final UnsupportedEncodingException e) { - throw new RuntimeException(e); - } - - } - - /** - * 功能描述:通过传入一个列表对象,调用指定方法将列表中的数据生成一个JSON规格指定字符串 - * @param list列表对象 - * @return java.lang.String - */ - public static String listToJson(List list) { - StringBuilder json = new StringBuilder(); - json.append("["); - if (list != null && list.size() > 0) { - for (Object obj : list) { - json.append(objectToJson(obj)); - json.append(","); - } - json.setCharAt(json.length() - 1, ']'); - } else { - json.append("]"); - } - return json.toString(); - } - - /** - * @param object 任意对象 - * @return java.lang.String - */ - public static String objectToJson(Object object) { - StringBuilder json = new StringBuilder(); - if (object == null) { - json.append("\"\""); - } else if (object.getClass().isArray()) { - JSONArray jsonarray = JSONArray.fromObject(object); - json.append("\"").append(jsonarray.toString().replace("\"", """)).append("\""); - } else if (object instanceof Timestamp) { - SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");//定义格式,不显示毫秒 - String str = df.format(object); - json.append("\"").append(str.replace("\"", """)).append("\""); - } else if (boolean.class.isAssignableFrom(object.getClass())) { - Boolean B = new Boolean((boolean)object); - json.append("\"").append(B.toString().replace("\"", """)).append("\""); - } else if (object instanceof String || object instanceof Integer || object instanceof Boolean || object instanceof Long) { - String str=object.toString().replace("\"", """); - str=str.replace("\r\n","
"); - str=str.replace("\n"," "); - json.append("\"").append(str).append("\""); - } else { - json.append(beanToJson(object)); - } - return json.toString(); - } - - /** - * 功能描述:传入任意一个 javabean 对象生成一个指定规格的字符串 - * @param bean bean对象 - * @return String - */ - private static String beanToJson(Object bean) { - StringBuilder json = new StringBuilder(); - json.append("{"); - PropertyDescriptor[] props = null; - try { - props = Introspector.getBeanInfo(bean.getClass(), Object.class) - .getPropertyDescriptors(); - } catch (IntrospectionException e) { - } - if (props != null) { - for (int i = 0; i < props.length; i++) { - try { - String name = objectToJson(props[i].getName()); - String value = objectToJson(props[i].getReadMethod() - .invoke(bean)); - json.append(name); - json.append(":"); - json.append(value); - json.append(","); - } catch (Exception e) { - } - } - json.setCharAt(json.length() - 1, '}'); - } else { - json.append("}"); - } - return json.toString(); - } - -} +package luckyweb.seagull.util; + + +import java.beans.IntrospectionException; +import java.beans.Introspector; +import java.beans.PropertyDescriptor; +import java.io.UnsupportedEncodingException; +import java.sql.Timestamp; +import java.text.SimpleDateFormat; +import java.util.Arrays; +import java.util.Date; +import java.util.List; +import java.util.StringTokenizer; + +import net.sf.json.JSONArray; + +public class StrLib { + private static final byte SPACE = 0x20, ZERO = 0x30; + public static final String CHARSET = "ISO-8859-1"; + + + private static StringTokenizer sto; + private static StringBuffer buf; + private static SimpleDateFormat format; + public static String format(String str) { + return (str == null ? "" : str); + } + + + public static String formatHtml(String str) { + if (str == null) return ""; + str = str.replaceAll("<","<"); + str = str.replaceAll(">",">"); + str = str.replaceAll(" ","  "); + str = str.replaceAll("\t","    "); + str = str.replaceAll("\n","
"); + return str; + } + + + public static String formatSql(String str) { + return str.replaceAll("'","''"); + } + + + public static boolean isEmpty(String str) { + return (str == null || str.length() == 0); + } + + + public static String toChinese(String str) { + if (str == null) return null; + try { + return new String(str.getBytes("ISO8859_1"), "UTF-8"); + } catch (Exception e) { + return null; + } + } + + + public static String trim(String str) { + return (str == null ? "" : str.trim()); + } + + + public static String arrayToString(String[] arr,String separator) { + int i,length; + String str = null; + if (arr != null) { + length = arr.length; + for (i = 0; i < length; i ++) { + if (StrLib.isEmpty(arr[i])) continue; + if (str == null) { + str = arr[i]; + } else { + str += separator + arr[i]; + } + } + } + return str; + } + public static String conFo(String str) + { + if(str.equals("")){return "";} + sto=new StringTokenizer(str,"-"); + buf=new StringBuffer(); + while(sto.hasMoreElements()) + { + buf.append(sto.nextElement()); + } + return buf.toString(); + + } + public static String getCurrenttime(String formatString) + { + format=new SimpleDateFormat(formatString); + return format.format(new Date()); + } + public static String getyestoday(String formatString) + { + Date today=new Date(); + format=new SimpleDateFormat(formatString); + Date yestoday=new Date(today.getTime()-24*3600*1000); + return format.format(yestoday); + } +// public static String convertDou(double b) +// { +// String te=String.valueOf(b); +// if(te.substring(te.indexOf('.')).length()<=2) +// { +// te+="0"; +// } +// return te; +// } + public static String convertTime(String str) + { + if(str==null)return ""; + if(str.trim().length()<8)return str; + return (str.substring(0,4)+"-"+str.substring(4,6)+"-"+str.substring(6,8)).trim(); + } + /** + * 随机产生一个6位的数字组合,作为密码 + * @return + */ + public static String generatePwd() { + StringBuffer pwd = new StringBuffer(6); + java.util.Random r = new java.util.Random(); + for (int i = 0;i < 6; i ++) { + pwd.append(r.nextInt(10)); + } + return pwd.toString(); + } + + /** + * 格式化一个字符串为指定的长度,长度不足的在右边补空格 rab = Right Append Blank + * + * @param src + * @param length + * @return + */ + public static final String rab(final String srcStr, final int length) { + try { + byte[] src, res; + if (srcStr == null) { + res = new byte[length]; + Arrays.fill(res, SPACE); + return new String(res, CHARSET); + } else { + src = srcStr.getBytes(CHARSET); + final int len = src.length; + if (len > length) { + return new String(src, 0, length, CHARSET); + } else if (len == length) { + return srcStr; + } else { + res = new byte[length]; + Arrays.fill(res, SPACE); + System.arraycopy(src, 0, res, 0, len); + return new String(res, CHARSET); + } + } + } catch (final UnsupportedEncodingException e) { + throw new RuntimeException(e); + } + + } + + /** + * 格式化一个字符串为指定的长度,长度不足的在左边补零 liz = Left Insert Zero + * + * @param src + * @param length + * @return + */ + public static final String liz(final String srcStr, final int length) { + try { + byte[] src, res; + if (srcStr == null) { + res = new byte[length]; + Arrays.fill(res, ZERO); + return new String(res, CHARSET); + } else { + src = srcStr.getBytes(CHARSET); + final int len = src.length; + if (len > length) { + return new String(src, 0, length, CHARSET); + } else if (len == length) { + return srcStr; + } else { + res = new byte[length]; + Arrays.fill(res, ZERO); + System.arraycopy(src, 0, res, length - len, len); + return new String(res, CHARSET); + } + } + } catch (final UnsupportedEncodingException e) { + throw new RuntimeException(e); + } + + } + + /** + * 功能描述:通过传入一个列表对象,调用指定方法将列表中的数据生成一个JSON规格指定字符串 + * @param list列表对象 + * @return java.lang.String + */ + public static String listToJson(List list) { + StringBuilder json = new StringBuilder(); + json.append("["); + if (list != null && list.size() > 0) { + for (Object obj : list) { + json.append(objectToJson(obj)); + json.append(","); + } + json.setCharAt(json.length() - 1, ']'); + } else { + json.append("]"); + } + return json.toString(); + } + + /** + * @param object 任意对象 + * @return java.lang.String + */ + public static String objectToJson(Object object) { + StringBuilder json = new StringBuilder(); + if (object == null) { + json.append("\"\""); + } else if (object.getClass().isArray()) { + JSONArray jsonarray = JSONArray.fromObject(object); + json.append("\"").append(jsonarray.toString().replace("\"", """)).append("\""); + } else if (object instanceof Timestamp) { + SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");//定义格式,不显示毫秒 + String str = df.format(object); + json.append("\"").append(str.replace("\"", """)).append("\""); + } else if (boolean.class.isAssignableFrom(object.getClass())) { + Boolean B = new Boolean((boolean)object); + json.append("\"").append(B.toString().replace("\"", """)).append("\""); + } else if (object instanceof String || object instanceof Integer || object instanceof Boolean || object instanceof Long) { + String str=object.toString().replace("\"", """); + str=str.replace("\r\n","
"); + str=str.replace("\n"," "); + json.append("\"").append(str).append("\""); + } else { + json.append(beanToJson(object)); + } + return json.toString(); + } + + /** + * 功能描述:传入任意一个 javabean 对象生成一个指定规格的字符串 + * @param bean bean对象 + * @return String + */ + private static String beanToJson(Object bean) { + StringBuilder json = new StringBuilder(); + json.append("{"); + PropertyDescriptor[] props = null; + try { + props = Introspector.getBeanInfo(bean.getClass(), Object.class) + .getPropertyDescriptors(); + } catch (IntrospectionException e) { + } + if (props != null) { + for (int i = 0; i < props.length; i++) { + try { + String name = objectToJson(props[i].getName()); + String value = objectToJson(props[i].getReadMethod() + .invoke(bean)); + json.append(name); + json.append(":"); + json.append(value); + json.append(","); + } catch (Exception e) { + } + } + json.setCharAt(json.length() - 1, '}'); + } else { + json.append("}"); + } + return json.toString(); + } + +} diff --git a/src/main/java/luckyweb/seagull/util/StringUtility.java b/src/main/java/luckyweb/seagull/util/StringUtility.java index f74f588..9ef4af8 100644 --- a/src/main/java/luckyweb/seagull/util/StringUtility.java +++ b/src/main/java/luckyweb/seagull/util/StringUtility.java @@ -1,977 +1,977 @@ -package luckyweb.seagull.util; - -import java.math.BigDecimal; -import java.text.SimpleDateFormat; -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - - -/** - * @category 字符串的工具类 - * @author chen - * - */ -public class StringUtility { - - private static final String[] EMPTY_STRING_ARRAY = new String[0]; - - - /** - * 判断字符串是否为空 - * - * @param s - * @return 空返回true,反之false - */ - public static boolean isNull(String s) { - return (s == null || s.trim().length() <= 0); - } - - public static String trimToEmpty(String s){ - return isNull(s)?"" : s.trim(); - } - - - public static String leftString(String str, int len) { - try { - if (str != null) { - byte[] b = str.getBytes("GBK"); - if (b.length > len) { - str = new String(b, 0, len, "GBK"); - } - } - } catch (Exception e) { - e.printStackTrace(); - } - return str; - } - - /** - * 填充字符串到定长 str-被处理串,length-总长,fill-填充字符,filllef-左边填充 - */ - public static String fillString(String str, int length, char fill, - boolean fillLeft) { - StringBuffer buffer = new StringBuffer(50); - if (str == null) { - str = ""; - } - int len = str.getBytes().length; - if (fillLeft) { - for (int i = 0; i < length - len; i++) { - buffer.append(fill); - } - buffer.append(str); - } else { - buffer.append(str); - for (int i = 0; i < length - len; i++) { - buffer.append(fill); - } - } - return buffer.toString(); - } - - /** - * 字符串替换。 - * - *
-	 * replace(null, *, *)        = null
-	 * replace("", *, *)          = ""
-	 * replace("aba", null, null) = "aba"
-	 * replace("aba", null, null) = "aba"
-	 * replace("aba", "a", null)  = "aba"
-	 * replace("aba", "a", "")    = "aba"
-	 * replace("aba", "a", "z")   = "zbz"
-	 * replace("aa", "bb", "aa中国a中国a")=”bb中国a中国a”
-	 * replace("aa", "bb", null)=null
-	 * replace("aa", null, "aa中国a中国a")=”aa中国a中国a”
-	 * replace(null, "bb", "aa中国a中国a")=”aa中国a中国a”
-	 * replace("aa", "bb", "")=””
-	 * replace("aa", "bb", " ")=” “
-	 * replace("aa", "bb", "aa中国a中国a")=”bb中国a中国a”
-	 * replace("", "bb", "aa中国a中国a")=”aa中国a中国a”
-	 * replace(" ", "bb", "aa中 国a中 国a")=”aa中bb国a中bb国a”
-	 * replace("aa", "", "aa中国a中国a")=”中国a中国a”
-	 * replace("aa", " ", "aa中国a中国a")=” 中国a中国a”
-	 * replace(null, null, "aa中国a中国a") = “aa中国a中国a”
-	 * 
- * - * @see #replace(String text, String repl, String with, int max) - * @param text - * 需要被替换或查找的字符串,有可能为null. - * @param repl - * 需要被替换的字符串。 - * @param with - * 替换的字符串信息。 - * @return 返回被替换后的字符串信息。 - */ - public static String replace(String repl, String with, String text) { - return replace(repl, with, text, -1); - } - - /** - * 以指定的次数来对字符串进行替换操作。 - * - *
-	 * replace(null, *, *, *)         = null
-	 * replace("", *, *, *)           = ""
-	 * replace("abaa", null, null, 1) = "abaa"
-	 * replace("abaa", null, null, 1) = "abaa"
-	 * replace("abaa", "a", null, 1)  = "abaa"
-	 * replace("abaa", "a", "", 1)    = "abaa"
-	 * replace("abaa", "a", "z", 0)   = "abaa"
-	 * replace("abaa", "a", "z", 1)   = "zbaa"
-	 * replace("abaa", "a", "z", 2)   = "zbza"
-	 * replace("abaa", "a", "z", -1)  = "zbzz"
-	 * 
- * - * @param text - * 需要被替换或查找的字符串,有可能为null. - * @param repl - * 需要被替换的字符串。 - * @param with - * 替换的字符串信息. - * @param max - * 需要被替换的最大次数,如果数值小于0那么将会全部替换。 - * @return 返回被替换后的字符串信息。 - */ - public static String replace(String repl, String with, String text, int max) { - if ((text == null) || (repl == null) || (with == null) - || (repl.length() == 0) || (max == 0)) { - return text; - } - StringBuffer objBuffer = new StringBuffer(text.length()); - int iStart = 0; - int iEnd = 0; - while ((iEnd = text.indexOf(repl, iStart)) != -1) { - objBuffer.append(text.substring(iStart, iEnd)); - objBuffer.append(with); - iStart = iEnd + repl.length(); - if (--max == 0) { - break; - } - } - objBuffer.append(text.substring(iStart)); - return objBuffer.toString(); - } - - /** - *

- * 检查string是否是空白或者string为null. - *

- * - *
-	 * StringUtils.isBlank(null)      = true
-	 * StringUtils.isBlank("")        = true
-	 * StringUtils.isBlank(" ")       = true
-	 * StringUtils.isBlank("bob")     = false
-	 * StringUtils.isBlank("  bob  ") = false
-	 * 
- * - * @param str - * 需要检查的string, 可能为null - * @return true 如果string为null或者string中数据为空白 - * @since 2.0 - */ - public static boolean isBlank(String str) { - int strLen; - if (str == null || (strLen = str.length()) == 0) { - return true; - } - for (int i = 0; i < strLen; i++) { - if ((Character.isWhitespace(str.charAt(i)) == false)) { - return false; - } - } - return true; - } - - /** - *

- * 是否string不为空白,string的长度不为0,string不为null. - *

- * - *
-	 * StringUtils.isNotBlank(null)      = false
-	 * StringUtils.isNotBlank("")        = false
-	 * StringUtils.isNotBlank(" ")       = false
-	 * StringUtils.isNotBlank("bob")     = true
-	 * StringUtils.isNotBlank("  bob  ") = true
-	 * 
- * - * @param str - * 需要检查的string, 可能为null - * @return true 如果string不为null并且 string不为空白,string的长度不为0. - * @since 2.0 - */ - public static boolean isNotBlank(String str) { - int strLen; - if (str == null || (strLen = str.length()) == 0) { - return false; - } - for (int i = 0; i < strLen; i++) { - if ((Character.isWhitespace(str.charAt(i)) == false)) { - return true; - } - } - return false; - } - - // Splitting - // ----------------------------------------------------------------------- - /** - *

- * Splits the provided text into an array, using whitespace as the - * separator. Whitespace is defined by {@link Character#isWhitespace(char)}. - *

- * - *

- * The separator is not included in the returned String array. Adjacent - * separators are treated as one separator. For more control over the split - * use the StrTokenizer class. - *

- * - *

- * A null input String returns null. - *

- * - *
-	 * StringUtils.split(null)       = null
-	 * StringUtils.split("")         = []
-	 * StringUtils.split("abc def")  = ["abc", "def"]
-	 * StringUtils.split("abc  def") = ["abc", "def"]
-	 * StringUtils.split(" abc ")    = ["abc"]
-	 * 
- * - * @param str - * the String to parse, may be null - * @return an array of parsed Strings, null if null String - * input - */ - public static String[] split(String str) { - return split(str, null, -1); - } - - /** - *

- * 根据指定的分割符separator把字符串分割为字符串数组. 也可以选择使用 StringTokenizer. - *

- * - *

- * 分割符separator不作为数组元素中的数据返回. 邻近的多个分割符separators 被认为是一个分割符separator. - *

- * - *

- * 输入的字符串为null返回null. - *

- * - *
-	 * StringUtils.split(null, *)         = null
-	 * StringUtils.split("", *)           = []
-	 * StringUtils.split("a.b.c", '.')    = ["a", "b", "c"]
-	 * StringUtils.split("a..b.c", '.')   = ["a", "b", "c"]
-	 * StringUtils.split("a:b:c", '.')    = ["a:b:c"]
-	 * StringUtils.split("a\tb\nc", null) = ["a", "b", "c"]
-	 * StringUtils.split("a b c", ' ')    = ["a", "b", "c"]
-	 * 
- * - * @param str - * 需要处理的字符串, 可能为null - * @param separatorChar - * 作为分隔符的字符, 如果为null就以whitespace作为分隔符 - * @return 处理后的数组, null如果输入的字符串为null - * @since 2.0 - */ - public static ArrayList split(String str, char separatorChar) { - if (str == null) { - return null; - } - int len = str.length(); - if (len == 0) { - return new ArrayList(); - } - ArrayList list = new ArrayList(); - int i = 0, start = 0; - boolean match = false; - while (i < len) { - if (str.charAt(i) == separatorChar) { - if (match) { - list.add(str.substring(start, i)); - match = false; - } - start = ++i; - continue; - } - match = true; - i++; - } - if (match) { - list.add(str.substring(start, i)); - } - return list; - } - - /** - *

- * Splits the provided text into an array, separator specified. This is an - * alternative to using StringTokenizer. - *

- * - *

- * The separator is not included in the returned String array. Adjacent - * separators are treated as one separator. For more control over the split - * use the StrTokenizer class. - *

- * - *

- * A null input String returns null. - *

- * - *
-	 * StringUtils.split(null, *)         = null
-	 * StringUtils.split("", *)           = []
-	 * StringUtils.split("a.b.c", '.')    = ["a", "b", "c"]
-	 * StringUtils.split("a..b.c", '.')   = ["a", "b", "c"]
-	 * StringUtils.split("a:b:c", '.')    = ["a:b:c"]
-	 * StringUtils.split("a\tb\nc", null) = ["a", "b", "c"]
-	 * StringUtils.split("a b c", ' ')    = ["a", "b", "c"]
-	 * 
- * - * @param str - * the String to parse, may be null - * @param separatorChar - * the character used as the delimiter, null - * splits on whitespace - * @return an array of parsed Strings, null if null String - * input - * @since 2.0 - */ - public static String[] splitByChar(String str, char separatorChar) { - return splitWorker(str, separatorChar, false); - } - - /** - *

- * Splits the provided text into an array, separators specified. This is an - * alternative to using StringTokenizer. - *

- * - *

- * The separator is not included in the returned String array. Adjacent - * separators are treated as one separator. For more control over the split - * use the StrTokenizer class. - *

- * - *

- * A null input String returns null. A - * null separatorChars splits on whitespace. - *

- * - *
-	 * StringUtils.split(null, *)         = null
-	 * StringUtils.split("", *)           = []
-	 * StringUtils.split("abc def", null) = ["abc", "def"]
-	 * StringUtils.split("abc def", " ")  = ["abc", "def"]
-	 * StringUtils.split("abc  def", " ") = ["abc", "def"]
-	 * StringUtils.split("ab:cd:ef", ":") = ["ab", "cd", "ef"]
-	 * 
- * - * @param str - * the String to parse, may be null - * @param separatorChars - * the characters used as the delimiters, null - * splits on whitespace - * @return an array of parsed Strings, null if null String - * input - */ - public static String[] split(String str, String separatorChars) { - return splitWorker(str, separatorChars, -1, false); - } - - /** - *

- * Splits the provided text into an array with a maximum length, separators - * specified. - *

- * - *

- * The separator is not included in the returned String array. Adjacent - * separators are treated as one separator. - *

- * - *

- * A null input String returns null. A - * null separatorChars splits on whitespace. - *

- * - *

- * If more than max delimited substrings are found, the last - * returned string includes all characters after the first - * max - 1 returned strings (including separator characters). - *

- * - *
-	 * StringUtils.split(null, *, *)            = null
-	 * StringUtils.split("", *, *)              = []
-	 * StringUtils.split("ab de fg", null, 0)   = ["ab", "cd", "ef"]
-	 * StringUtils.split("ab   de fg", null, 0) = ["ab", "cd", "ef"]
-	 * StringUtils.split("ab:cd:ef", ":", 0)    = ["ab", "cd", "ef"]
-	 * StringUtils.split("ab:cd:ef", ":", 2)    = ["ab", "cd:ef"]
-	 * 
- * - * @param str - * the String to parse, may be null - * @param separatorChars - * the characters used as the delimiters, null - * splits on whitespace - * @param max - * the maximum number of elements to include in the array. A zero - * or negative value implies no limit - * @return an array of parsed Strings, null if null String - * input - */ - public static String[] split(String str, String separatorChars, int max) { - return splitWorker(str, separatorChars, max, false); - } - - /** - *

- * Splits the provided text into an array, separator string specified. - *

- * - *

- * The separator(s) will not be included in the returned String array. - * Adjacent separators are treated as one separator. - *

- * - *

- * A null input String returns null. A - * null separator splits on whitespace. - *

- * - *
-	 * StringUtils.splitByWholeSeparator(null, *)               = null
-	 * StringUtils.splitByWholeSeparator("", *)                 = []
-	 * StringUtils.splitByWholeSeparator("ab de fg", null)      = ["ab", "de", "fg"]
-	 * StringUtils.splitByWholeSeparator("ab   de fg", null)    = ["ab", "de", "fg"]
-	 * StringUtils.splitByWholeSeparator("ab:cd:ef", ":")       = ["ab", "cd", "ef"]
-	 * StringUtils.splitByWholeSeparator("ab-!-cd-!-ef", "-!-") = ["ab", "cd", "ef"]
-	 * 
- * - * @param str - * the String to parse, may be null - * @param separator - * String containing the String to be used as a delimiter, - * null splits on whitespace - * @return an array of parsed Strings, null if null String - * was input - */ - public static String[] splitByWholeSeparator(String str, String separator) { - return splitByWholeSeparator(str, separator, -1); - } - - /** - *

- * Splits the provided text into an array, separator string specified. - * Returns a maximum of max substrings. - *

- * - *

- * The separator(s) will not be included in the returned String array. - * Adjacent separators are treated as one separator. - *

- * - *

- * A null input String returns null. A - * null separator splits on whitespace. - *

- * - *
-	 * StringUtils.splitByWholeSeparator(null, *, *)               = null
-	 * StringUtils.splitByWholeSeparator("", *, *)                 = []
-	 * StringUtils.splitByWholeSeparator("ab de fg", null, 0)      = ["ab", "de", "fg"]
-	 * StringUtils.splitByWholeSeparator("ab   de fg", null, 0)    = ["ab", "de", "fg"]
-	 * StringUtils.splitByWholeSeparator("ab:cd:ef", ":", 2)       = ["ab", "cd:ef"]
-	 * StringUtils.splitByWholeSeparator("ab-!-cd-!-ef", "-!-", 5) = ["ab", "cd", "ef"]
-	 * StringUtils.splitByWholeSeparator("ab-!-cd-!-ef", "-!-", 2) = ["ab", "cd-!-ef"]
-	 * 
- * - * @param str - * the String to parse, may be null - * @param separator - * String containing the String to be used as a delimiter, - * null splits on whitespace - * @param max - * the maximum number of elements to include in the returned - * array. A zero or negative value implies no limit. - * @return an array of parsed Strings, null if null String - * was input - */ - public static String[] splitByWholeSeparator(String str, String separator, - int max) { - if (str == null) { - return null; - } - - int len = str.length(); - - if (len == 0) { - return EMPTY_STRING_ARRAY; - } - - if ((separator == null) || ("".equals(separator))) { - // Split on whitespace. - return split(str, null, max); - } - - int separatorLength = separator.length(); - - ArrayList substrings = new ArrayList(); - int numberOfSubstrings = 0; - int beg = 0; - int end = 0; - while (end < len) { - end = str.indexOf(separator, beg); - - if (end > -1) { - if (end > beg) { - numberOfSubstrings += 1; - - if (numberOfSubstrings == max) { - end = len; - substrings.add(str.substring(beg)); - } else { - // The following is OK, because String.substring( beg, - // end ) excludes - // the character at the position 'end'. - substrings.add(str.substring(beg, end)); - - // Set the starting point for the next search. - // The following is equivalent to beg = end + - // (separatorLength - 1) + 1, - // which is the right calculation: - beg = end + separatorLength; - } - } else { - // We found a consecutive occurrence of the separator, so - // skip it. - beg = end + separatorLength; - } - } else { - // String.substring( beg ) goes from 'beg' to the end of the - // String. - substrings.add(str.substring(beg)); - end = len; - } - } - - return (String[]) substrings.toArray(new String[substrings.size()]); - } - - // ----------------------------------------------------------------------- - /** - *

- * Splits the provided text into an array, using whitespace as the - * separator, preserving all tokens, including empty tokens created by - * adjacent separators. This is an alternative to using StringTokenizer. - * Whitespace is defined by {@link Character#isWhitespace(char)}. - *

- * - *

- * The separator is not included in the returned String array. Adjacent - * separators are treated as separators for empty tokens. For more control - * over the split use the StrTokenizer class. - *

- * - *

- * A null input String returns null. - *

- * - *
-	 * StringUtils.splitPreserveAllTokens(null)       = null
-	 * StringUtils.splitPreserveAllTokens("")         = []
-	 * StringUtils.splitPreserveAllTokens("abc def")  = ["abc", "def"]
-	 * StringUtils.splitPreserveAllTokens("abc  def") = ["abc", "", "def"]
-	 * StringUtils.splitPreserveAllTokens(" abc ")    = ["", "abc", ""]
-	 * 
- * - * @param str - * the String to parse, may be null - * @return an array of parsed Strings, null if null String - * input - * @since 2.1 - */ - public static String[] splitPreserveAllTokens(String str) { - return splitWorker(str, null, -1, true); - } - - /** - *

- * Splits the provided text into an array, separator specified, preserving - * all tokens, including empty tokens created by adjacent separators. This - * is an alternative to using StringTokenizer. - *

- * - *

- * The separator is not included in the returned String array. Adjacent - * separators are treated as separators for empty tokens. For more control - * over the split use the StrTokenizer class. - *

- * - *

- * A null input String returns null. - *

- * - *
-	 * StringUtils.splitPreserveAllTokens(null, *)         = null
-	 * StringUtils.splitPreserveAllTokens("", *)           = []
-	 * StringUtils.splitPreserveAllTokens("a.b.c", '.')    = ["a", "b", "c"]
-	 * StringUtils.splitPreserveAllTokens("a..b.c", '.')   = ["a", "", "b", "c"]
-	 * StringUtils.splitPreserveAllTokens("a:b:c", '.')    = ["a:b:c"]
-	 * StringUtils.splitPreserveAllTokens("a\tb\nc", null) = ["a", "b", "c"]
-	 * StringUtils.splitPreserveAllTokens("a b c", ' ')    = ["a", "b", "c"]
-	 * StringUtils.splitPreserveAllTokens("a b c ", ' ')   = ["a", "b", "c", ""]
-	 * StringUtils.splitPreserveAllTokens("a b c  ", ' ')   = ["a", "b", "c", "", ""]
-	 * StringUtils.splitPreserveAllTokens(" a b c", ' ')   = ["", a", "b", "c"]
-	 * StringUtils.splitPreserveAllTokens("  a b c", ' ')  = ["", "", a", "b", "c"]
-	 * StringUtils.splitPreserveAllTokens(" a b c ", ' ')  = ["", a", "b", "c", ""]
-	 * 
- * - * @param str - * the String to parse, may be null - * @param separatorChar - * the character used as the delimiter, null - * splits on whitespace - * @return an array of parsed Strings, null if null String - * input - * @since 2.1 - */ - public static String[] splitPreserveAllTokens(String str, char separatorChar) { - return splitWorker(str, separatorChar, true); - } - - /** - * Performs the logic for the split and - * splitPreserveAllTokens methods that do not return a - * maximum array length. - * - * @param str - * the String to parse, may be null - * @param separatorChar - * the separate character - * @param preserveAllTokens - * if true, adjacent separators are treated as - * empty token separators; if false, adjacent - * separators are treated as one separator. - * @return an array of parsed Strings, null if null String - * input - */ - private static String[] splitWorker(String str, char separatorChar, - boolean preserveAllTokens) { - // Performance tuned for 2.0 (JDK1.4) - - if (str == null) { - return null; - } - int len = str.length(); - if (len == 0) { - return EMPTY_STRING_ARRAY; - } - List list = new ArrayList(); - int i = 0, start = 0; - boolean match = false; - boolean lastMatch = false; - while (i < len) { - if (str.charAt(i) == separatorChar) { - if (match || preserveAllTokens) { - list.add(str.substring(start, i)); - match = false; - lastMatch = true; - } - start = ++i; - continue; - } else { - lastMatch = false; - } - match = true; - i++; - } - if (match || (preserveAllTokens && lastMatch)) { - list.add(str.substring(start, i)); - } - return (String[]) list.toArray(new String[list.size()]); - } - - /** - *

- * Splits the provided text into an array, separators specified, preserving - * all tokens, including empty tokens created by adjacent separators. This - * is an alternative to using StringTokenizer. - *

- * - *

- * The separator is not included in the returned String array. Adjacent - * separators are treated as separators for empty tokens. For more control - * over the split use the StrTokenizer class. - *

- * - *

- * A null input String returns null. A - * null separatorChars splits on whitespace. - *

- * - *
-	 * StringUtils.splitPreserveAllTokens(null, *)           = null
-	 * StringUtils.splitPreserveAllTokens("", *)             = []
-	 * StringUtils.splitPreserveAllTokens("abc def", null)   = ["abc", "def"]
-	 * StringUtils.splitPreserveAllTokens("abc def", " ")    = ["abc", "def"]
-	 * StringUtils.splitPreserveAllTokens("abc  def", " ")   = ["abc", "", def"]
-	 * StringUtils.splitPreserveAllTokens("ab:cd:ef", ":")   = ["ab", "cd", "ef"]
-	 * StringUtils.splitPreserveAllTokens("ab:cd:ef:", ":")  = ["ab", "cd", "ef", ""]
-	 * StringUtils.splitPreserveAllTokens("ab:cd:ef::", ":") = ["ab", "cd", "ef", "", ""]
-	 * StringUtils.splitPreserveAllTokens("ab::cd:ef", ":")  = ["ab", "", cd", "ef"]
-	 * StringUtils.splitPreserveAllTokens(":cd:ef", ":")     = ["", cd", "ef"]
-	 * StringUtils.splitPreserveAllTokens("::cd:ef", ":")    = ["", "", cd", "ef"]
-	 * StringUtils.splitPreserveAllTokens(":cd:ef:", ":")    = ["", cd", "ef", ""]
-	 * 
- * - * @param str - * the String to parse, may be null - * @param separatorChars - * the characters used as the delimiters, null - * splits on whitespace - * @return an array of parsed Strings, null if null String - * input - * @since 2.1 - */ - public static String[] splitPreserveAllTokens(String str, - String separatorChars) { - return splitWorker(str, separatorChars, -1, true); - } - - /** - *

- * Splits the provided text into an array with a maximum length, separators - * specified, preserving all tokens, including empty tokens created by - * adjacent separators. - *

- * - *

- * The separator is not included in the returned String array. Adjacent - * separators are treated as separators for empty tokens. Adjacent - * separators are treated as one separator. - *

- * - *

- * A null input String returns null. A - * null separatorChars splits on whitespace. - *

- * - *

- * If more than max delimited substrings are found, the last - * returned string includes all characters after the first - * max - 1 returned strings (including separator characters). - *

- * - *
-	 * StringUtils.splitPreserveAllTokens(null, *, *)            = null
-	 * StringUtils.splitPreserveAllTokens("", *, *)              = []
-	 * StringUtils.splitPreserveAllTokens("ab de fg", null, 0)   = ["ab", "cd", "ef"]
-	 * StringUtils.splitPreserveAllTokens("ab   de fg", null, 0) = ["ab", "cd", "ef"]
-	 * StringUtils.splitPreserveAllTokens("ab:cd:ef", ":", 0)    = ["ab", "cd", "ef"]
-	 * StringUtils.splitPreserveAllTokens("ab:cd:ef", ":", 2)    = ["ab", "cd:ef"]
-	 * StringUtils.splitPreserveAllTokens("ab   de fg", null, 2) = ["ab", "  de fg"]
-	 * StringUtils.splitPreserveAllTokens("ab   de fg", null, 3) = ["ab", "", " de fg"]
-	 * StringUtils.splitPreserveAllTokens("ab   de fg", null, 4) = ["ab", "", "", "de fg"]
-	 * 
- * - * @param str - * the String to parse, may be null - * @param separatorChars - * the characters used as the delimiters, null - * splits on whitespace - * @param max - * the maximum number of elements to include in the array. A zero - * or negative value implies no limit - * @return an array of parsed Strings, null if null String - * input - * @since 2.1 - */ - public static String[] splitPreserveAllTokens(String str, - String separatorChars, int max) { - return splitWorker(str, separatorChars, max, true); - } - - /** - * Performs the logic for the split and - * splitPreserveAllTokens methods that return a maximum array - * length. - * - * @param str - * the String to parse, may be null - * @param separatorChars - * the separate character - * @param max - * the maximum number of elements to include in the array. A zero - * or negative value implies no limit. - * @param preserveAllTokens - * if true, adjacent separators are treated as - * empty token separators; if false, adjacent - * separators are treated as one separator. - * @return an array of parsed Strings, null if null String - * input - */ - private static String[] splitWorker(String str, String separatorChars, - int max, boolean preserveAllTokens) { - // Performance tuned for 2.0 (JDK1.4) - // Direct code is quicker than StringTokenizer. - // Also, StringTokenizer uses isSpace() not isWhitespace() - - if (str == null) { - return null; - } - int len = str.length(); - if (len == 0) { - return EMPTY_STRING_ARRAY; - } - List list = new ArrayList(); - int sizePlus1 = 1; - int i = 0, start = 0; - boolean match = false; - boolean lastMatch = false; - if (separatorChars == null) { - // Null separator means use whitespace - while (i < len) { - if (Character.isWhitespace(str.charAt(i))) { - if (match || preserveAllTokens) { - lastMatch = true; - if (sizePlus1++ == max) { - i = len; - lastMatch = false; - } - list.add(str.substring(start, i)); - match = false; - } - start = ++i; - continue; - } else { - lastMatch = false; - } - match = true; - i++; - } - } else if (separatorChars.length() == 1) { - // Optimise 1 character case - char sep = separatorChars.charAt(0); - while (i < len) { - if (str.charAt(i) == sep) { - if (match || preserveAllTokens) { - lastMatch = true; - if (sizePlus1++ == max) { - i = len; - lastMatch = false; - } - list.add(str.substring(start, i)); - match = false; - } - start = ++i; - continue; - } else { - lastMatch = false; - } - match = true; - i++; - } - } else { - // standard case - while (i < len) { - if (separatorChars.indexOf(str.charAt(i)) >= 0) { - if (match || preserveAllTokens) { - lastMatch = true; - if (sizePlus1++ == max) { - i = len; - lastMatch = false; - } - list.add(str.substring(start, i)); - match = false; - } - start = ++i; - continue; - } else { - lastMatch = false; - } - match = true; - i++; - } - } - if (match || (preserveAllTokens && lastMatch)) { - list.add(str.substring(start, i)); - } - return (String[]) list.toArray(new String[list.size()]); - } - - public static String toHtmlEncode(String str) { - str = str.replaceAll("\\n", "
"); - str = str.replaceAll("&", "&"); - str = str.replaceAll("<", "<"); - str = str.replaceAll(">", ">"); - str = str.replaceAll("\'", "'"); - str = str.replaceAll("\"", """); - str = str.replaceAll("\n", "
"); - str = str.replaceAll(" ", " "); - str = str.replaceAll("\t", "    "); - return str; - } - - public static String toUtf8Encode(String str){ - str=str.replaceAll("&","&"); - str=str.replaceAll("<","<"); - str=str.replaceAll(">",">"); - str=str.replaceAll("'","\'"); - str=str.replaceAll(""","\""); - str=str.replaceAll("
","\n"); - str=str.replaceAll("
","\n"); - str=str.replaceAll(" "," "); - str=str.replaceAll("    ","\t"); - return str; - } - - /** - * 从源字符串(source)中取前len个字符,如果len小于源字符串的长度,则在返回值后加上字符串concat。 - *
-     * String strSource = "a中华人民共和国";
-     * PubFunctions.getFixedLengthString(strSource,10,"...")= "a中华人民共..."
-     * PubFunctions.getFixedLengthString(strSource,10,null)= “a中华人民共”
-     * PubFunctions.getFixedLengthString(strSource,10,"")=”a中华人民共”
-     * PubFunctions.getFixedLengthString(strSource,10," ")=”a中华人民共”
-     * PubFunctions.getFixedLengthString(strSource,-1,"")=””
-     * PubFunctions.getFixedLengthString(strSource,0,"")=””
-     * PubFunctions.getFixedLengthString(strSource,0,null)=””
-     * PubFunctions.getFixedLengthString(strSource,-1,null)=””
-     * 
- * - * @param source 源字符串信息 - * @param len 需要截取的字符个数 - * @param concat 需要填补的字符串 - * @return 返回获取的字符串信息。 - */ - public static String getFixedLengthString(String source, int len, String concat) { - String strRet = ""; - if (source == null || concat == null) { - return ""; - } - if (len <= 0) { - return strRet; - } - for (int i = 1; i <= source.length(); i++) { - strRet = source.substring(0, i); - if (strRet.getBytes().length >= len) { - break; - } - } - if ((source != null) && (strRet != null) - && (strRet.getBytes().length < source.getBytes().length)) { - strRet += concat; - } - return strRet; - } +package luckyweb.seagull.util; + +import java.math.BigDecimal; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + + +/** + * @category 字符串的工具类 + * @author chen + * + */ +public class StringUtility { + + private static final String[] EMPTY_STRING_ARRAY = new String[0]; + + + /** + * 判断字符串是否为空 + * + * @param s + * @return 空返回true,反之false + */ + public static boolean isNull(String s) { + return (s == null || s.trim().length() <= 0); + } + + public static String trimToEmpty(String s){ + return isNull(s)?"" : s.trim(); + } + + + public static String leftString(String str, int len) { + try { + if (str != null) { + byte[] b = str.getBytes("GBK"); + if (b.length > len) { + str = new String(b, 0, len, "GBK"); + } + } + } catch (Exception e) { + e.printStackTrace(); + } + return str; + } + + /** + * 填充字符串到定长 str-被处理串,length-总长,fill-填充字符,filllef-左边填充 + */ + public static String fillString(String str, int length, char fill, + boolean fillLeft) { + StringBuffer buffer = new StringBuffer(50); + if (str == null) { + str = ""; + } + int len = str.getBytes().length; + if (fillLeft) { + for (int i = 0; i < length - len; i++) { + buffer.append(fill); + } + buffer.append(str); + } else { + buffer.append(str); + for (int i = 0; i < length - len; i++) { + buffer.append(fill); + } + } + return buffer.toString(); + } + + /** + * 字符串替换。 + * + *
+	 * replace(null, *, *)        = null
+	 * replace("", *, *)          = ""
+	 * replace("aba", null, null) = "aba"
+	 * replace("aba", null, null) = "aba"
+	 * replace("aba", "a", null)  = "aba"
+	 * replace("aba", "a", "")    = "aba"
+	 * replace("aba", "a", "z")   = "zbz"
+	 * replace("aa", "bb", "aa中国a中国a")=”bb中国a中国a”
+	 * replace("aa", "bb", null)=null
+	 * replace("aa", null, "aa中国a中国a")=”aa中国a中国a”
+	 * replace(null, "bb", "aa中国a中国a")=”aa中国a中国a”
+	 * replace("aa", "bb", "")=””
+	 * replace("aa", "bb", " ")=” “
+	 * replace("aa", "bb", "aa中国a中国a")=”bb中国a中国a”
+	 * replace("", "bb", "aa中国a中国a")=”aa中国a中国a”
+	 * replace(" ", "bb", "aa中 国a中 国a")=”aa中bb国a中bb国a”
+	 * replace("aa", "", "aa中国a中国a")=”中国a中国a”
+	 * replace("aa", " ", "aa中国a中国a")=” 中国a中国a”
+	 * replace(null, null, "aa中国a中国a") = “aa中国a中国a”
+	 * 
+ * + * @see #replace(String text, String repl, String with, int max) + * @param text + * 需要被替换或查找的字符串,有可能为null. + * @param repl + * 需要被替换的字符串。 + * @param with + * 替换的字符串信息。 + * @return 返回被替换后的字符串信息。 + */ + public static String replace(String repl, String with, String text) { + return replace(repl, with, text, -1); + } + + /** + * 以指定的次数来对字符串进行替换操作。 + * + *
+	 * replace(null, *, *, *)         = null
+	 * replace("", *, *, *)           = ""
+	 * replace("abaa", null, null, 1) = "abaa"
+	 * replace("abaa", null, null, 1) = "abaa"
+	 * replace("abaa", "a", null, 1)  = "abaa"
+	 * replace("abaa", "a", "", 1)    = "abaa"
+	 * replace("abaa", "a", "z", 0)   = "abaa"
+	 * replace("abaa", "a", "z", 1)   = "zbaa"
+	 * replace("abaa", "a", "z", 2)   = "zbza"
+	 * replace("abaa", "a", "z", -1)  = "zbzz"
+	 * 
+ * + * @param text + * 需要被替换或查找的字符串,有可能为null. + * @param repl + * 需要被替换的字符串。 + * @param with + * 替换的字符串信息. + * @param max + * 需要被替换的最大次数,如果数值小于0那么将会全部替换。 + * @return 返回被替换后的字符串信息。 + */ + public static String replace(String repl, String with, String text, int max) { + if ((text == null) || (repl == null) || (with == null) + || (repl.length() == 0) || (max == 0)) { + return text; + } + StringBuffer objBuffer = new StringBuffer(text.length()); + int iStart = 0; + int iEnd = 0; + while ((iEnd = text.indexOf(repl, iStart)) != -1) { + objBuffer.append(text.substring(iStart, iEnd)); + objBuffer.append(with); + iStart = iEnd + repl.length(); + if (--max == 0) { + break; + } + } + objBuffer.append(text.substring(iStart)); + return objBuffer.toString(); + } + + /** + *

+ * 检查string是否是空白或者string为null. + *

+ * + *
+	 * StringUtils.isBlank(null)      = true
+	 * StringUtils.isBlank("")        = true
+	 * StringUtils.isBlank(" ")       = true
+	 * StringUtils.isBlank("bob")     = false
+	 * StringUtils.isBlank("  bob  ") = false
+	 * 
+ * + * @param str + * 需要检查的string, 可能为null + * @return true 如果string为null或者string中数据为空白 + * @since 2.0 + */ + public static boolean isBlank(String str) { + int strLen; + if (str == null || (strLen = str.length()) == 0) { + return true; + } + for (int i = 0; i < strLen; i++) { + if ((Character.isWhitespace(str.charAt(i)) == false)) { + return false; + } + } + return true; + } + + /** + *

+ * 是否string不为空白,string的长度不为0,string不为null. + *

+ * + *
+	 * StringUtils.isNotBlank(null)      = false
+	 * StringUtils.isNotBlank("")        = false
+	 * StringUtils.isNotBlank(" ")       = false
+	 * StringUtils.isNotBlank("bob")     = true
+	 * StringUtils.isNotBlank("  bob  ") = true
+	 * 
+ * + * @param str + * 需要检查的string, 可能为null + * @return true 如果string不为null并且 string不为空白,string的长度不为0. + * @since 2.0 + */ + public static boolean isNotBlank(String str) { + int strLen; + if (str == null || (strLen = str.length()) == 0) { + return false; + } + for (int i = 0; i < strLen; i++) { + if ((Character.isWhitespace(str.charAt(i)) == false)) { + return true; + } + } + return false; + } + + // Splitting + // ----------------------------------------------------------------------- + /** + *

+ * Splits the provided text into an array, using whitespace as the + * separator. Whitespace is defined by {@link Character#isWhitespace(char)}. + *

+ * + *

+ * The separator is not included in the returned String array. Adjacent + * separators are treated as one separator. For more control over the split + * use the StrTokenizer class. + *

+ * + *

+ * A null input String returns null. + *

+ * + *
+	 * StringUtils.split(null)       = null
+	 * StringUtils.split("")         = []
+	 * StringUtils.split("abc def")  = ["abc", "def"]
+	 * StringUtils.split("abc  def") = ["abc", "def"]
+	 * StringUtils.split(" abc ")    = ["abc"]
+	 * 
+ * + * @param str + * the String to parse, may be null + * @return an array of parsed Strings, null if null String + * input + */ + public static String[] split(String str) { + return split(str, null, -1); + } + + /** + *

+ * 根据指定的分割符separator把字符串分割为字符串数组. 也可以选择使用 StringTokenizer. + *

+ * + *

+ * 分割符separator不作为数组元素中的数据返回. 邻近的多个分割符separators 被认为是一个分割符separator. + *

+ * + *

+ * 输入的字符串为null返回null. + *

+ * + *
+	 * StringUtils.split(null, *)         = null
+	 * StringUtils.split("", *)           = []
+	 * StringUtils.split("a.b.c", '.')    = ["a", "b", "c"]
+	 * StringUtils.split("a..b.c", '.')   = ["a", "b", "c"]
+	 * StringUtils.split("a:b:c", '.')    = ["a:b:c"]
+	 * StringUtils.split("a\tb\nc", null) = ["a", "b", "c"]
+	 * StringUtils.split("a b c", ' ')    = ["a", "b", "c"]
+	 * 
+ * + * @param str + * 需要处理的字符串, 可能为null + * @param separatorChar + * 作为分隔符的字符, 如果为null就以whitespace作为分隔符 + * @return 处理后的数组, null如果输入的字符串为null + * @since 2.0 + */ + public static ArrayList split(String str, char separatorChar) { + if (str == null) { + return null; + } + int len = str.length(); + if (len == 0) { + return new ArrayList(); + } + ArrayList list = new ArrayList(); + int i = 0, start = 0; + boolean match = false; + while (i < len) { + if (str.charAt(i) == separatorChar) { + if (match) { + list.add(str.substring(start, i)); + match = false; + } + start = ++i; + continue; + } + match = true; + i++; + } + if (match) { + list.add(str.substring(start, i)); + } + return list; + } + + /** + *

+ * Splits the provided text into an array, separator specified. This is an + * alternative to using StringTokenizer. + *

+ * + *

+ * The separator is not included in the returned String array. Adjacent + * separators are treated as one separator. For more control over the split + * use the StrTokenizer class. + *

+ * + *

+ * A null input String returns null. + *

+ * + *
+	 * StringUtils.split(null, *)         = null
+	 * StringUtils.split("", *)           = []
+	 * StringUtils.split("a.b.c", '.')    = ["a", "b", "c"]
+	 * StringUtils.split("a..b.c", '.')   = ["a", "b", "c"]
+	 * StringUtils.split("a:b:c", '.')    = ["a:b:c"]
+	 * StringUtils.split("a\tb\nc", null) = ["a", "b", "c"]
+	 * StringUtils.split("a b c", ' ')    = ["a", "b", "c"]
+	 * 
+ * + * @param str + * the String to parse, may be null + * @param separatorChar + * the character used as the delimiter, null + * splits on whitespace + * @return an array of parsed Strings, null if null String + * input + * @since 2.0 + */ + public static String[] splitByChar(String str, char separatorChar) { + return splitWorker(str, separatorChar, false); + } + + /** + *

+ * Splits the provided text into an array, separators specified. This is an + * alternative to using StringTokenizer. + *

+ * + *

+ * The separator is not included in the returned String array. Adjacent + * separators are treated as one separator. For more control over the split + * use the StrTokenizer class. + *

+ * + *

+ * A null input String returns null. A + * null separatorChars splits on whitespace. + *

+ * + *
+	 * StringUtils.split(null, *)         = null
+	 * StringUtils.split("", *)           = []
+	 * StringUtils.split("abc def", null) = ["abc", "def"]
+	 * StringUtils.split("abc def", " ")  = ["abc", "def"]
+	 * StringUtils.split("abc  def", " ") = ["abc", "def"]
+	 * StringUtils.split("ab:cd:ef", ":") = ["ab", "cd", "ef"]
+	 * 
+ * + * @param str + * the String to parse, may be null + * @param separatorChars + * the characters used as the delimiters, null + * splits on whitespace + * @return an array of parsed Strings, null if null String + * input + */ + public static String[] split(String str, String separatorChars) { + return splitWorker(str, separatorChars, -1, false); + } + + /** + *

+ * Splits the provided text into an array with a maximum length, separators + * specified. + *

+ * + *

+ * The separator is not included in the returned String array. Adjacent + * separators are treated as one separator. + *

+ * + *

+ * A null input String returns null. A + * null separatorChars splits on whitespace. + *

+ * + *

+ * If more than max delimited substrings are found, the last + * returned string includes all characters after the first + * max - 1 returned strings (including separator characters). + *

+ * + *
+	 * StringUtils.split(null, *, *)            = null
+	 * StringUtils.split("", *, *)              = []
+	 * StringUtils.split("ab de fg", null, 0)   = ["ab", "cd", "ef"]
+	 * StringUtils.split("ab   de fg", null, 0) = ["ab", "cd", "ef"]
+	 * StringUtils.split("ab:cd:ef", ":", 0)    = ["ab", "cd", "ef"]
+	 * StringUtils.split("ab:cd:ef", ":", 2)    = ["ab", "cd:ef"]
+	 * 
+ * + * @param str + * the String to parse, may be null + * @param separatorChars + * the characters used as the delimiters, null + * splits on whitespace + * @param max + * the maximum number of elements to include in the array. A zero + * or negative value implies no limit + * @return an array of parsed Strings, null if null String + * input + */ + public static String[] split(String str, String separatorChars, int max) { + return splitWorker(str, separatorChars, max, false); + } + + /** + *

+ * Splits the provided text into an array, separator string specified. + *

+ * + *

+ * The separator(s) will not be included in the returned String array. + * Adjacent separators are treated as one separator. + *

+ * + *

+ * A null input String returns null. A + * null separator splits on whitespace. + *

+ * + *
+	 * StringUtils.splitByWholeSeparator(null, *)               = null
+	 * StringUtils.splitByWholeSeparator("", *)                 = []
+	 * StringUtils.splitByWholeSeparator("ab de fg", null)      = ["ab", "de", "fg"]
+	 * StringUtils.splitByWholeSeparator("ab   de fg", null)    = ["ab", "de", "fg"]
+	 * StringUtils.splitByWholeSeparator("ab:cd:ef", ":")       = ["ab", "cd", "ef"]
+	 * StringUtils.splitByWholeSeparator("ab-!-cd-!-ef", "-!-") = ["ab", "cd", "ef"]
+	 * 
+ * + * @param str + * the String to parse, may be null + * @param separator + * String containing the String to be used as a delimiter, + * null splits on whitespace + * @return an array of parsed Strings, null if null String + * was input + */ + public static String[] splitByWholeSeparator(String str, String separator) { + return splitByWholeSeparator(str, separator, -1); + } + + /** + *

+ * Splits the provided text into an array, separator string specified. + * Returns a maximum of max substrings. + *

+ * + *

+ * The separator(s) will not be included in the returned String array. + * Adjacent separators are treated as one separator. + *

+ * + *

+ * A null input String returns null. A + * null separator splits on whitespace. + *

+ * + *
+	 * StringUtils.splitByWholeSeparator(null, *, *)               = null
+	 * StringUtils.splitByWholeSeparator("", *, *)                 = []
+	 * StringUtils.splitByWholeSeparator("ab de fg", null, 0)      = ["ab", "de", "fg"]
+	 * StringUtils.splitByWholeSeparator("ab   de fg", null, 0)    = ["ab", "de", "fg"]
+	 * StringUtils.splitByWholeSeparator("ab:cd:ef", ":", 2)       = ["ab", "cd:ef"]
+	 * StringUtils.splitByWholeSeparator("ab-!-cd-!-ef", "-!-", 5) = ["ab", "cd", "ef"]
+	 * StringUtils.splitByWholeSeparator("ab-!-cd-!-ef", "-!-", 2) = ["ab", "cd-!-ef"]
+	 * 
+ * + * @param str + * the String to parse, may be null + * @param separator + * String containing the String to be used as a delimiter, + * null splits on whitespace + * @param max + * the maximum number of elements to include in the returned + * array. A zero or negative value implies no limit. + * @return an array of parsed Strings, null if null String + * was input + */ + public static String[] splitByWholeSeparator(String str, String separator, + int max) { + if (str == null) { + return null; + } + + int len = str.length(); + + if (len == 0) { + return EMPTY_STRING_ARRAY; + } + + if ((separator == null) || ("".equals(separator))) { + // Split on whitespace. + return split(str, null, max); + } + + int separatorLength = separator.length(); + + ArrayList substrings = new ArrayList(); + int numberOfSubstrings = 0; + int beg = 0; + int end = 0; + while (end < len) { + end = str.indexOf(separator, beg); + + if (end > -1) { + if (end > beg) { + numberOfSubstrings += 1; + + if (numberOfSubstrings == max) { + end = len; + substrings.add(str.substring(beg)); + } else { + // The following is OK, because String.substring( beg, + // end ) excludes + // the character at the position 'end'. + substrings.add(str.substring(beg, end)); + + // Set the starting point for the next search. + // The following is equivalent to beg = end + + // (separatorLength - 1) + 1, + // which is the right calculation: + beg = end + separatorLength; + } + } else { + // We found a consecutive occurrence of the separator, so + // skip it. + beg = end + separatorLength; + } + } else { + // String.substring( beg ) goes from 'beg' to the end of the + // String. + substrings.add(str.substring(beg)); + end = len; + } + } + + return (String[]) substrings.toArray(new String[substrings.size()]); + } + + // ----------------------------------------------------------------------- + /** + *

+ * Splits the provided text into an array, using whitespace as the + * separator, preserving all tokens, including empty tokens created by + * adjacent separators. This is an alternative to using StringTokenizer. + * Whitespace is defined by {@link Character#isWhitespace(char)}. + *

+ * + *

+ * The separator is not included in the returned String array. Adjacent + * separators are treated as separators for empty tokens. For more control + * over the split use the StrTokenizer class. + *

+ * + *

+ * A null input String returns null. + *

+ * + *
+	 * StringUtils.splitPreserveAllTokens(null)       = null
+	 * StringUtils.splitPreserveAllTokens("")         = []
+	 * StringUtils.splitPreserveAllTokens("abc def")  = ["abc", "def"]
+	 * StringUtils.splitPreserveAllTokens("abc  def") = ["abc", "", "def"]
+	 * StringUtils.splitPreserveAllTokens(" abc ")    = ["", "abc", ""]
+	 * 
+ * + * @param str + * the String to parse, may be null + * @return an array of parsed Strings, null if null String + * input + * @since 2.1 + */ + public static String[] splitPreserveAllTokens(String str) { + return splitWorker(str, null, -1, true); + } + + /** + *

+ * Splits the provided text into an array, separator specified, preserving + * all tokens, including empty tokens created by adjacent separators. This + * is an alternative to using StringTokenizer. + *

+ * + *

+ * The separator is not included in the returned String array. Adjacent + * separators are treated as separators for empty tokens. For more control + * over the split use the StrTokenizer class. + *

+ * + *

+ * A null input String returns null. + *

+ * + *
+	 * StringUtils.splitPreserveAllTokens(null, *)         = null
+	 * StringUtils.splitPreserveAllTokens("", *)           = []
+	 * StringUtils.splitPreserveAllTokens("a.b.c", '.')    = ["a", "b", "c"]
+	 * StringUtils.splitPreserveAllTokens("a..b.c", '.')   = ["a", "", "b", "c"]
+	 * StringUtils.splitPreserveAllTokens("a:b:c", '.')    = ["a:b:c"]
+	 * StringUtils.splitPreserveAllTokens("a\tb\nc", null) = ["a", "b", "c"]
+	 * StringUtils.splitPreserveAllTokens("a b c", ' ')    = ["a", "b", "c"]
+	 * StringUtils.splitPreserveAllTokens("a b c ", ' ')   = ["a", "b", "c", ""]
+	 * StringUtils.splitPreserveAllTokens("a b c  ", ' ')   = ["a", "b", "c", "", ""]
+	 * StringUtils.splitPreserveAllTokens(" a b c", ' ')   = ["", a", "b", "c"]
+	 * StringUtils.splitPreserveAllTokens("  a b c", ' ')  = ["", "", a", "b", "c"]
+	 * StringUtils.splitPreserveAllTokens(" a b c ", ' ')  = ["", a", "b", "c", ""]
+	 * 
+ * + * @param str + * the String to parse, may be null + * @param separatorChar + * the character used as the delimiter, null + * splits on whitespace + * @return an array of parsed Strings, null if null String + * input + * @since 2.1 + */ + public static String[] splitPreserveAllTokens(String str, char separatorChar) { + return splitWorker(str, separatorChar, true); + } + + /** + * Performs the logic for the split and + * splitPreserveAllTokens methods that do not return a + * maximum array length. + * + * @param str + * the String to parse, may be null + * @param separatorChar + * the separate character + * @param preserveAllTokens + * if true, adjacent separators are treated as + * empty token separators; if false, adjacent + * separators are treated as one separator. + * @return an array of parsed Strings, null if null String + * input + */ + private static String[] splitWorker(String str, char separatorChar, + boolean preserveAllTokens) { + // Performance tuned for 2.0 (JDK1.4) + + if (str == null) { + return null; + } + int len = str.length(); + if (len == 0) { + return EMPTY_STRING_ARRAY; + } + List list = new ArrayList(); + int i = 0, start = 0; + boolean match = false; + boolean lastMatch = false; + while (i < len) { + if (str.charAt(i) == separatorChar) { + if (match || preserveAllTokens) { + list.add(str.substring(start, i)); + match = false; + lastMatch = true; + } + start = ++i; + continue; + } else { + lastMatch = false; + } + match = true; + i++; + } + if (match || (preserveAllTokens && lastMatch)) { + list.add(str.substring(start, i)); + } + return (String[]) list.toArray(new String[list.size()]); + } + + /** + *

+ * Splits the provided text into an array, separators specified, preserving + * all tokens, including empty tokens created by adjacent separators. This + * is an alternative to using StringTokenizer. + *

+ * + *

+ * The separator is not included in the returned String array. Adjacent + * separators are treated as separators for empty tokens. For more control + * over the split use the StrTokenizer class. + *

+ * + *

+ * A null input String returns null. A + * null separatorChars splits on whitespace. + *

+ * + *
+	 * StringUtils.splitPreserveAllTokens(null, *)           = null
+	 * StringUtils.splitPreserveAllTokens("", *)             = []
+	 * StringUtils.splitPreserveAllTokens("abc def", null)   = ["abc", "def"]
+	 * StringUtils.splitPreserveAllTokens("abc def", " ")    = ["abc", "def"]
+	 * StringUtils.splitPreserveAllTokens("abc  def", " ")   = ["abc", "", def"]
+	 * StringUtils.splitPreserveAllTokens("ab:cd:ef", ":")   = ["ab", "cd", "ef"]
+	 * StringUtils.splitPreserveAllTokens("ab:cd:ef:", ":")  = ["ab", "cd", "ef", ""]
+	 * StringUtils.splitPreserveAllTokens("ab:cd:ef::", ":") = ["ab", "cd", "ef", "", ""]
+	 * StringUtils.splitPreserveAllTokens("ab::cd:ef", ":")  = ["ab", "", cd", "ef"]
+	 * StringUtils.splitPreserveAllTokens(":cd:ef", ":")     = ["", cd", "ef"]
+	 * StringUtils.splitPreserveAllTokens("::cd:ef", ":")    = ["", "", cd", "ef"]
+	 * StringUtils.splitPreserveAllTokens(":cd:ef:", ":")    = ["", cd", "ef", ""]
+	 * 
+ * + * @param str + * the String to parse, may be null + * @param separatorChars + * the characters used as the delimiters, null + * splits on whitespace + * @return an array of parsed Strings, null if null String + * input + * @since 2.1 + */ + public static String[] splitPreserveAllTokens(String str, + String separatorChars) { + return splitWorker(str, separatorChars, -1, true); + } + + /** + *

+ * Splits the provided text into an array with a maximum length, separators + * specified, preserving all tokens, including empty tokens created by + * adjacent separators. + *

+ * + *

+ * The separator is not included in the returned String array. Adjacent + * separators are treated as separators for empty tokens. Adjacent + * separators are treated as one separator. + *

+ * + *

+ * A null input String returns null. A + * null separatorChars splits on whitespace. + *

+ * + *

+ * If more than max delimited substrings are found, the last + * returned string includes all characters after the first + * max - 1 returned strings (including separator characters). + *

+ * + *
+	 * StringUtils.splitPreserveAllTokens(null, *, *)            = null
+	 * StringUtils.splitPreserveAllTokens("", *, *)              = []
+	 * StringUtils.splitPreserveAllTokens("ab de fg", null, 0)   = ["ab", "cd", "ef"]
+	 * StringUtils.splitPreserveAllTokens("ab   de fg", null, 0) = ["ab", "cd", "ef"]
+	 * StringUtils.splitPreserveAllTokens("ab:cd:ef", ":", 0)    = ["ab", "cd", "ef"]
+	 * StringUtils.splitPreserveAllTokens("ab:cd:ef", ":", 2)    = ["ab", "cd:ef"]
+	 * StringUtils.splitPreserveAllTokens("ab   de fg", null, 2) = ["ab", "  de fg"]
+	 * StringUtils.splitPreserveAllTokens("ab   de fg", null, 3) = ["ab", "", " de fg"]
+	 * StringUtils.splitPreserveAllTokens("ab   de fg", null, 4) = ["ab", "", "", "de fg"]
+	 * 
+ * + * @param str + * the String to parse, may be null + * @param separatorChars + * the characters used as the delimiters, null + * splits on whitespace + * @param max + * the maximum number of elements to include in the array. A zero + * or negative value implies no limit + * @return an array of parsed Strings, null if null String + * input + * @since 2.1 + */ + public static String[] splitPreserveAllTokens(String str, + String separatorChars, int max) { + return splitWorker(str, separatorChars, max, true); + } + + /** + * Performs the logic for the split and + * splitPreserveAllTokens methods that return a maximum array + * length. + * + * @param str + * the String to parse, may be null + * @param separatorChars + * the separate character + * @param max + * the maximum number of elements to include in the array. A zero + * or negative value implies no limit. + * @param preserveAllTokens + * if true, adjacent separators are treated as + * empty token separators; if false, adjacent + * separators are treated as one separator. + * @return an array of parsed Strings, null if null String + * input + */ + private static String[] splitWorker(String str, String separatorChars, + int max, boolean preserveAllTokens) { + // Performance tuned for 2.0 (JDK1.4) + // Direct code is quicker than StringTokenizer. + // Also, StringTokenizer uses isSpace() not isWhitespace() + + if (str == null) { + return null; + } + int len = str.length(); + if (len == 0) { + return EMPTY_STRING_ARRAY; + } + List list = new ArrayList(); + int sizePlus1 = 1; + int i = 0, start = 0; + boolean match = false; + boolean lastMatch = false; + if (separatorChars == null) { + // Null separator means use whitespace + while (i < len) { + if (Character.isWhitespace(str.charAt(i))) { + if (match || preserveAllTokens) { + lastMatch = true; + if (sizePlus1++ == max) { + i = len; + lastMatch = false; + } + list.add(str.substring(start, i)); + match = false; + } + start = ++i; + continue; + } else { + lastMatch = false; + } + match = true; + i++; + } + } else if (separatorChars.length() == 1) { + // Optimise 1 character case + char sep = separatorChars.charAt(0); + while (i < len) { + if (str.charAt(i) == sep) { + if (match || preserveAllTokens) { + lastMatch = true; + if (sizePlus1++ == max) { + i = len; + lastMatch = false; + } + list.add(str.substring(start, i)); + match = false; + } + start = ++i; + continue; + } else { + lastMatch = false; + } + match = true; + i++; + } + } else { + // standard case + while (i < len) { + if (separatorChars.indexOf(str.charAt(i)) >= 0) { + if (match || preserveAllTokens) { + lastMatch = true; + if (sizePlus1++ == max) { + i = len; + lastMatch = false; + } + list.add(str.substring(start, i)); + match = false; + } + start = ++i; + continue; + } else { + lastMatch = false; + } + match = true; + i++; + } + } + if (match || (preserveAllTokens && lastMatch)) { + list.add(str.substring(start, i)); + } + return (String[]) list.toArray(new String[list.size()]); + } + + public static String toHtmlEncode(String str) { + str = str.replaceAll("\\n", "
"); + str = str.replaceAll("&", "&"); + str = str.replaceAll("<", "<"); + str = str.replaceAll(">", ">"); + str = str.replaceAll("\'", "'"); + str = str.replaceAll("\"", """); + str = str.replaceAll("\n", "
"); + str = str.replaceAll(" ", " "); + str = str.replaceAll("\t", "    "); + return str; + } + + public static String toUtf8Encode(String str){ + str=str.replaceAll("&","&"); + str=str.replaceAll("<","<"); + str=str.replaceAll(">",">"); + str=str.replaceAll("'","\'"); + str=str.replaceAll(""","\""); + str=str.replaceAll("
","\n"); + str=str.replaceAll("
","\n"); + str=str.replaceAll(" "," "); + str=str.replaceAll("    ","\t"); + return str; + } + + /** + * 从源字符串(source)中取前len个字符,如果len小于源字符串的长度,则在返回值后加上字符串concat。 + *
+     * String strSource = "a中华人民共和国";
+     * PubFunctions.getFixedLengthString(strSource,10,"...")= "a中华人民共..."
+     * PubFunctions.getFixedLengthString(strSource,10,null)= “a中华人民共”
+     * PubFunctions.getFixedLengthString(strSource,10,"")=”a中华人民共”
+     * PubFunctions.getFixedLengthString(strSource,10," ")=”a中华人民共”
+     * PubFunctions.getFixedLengthString(strSource,-1,"")=””
+     * PubFunctions.getFixedLengthString(strSource,0,"")=””
+     * PubFunctions.getFixedLengthString(strSource,0,null)=””
+     * PubFunctions.getFixedLengthString(strSource,-1,null)=””
+     * 
+ * + * @param source 源字符串信息 + * @param len 需要截取的字符个数 + * @param concat 需要填补的字符串 + * @return 返回获取的字符串信息。 + */ + public static String getFixedLengthString(String source, int len, String concat) { + String strRet = ""; + if (source == null || concat == null) { + return ""; + } + if (len <= 0) { + return strRet; + } + for (int i = 1; i <= source.length(); i++) { + strRet = source.substring(0, i); + if (strRet.getBytes().length >= len) { + break; + } + } + if ((source != null) && (strRet != null) + && (strRet.getBytes().length < source.getBytes().length)) { + strRet += concat; + } + return strRet; + } } \ No newline at end of file diff --git a/src/main/java/luckyweb/seagull/util/TestJobsException.java b/src/main/java/luckyweb/seagull/util/TestJobsException.java index 5ca4e7f..e1a6648 100644 --- a/src/main/java/luckyweb/seagull/util/TestJobsException.java +++ b/src/main/java/luckyweb/seagull/util/TestJobsException.java @@ -1,32 +1,32 @@ -package luckyweb.seagull.util; - -public class TestJobsException extends RuntimeException{ - - /** - * - */ - private static final long serialVersionUID = 1L; - - public TestJobsException() { - super(); - } - - public TestJobsException(String message, Throwable cause, - boolean enableSuppression, boolean writableStackTrace) { - super(message, cause, enableSuppression, writableStackTrace); - } - - public TestJobsException(String message, Throwable cause) { - super(message, cause); - } - - public TestJobsException(String message) { - super(message); - } - - public TestJobsException(Throwable cause) { - super(cause); - } - - -} +package luckyweb.seagull.util; + +public class TestJobsException extends RuntimeException{ + + /** + * + */ + private static final long serialVersionUID = 1L; + + public TestJobsException() { + super(); + } + + public TestJobsException(String message, Throwable cause, + boolean enableSuppression, boolean writableStackTrace) { + super(message, cause, enableSuppression, writableStackTrace); + } + + public TestJobsException(String message, Throwable cause) { + super(message, cause); + } + + public TestJobsException(String message) { + super(message); + } + + public TestJobsException(Throwable cause) { + super(cause); + } + + +} diff --git a/src/main/java/rmi/model/RunBatchCaseEntity.java b/src/main/java/rmi/model/RunBatchCaseEntity.java index 6bd9e9a..ed23b5f 100644 --- a/src/main/java/rmi/model/RunBatchCaseEntity.java +++ b/src/main/java/rmi/model/RunBatchCaseEntity.java @@ -1,34 +1,34 @@ -package rmi.model; - -import java.io.Serializable; - -//注意对象必须继承Serializable -public class RunBatchCaseEntity implements Serializable { - /** - * - */ - private static final long serialVersionUID = 1L; - private String projectname; - private String taskid; - private String batchcase; - - public String getProjectname() { - return projectname; - } - public void setProjectname(String projectname) { - this.projectname = projectname; - } - public String getTaskid() { - return taskid; - } - public void setTaskid(String taskid) { - this.taskid = taskid; - } - public String getBatchcase() { - return batchcase; - } - public void setBatchcase(String batchcase) { - this.batchcase = batchcase; - } - -} +package rmi.model; + +import java.io.Serializable; + +//注意对象必须继承Serializable +public class RunBatchCaseEntity implements Serializable { + /** + * + */ + private static final long serialVersionUID = 1L; + private String projectname; + private String taskid; + private String batchcase; + + public String getProjectname() { + return projectname; + } + public void setProjectname(String projectname) { + this.projectname = projectname; + } + public String getTaskid() { + return taskid; + } + public void setTaskid(String taskid) { + this.taskid = taskid; + } + public String getBatchcase() { + return batchcase; + } + public void setBatchcase(String batchcase) { + this.batchcase = batchcase; + } + +} diff --git a/src/main/java/rmi/model/RunCaseEntity.java b/src/main/java/rmi/model/RunCaseEntity.java index f3f42fb..c8aa09f 100644 --- a/src/main/java/rmi/model/RunCaseEntity.java +++ b/src/main/java/rmi/model/RunCaseEntity.java @@ -1,41 +1,41 @@ -package rmi.model; - -import java.io.Serializable; - -//注意对象必须继承Serializable -public class RunCaseEntity implements Serializable { - /** - * - */ - private static final long serialVersionUID = 1L; - private String projectname; - private String taskid; - private String testCaseExternalId; - private String version; - - public String getProjectname() { - return projectname; - } - public void setProjectname(String projectname) { - this.projectname = projectname; - } - public String getTaskid() { - return taskid; - } - public void setTaskid(String taskid) { - this.taskid = taskid; - } - public String getTestCaseExternalId() { - return testCaseExternalId; - } - public void setTestCaseExternalId(String testCaseExternalId) { - this.testCaseExternalId = testCaseExternalId; - } - public String getVersion() { - return version; - } - public void setVersion(String version) { - this.version = version; - } - -} +package rmi.model; + +import java.io.Serializable; + +//注意对象必须继承Serializable +public class RunCaseEntity implements Serializable { + /** + * + */ + private static final long serialVersionUID = 1L; + private String projectname; + private String taskid; + private String testCaseExternalId; + private String version; + + public String getProjectname() { + return projectname; + } + public void setProjectname(String projectname) { + this.projectname = projectname; + } + public String getTaskid() { + return taskid; + } + public void setTaskid(String taskid) { + this.taskid = taskid; + } + public String getTestCaseExternalId() { + return testCaseExternalId; + } + public void setTestCaseExternalId(String testCaseExternalId) { + this.testCaseExternalId = testCaseExternalId; + } + public String getVersion() { + return version; + } + public void setVersion(String version) { + this.version = version; + } + +} diff --git a/src/main/java/rmi/model/RunTaskEntity.java b/src/main/java/rmi/model/RunTaskEntity.java index a1ed385..7c9346f 100644 --- a/src/main/java/rmi/model/RunTaskEntity.java +++ b/src/main/java/rmi/model/RunTaskEntity.java @@ -1,27 +1,27 @@ -package rmi.model; - -import java.io.Serializable; - -//注意对象必须继承Serializable -public class RunTaskEntity implements Serializable { - /** - * - */ - private static final long serialVersionUID = 1L; - private String projectname; - private String taskid; - - public String getProjectname() { - return projectname; - } - public void setProjectname(String projectname) { - this.projectname = projectname; - } - public String getTaskid() { - return taskid; - } - public void setTaskid(String taskid) { - this.taskid = taskid; - } - -} +package rmi.model; + +import java.io.Serializable; + +//注意对象必须继承Serializable +public class RunTaskEntity implements Serializable { + /** + * + */ + private static final long serialVersionUID = 1L; + private String projectname; + private String taskid; + + public String getProjectname() { + return projectname; + } + public void setProjectname(String projectname) { + this.projectname = projectname; + } + public String getTaskid() { + return taskid; + } + public void setTaskid(String taskid) { + this.taskid = taskid; + } + +} diff --git a/src/main/java/rmi/service/RunService.java b/src/main/java/rmi/service/RunService.java index ca8c5a4..0501441 100644 --- a/src/main/java/rmi/service/RunService.java +++ b/src/main/java/rmi/service/RunService.java @@ -1,20 +1,20 @@ -package rmi.service; - -import java.rmi.Remote; -import java.rmi.RemoteException; - -import rmi.model.RunBatchCaseEntity; -import rmi.model.RunCaseEntity; -import rmi.model.RunTaskEntity; - -//此为远程对象调用的接口,必须继承Remote类 -public interface RunService extends Remote { - public String runtask(RunTaskEntity task,String loadpath) throws RemoteException; - public String runcase(RunCaseEntity onecase,String loadpath) throws RemoteException; - public String runbatchcase(RunBatchCaseEntity batchcase,String loadpath) throws RemoteException; - public String getlogdetail(String storeName) throws RemoteException; - public byte[] getlogimg(String imgName) throws RemoteException; - public String uploadjar(byte[] fileContent,String name,String loadpath) throws RemoteException; - public String webdebugcase(String sign,String executor,String loadpath) throws RemoteException; - public String getClientStatus() throws RemoteException; -} +package rmi.service; + +import java.rmi.Remote; +import java.rmi.RemoteException; + +import rmi.model.RunBatchCaseEntity; +import rmi.model.RunCaseEntity; +import rmi.model.RunTaskEntity; + +//此为远程对象调用的接口,必须继承Remote类 +public interface RunService extends Remote { + public String runtask(RunTaskEntity task,String loadpath) throws RemoteException; + public String runcase(RunCaseEntity onecase,String loadpath) throws RemoteException; + public String runbatchcase(RunBatchCaseEntity batchcase,String loadpath) throws RemoteException; + public String getlogdetail(String storeName) throws RemoteException; + public byte[] getlogimg(String imgName) throws RemoteException; + public String uploadjar(byte[] fileContent,String name,String loadpath) throws RemoteException; + public String webdebugcase(String sign,String executor,String loadpath) throws RemoteException; + public String getClientStatus() throws RemoteException; +} diff --git a/src/main/resources/Accident.hbm.xml b/src/main/resources/Accident.hbm.xml index e5c0a1d..15ee17c 100644 --- a/src/main/resources/Accident.hbm.xml +++ b/src/main/resources/Accident.hbm.xml @@ -1,73 +1,73 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/main/resources/FlowCheck.hbm.xml b/src/main/resources/FlowCheck.hbm.xml index 388b516..580d82c 100644 --- a/src/main/resources/FlowCheck.hbm.xml +++ b/src/main/resources/FlowCheck.hbm.xml @@ -1,49 +1,49 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/main/resources/FlowInfo.hbm.xml b/src/main/resources/FlowInfo.hbm.xml index 754a03d..e3e5ab1 100644 --- a/src/main/resources/FlowInfo.hbm.xml +++ b/src/main/resources/FlowInfo.hbm.xml @@ -1,33 +1,33 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/main/resources/OperationLog.hbm.xml b/src/main/resources/OperationLog.hbm.xml index 50ceec2..ff22aef 100644 --- a/src/main/resources/OperationLog.hbm.xml +++ b/src/main/resources/OperationLog.hbm.xml @@ -1,30 +1,30 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/main/resources/PlanFlowCheck.hbm.xml b/src/main/resources/PlanFlowCheck.hbm.xml index a88a254..34d672e 100644 --- a/src/main/resources/PlanFlowCheck.hbm.xml +++ b/src/main/resources/PlanFlowCheck.hbm.xml @@ -1,28 +1,28 @@ - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/main/resources/ProjectCase.hbm.xml b/src/main/resources/ProjectCase.hbm.xml index 43bcaff..173a9a7 100644 --- a/src/main/resources/ProjectCase.hbm.xml +++ b/src/main/resources/ProjectCase.hbm.xml @@ -1,40 +1,40 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/main/resources/ProjectCasesteps.hbm.xml b/src/main/resources/ProjectCasesteps.hbm.xml index 8641e2b..cea6f6f 100644 --- a/src/main/resources/ProjectCasesteps.hbm.xml +++ b/src/main/resources/ProjectCasesteps.hbm.xml @@ -1,49 +1,49 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/main/resources/ProjectModule.hbm.xml b/src/main/resources/ProjectModule.hbm.xml index 7a42a5c..aa8e41d 100644 --- a/src/main/resources/ProjectModule.hbm.xml +++ b/src/main/resources/ProjectModule.hbm.xml @@ -1,22 +1,22 @@ - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/main/resources/ProjectPlan.hbm.xml b/src/main/resources/ProjectPlan.hbm.xml index 21a2fc5..51ffce1 100644 --- a/src/main/resources/ProjectPlan.hbm.xml +++ b/src/main/resources/ProjectPlan.hbm.xml @@ -1,31 +1,31 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/main/resources/ProjectPlanCase.hbm.xml b/src/main/resources/ProjectPlanCase.hbm.xml index c70921c..457dbe6 100644 --- a/src/main/resources/ProjectPlanCase.hbm.xml +++ b/src/main/resources/ProjectPlanCase.hbm.xml @@ -1,22 +1,22 @@ - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/main/resources/ProjectProtocolTemplate.hbm.xml b/src/main/resources/ProjectProtocolTemplate.hbm.xml index c3ec4fe..9059735 100644 --- a/src/main/resources/ProjectProtocolTemplate.hbm.xml +++ b/src/main/resources/ProjectProtocolTemplate.hbm.xml @@ -1,36 +1,36 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/main/resources/ProjectTemplateParams.hbm.xml b/src/main/resources/ProjectTemplateParams.hbm.xml index 0cb254e..26535b3 100644 --- a/src/main/resources/ProjectTemplateParams.hbm.xml +++ b/src/main/resources/ProjectTemplateParams.hbm.xml @@ -1,21 +1,21 @@ - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/main/resources/ProjectVersion.hbm.xml b/src/main/resources/ProjectVersion.hbm.xml index 42af1eb..ec91a9a 100644 --- a/src/main/resources/ProjectVersion.hbm.xml +++ b/src/main/resources/ProjectVersion.hbm.xml @@ -1,145 +1,145 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/main/resources/Review.hbm.xml b/src/main/resources/Review.hbm.xml index 2a0b402..d714cca 100644 --- a/src/main/resources/Review.hbm.xml +++ b/src/main/resources/Review.hbm.xml @@ -1,46 +1,46 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/main/resources/ReviewInfo.hbm.xml b/src/main/resources/ReviewInfo.hbm.xml index 482c666..6ba10c4 100644 --- a/src/main/resources/ReviewInfo.hbm.xml +++ b/src/main/resources/ReviewInfo.hbm.xml @@ -1,31 +1,31 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/main/resources/SecondarySector.hbm.xml b/src/main/resources/SecondarySector.hbm.xml index fb40bc0..32a3cd3 100644 --- a/src/main/resources/SecondarySector.hbm.xml +++ b/src/main/resources/SecondarySector.hbm.xml @@ -1,19 +1,19 @@ - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/main/resources/SectorProjects.hbm.xml b/src/main/resources/SectorProjects.hbm.xml index 9a6e1fd..1e5fce1 100644 --- a/src/main/resources/SectorProjects.hbm.xml +++ b/src/main/resources/SectorProjects.hbm.xml @@ -1,28 +1,28 @@ - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/main/resources/TempCasestepDebug.hbm.xml b/src/main/resources/TempCasestepDebug.hbm.xml index 7b355a6..16a30b1 100644 --- a/src/main/resources/TempCasestepDebug.hbm.xml +++ b/src/main/resources/TempCasestepDebug.hbm.xml @@ -1,24 +1,24 @@ - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/main/resources/TestCasedetail.hbm.xml b/src/main/resources/TestCasedetail.hbm.xml index c1bd2f0..093d52a 100644 --- a/src/main/resources/TestCasedetail.hbm.xml +++ b/src/main/resources/TestCasedetail.hbm.xml @@ -1,30 +1,30 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/resources/TestClient.hbm.xml b/src/main/resources/TestClient.hbm.xml index 7fa1d92..538aaf7 100644 --- a/src/main/resources/TestClient.hbm.xml +++ b/src/main/resources/TestClient.hbm.xml @@ -1,33 +1,33 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/main/resources/TestJobs.hbm.xml b/src/main/resources/TestJobs.hbm.xml index 68103c5..79a2ab0 100644 --- a/src/main/resources/TestJobs.hbm.xml +++ b/src/main/resources/TestJobs.hbm.xml @@ -1,108 +1,108 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/resources/TestLogdetail.hbm.xml b/src/main/resources/TestLogdetail.hbm.xml index a45ecd5..974063b 100644 --- a/src/main/resources/TestLogdetail.hbm.xml +++ b/src/main/resources/TestLogdetail.hbm.xml @@ -1,38 +1,38 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/resources/TestTaskexcute.hbm.xml b/src/main/resources/TestTaskexcute.hbm.xml index ba8993c..a3c6334 100644 --- a/src/main/resources/TestTaskexcute.hbm.xml +++ b/src/main/resources/TestTaskexcute.hbm.xml @@ -1,45 +1,45 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/resources/UserAuthority.hbm.xml b/src/main/resources/UserAuthority.hbm.xml index daeaa36..0d14d57 100644 --- a/src/main/resources/UserAuthority.hbm.xml +++ b/src/main/resources/UserAuthority.hbm.xml @@ -1,21 +1,21 @@ - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/main/resources/UserInfo.hbm.xml b/src/main/resources/UserInfo.hbm.xml index 6b8357b..f3801b0 100644 --- a/src/main/resources/UserInfo.hbm.xml +++ b/src/main/resources/UserInfo.hbm.xml @@ -1,30 +1,30 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/main/resources/UserRole.hbm.xml b/src/main/resources/UserRole.hbm.xml index da15c8a..ecaee32 100644 --- a/src/main/resources/UserRole.hbm.xml +++ b/src/main/resources/UserRole.hbm.xml @@ -1,21 +1,21 @@ - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/main/resources/ZtTask.hbm.xml b/src/main/resources/ZtTask.hbm.xml index f921f07..764a0cb 100644 --- a/src/main/resources/ZtTask.hbm.xml +++ b/src/main/resources/ZtTask.hbm.xml @@ -1,41 +1,41 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/main/resources/applicationContext.xml b/src/main/resources/applicationContext.xml index 20b0599..9b69e25 100644 --- a/src/main/resources/applicationContext.xml +++ b/src/main/resources/applicationContext.xml @@ -1,59 +1,59 @@ - - - - - - - - - - classpath:hibernate.cfg.xml - - - - - - - - - - - - - - - - - - - - text/html;charset=UTF-8 - - - - - - - - - + + + + + + + + + + classpath:hibernate.cfg.xml + + + + + + + + + + + + + + + + + + + + text/html;charset=UTF-8 + + + + + + + + + \ No newline at end of file diff --git a/src/main/resources/hibernate.cfg.xml b/src/main/resources/hibernate.cfg.xml deleted file mode 100644 index 1fbf1fd..0000000 --- a/src/main/resources/hibernate.cfg.xml +++ /dev/null @@ -1,74 +0,0 @@ - - - - - - - com.mysql.cj.jdbc.Driver - - jdbc:mysql://XX.XX.XX.XX:3306/luckyframedb?useUnicode=true&characterEncoding=utf8&useSSL=false - true - utf-8 - - luckyframe - - luckyframe - - org.hibernate.connection.C3P0ConnectionProvider - - 50 - - 50 - - 10 - - 1800 - - 20 - 30 - 10 - true - SELECT 1 - true - false - true - - org.hibernate.dialect.MySQLInnoDBDialect - - update - - true - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/main/resources/log4j.xml b/src/main/resources/log4j.xml index b35e05c..01ca3e4 100644 --- a/src/main/resources/log4j.xml +++ b/src/main/resources/log4j.xml @@ -1,58 +1,58 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/main/webapp/META-INF/MANIFEST.MF b/src/main/webapp/META-INF/MANIFEST.MF index 5e94951..254272e 100644 --- a/src/main/webapp/META-INF/MANIFEST.MF +++ b/src/main/webapp/META-INF/MANIFEST.MF @@ -1,3 +1,3 @@ -Manifest-Version: 1.0 -Class-Path: - +Manifest-Version: 1.0 +Class-Path: + diff --git a/src/main/webapp/WEB-INF/web.xml b/src/main/webapp/WEB-INF/web.xml index 0dc0ffb..9211c6b 100644 --- a/src/main/webapp/WEB-INF/web.xml +++ b/src/main/webapp/WEB-INF/web.xml @@ -1,72 +1,72 @@ - - - - default - *.css - - - default - *.gif - - - default - *.jpg - - - default - *.js - - - default - *.png - - - default - *.html - - - default - *.htm - - - default - *.conf - - - CharacterEncodingFilter - org.springframework.web.filter.CharacterEncodingFilter - - encoding - UTF-8 - - - - CharacterEncodingFilter - /* - - - Dispatcher - org.springframework.web.servlet.DispatcherServlet - - contextConfigLocation - classpath:applicationContext.xml - - - - Dispatcher - / - - - luckyweb.seagull.comm.QueueListener - - - log4jConfigLocation - classpath:log4j.xml - - - org.springframework.web.util.Log4jConfigListener - - - index.jsp - + + + + default + *.css + + + default + *.gif + + + default + *.jpg + + + default + *.js + + + default + *.png + + + default + *.html + + + default + *.htm + + + default + *.conf + + + CharacterEncodingFilter + org.springframework.web.filter.CharacterEncodingFilter + + encoding + UTF-8 + + + + CharacterEncodingFilter + /* + + + Dispatcher + org.springframework.web.servlet.DispatcherServlet + + contextConfigLocation + classpath:applicationContext.xml + + + + Dispatcher + / + + + luckyweb.seagull.comm.QueueListener + + + log4jConfigLocation + classpath:log4j.xml + + + org.springframework.web.util.Log4jConfigListener + + + index.jsp + \ No newline at end of file diff --git a/src/main/webapp/css/login.css b/src/main/webapp/css/login.css index 6e9398b..25d383e 100644 --- a/src/main/webapp/css/login.css +++ b/src/main/webapp/css/login.css @@ -1,438 +1,438 @@ - #login{ - width:287px; - height:340px;; - margin: 0 auto; - font-size:12px; - margin-top: 40px; - -} -.clear{ clear:both; width:100%; height:0; overflow:hidden;} -*+html #login{ - width:287px; - height:330px;; - margin: 0 auto; - font-size:12px; - margin-top: 40px; - -} -#login .login_type_div{ - width:100%; - height:48px; -} -#login .login_type_div span{ - float:right; - width:46px; - height:48px; -} - -#login .login_type_div .iphone_tip{ - background:url("login/login_type_tip.png") -49px -49px no-repeat; - - - -} -#login .login_type_div .pc_tip{ - background:url("login/login_type_tip.png") -2px -1px no-repeat; - display:none; -} - -#login #loginTab{ - float: left; - width:287px; - height:340px; - background:url(login/login_banner.png) no-repeat; - clear:both; -} - -#login #mobile{ - margin-top:10px; -} -#login #goHomeTab{ - float: left; - padding-top:10px; - background:url(login/goHome_banner.png) no-repeat; - clear:both; -} - -*+html #login #goHomeTab{ - float: left; - padding-top:10px; - background:url(login/goHome_banner.png) no-repeat; - clear:both; -} - - -.loginDiv_left{ - float:left; - font-size: 20px; - font-family: '微软雅黑'; - color:#fff; - margin-left: 28px; -} -.loginDiv_right{ - float:right; - margin-right: 20px; -} - - - - - - -#login .right .login_right_ul{ - width:287px; - height:146px; - margin:0; - padding:0; - padding-left:33px; -} - - -#login .right li{ - clear:both; - height:40px; - color:#666666; - list-style-type: none; -} - -/* #login .right input{ - height:22px; - width:155px; - line-height:24px; - border:1px solid rgb(170,170,170); - line-height:26px; - margin-top:3px; - font-size:12px; -} */ - - -#_ocx_password{ - height:26px; - width:170px; - margin:0px; - margin-top: 11px; -} - -*+html #_ocx_password{ - height:26px; - width:170px; - margin:0px; - margin-top:16px; -} - -.loginForm{ - margin-top:20px; - height: 120px; -} - -*+html .loginForm{ - margin-top:20px; - height: 120px; -} - -#login .login_bottom{ - text-align: center; - padding-top: 3px; -} - -#login .login_bottom p{ - font-size:12px; - -} - -#login .login_bottom .login_bottom_login_p{ - font-family: "微软雅黑"; - color:rgb(203,203,203); -} - -#login .login_bottom .login_bottom_login_p_second{ - margin-top: 6px; - font-family: "微软雅黑"; - -} - -#login .login_bottom .login_bottom_login_p_second a{ - color:#fff; - -} - -*+html #login .login_bottom .login_bottom_login_p{ - font-family: "微软雅黑"; - color:rgb(203,203,203); - margin-top: 0px; -} - - - - - - - -.login_submit_img { - width:220px; - margin:0 auto; - margin-top:20px; - cursor: pointer; -} - -#login .right .labelstyle { - display: inline-block; - float: left; - height: 22px; - line-height: 30px; - width: 50px; - color:rgb(75,75,75); - font-size:14px; - font-family: "微软雅黑"; - margin-left:13px; -} - -#login .right a:active { - color: rgb(0,160,255); - cursor: pointer; - text-decoration: none; - font-family: "微软雅黑"; -} - -#login .right a:link { - color:#fff; - cursor: pointer; - text-decoration: none; - font-family: "微软雅黑"; -} - -#login .right a{ - color:rgb(0,160,255); - cursor: pointer; - text-decoration: none; - font-family: "微软雅黑"; -} - -*+html .right #imgcode{ - margin-top:-11px; - padding-top:-10px; - vertical-align: top; -} - - - - - - - - - - - - - - - /** lable **/ - .ui-form-label { - display: inline-block; - float: left; - height: 22px; - line-height: 30px; - width: 50px; - color:rgb(75,75,75); - font-size:14px; - font-family: "微软雅黑"; - margin-left:-2px; - } - /** input **/ - .ui-input { - height:25px; - width:170px; - border: 0px; - line-height:26px; - font-size:13px; - font-family: "微软雅黑"; - } - - -/** link **/ - .fm-link { - display: block; - margin-bottom:5px; - font: 12px/1.5 tahoma,arial,宋体; - } - .fm-link a { - color:#666666; - text-align:center; - } - .fm-link img { - - } -/** btn **/ -.ui-button-text { - background:url("../images/btn.png") no-repeat scroll 0 0 transparent; - font: 12px/1.5 tahoma,arial,宋体; - font-size: 24px; - font-weight:bolder; - line-height: 35px; - border: 0 none; - cursor: pointer; - display: block; - height: 35px; - outline: 0 none; - overflow: hidden; - text-indent: -9999px; - width: 200px; -} -.ocx_style{ - font-size: 13px; - height: 28px; - width: 198px; - margin-bottom:10px; -} -.ocx_style_init{ - - color: #aeaeae; - width:175px; - height: 28px; - line-height: 28px; - text-indent: 6px; - margin-left: 20px; - margin: 0; - -} -/*针对GoogleChrome、Safari3*/ -@media screen and (-webkit-min-device-pixel-ratio:0) { - .ocx_style {width:192px;height: 20px; } - } -@-moz-document url-prefix() { -.ocx_style {width:200px} - } - -.contact01{ -padding:0px; -margin-right: 0px; -margin-left: 0px; -} -.loginForm{ -margin: 0px; -padding:0px; -padding-bottom: 5px; -} -.showDetail { -border: 1px dashed #DE9797; -color: #C40404; -background: #FDF3F3 url(../images/wrong.gif) no-repeat 5px 3px; -padding: 3px 4px; -text-indent: 20px; -margin-bottom: 10px; -margin-left:0px; -width: 190px; -display: none; -} -.otherDiv { -padding-top:5px; -} -#register{ -color: #585757; -display: block; -font-size: 14px; -font-weight: bold; -height: 33px; -line-height: 33px; -margin-bottom: 10px; -text-align: center; -width: 198px; -background: url("../images/reg.png") no-repeat scroll 0 0 transparent; -} - - - -#checkcode{ - height: 30px; - width:93px; - margin-top: 18px; - margin-left: -18px; - border:0px; -} - -#valicode{ - height: 22px; - width:93px; - margin-top: 3.5px; - margin-left: -15px; - border:0px; -} - -*+html #valicode{ - height: 26px; - width:93px; - margin-top: 17px; - margin-left: -15px; -} - - -.usercodeline{ - color:rgb(50, 174, 229); - font-size: 16px; - font-weight: 1000; - margin-left: 30px; - margin-top: 32px; -} - -*+html .usercodeline{ - color:rgb(50, 174, 229); - font-size: 16px; - font-weight: 1000; - margin-left: 30px; - margin-top: 44px; -} - -#login #imgcode{ - width: 75px; - height: 38px; - vertical-align: middle; - cursor: pointer; - margin-top:-5px; -} - -*+html #login #imgcode{ - margin-top:-10px; -} - -#resetSms{ - background: none repeat scroll 0 0 #fafafa; - border: 1px solid #c8c8c8; - color: #a9a8a8; - cursor: pointer; - float: right; - height: 38px; - margin-right: 68px; - margin-top: 14px; - text-align: center; - width: 72px; - border-radius: 3px; -} - -#acquireSms{ - background: none repeat scroll 0 0 #fafafa; - border: 1px solid #c8c8c8; - color: #a9a8a8; - cursor: pointer; - float: right; - height: 38px; - margin-right: 68px; - margin-top: -36px; - text-align: center; - width: 72px; - border-radius: 3px; -} - - - - - - - - - - - - - - + #login{ + width:287px; + height:340px;; + margin: 0 auto; + font-size:12px; + margin-top: 40px; + +} +.clear{ clear:both; width:100%; height:0; overflow:hidden;} +*+html #login{ + width:287px; + height:330px;; + margin: 0 auto; + font-size:12px; + margin-top: 40px; + +} +#login .login_type_div{ + width:100%; + height:48px; +} +#login .login_type_div span{ + float:right; + width:46px; + height:48px; +} + +#login .login_type_div .iphone_tip{ + background:url("login/login_type_tip.png") -49px -49px no-repeat; + + + +} +#login .login_type_div .pc_tip{ + background:url("login/login_type_tip.png") -2px -1px no-repeat; + display:none; +} + +#login #loginTab{ + float: left; + width:287px; + height:340px; + background:url(login/login_banner.png) no-repeat; + clear:both; +} + +#login #mobile{ + margin-top:10px; +} +#login #goHomeTab{ + float: left; + padding-top:10px; + background:url(login/goHome_banner.png) no-repeat; + clear:both; +} + +*+html #login #goHomeTab{ + float: left; + padding-top:10px; + background:url(login/goHome_banner.png) no-repeat; + clear:both; +} + + +.loginDiv_left{ + float:left; + font-size: 20px; + font-family: '微软雅黑'; + color:#fff; + margin-left: 28px; +} +.loginDiv_right{ + float:right; + margin-right: 20px; +} + + + + + + +#login .right .login_right_ul{ + width:287px; + height:146px; + margin:0; + padding:0; + padding-left:33px; +} + + +#login .right li{ + clear:both; + height:40px; + color:#666666; + list-style-type: none; +} + +/* #login .right input{ + height:22px; + width:155px; + line-height:24px; + border:1px solid rgb(170,170,170); + line-height:26px; + margin-top:3px; + font-size:12px; +} */ + + +#_ocx_password{ + height:26px; + width:170px; + margin:0px; + margin-top: 11px; +} + +*+html #_ocx_password{ + height:26px; + width:170px; + margin:0px; + margin-top:16px; +} + +.loginForm{ + margin-top:20px; + height: 120px; +} + +*+html .loginForm{ + margin-top:20px; + height: 120px; +} + +#login .login_bottom{ + text-align: center; + padding-top: 3px; +} + +#login .login_bottom p{ + font-size:12px; + +} + +#login .login_bottom .login_bottom_login_p{ + font-family: "微软雅黑"; + color:rgb(203,203,203); +} + +#login .login_bottom .login_bottom_login_p_second{ + margin-top: 6px; + font-family: "微软雅黑"; + +} + +#login .login_bottom .login_bottom_login_p_second a{ + color:#fff; + +} + +*+html #login .login_bottom .login_bottom_login_p{ + font-family: "微软雅黑"; + color:rgb(203,203,203); + margin-top: 0px; +} + + + + + + + +.login_submit_img { + width:220px; + margin:0 auto; + margin-top:20px; + cursor: pointer; +} + +#login .right .labelstyle { + display: inline-block; + float: left; + height: 22px; + line-height: 30px; + width: 50px; + color:rgb(75,75,75); + font-size:14px; + font-family: "微软雅黑"; + margin-left:13px; +} + +#login .right a:active { + color: rgb(0,160,255); + cursor: pointer; + text-decoration: none; + font-family: "微软雅黑"; +} + +#login .right a:link { + color:#fff; + cursor: pointer; + text-decoration: none; + font-family: "微软雅黑"; +} + +#login .right a{ + color:rgb(0,160,255); + cursor: pointer; + text-decoration: none; + font-family: "微软雅黑"; +} + +*+html .right #imgcode{ + margin-top:-11px; + padding-top:-10px; + vertical-align: top; +} + + + + + + + + + + + + + + + /** lable **/ + .ui-form-label { + display: inline-block; + float: left; + height: 22px; + line-height: 30px; + width: 50px; + color:rgb(75,75,75); + font-size:14px; + font-family: "微软雅黑"; + margin-left:-2px; + } + /** input **/ + .ui-input { + height:25px; + width:170px; + border: 0px; + line-height:26px; + font-size:13px; + font-family: "微软雅黑"; + } + + +/** link **/ + .fm-link { + display: block; + margin-bottom:5px; + font: 12px/1.5 tahoma,arial,宋体; + } + .fm-link a { + color:#666666; + text-align:center; + } + .fm-link img { + + } +/** btn **/ +.ui-button-text { + background:url("../images/btn.png") no-repeat scroll 0 0 transparent; + font: 12px/1.5 tahoma,arial,宋体; + font-size: 24px; + font-weight:bolder; + line-height: 35px; + border: 0 none; + cursor: pointer; + display: block; + height: 35px; + outline: 0 none; + overflow: hidden; + text-indent: -9999px; + width: 200px; +} +.ocx_style{ + font-size: 13px; + height: 28px; + width: 198px; + margin-bottom:10px; +} +.ocx_style_init{ + + color: #aeaeae; + width:175px; + height: 28px; + line-height: 28px; + text-indent: 6px; + margin-left: 20px; + margin: 0; + +} +/*针对GoogleChrome、Safari3*/ +@media screen and (-webkit-min-device-pixel-ratio:0) { + .ocx_style {width:192px;height: 20px; } + } +@-moz-document url-prefix() { +.ocx_style {width:200px} + } + +.contact01{ +padding:0px; +margin-right: 0px; +margin-left: 0px; +} +.loginForm{ +margin: 0px; +padding:0px; +padding-bottom: 5px; +} +.showDetail { +border: 1px dashed #DE9797; +color: #C40404; +background: #FDF3F3 url(../images/wrong.gif) no-repeat 5px 3px; +padding: 3px 4px; +text-indent: 20px; +margin-bottom: 10px; +margin-left:0px; +width: 190px; +display: none; +} +.otherDiv { +padding-top:5px; +} +#register{ +color: #585757; +display: block; +font-size: 14px; +font-weight: bold; +height: 33px; +line-height: 33px; +margin-bottom: 10px; +text-align: center; +width: 198px; +background: url("../images/reg.png") no-repeat scroll 0 0 transparent; +} + + + +#checkcode{ + height: 30px; + width:93px; + margin-top: 18px; + margin-left: -18px; + border:0px; +} + +#valicode{ + height: 22px; + width:93px; + margin-top: 3.5px; + margin-left: -15px; + border:0px; +} + +*+html #valicode{ + height: 26px; + width:93px; + margin-top: 17px; + margin-left: -15px; +} + + +.usercodeline{ + color:rgb(50, 174, 229); + font-size: 16px; + font-weight: 1000; + margin-left: 30px; + margin-top: 32px; +} + +*+html .usercodeline{ + color:rgb(50, 174, 229); + font-size: 16px; + font-weight: 1000; + margin-left: 30px; + margin-top: 44px; +} + +#login #imgcode{ + width: 75px; + height: 38px; + vertical-align: middle; + cursor: pointer; + margin-top:-5px; +} + +*+html #login #imgcode{ + margin-top:-10px; +} + +#resetSms{ + background: none repeat scroll 0 0 #fafafa; + border: 1px solid #c8c8c8; + color: #a9a8a8; + cursor: pointer; + float: right; + height: 38px; + margin-right: 68px; + margin-top: 14px; + text-align: center; + width: 72px; + border-radius: 3px; +} + +#acquireSms{ + background: none repeat scroll 0 0 #fafafa; + border: 1px solid #c8c8c8; + color: #a9a8a8; + cursor: pointer; + float: right; + height: 38px; + margin-right: 68px; + margin-top: -36px; + text-align: center; + width: 72px; + border-radius: 3px; +} + + + + + + + + + + + + + + diff --git a/src/main/webapp/css/style.css b/src/main/webapp/css/style.css index b0d1115..d956ab0 100644 --- a/src/main/webapp/css/style.css +++ b/src/main/webapp/css/style.css @@ -1,183 +1,183 @@ -body { - font-family:'΢ź'; - font-size: 14px; - color: #444; -} -td{padding-left:3px;} - -.error_msg { - font-size: 14px; - color: #f00; -} - -.tip { - font-size: 14px; - color: blue; -} - - -table { - *border-collapse: collapse; /* IE7 and lower */ - border-spacing: 0; - width: 90%; -} - -.rect{BORDER:#ccc 1px solid; BORDER-COLLAPSE: collapse;} - -.bordered { - border: solid #ccc 1px; - -moz-border-radius: 6px; - -webkit-border-radius: 6px; - border-radius: 6px; - -webkit-box-shadow: 0 1px 1px #ccc; - -moz-box-shadow: 0 1px 1px #ccc; - /* box-shadow: 0 1px 1px #ccc; */ - font-size:13px; -} - -.bordered tr:hover { - background: #fbf8e9; - -o-transition: all 0.1s ease-in-out; - -webkit-transition: all 0.1s ease-in-out; - -moz-transition: all 0.1s ease-in-out; - -ms-transition: all 0.1s ease-in-out; - transition: all 0.1s ease-in-out; -} - -.bordered td, .bordered th { - border-left: 1px solid #ccc; - border-top: 1px solid #ccc; - padding: 2px; - text-align: left; -} - -.bordered th { - background-color: #48D1CC; - color:#FFFFFF; - /* text-shadow:1px 1px 1px #fff; - -webkit-box-shadow: 0 1px 0 rgba(255,255,255,.8) inset; - -moz-box-shadow:0 1px 0 rgba(255,255,255,.8) inset; - box-shadow: 0 1px 0 rgba(255,255,255,.8) inset; */ - border-top: none; - text-align:center; -} - -.bordered td:first-child, .bordered th:first-child { - border-left: none; -} - -.bordered th:first-child { - -moz-border-radius: 6px 0 0 0; - -webkit-border-radius: 6px 0 0 0; - border-radius: 6px 0 0 0; -} - -.bordered th:last-child { - -moz-border-radius: 0 6px 0 0; - -webkit-border-radius: 0 6px 0 0; - border-radius: 0 6px 0 0; -} - -.bordered th:only-child{ - -moz-border-radius: 6px 6px 0 0; - -webkit-border-radius: 6px 6px 0 0; - border-radius: 6px 6px 0 0; -} - -.bordered tr:last-child td:first-child { - -moz-border-radius: 0 0 0 6px; - -webkit-border-radius: 0 0 0 6px; - border-radius: 0 0 0 6px; -} - -.bordered tr:last-child td:last-child { - -moz-border-radius: 0 0 6px 0; - -webkit-border-radius: 0 0 6px 0; - border-radius: 0 0 6px 0; -} - -.log th { - background-color: #999; - color:#FFFFFF; - /* text-shadow:1px 1px 1px #fff; - -webkit-box-shadow: 0 1px 0 rgba(255,255,255,.8) inset; - -moz-box-shadow:0 1px 0 rgba(255,255,255,.8) inset; - box-shadow: 0 1px 0 rgba(255,255,255,.8) inset; */ - border-top: none; - text-align:center; - border-left: 1px solid #ccc; - border-top: 1px solid #ccc; - padding: 2px; - -} -.log { - border: solid #ccc 1px; - -moz-border-radius: 6px; - -webkit-border-radius: 6px; - border-radius: 6px; - -webkit-box-shadow: 0 1px 1px #ccc; - -moz-box-shadow: 0 1px 1px #ccc; - /* box-shadow: 0 1px 1px #ccc; */ - font-size:13px; -} -.log td{ - border-left: 1px solid #ccc; - border-top: 1px solid #ccc; - padding: 2px; - text-align: left; -} - - - -.button.gray{ -color:#fff; -width:70px; -margin-left:5px; -height:32px; -font-size:12px; -/*text-shadow:1px 1px 1px #fff; -*/border:1px solid #48D1CC; -background:#48D1CC; -} - - -.btnold { -color:#fff; -width:auto; -margin-left:5px; -height:32px; -line-height:32px; -border:1px solid #48D1CC; -PADDING-LEFT:22px; -PADDING-RIGHT: 22px; -PADDING-TOP: 7px; -PADDING-BOTTOM:7px; -FONT-SIZE: 12px; -CURSOR: pointer; -background:#48D1CC; -/*text-shadow:1px 1px 1px #fff;*/ -} - - - - - - - - - - - - -a{ -text-decoration:none; -color:#666666; } -a:link {color: blue} - - -ul { list-style:none;} -#pagelist { width:710px;padding:6px 0px; height:20px; text-align:center} -#pagelist ul li { float:left; border:1px solid #48D1CC; height:25px; line-height:25px; width:88px; margin:0px 2px; background:#48D1CC; color:#FFFFFF;} -#pagelist ul li a, .pageinfo { display:block; padding:0px 2px; background:#48D1CC; border:0px; color:#FFFFFF;} -.pageinfo { color:#FFFFFF;} -.current { background:#48D1CC; display:block; padding:0px 6px; width:80px; } +body { + font-family:'΢ź'; + font-size: 14px; + color: #444; +} +td{padding-left:3px;} + +.error_msg { + font-size: 14px; + color: #f00; +} + +.tip { + font-size: 14px; + color: blue; +} + + +table { + *border-collapse: collapse; /* IE7 and lower */ + border-spacing: 0; + width: 90%; +} + +.rect{BORDER:#ccc 1px solid; BORDER-COLLAPSE: collapse;} + +.bordered { + border: solid #ccc 1px; + -moz-border-radius: 6px; + -webkit-border-radius: 6px; + border-radius: 6px; + -webkit-box-shadow: 0 1px 1px #ccc; + -moz-box-shadow: 0 1px 1px #ccc; + /* box-shadow: 0 1px 1px #ccc; */ + font-size:13px; +} + +.bordered tr:hover { + background: #fbf8e9; + -o-transition: all 0.1s ease-in-out; + -webkit-transition: all 0.1s ease-in-out; + -moz-transition: all 0.1s ease-in-out; + -ms-transition: all 0.1s ease-in-out; + transition: all 0.1s ease-in-out; +} + +.bordered td, .bordered th { + border-left: 1px solid #ccc; + border-top: 1px solid #ccc; + padding: 2px; + text-align: left; +} + +.bordered th { + background-color: #48D1CC; + color:#FFFFFF; + /* text-shadow:1px 1px 1px #fff; + -webkit-box-shadow: 0 1px 0 rgba(255,255,255,.8) inset; + -moz-box-shadow:0 1px 0 rgba(255,255,255,.8) inset; + box-shadow: 0 1px 0 rgba(255,255,255,.8) inset; */ + border-top: none; + text-align:center; +} + +.bordered td:first-child, .bordered th:first-child { + border-left: none; +} + +.bordered th:first-child { + -moz-border-radius: 6px 0 0 0; + -webkit-border-radius: 6px 0 0 0; + border-radius: 6px 0 0 0; +} + +.bordered th:last-child { + -moz-border-radius: 0 6px 0 0; + -webkit-border-radius: 0 6px 0 0; + border-radius: 0 6px 0 0; +} + +.bordered th:only-child{ + -moz-border-radius: 6px 6px 0 0; + -webkit-border-radius: 6px 6px 0 0; + border-radius: 6px 6px 0 0; +} + +.bordered tr:last-child td:first-child { + -moz-border-radius: 0 0 0 6px; + -webkit-border-radius: 0 0 0 6px; + border-radius: 0 0 0 6px; +} + +.bordered tr:last-child td:last-child { + -moz-border-radius: 0 0 6px 0; + -webkit-border-radius: 0 0 6px 0; + border-radius: 0 0 6px 0; +} + +.log th { + background-color: #999; + color:#FFFFFF; + /* text-shadow:1px 1px 1px #fff; + -webkit-box-shadow: 0 1px 0 rgba(255,255,255,.8) inset; + -moz-box-shadow:0 1px 0 rgba(255,255,255,.8) inset; + box-shadow: 0 1px 0 rgba(255,255,255,.8) inset; */ + border-top: none; + text-align:center; + border-left: 1px solid #ccc; + border-top: 1px solid #ccc; + padding: 2px; + +} +.log { + border: solid #ccc 1px; + -moz-border-radius: 6px; + -webkit-border-radius: 6px; + border-radius: 6px; + -webkit-box-shadow: 0 1px 1px #ccc; + -moz-box-shadow: 0 1px 1px #ccc; + /* box-shadow: 0 1px 1px #ccc; */ + font-size:13px; +} +.log td{ + border-left: 1px solid #ccc; + border-top: 1px solid #ccc; + padding: 2px; + text-align: left; +} + + + +.button.gray{ +color:#fff; +width:70px; +margin-left:5px; +height:32px; +font-size:12px; +/*text-shadow:1px 1px 1px #fff; +*/border:1px solid #48D1CC; +background:#48D1CC; +} + + +.btnold { +color:#fff; +width:auto; +margin-left:5px; +height:32px; +line-height:32px; +border:1px solid #48D1CC; +PADDING-LEFT:22px; +PADDING-RIGHT: 22px; +PADDING-TOP: 7px; +PADDING-BOTTOM:7px; +FONT-SIZE: 12px; +CURSOR: pointer; +background:#48D1CC; +/*text-shadow:1px 1px 1px #fff;*/ +} + + + + + + + + + + + + +a{ +text-decoration:none; +color:#666666; } +a:link {color: blue} + + +ul { list-style:none;} +#pagelist { width:710px;padding:6px 0px; height:20px; text-align:center} +#pagelist ul li { float:left; border:1px solid #48D1CC; height:25px; line-height:25px; width:88px; margin:0px 2px; background:#48D1CC; color:#FFFFFF;} +#pagelist ul li a, .pageinfo { display:block; padding:0px 2px; background:#48D1CC; border:0px; color:#FFFFFF;} +.pageinfo { color:#FFFFFF;} +.current { background:#48D1CC; display:block; padding:0px 6px; width:80px; } diff --git a/src/main/webapp/down.jsp b/src/main/webapp/down.jsp index c22a835..ea5bc6b 100644 --- a/src/main/webapp/down.jsp +++ b/src/main/webapp/down.jsp @@ -1,4 +1,4 @@ -<% response.setContentType("application/unknown;charset=gbk"); - response.setHeader("Content-disposition","filename=" + (String) request.getAttribute("filename")); - out.println((String) request.getAttribute("data")); +<% response.setContentType("application/unknown;charset=gbk"); + response.setHeader("Content-disposition","filename=" + (String) request.getAttribute("filename")); + out.println((String) request.getAttribute("data")); %> \ No newline at end of file diff --git a/src/main/webapp/error.jsp b/src/main/webapp/error.jsp index 90efc69..0ac0745 100644 --- a/src/main/webapp/error.jsp +++ b/src/main/webapp/error.jsp @@ -1,52 +1,52 @@ -<%@ page language="java" contentType="text/html; charset=utf-8" - pageEncoding="utf-8"%> - - - - -error - - - - -
- <%@ include file="/head.jsp" %> -
- - -
- - -
- -
- - -
- - - - - - - -
    -

${message}

-

 

-

确定

-
-

 

-
-
-
- +<%@ page language="java" contentType="text/html; charset=utf-8" + pageEncoding="utf-8"%> + + + + +error + + + + +
+ <%@ include file="/head.jsp" %> +
+ + +
+ + +
+ +
+ + +
+ + + + + + + +
    +

${message}

+

 

+

确定

+
+

 

+
+
+
+ \ No newline at end of file diff --git a/src/main/webapp/error/404.jsp b/src/main/webapp/error/404.jsp index b979cdf..a3ba920 100644 --- a/src/main/webapp/error/404.jsp +++ b/src/main/webapp/error/404.jsp @@ -1,12 +1,12 @@ -<%@ page language="java" contentType="text/html; charset=UTF-8" - pageEncoding="UTF-8"%> - - - - -Insert title here - - - - +<%@ page language="java" contentType="text/html; charset=UTF-8" + pageEncoding="UTF-8"%> + + + + +Insert title here + + + + \ No newline at end of file diff --git a/src/main/webapp/error/500.jsp b/src/main/webapp/error/500.jsp index 7814b34..f46998d 100644 --- a/src/main/webapp/error/500.jsp +++ b/src/main/webapp/error/500.jsp @@ -1,13 +1,13 @@ -<%@ page language="java" contentType="text/html; charset=UTF-8" - pageEncoding="UTF-8"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> - - - - -Insert title here - - - - +<%@ page language="java" contentType="text/html; charset=UTF-8" + pageEncoding="UTF-8"%> +<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> + + + + +Insert title here + + + + \ No newline at end of file diff --git a/src/main/webapp/error/error.jsp b/src/main/webapp/error/error.jsp index 38d05ee..6ce6333 100644 --- a/src/main/webapp/error/error.jsp +++ b/src/main/webapp/error/error.jsp @@ -1,14 +1,14 @@ -<%@ page language="java" contentType="text/html; charset=UTF-8" - pageEncoding="UTF-8"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> - - - - -Insert title here - - -

${exception.message }

-
- +<%@ page language="java" contentType="text/html; charset=UTF-8" + pageEncoding="UTF-8"%> +<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> + + + + +Insert title here + + +

${exception.message }

+
+ \ No newline at end of file diff --git a/src/main/webapp/footer.jsp b/src/main/webapp/footer.jsp index c9399c5..1731000 100644 --- a/src/main/webapp/footer.jsp +++ b/src/main/webapp/footer.jsp @@ -1,49 +1,49 @@ -<%@ page language="java" contentType="text/html; charset=utf-8"%> - - - - -
-
-
- -
-
-

- 主页 | - 关于 | - 帮助 | - 联系我们| - 系统管理 -

-
-
- -
-
-

- - Copyright © 2017, LuckyFrame.Designed by LuckyFrame V2.3 -

-
-
- -
-
-
+<%@ page language="java" contentType="text/html; charset=utf-8"%> + + + + +
+
+
+ +
+
+

+ 主页 | + 关于 | + 帮助 | + 联系我们| + 系统管理 +

+
+
+ +
+
+

+ + Copyright © 2017, LuckyFrame.Designed by LuckyFrame V2.3 +

+
+
+ +
+
+
diff --git a/src/main/webapp/head.jsp b/src/main/webapp/head.jsp index 6bb6278..23e10bc 100644 --- a/src/main/webapp/head.jsp +++ b/src/main/webapp/head.jsp @@ -1,161 +1,161 @@ -<%@ page language="java" contentType="text/html; charset=utf-8"%> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +<%@ page language="java" contentType="text/html; charset=utf-8"%> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/webapp/index.jsp b/src/main/webapp/index.jsp index 82400c8..ac58179 100644 --- a/src/main/webapp/index.jsp +++ b/src/main/webapp/index.jsp @@ -1,124 +1,124 @@ -<%@ page language="java" contentType="text/html; charset=utf-8" - pageEncoding="utf-8"%> - - - - -LuckyFrame-首页 - - -
- <%@ include file="/head.jsp" %> -
- - - - - - - -
-

-

一站式测试自动化、质量管理服务,让我们的工作更简单、专业、高效

-

-     LuckyFrame主要有测试计划管理、测试用例管理、任务调度管理、任务执行进度概况、用例执行情况以及日志定位、项目执行图表统计等功能,高度集成TestLink API, - 提供系统自带用例管理以及TestLink用例管理2种方式,通过用例关键字对自动化进行基本的测试分层(框架层,用例层,脚本层,数据层)驱动管理。 - 全纬度支持接口自动化、UI自动化。质量管理模块目的是为了使QA的工作更加系统化、信息化,同时也能使项目管理人员及时掌握项目整体动态。 - 主要有版本信息、生产故障、项目流程规范检查、评审检查等方面。 -

-
- - - -
-
- -

我们能做的不止于此...

- -
-
-

配置灵活

-
-

支持关键字自驱动、定时任务、用例运行优先级控制、邮件通知、自动构建jenkins、自动重启TOMCAT、线程数控制等功能, - 通过分层控制让自动化测试场景更灵活。

-
-
-
-

运行更快

-
-

接口测试采用多线程运行,任务调度中最高可配置30个线程,在测试桩响应速度足够快的情况下,理论上一分钟时间内可测试1000条以上的用例。 - UI自动化以及APP自动化采用单线程server-client模式。 -

-
-
-
-

封装更全

-
-

UI自动化以及APP自动化采取关键字驱动全封装selenium以及APPIUM,使用UTP平台关键字就可以0代码基础完成自动化脚本,解决测试人员代码 - 能力不足的短板。接口自动化采取JAVA反射机制,只需要简单完成驱动桩简单调用代码。

-
-
-
-

质量管理

-
-

检查项目实际进度与计划进度是否保持一致;检查项目过程中的活动是否与已定的规范和流程一致;记录质量事故并进行原因分析,纠正及预防的措施跟进。

-
-
-
- -
-
-
- <%@ include file="/footer.jsp" %> -
- - - +<%@ page language="java" contentType="text/html; charset=utf-8" + pageEncoding="utf-8"%> + + + + +LuckyFrame-首页 + + +
+ <%@ include file="/head.jsp" %> +
+ + + + + + + +
+

+

一站式测试自动化、质量管理服务,让我们的工作更简单、专业、高效

+

+     LuckyFrame主要有测试计划管理、测试用例管理、任务调度管理、任务执行进度概况、用例执行情况以及日志定位、项目执行图表统计等功能,高度集成TestLink API, + 提供系统自带用例管理以及TestLink用例管理2种方式,通过用例关键字对自动化进行基本的测试分层(框架层,用例层,脚本层,数据层)驱动管理。 + 全纬度支持接口自动化、UI自动化。质量管理模块目的是为了使QA的工作更加系统化、信息化,同时也能使项目管理人员及时掌握项目整体动态。 + 主要有版本信息、生产故障、项目流程规范检查、评审检查等方面。 +

+
+ + + +
+
+ +

我们能做的不止于此...

+ +
+
+

配置灵活

+
+

支持关键字自驱动、定时任务、用例运行优先级控制、邮件通知、自动构建jenkins、自动重启TOMCAT、线程数控制等功能, + 通过分层控制让自动化测试场景更灵活。

+
+
+
+

运行更快

+
+

接口测试采用多线程运行,任务调度中最高可配置30个线程,在测试桩响应速度足够快的情况下,理论上一分钟时间内可测试1000条以上的用例。 + UI自动化以及APP自动化采用单线程server-client模式。 +

+
+
+
+

封装更全

+
+

UI自动化以及APP自动化采取关键字驱动全封装selenium以及APPIUM,使用UTP平台关键字就可以0代码基础完成自动化脚本,解决测试人员代码 + 能力不足的短板。接口自动化采取JAVA反射机制,只需要简单完成驱动桩简单调用代码。

+
+
+
+

质量管理

+
+

检查项目实际进度与计划进度是否保持一致;检查项目过程中的活动是否与已定的规范和流程一致;记录质量事故并进行原因分析,纠正及预防的措施跟进。

+
+
+
+ +
+
+
+ <%@ include file="/footer.jsp" %> +
+ + + \ No newline at end of file diff --git a/src/main/webapp/js/My97DatePicker/WdatePicker.js b/src/main/webapp/js/My97DatePicker/WdatePicker.js index 6c23cdd..d874936 100644 --- a/src/main/webapp/js/My97DatePicker/WdatePicker.js +++ b/src/main/webapp/js/My97DatePicker/WdatePicker.js @@ -1,488 +1,488 @@ -/* - * My97 DatePicker 4.8 Beta1 - * License: http://www.my97.net/dp/license.asp - */ -var $dp, WdatePicker; -(function() { - var $ = { - $langList : [ { - name : "en", - charset : "UTF-8" - }, { - name : "zh-cn", - charset : "gb2312" - }, { - name : "zh-tw", - charset : "GBK" - } ], - $skinList : [ { - name : "default", - charset : "gb2312" - }, { - name : "whyGreen", - charset : "gb2312" - } ], - $wdate : true, - $crossFrame : true, - $preLoad : false, - doubleCalendar : false, - enableKeyboard : true, - enableInputMask : true, - autoUpdateOnChanged : null, - whichDayIsfirstWeek : 4, - position : {}, - lang : "auto", - skin : "default", - dateFmt : "yyyy-MM-dd", - realDateFmt : "yyyy-MM-dd", - realTimeFmt : "HH:mm:ss", - realFullFmt : "%Date %Time", - minDate : "1900-01-01 00:00:00", - maxDate : "2099-12-31 23:59:59", - startDate : "", - alwaysUseStartDate : false, - yearOffset : 1911, - firstDayOfWeek : 0, - isShowWeek : false, - highLineWeekDay : true, - isShowClear : true, - isShowToday : true, - isShowOK : true, - isShowOthers : true, - readOnly : false, - errDealMode : 0, - autoPickDate : null, - qsEnabled : true, - autoShowQS : false, - - specialDates : null, - specialDays : null, - disabledDates : null, - disabledDays : null, - opposite : false, - errMsg : "", - quickSel : [], - has : {}, - getRealLang : function() { - var _ = $.$langList; - for (var A = 0; A < _.length; A++) - if (_[A].name == this.lang) - return _[A]; - return _[0] - } - }; - WdatePicker = T; - var X = window, S = { - innerHTML : "" - }, M = "document", H = "documentElement", C = "getElementsByTagName", U, A, R, G, a, W = navigator.appName; - if (W == "Microsoft Internet Explorer") - R = true; - else if (W == "Opera") - a = true; - else - G = true; - A = J(); - if ($.$wdate) - K(A + "skin/WdatePicker.css"); - U = X; - if ($.$crossFrame) { - try { - while (U.parent && U.parent[M] != U[M] - && U.parent[M][C]("frameset").length == 0) - U = U.parent - } catch (N) { - } - } - if (!U.$dp) - U.$dp = { - ff : G, - ie : R, - opera : a, - status : 0, - defMinDate : $.minDate, - defMaxDate : $.maxDate - }; - B(); - if ($.$preLoad && $dp.status == 0) - E(X, "onload", function() { - T(null, true) - }); - if (!X[M].docMD) { - E(X[M], "onmousedown", D); - X[M].docMD = true - } - if (!U[M].docMD) { - E(U[M], "onmousedown", D); - U[M].docMD = true - } - E(X, "onunload", function() { - if ($dp.dd) - O($dp.dd, "none") - }); - function B() { - U.$dp = U.$dp || {}; - obj = { - $ : function($) { - return (typeof $ == "string") ? X[M].getElementById($) : $ - }, - $D : function($, _) { - return this.$DV(this.$($).value, _) - }, - $DV : function(_, $) { - if (_ != "") { - this.dt = $dp.cal.splitDate(_, $dp.cal.dateFmt); - if ($) - for ( var B in $) - if (this.dt[B] === undefined) - this.errMsg = "invalid property:" + B; - else { - this.dt[B] += $[B]; - if (B == "M") { - var C = $["M"] > 0 ? 1 : 0, A = new Date( - this.dt["y"], this.dt["M"], 0) - .getDate(); - this.dt["d"] = Math - .min(A + C, this.dt["d"]) - } - } - if (this.dt.refresh()) - return this.dt - } - return "" - }, - show : function() { - var A = U[M].getElementsByTagName("div"), $ = 100000; - for (var B = 0; B < A.length; B++) { - var _ = parseInt(A[B].style.zIndex); - if (_ > $) - $ = _ - } - this.dd.style.zIndex = $ + 2; - O(this.dd, "block") - }, - hide : function() { - O(this.dd, "none") - }, - attachEvent : E - }; - for ( var $ in obj) - U.$dp[$] = obj[$]; - $dp = U.$dp - } - function E(A, $, _) { - if (R) - A.attachEvent($, _); - else if (_) { - var B = $.replace(/on/, ""); - _._ieEmuEventHandler = function($) { - return _($) - }; - A.addEventListener(B, _._ieEmuEventHandler, false) - } - } - function J() { - var _, A, $ = X[M][C]("script"); - for (var B = 0; B < $.length; B++) { - _ = $[B].getAttribute("src"); - _ = _.substr(0, _.toLowerCase().indexOf("wdatepicker.js")); - A = _.lastIndexOf("/"); - if (A > 0) - _ = _.substring(0, A + 1); - if (_) - break - } - return _ - } - function K(A, $, B) { - var D = X[M][C]("HEAD").item(0), _ = X[M].createElement("link"); - if (D) { - _.href = A; - _.rel = "stylesheet"; - _.type = "text/css"; - if ($) - _.title = $; - if (B) - _.charset = B; - D.appendChild(_) - } - } - function F($) { - $ = $ || U; - var A = 0, _ = 0; - while ($ != U) { - var D = $.parent[M][C]("iframe"); - for (var F = 0; F < D.length; F++) { - try { - if (D[F].contentWindow == $) { - var E = V(D[F]); - A += E.left; - _ += E.top; - break - } - } catch (B) { - } - } - $ = $.parent - } - return { - "leftM" : A, - "topM" : _ - } - } - function V(F) { - if (F.getBoundingClientRect) - return F.getBoundingClientRect(); - else { - var A = { - ROOT_TAG : /^body|html$/i, - OP_SCROLL : /^(?:inline|table-row)$/i - }, E = false, H = null, _ = F.offsetTop, G = F.offsetLeft, D = F.offsetWidth, B = F.offsetHeight, C = F.offsetParent; - if (C != F) - while (C) { - G += C.offsetLeft; - _ += C.offsetTop; - if (Q(C, "position").toLowerCase() == "fixed") - E = true; - else if (C.tagName.toLowerCase() == "body") - H = C.ownerDocument.defaultView; - C = C.offsetParent - } - C = F.parentNode; - while (C.tagName && !A.ROOT_TAG.test(C.tagName)) { - if (C.scrollTop || C.scrollLeft) - if (!A.OP_SCROLL.test(O(C))) - if (!a || C.style.overflow !== "visible") { - G -= C.scrollLeft; - _ -= C.scrollTop - } - C = C.parentNode - } - if (!E) { - var $ = Z(H); - G -= $.left; - _ -= $.top - } - D += G; - B += _; - return { - "left" : G, - "top" : _, - "right" : D, - "bottom" : B - } - } - } - function L($) { - $ = $ || U; - var B = $[M], A = ($.innerWidth) ? $.innerWidth - : (B[H] && B[H].clientWidth) ? B[H].clientWidth - : B.body.offsetWidth, _ = ($.innerHeight) ? $.innerHeight - : (B[H] && B[H].clientHeight) ? B[H].clientHeight - : B.body.offsetHeight; - return { - "width" : A, - "height" : _ - } - } - function Z($) { - $ = $ || U; - var B = $[M], A = B[H], _ = B.body; - B = (A && A.scrollTop != null && (A.scrollTop > _.scrollTop || A.scrollLeft > _.scrollLeft)) ? A - : _; - return { - "top" : B.scrollTop, - "left" : B.scrollLeft - } - } - function D($) { - var _ = $ ? ($.srcElement || $.target) : null; - try { - if ($dp.cal && !$dp.eCont && $dp.dd && _ != $dp.el - && $dp.dd.style.display == "block") - $dp.cal.close() - } catch ($) { - } - } - function Y() { - $dp.status = 2 - } - var P, _; - function T(L, D) { - $dp.win = X; - B(); - L = L || {}; - for ( var J in $) - if (J.substring(0, 1) != "$" && L[J] === undefined) - L[J] = $[J]; - if (D) { - if (!K()) { - _ = _ || setInterval(function() { - if (U[M].readyState == "complete") - clearInterval(_); - T(null, true) - }, 50); - return - } - if ($dp.status == 0) { - $dp.status = 1; - L.el = S; - I(L, true) - } else - return - } else if (L.eCont) { - L.eCont = $dp.$(L.eCont); - L.el = S; - L.autoPickDate = true; - L.qsEnabled = false; - I(L) - } else { - if ($.$preLoad && $dp.status != 2) - return; - var H = F(); - if (H) { - L.srcEl = H.srcElement || H.target; - H.cancelBubble = true - } - L.el = L.el = $dp.$(L.el || L.srcEl); - if (!L.el - || L.el["My97Mark"] === true - || L.el.disabled - || ($dp.dd && O($dp.dd) != "none" && $dp.dd.style.left != "-970px")) { - L.el["My97Mark"] = false; - return - } - I(L); - if (H && L.el.nodeType == 1 && L.el["My97Mark"] === undefined) { - L.el["My97Mark"] = false; - var A, C; - if (H.type == "focus") { - A = "onclick"; - C = "onfocus" - } else { - A = "onfocus"; - C = "onclick" - } - E(L.el, A, L.el[C]) - } - } - function K() { - if (R && U != X && U[M].readyState != "complete") - return false; - return true - } - function F() { - if (G) { - func = F.caller; - while (func != null) { - var $ = func.arguments[0]; - if ($ && ($ + "").indexOf("Event") >= 0) - return $; - func = func.caller - } - return null - } - return event - } - } - function Q(_, $) { - return _.currentStyle ? _.currentStyle[$] : document.defaultView - .getComputedStyle(_, false)[$] - } - function O(_, $) { - if (_) - if ($ != null) - _.style.display = $; - else - return Q(_, "display") - } - function I(G, _) { - var D = G.el ? G.el.nodeName : "INPUT"; - if (_ || G.eCont || new RegExp(/input|textarea|div|span|p|a/ig).test(D)) - G.elProp = D == "INPUT" ? "value" : "innerHTML"; - else - return; - if (G.lang == "auto") - G.lang = R ? navigator.browserLanguage.toLowerCase() - : navigator.language.toLowerCase(); - if (!G.eCont) - for ( var C in G) - $dp[C] = G[C]; - if (!$dp.dd - || G.eCont - || ($dp.dd && (G.getRealLang().name != $dp.dd.lang || G.skin != $dp.dd.skin))) { - if (G.eCont) - E(G.eCont, G); - else { - $dp.dd = U[M].createElement("DIV"); - $dp.dd.style.cssText = "position:absolute"; - U[M].body.appendChild($dp.dd); - E($dp.dd, G); - if (_) - $dp.dd.style.left = $dp.dd.style.top = "-970px"; - else { - $dp.show(); - B($dp) - } - } - } else if ($dp.cal) { - $dp.show(); - $dp.cal.init(); - if (!$dp.eCont) - B($dp) - } - function E(F, E) { - F.innerHTML = ""; - var D = F.lastChild.contentWindow[M], _ = $.$langList, C = $.$skinList, H = E - .getRealLang(); - F.lang = H.name; - F.skin = E.skin; - var G = [ - "" ]; - for (var I = 0; I < C.length; I++) - if (C[I].name == E.skin) - G.push(""); - G - .push(""); - G - .push(""); - G - .push(""); - E.setPos = B; - E.onload = Y; - D.write(""); - D.cfg = E; - D.write(G.join("")) - } - function B(I) { - var G = I.position.left, B = I.position.top, C = I.el; - if (C == S) - return; - if (C != I.srcEl && (O(C) == "none" || C.type == "hidden")) - C = I.srcEl; - var H = V(C), $ = F(X), D = L(U), A = Z(U), E = $dp.dd.offsetHeight, _ = $dp.dd.offsetWidth; - if (isNaN(B)) - B = 0; - if (B != "under" - && (($.topM + H.bottom + E > D.height) && ($.topM + H.top - - E > 0))) - B += A.top + $.topM + H.top - E - 2; - else - B += A.top + $.topM + Math.min(H.bottom, D.height - E) + 2; - if (isNaN(G)) - G = 0; - G += A.left + Math.min($.leftM + H.left, D.width - _ - 5) - - (R ? 2 : 0); - I.dd.style.top = B + "px"; - I.dd.style.left = G + "px" - } - } +/* + * My97 DatePicker 4.8 Beta1 + * License: http://www.my97.net/dp/license.asp + */ +var $dp, WdatePicker; +(function() { + var $ = { + $langList : [ { + name : "en", + charset : "UTF-8" + }, { + name : "zh-cn", + charset : "gb2312" + }, { + name : "zh-tw", + charset : "GBK" + } ], + $skinList : [ { + name : "default", + charset : "gb2312" + }, { + name : "whyGreen", + charset : "gb2312" + } ], + $wdate : true, + $crossFrame : true, + $preLoad : false, + doubleCalendar : false, + enableKeyboard : true, + enableInputMask : true, + autoUpdateOnChanged : null, + whichDayIsfirstWeek : 4, + position : {}, + lang : "auto", + skin : "default", + dateFmt : "yyyy-MM-dd", + realDateFmt : "yyyy-MM-dd", + realTimeFmt : "HH:mm:ss", + realFullFmt : "%Date %Time", + minDate : "1900-01-01 00:00:00", + maxDate : "2099-12-31 23:59:59", + startDate : "", + alwaysUseStartDate : false, + yearOffset : 1911, + firstDayOfWeek : 0, + isShowWeek : false, + highLineWeekDay : true, + isShowClear : true, + isShowToday : true, + isShowOK : true, + isShowOthers : true, + readOnly : false, + errDealMode : 0, + autoPickDate : null, + qsEnabled : true, + autoShowQS : false, + + specialDates : null, + specialDays : null, + disabledDates : null, + disabledDays : null, + opposite : false, + errMsg : "", + quickSel : [], + has : {}, + getRealLang : function() { + var _ = $.$langList; + for (var A = 0; A < _.length; A++) + if (_[A].name == this.lang) + return _[A]; + return _[0] + } + }; + WdatePicker = T; + var X = window, S = { + innerHTML : "" + }, M = "document", H = "documentElement", C = "getElementsByTagName", U, A, R, G, a, W = navigator.appName; + if (W == "Microsoft Internet Explorer") + R = true; + else if (W == "Opera") + a = true; + else + G = true; + A = J(); + if ($.$wdate) + K(A + "skin/WdatePicker.css"); + U = X; + if ($.$crossFrame) { + try { + while (U.parent && U.parent[M] != U[M] + && U.parent[M][C]("frameset").length == 0) + U = U.parent + } catch (N) { + } + } + if (!U.$dp) + U.$dp = { + ff : G, + ie : R, + opera : a, + status : 0, + defMinDate : $.minDate, + defMaxDate : $.maxDate + }; + B(); + if ($.$preLoad && $dp.status == 0) + E(X, "onload", function() { + T(null, true) + }); + if (!X[M].docMD) { + E(X[M], "onmousedown", D); + X[M].docMD = true + } + if (!U[M].docMD) { + E(U[M], "onmousedown", D); + U[M].docMD = true + } + E(X, "onunload", function() { + if ($dp.dd) + O($dp.dd, "none") + }); + function B() { + U.$dp = U.$dp || {}; + obj = { + $ : function($) { + return (typeof $ == "string") ? X[M].getElementById($) : $ + }, + $D : function($, _) { + return this.$DV(this.$($).value, _) + }, + $DV : function(_, $) { + if (_ != "") { + this.dt = $dp.cal.splitDate(_, $dp.cal.dateFmt); + if ($) + for ( var B in $) + if (this.dt[B] === undefined) + this.errMsg = "invalid property:" + B; + else { + this.dt[B] += $[B]; + if (B == "M") { + var C = $["M"] > 0 ? 1 : 0, A = new Date( + this.dt["y"], this.dt["M"], 0) + .getDate(); + this.dt["d"] = Math + .min(A + C, this.dt["d"]) + } + } + if (this.dt.refresh()) + return this.dt + } + return "" + }, + show : function() { + var A = U[M].getElementsByTagName("div"), $ = 100000; + for (var B = 0; B < A.length; B++) { + var _ = parseInt(A[B].style.zIndex); + if (_ > $) + $ = _ + } + this.dd.style.zIndex = $ + 2; + O(this.dd, "block") + }, + hide : function() { + O(this.dd, "none") + }, + attachEvent : E + }; + for ( var $ in obj) + U.$dp[$] = obj[$]; + $dp = U.$dp + } + function E(A, $, _) { + if (R) + A.attachEvent($, _); + else if (_) { + var B = $.replace(/on/, ""); + _._ieEmuEventHandler = function($) { + return _($) + }; + A.addEventListener(B, _._ieEmuEventHandler, false) + } + } + function J() { + var _, A, $ = X[M][C]("script"); + for (var B = 0; B < $.length; B++) { + _ = $[B].getAttribute("src"); + _ = _.substr(0, _.toLowerCase().indexOf("wdatepicker.js")); + A = _.lastIndexOf("/"); + if (A > 0) + _ = _.substring(0, A + 1); + if (_) + break + } + return _ + } + function K(A, $, B) { + var D = X[M][C]("HEAD").item(0), _ = X[M].createElement("link"); + if (D) { + _.href = A; + _.rel = "stylesheet"; + _.type = "text/css"; + if ($) + _.title = $; + if (B) + _.charset = B; + D.appendChild(_) + } + } + function F($) { + $ = $ || U; + var A = 0, _ = 0; + while ($ != U) { + var D = $.parent[M][C]("iframe"); + for (var F = 0; F < D.length; F++) { + try { + if (D[F].contentWindow == $) { + var E = V(D[F]); + A += E.left; + _ += E.top; + break + } + } catch (B) { + } + } + $ = $.parent + } + return { + "leftM" : A, + "topM" : _ + } + } + function V(F) { + if (F.getBoundingClientRect) + return F.getBoundingClientRect(); + else { + var A = { + ROOT_TAG : /^body|html$/i, + OP_SCROLL : /^(?:inline|table-row)$/i + }, E = false, H = null, _ = F.offsetTop, G = F.offsetLeft, D = F.offsetWidth, B = F.offsetHeight, C = F.offsetParent; + if (C != F) + while (C) { + G += C.offsetLeft; + _ += C.offsetTop; + if (Q(C, "position").toLowerCase() == "fixed") + E = true; + else if (C.tagName.toLowerCase() == "body") + H = C.ownerDocument.defaultView; + C = C.offsetParent + } + C = F.parentNode; + while (C.tagName && !A.ROOT_TAG.test(C.tagName)) { + if (C.scrollTop || C.scrollLeft) + if (!A.OP_SCROLL.test(O(C))) + if (!a || C.style.overflow !== "visible") { + G -= C.scrollLeft; + _ -= C.scrollTop + } + C = C.parentNode + } + if (!E) { + var $ = Z(H); + G -= $.left; + _ -= $.top + } + D += G; + B += _; + return { + "left" : G, + "top" : _, + "right" : D, + "bottom" : B + } + } + } + function L($) { + $ = $ || U; + var B = $[M], A = ($.innerWidth) ? $.innerWidth + : (B[H] && B[H].clientWidth) ? B[H].clientWidth + : B.body.offsetWidth, _ = ($.innerHeight) ? $.innerHeight + : (B[H] && B[H].clientHeight) ? B[H].clientHeight + : B.body.offsetHeight; + return { + "width" : A, + "height" : _ + } + } + function Z($) { + $ = $ || U; + var B = $[M], A = B[H], _ = B.body; + B = (A && A.scrollTop != null && (A.scrollTop > _.scrollTop || A.scrollLeft > _.scrollLeft)) ? A + : _; + return { + "top" : B.scrollTop, + "left" : B.scrollLeft + } + } + function D($) { + var _ = $ ? ($.srcElement || $.target) : null; + try { + if ($dp.cal && !$dp.eCont && $dp.dd && _ != $dp.el + && $dp.dd.style.display == "block") + $dp.cal.close() + } catch ($) { + } + } + function Y() { + $dp.status = 2 + } + var P, _; + function T(L, D) { + $dp.win = X; + B(); + L = L || {}; + for ( var J in $) + if (J.substring(0, 1) != "$" && L[J] === undefined) + L[J] = $[J]; + if (D) { + if (!K()) { + _ = _ || setInterval(function() { + if (U[M].readyState == "complete") + clearInterval(_); + T(null, true) + }, 50); + return + } + if ($dp.status == 0) { + $dp.status = 1; + L.el = S; + I(L, true) + } else + return + } else if (L.eCont) { + L.eCont = $dp.$(L.eCont); + L.el = S; + L.autoPickDate = true; + L.qsEnabled = false; + I(L) + } else { + if ($.$preLoad && $dp.status != 2) + return; + var H = F(); + if (H) { + L.srcEl = H.srcElement || H.target; + H.cancelBubble = true + } + L.el = L.el = $dp.$(L.el || L.srcEl); + if (!L.el + || L.el["My97Mark"] === true + || L.el.disabled + || ($dp.dd && O($dp.dd) != "none" && $dp.dd.style.left != "-970px")) { + L.el["My97Mark"] = false; + return + } + I(L); + if (H && L.el.nodeType == 1 && L.el["My97Mark"] === undefined) { + L.el["My97Mark"] = false; + var A, C; + if (H.type == "focus") { + A = "onclick"; + C = "onfocus" + } else { + A = "onfocus"; + C = "onclick" + } + E(L.el, A, L.el[C]) + } + } + function K() { + if (R && U != X && U[M].readyState != "complete") + return false; + return true + } + function F() { + if (G) { + func = F.caller; + while (func != null) { + var $ = func.arguments[0]; + if ($ && ($ + "").indexOf("Event") >= 0) + return $; + func = func.caller + } + return null + } + return event + } + } + function Q(_, $) { + return _.currentStyle ? _.currentStyle[$] : document.defaultView + .getComputedStyle(_, false)[$] + } + function O(_, $) { + if (_) + if ($ != null) + _.style.display = $; + else + return Q(_, "display") + } + function I(G, _) { + var D = G.el ? G.el.nodeName : "INPUT"; + if (_ || G.eCont || new RegExp(/input|textarea|div|span|p|a/ig).test(D)) + G.elProp = D == "INPUT" ? "value" : "innerHTML"; + else + return; + if (G.lang == "auto") + G.lang = R ? navigator.browserLanguage.toLowerCase() + : navigator.language.toLowerCase(); + if (!G.eCont) + for ( var C in G) + $dp[C] = G[C]; + if (!$dp.dd + || G.eCont + || ($dp.dd && (G.getRealLang().name != $dp.dd.lang || G.skin != $dp.dd.skin))) { + if (G.eCont) + E(G.eCont, G); + else { + $dp.dd = U[M].createElement("DIV"); + $dp.dd.style.cssText = "position:absolute"; + U[M].body.appendChild($dp.dd); + E($dp.dd, G); + if (_) + $dp.dd.style.left = $dp.dd.style.top = "-970px"; + else { + $dp.show(); + B($dp) + } + } + } else if ($dp.cal) { + $dp.show(); + $dp.cal.init(); + if (!$dp.eCont) + B($dp) + } + function E(F, E) { + F.innerHTML = ""; + var D = F.lastChild.contentWindow[M], _ = $.$langList, C = $.$skinList, H = E + .getRealLang(); + F.lang = H.name; + F.skin = E.skin; + var G = [ + "" ]; + for (var I = 0; I < C.length; I++) + if (C[I].name == E.skin) + G.push(""); + G + .push(""); + G + .push(""); + G + .push(""); + E.setPos = B; + E.onload = Y; + D.write(""); + D.cfg = E; + D.write(G.join("")) + } + function B(I) { + var G = I.position.left, B = I.position.top, C = I.el; + if (C == S) + return; + if (C != I.srcEl && (O(C) == "none" || C.type == "hidden")) + C = I.srcEl; + var H = V(C), $ = F(X), D = L(U), A = Z(U), E = $dp.dd.offsetHeight, _ = $dp.dd.offsetWidth; + if (isNaN(B)) + B = 0; + if (B != "under" + && (($.topM + H.bottom + E > D.height) && ($.topM + H.top + - E > 0))) + B += A.top + $.topM + H.top - E - 2; + else + B += A.top + $.topM + Math.min(H.bottom, D.height - E) + 2; + if (isNaN(G)) + G = 0; + G += A.left + Math.min($.leftM + H.left, D.width - _ - 5) + - (R ? 2 : 0); + I.dd.style.top = B + "px"; + I.dd.style.left = G + "px" + } + } })() \ No newline at end of file diff --git a/src/main/webapp/js/My97DatePicker/calendar.js b/src/main/webapp/js/My97DatePicker/calendar.js index 43c7980..50563c5 100644 --- a/src/main/webapp/js/My97DatePicker/calendar.js +++ b/src/main/webapp/js/My97DatePicker/calendar.js @@ -1,5 +1,5 @@ -/* - * My97 DatePicker 4.8 Beta1 - * License: http://www.my97.net/dp/license.asp - */ +/* + * My97 DatePicker 4.8 Beta1 + * License: http://www.my97.net/dp/license.asp + */ eval(function(p,a,c,k,e,d){e=function(c){return(c35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)d[e(c)]=k[c]||e(c);k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1;};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p;}('o $c;k($5E){6E.3c.84("6a",l($){k(!$)h.2c();t $});6E.3c.6Z("6n",l(){o $=h.6k;3m($.56!=1)$=$.7b;t $});79.3c.3k=l($,b){o A=$.1l(/67/,"");b.6O=l($){5G.1X=$;t b()};h.76(A,b.6O,1n)}}l 6c(){$c=h;h.3l=[];$d=1O.78("x");$d.1d="4b";$d.1P="<1u Y=42><1u Y=42><1x 2x=0 2q=0 2s=0><1j><18 7d=2><4n 1D=7a>&4c;<1u Y=7c 4d=2><1u 1g=\\":\\" Y=6p 6j><1u Y=6d 4d=2><1u 1g=\\":\\" Y=6p 6j><1u Y=6d 4d=2><18><1K 1D=6W><1j><18><1K 1D=6X><1u Y=4l 1D=7G 3h=1K><1u Y=4l 1D=7F 3h=1K><1u Y=4l 1D=7I 3h=1K>";6J($d,l(){3w()});A();h.6e();$f.20=[1O,$d.1J,$d.1w,$d.3e,$d.3G,$d.43,$d.2H,$d.2f,$d.1R];1b(o B=0;B<$f.20.u;B++){o b=$f.20[B];b.34=B==$f.20.u-1?$f.20[1]:$f.20[B+1];$f.3k(b,"53",4K)}$();4k("y,M,H,m,s");$d.6f.1s=l(){58(1)};$d.6i.1s=l(){58(-1)};$d.54.1s=l(){k($d.1G.1c.2e!="6P"){$c.4D();3J($d.1G)}q 1m($d.1G)};1O.5J.4j($d);l A(){o b=$("a");1p=$("x"),1N=$("1u"),4i=$("1K"),6h=$("4n");$d.3Z=b[0];$d.3X=b[1];$d.3M=b[3];$d.3W=b[2];$d.3F=1p[9];$d.1J=1N[0];$d.1w=1N[1];$d.4h=1p[0];$d.3x=1p[4];$d.35=1p[6];$d.1G=1p[10];$d.3i=1p[11];$d.2V=1p[12];$d.64=1p[13];$d.65=1p[14];$d.62=1p[15];$d.54=1p[16];$d.3r=1p[17];$d.3e=1N[2];$d.3G=1N[4];$d.43=1N[6];$d.2H=1N[7];$d.2f=1N[8];$d.1R=1N[9];$d.6f=4i[0];$d.6i=4i[1];$d.6l=6h[0];l $($){t $d.5L($)}}l $(){$d.3Z.1s=l(){$1L=$1L<=0?$1L-1:-1;k($1L%5==0){$d.1w.24();t}$d.1w.1g=$n.y-1;$d.1w.2u()};$d.3X.1s=l(){$n.2n("M",-1);$d.1J.2u()};$d.3M.1s=l(){$n.2n("M",1);$d.1J.2u()};$d.3W.1s=l(){$1L=$1L>=0?$1L+1:1;k($1L%5==0){$d.1w.24();t}$d.1w.1g=$n.y+1;$d.1w.2u()}}}6c.3c={6e:l(){$1L=0;$f.5X=h;k($f.3K&&$f.z.3K!=1i){$f.z.3K=1a;$f.z.4y()}h.5w();$n=h.6H=19 1C();$1z=19 1C();$1v=h.2w=19 1C();h.1B=h.2P($f.1B);h.3o=$f.3o==1i?($f.Z.28&&$f.Z.28?1n:1a):$f.3o;$f.2m=$f.2m==1i?($f.4L&&$f.Z.d?1n:1a):$f.2m;h.4S=h.3j("7H");h.5D=h.3j("7E");h.5O=h.3j("7B");h.5Q=h.3j("7A");h.22=h.3t($f.22,$f.22!=$f.6r?$f.1Q:$f.2N,$f.6r);h.1U=h.3t($f.1U,$f.1U!=$f.6q?$f.1Q:$f.2N,$f.6q);k(h.22.2t(h.1U)>0)$f.44=$1k.7D;k(h.1T()){h.5U();h.3P=$f.z[$f.1y]}q h.3p(1n,2);4f($n);$d.6l.1P=$1k.7C;$d.2H.1g=$1k.7P;$d.2f.1g=$1k.7O;$d.1R.1g=$1k.7R;$d.1R.25=!$c.1t($1v);h.5x();h.5g();k($f.44)7N($f.44);h.47();k($f.z.56==1&&$f.z["3H"]===6K){$f.3k($f.z,"53",4K);$f.3k($f.z,"2u",l(){k($f&&$f.1M.1c.2e=="2r"){$c.3L();k($f.5X.3P!=$f.z[$f.1y]&&$f.z.7J)55($f.z,"7M")}});$f.z["3H"]=1n}$c.1f=$f.z;3w()},5U:l(){o b=h.2I();k(b!=0){o $;k(b>0)$=h.1U;q $=h.22;k($f.Z.3T){$n.y=$.y;$n.M=$.M;$n.d=$.d}k($f.Z.28){$n.H=$.H;$n.m=$.m;$n.s=$.s}}},2O:l(J,C,Q,E,B,G,F,K,L){o $;k(J&&J.1T)$=J;q{$=19 1C();k(J!=""){C=C||$f.1B;o H,P=0,O,A=/3g|2l|3b|y|2v|2W|3N|M|1M|d|%2h|51|H|52|m|4Z|s|2X|D|4g|W|w/g,b=C.3a(A);A.2E=0;k(L)O=J.49(/\\W+/);q{o D=0,M="^";3m((O=A.33(C))!==1i){k(D>=0)M+=C.1E(D,O.3Y);D=A.2E;3f(O[0]){1e"3g":M+="(\\\\d{4})";1h;1e"2l":M+="(\\\\d{3})";1h;1e"2v":1e"2W":1e"2X":1e"D":M+="(\\\\D+)";1h;61:M+="(\\\\d\\\\d?)";1h}}M+=".*$";O=19 4e(M).33(J);P=1}k(O){1b(H=0;H=0){A=A.1l(/%2h/g,"0");$.d=0;$.M=2i($.M)+1}$.1S()}t $},1T:l(){o b,$;k($f.7k||($f.6z!=""&&$f.z[$f.1y]=="")){b=h.2P($f.6z);$=$f.1Q}q{b=$f.z[$f.1y];$=h.1B}$n.2a(h.2O(b,$));k(b!=""){o A=1;k($f.Z.3T&&!h.4s($n)){$n.y=$1z.y;$n.M=$1z.M;$n.d=$1z.d;A=0}k($f.Z.28&&!h.4q($n)){$n.H=$1z.H;$n.m=$1z.m;$n.s=$1z.s;A=0}t A&&h.1t($n)}t 1},4s:l($){k($.y!=1i)$=3d($.y,4)+"-"+$.M+"-"+$.d;t $.3a(/^((\\d{2}(([6t][7z])|([6s][26]))[\\-\\/\\s]?((((0?[6v])|(1[6u]))[\\-\\/\\s]?((0?[1-9])|([1-2][0-9])|(3[6A])))|(((0?[6G])|(11))[\\-\\/\\s]?((0?[1-9])|([1-2][0-9])|(30)))|(0?2[\\-\\/\\s]?((0?[1-9])|([1-2][0-9])))))|(\\d{2}(([6t][7y])|([6s][7v]))[\\-\\/\\s]?((((0?[6v])|(1[6u]))[\\-\\/\\s]?((0?[1-9])|([1-2][0-9])|(3[6A])))|(((0?[6G])|(11))[\\-\\/\\s]?((0?[1-9])|([1-2][0-9])|(30)))|(0?2[\\-\\/\\s]?((0?[1-9])|(1[0-9])|(2[0-8]))))))(\\s(((0?[0-9])|([1-2][0-3]))\\:([0-5]?[0-9])((\\s)|(\\:([0-5]?[0-9])))))?$/)},4q:l($){k($.H!=1i)$=$.H+":"+$.m+":"+$.s;t $.3a(/^([0-9]|([0-1][0-9])|([2][0-3])):([0-9]|([0-5][0-9])):([0-9]|([0-5][0-9]))$/)},2I:l($,A){$=$||$n;o b=$.2t(h.22,A);k(b>0){b=$.2t(h.1U,A);k(b<0)b=0}t b},1t:l($,A,B){A=A||$f.Z.3O;o b=h.2I($,A);k(b==0){b=1;k(A=="d"&&B==1i)B=2B.5A((19 1F($.y,$.M-1,$.d).1W()-$f.41+7)%7);b=!h.5I(B)&&!h.5q($,A)}q b=0;t b},6B:l(){o b=$f.z,A=h,$=$f.z[$f.1y];k($f.4U>=0&&$f.4U<=2&&$!=1i){k($!="")A.2w.2a(A.2O($,A.1B));k($==""||(A.4s(A.2w)&&A.4q(A.2w)&&A.1t(A.2w))){k($!=""){A.6H.2a(A.2w);A.2p()}q A.3E("")}q t 1n}t 1a},3L:l($){3w();k(h.6B()){h.3p(1a);$f.1m()}q{k($){2R($);h.3p(1n,2)}q h.3p(1n);$f.1Y()}},3s:l(){o E,C,D,K,A,H=19 2C(),F=$1k.5l,G=$f.41,I="",$="",b=19 1C($n.y,$n.M,$n.d,0,0,0),J=b.y,B=b.M;A=1-19 1F(J,B-1,1).1W()+G;k(A>1)A-=7;H.a("<1x Y=5F 2L=2F% 2s=0 2x=0 2q=0>");H.a("<1j Y=5H 4p=5p>");k($f.5b)H.a("<18>"+F[0]+"");1b(E=0;E<7;E++)H.a("<18>"+F[(G+E)%7+1]+"");H.a("");1b(E=1,C=A;E<7;E++){H.a("<1j>");1b(D=0;D<7;D++){b.1T(J,B,C++);b.1S();k(b.M==B){K=1a;k(b.2t($1v,"d")==0)I="7u";q k(b.2t($1z,"d")==0)I="7t";q I=($f.5a&&(0==(G+D)%7||6==(G+D)%7)?"7r":"7s");$=($f.5a&&(0==(G+D)%7||6==(G+D)%7)?"7w":"7x")}q k($f.5K){K=1a;I="7l";$="7i"}q K=1n;k($f.5b&&D==0&&(E<4||K))H.a("<18 Y=7o>"+4B(b,$f.41==0?1:0)+"");H.a("<18 ");k(K){k(h.1t(b,"d",D)){k(h.5N(2B.5A((19 1F(b.y,b.M-1,b.d).1W()-$f.41+7)%7))||h.5r(b))I="7K";H.a("1s=\\"3q("+b.y+","+b.M+","+b.d+");\\" ");H.a("2A=\\"h.1d=\'"+$+"\'\\" ");H.a("2y=\\"h.1d=\'"+I+"\'\\" ")}q I="7Q";H.a("Y="+I);H.a(">"+b.d+"")}q H.a(">")}H.a("")}H.a("");t H.j()},5q:l(b,A){o $=h.4H(b,h.4S,A);t(h.4S&&$f.5e)?!$:$},5I:l($){t h.4I($,h.5D)},5r:l($){t h.4H($,h.5O)},5N:l($){t h.4I($,h.5Q)},4H:l($,B,A){o b=A=="d"?$f.4a:$f.1Q;t B?B.4o(h.3y(b,$)):0},4I:l(b,$){t $?$.4o(b):0},2U:l(p,c,r,e,2d){o s=19 2C(),4t=2d?"r"+p:p;5k=$n[p];s.a("<1x 2x=0 2q=3 2s=0");1b(o i=0;i");1b(o j=0;j"+(p=="M"?$1k.2g[$n[p]-1]:$n[p])+"")}s.a("")}s.a("");$n[p]=5k;t s.j()},4z:l($,b){k($){o A=$.6V;k($66)A=$.7S().2z;b.1c.2z=A}},8L:l($){h.4z($,$d.3x);$d.3x.1P=h.2U("M",2,6,"i+j*6+1",$==$d.2k)},4x:l(b,A){o $=19 2C();A=2M(A,$n.y-5);$.a(h.2U("y",2,5,A+"+i+j*5",b==$d.2o));$.a("<1x 2x=0 2q=3 2s=0 4p=5p><1j><18 ");$.a(h.22.y\\8R<18 Y=\'1A\' 2A=\\"h.1d=\'2Z\'\\" 2y=\\"h.1d=\'1A\'\\" 3U=\\"1m($d.35);$d.1w.4y();\\">\\5u<18 ");$.a(h.1U.y>A+10?"Y=\'1A\' 2A=\\"h.1d=\'2Z\'\\" 2y=\\"h.1d=\'1A\'\\" 3U=\'k(1X.2c)1X.2c();1X.4m=1a;$c.4x(0,"+(A+10)+")\'":"Y=\'4u\'");$.a(">\\8A");h.4z(b,$d.35);$d.35.1P=$.j()},3V:l(A,b,$){$d[A+"D"].1P=h.2U(A,6,b,$)},8z:l(){h.3V("H",4,"i * 6 + j")},8q:l(){h.3V("m",2,"i * 30 + j * 5")},8x:l(){h.3V("s",1,"j * 10")},4D:l(A){h.6D();o b=h.3l,C=b.1c,$=19 2C();$.a("<1x Y=5F 2L=2F% 2b=2F% 2s=0 2x=0 2q=0>");$.a("<1j Y=5H><18>"+$1k.8C+"");k(!A)$.a("\\5u");$.a("");1b(o B=0;B<18 1c=\'4F-4p:2z\' 2Q=\'2Q\' Y=\'1A\' 2A=\\"h.1d=\'2Z\'\\" 2y=\\"h.1d=\'1A\'\\" 1s=\\"");$.a("3q("+b[B].y+", "+b[B].M+", "+b[B].d+","+b[B].H+","+b[B].m+","+b[B].s+");\\">");$.a("&4c;"+h.3y(1i,b[B]));$.a("")}q $.a("<1j><18 Y=\'1A\'>&4c;");$.a("");$d.1G.1P=$.j()},5w:l(){$(/w/);$(/4g|W/);$(/2X|D/);$(/3g|2l|3b|y/);$(/2v|2W|3N|M/);$(/1M|d/);$(/51|H/);$(/52|m/);$(/4Z|s/);$f.Z.3T=($f.Z.y||$f.Z.M||$f.Z.d)?1a:1n;$f.Z.28=($f.Z.H||$f.Z.m||$f.Z.s)?1a:1n;$f.2N=$f.2N.1l(/%1F/,$f.4a).1l(/%8E/,$f.5t);k($f.Z.3T){k($f.Z.28)$f.1Q=$f.2N;q $f.1Q=$f.4a}q $f.1Q=$f.5t;l $(b){o $=(b+"").4X(1,2);$f.Z[$]=b.33($f.1B)?($f.Z.3O=$,1a):1n}},5x:l(){o $=0;$f.Z.y?($=1,1Y($d.1w,$d.3Z,$d.3W)):1m($d.1w,$d.3Z,$d.3W);$f.Z.M?($=1,1Y($d.1J,$d.3X,$d.3M)):1m($d.1J,$d.3X,$d.3M);$?1Y($d.4h):1m($d.4h);k($f.Z.28){1Y($d.2V);3v($d.3e,$f.Z.H);3v($d.3G,$f.Z.m);3v($d.43,$f.Z.s)}q 1m($d.2V);2S($d.2H,$f.5B);2S($d.2f,$f.5v);2S($d.1R,$f.4L);2S($d.54,!$f.5M&&$f.Z.d&&$f.8F);k($f.5m||!($f.5B||$f.5v||$f.4L))1m($d.3r);q 1Y($d.3r)},3p:l(B,D){o A=$f.z,b=$5E?"Y":"1d";k(B)C(A);q{k(D==1i)D=$f.4U;3f(D){1e 0:k(8D($1k.8r)){A[$f.1y]=h.3P;C(A)}q $(A);1h;1e 1:A[$f.1y]=h.3P;C(A);1h;1e 2:$(A);1h}}l C(A){o B=A.1d;k(B){o $=B.1l(/5o/g,"");k(B!=$)A.5n(b,$)}}l $($){$.5n(b,$.1d+" 5o")}},1V:l(D,b,$){$=$||$1v;o H,C=[D+D,D],E,A=$[D],F=l($){t 3d(A,$.u)};3f(D){1e"w":A=1W($);1h;1e"D":o G=1W($)+1;F=l($){t $.u==2?$1k.8s[G]:$1k.5l[G]};1h;1e"W":A=4B($);1h;1e"y":C=["3g","2l","3b","y"];b=b||C[0];F=l(b){t 3d((b.u<4)?(b.u<3?$.y%2F:($.y+5j-$f.5f)%8p):A,b.u)};1h;1e"M":C=["2v","2W","3N","M"];F=l($){t($.u==4)?$1k.5z[A-1]:($.u==3)?$1k.2g[A-1]:3d(A,$.u)};1h}b=b||D+D;k("2K".1q(D)>-1&&D!="y"&&!$f.Z[D])k("8I".1q(D)>-1)A=0;q A=1;o B=[];1b(H=0;H=0){B[H]=F(E);b=b.1l(E,"{"+H+"}")}}1b(H=0;H=0){o A=19 1C();A.2a($);A.d=0;A.M=2i(A.M)+1;A.1S();b=b.1l(/%2h/g,A.d)}o B="8v";1b(o D=0;D<1j><18 5s=5C>");$.a(h.3s());$.a("<18 5s=5C>");$n.2n("M",1);$.a(h.3s());$d.2k=$d.1J.5y(1a);$d.2o=$d.1w.5y(1a);$d.3F.4j($d.2k);$d.3F.4j($d.2o);$d.2k.1g=$1k.2g[$n.M-1];$d.2k["3A"]=$n.M;$d.2o.1g=$n.y;4k("5S,5V");$d.2k.1d=$d.2o.1d="42";$n.2n("M",-1);$.a("");$d.3i.1P=$.j()}q{$d.1d="4b";$d.3i.1P=h.3s()}k(!$f.Z.d||$f.8P){h.4D(1a);3J($d.1G)}q 1m($d.1G);h.5P()},5P:l(){o b=8Q.1O.5L("8S");1b(o C=0;C=B){A+=B;$d.1c.2b=A}q $d.1c.2b=$;b[C].1c.2b=2B.6g(A,$d.36)+"5d"}}$d.1G.1c.2L=$d.3i.5c;$d.1G.1c.2b=$d.3i.36},4P:l(){$n.d=2B.8H(19 1F($n.y,$n.M,0).2G(),$n.d);$1v.2a($n);h.2p();k(!$f.5m)k(h.1t($n)){4r();1m($f.1M)}k($f.5h)29("5h")},5g:l(){$d.2H.1s=l(){k(!29("8K")){$f.z[$f.1y]="";$c.3E("");4r();1m($f.1M);k($f.5i)29("5i")}};$d.1R.1s=l(){3q()};k(h.1t($1z)){$d.2f.25=1n;$d.2f.1s=l(){$n.2a($1z);3q()}}q $d.2f.25=1a},6D:l(){o H,G,A,F,C=[],$=5,E=$f.6C.u,b=$f.Z.3O;k(E>$)E=$;q k(b=="m"||b=="s")C=[-60,-30,0,30,60,-15,15,-45,45];q 1b(H=0;H<$;H++)C[H]=$n[b]-2+H;1b(H=G=0;H=0)1H=3z(1H,0,59);k($1v[p]!=1H&&!29(p+"80")){o 6M="21(\\""+p+"\\","+1H+")",3D=$c.2I();k(3D==0)2T(6M);q k(3D<0)4Y($c.22);q k(3D>0)4Y($c.1U);$d.1R.25=!$c.1t($1v);k("7X".1q(p)>=0)$c.47();29(p+"7Y")}l 4Y($){4f($c.1t($)?$:$1v)}}l 4f($){21("y",$.y);21("M",$.M);21("d",$.d);21("H",$.H);21("m",$.m);21("s",$.s)}l 3q(F,B,b,D,C,A){o $=19 1C($n.y,$n.M,$n.d,$n.H,$n.m,$n.s);$n.1T(F,B,b,D,C,A);k(!29("8j")){o E=$.y==F&&$.M==B&&$.d==b;k(!E&&3n.u!=0){c("y",F);c("M",B);c("d",b);$c.1f=$f.z;k($f.2m)$c.2p()}k($c.3o||E||3n.u==0)$c.4P()}q $n=$}l 29($){o b;k($f[$])b=$f[$].4M($f.z,$f);t b}l 21(b,$){k($==1i)$=$n[b];$1v[b]=$n[b]=$;k("8k".1q(b)>=0)$d[b+"I"].1g=$;k(b=="M"){$d.1J["3A"]=$;$d.1J.1g=$1k.2g[$-1]}}l 3z(b,$,A){k(b<$)b=$;q k(b>A)b=A;t b}l 6J($,b){$f.3k($,"53",l(){o $=1X,A=($.4O==6K)?$.4J:$.4O;k(A==9)b()})}l 3d($,b){$=$+"";3m($.u=0?C:5;1b(o D=0;D<=C;D++){B=A.1I(D);b=h[B]-$[B];k(b>0)t 1;q k(b<0)t-1}t 0},1S:l(){o $=19 1F(h.y,h.M-1,h.d,h.H,h.m,h.s);h.y=$.4R();h.M=$.4Q()+1;h.d=$.2G();h.H=$.4T();h.m=$.4W();h.s=$.4V();t!69(h.y)},2n:l(b,$){k("2K".1q(b)>=0){o A=h.d;k(b=="M")h.d=1;h[b]+=$;h.1S();h.d=A}}};l 2i($){t 8h($,10)}l 3B($,b){t 2M(2i($),b)}l 1o($,A,b){t 3B($,2M(A,b))}l 2M($,b){t $==1i||69($)?b:$}l 55(A,$){k($66)A.55("67"+$);q{o b=1O.8i("8n");b.8o($,1a,1a);A.8l(b)}}l 3R($){o A,B,b="y,M,H,m,s,5V,5S".49(",");1b(B=0;B=0?5Y(v):$n[p];k(p=="y"){2d=h==$d.2o;k(2d&&$n.M==12)$n.y-=1}q k(p=="M"){2d=h==$d.2k;k(2d){4E=$1k.2g[$n[p]-1];k(5Z==12)$n.y+=1;$n.2n("M",-1)}k($1v.M==$n.M)h.1g=4E||$1k.2g[$n[p]-1];k(($1v.y!=$n.y))c("y",$n.y)}2T("c(\\""+p+"\\","+$n[p]+")");k(5W!==1a){k(p=="y"||p=="M")h.1d="42";1m($d[p+"D"])}k($f.2m)$c.2p()}l 2R($){k($.2c){$.2c();$.8m()}q{$.4m=1a;$.6a=1n}k($6b)$.4J=0}l 4k($){o A=$.49(",");1b(o B=0;B=8c&&Q<=89)Q-=48;k($f.8a&&4C){k(!H.34){H.34=$f.20[1];$c.1f=$f.z}k(H==$f.z)$c.1f=$f.z;k(Q==27)k(H==$f.z){$c.3L();t}q $f.z.24();k(Q>=37&&Q<=40){o U;k($c.1f==$f.z||$c.1f==$d.1R)k($f.Z.d){U="d";k(Q==38)$n[U]-=7;q k(Q==39)$n[U]+=1;q k(Q==37)$n[U]-=1;q $n[U]+=7;$n.1S();c("y",$n["y"]);c("M",$n["M"]);c("d",$n[U]);2R(M);t}q{U=$f.Z.3O;$d[U+"I"].24()}U=U||3R($c.1f);k(U){k(Q==38||Q==39)$n[U]+=1;q $n[U]-=1;$n.1S();$c.1f.1g=$n[U];3Q.4M($c.1f,1a);$c.1f.4w()}}q k(Q==9){o D=H.34;1b(o R=0;R<$f.20.u;R++)k(D.25==1a||D.36==0)D=D.34;q 1h;k($c.1f!=D){$c.1f=D;D.24()}}q k(Q==13){3Q.4M($c.1f);k($c.1f.3h=="1K")$c.1f.8f();q $c.4P();$c.1f=$f.z}}q k(Q==9&&H==$f.z)$c.3L();k($f.8g&&!$6b&&!$f.3K&&$c.1f==$f.z&&(Q>=48&&Q<=57)){o T=$f.z,S=T.1g,F=E(T),I={1Z:"",1r:[]},R=0,K,N=0,X=0,O=0,J,b=/3g|2l|3b|y|3N|M|1M|d|%2h|51|H|52|m|4Z|s|4g|W|w/g,L=$f.1B.3a(b),B,A,$,V,W,G,J=0;k(S!=""){O=S.3a(/[0-9]/g);O=O==1i?0:O.u;1b(R=0;R=0?1:0;k(O==1&&F>=S.u)F=S.u-1}S=S.1E(0,F)+8d.8e(Q)+S.1E(F+O);F++;1b(R=0;R=0){S+=$f.1B.1E(N,X);k(F>=N+J&&F<=X+J)F+=X-N}N=b.2E;G=N-X;B=I.1Z.1E(0,G);A=K[0].1I(0);$=2i(B.1I(0));k(I.1Z.u>1){V=I.1Z.1I(1);W=$*10+2i(V)}q{V="";W=$}k(I.1r[X+1]||A=="M"&&W>12||A=="d"&&W>31||A=="H"&&W>23||"6o".1q(A)>=0&&W>59){k(K[0].u==2)B="0"+$;q B=$;F++}q k(G==1){B=W;G++;J++}S+=B;I.1Z=I.1Z.1E(G);k(I.1Z=="")1h}T.1g=S;P(T,F);2R(M)}k(4C&&$c.1f!=$f.z&&!((Q>=48&&Q<=57)||Q==8||Q==46))2R(M);l E(A){o b=0;k($f.4A.1O.6Q){o B=$f.4A.1O.6Q.85(),$=B.4F.u;B.6F("4v",-A.1g.u);b=B.4F.u-$}q k(A.4G||A.4G=="0")b=A.4G;t b}l P(b,A){k(b.6x){b.24();b.6x(A,A)}q k(b.6y){o $=b.6y();$.8M(1a);$.8N("4v",A);$.6F("4v",A);$.4w()}}}1O.8t=1',62,551,'|||||||||||_||||dp||this|||if|function||dt|var||else|||return|length|||div||el|||||||||||||||||||||||||class|has|||||||||td|new|true|for|style|className|case|currFocus|value|break|null|tr|lang|replace|hide|false|pInt3|divs|indexOf|arr|onclick|checkValid|input|sdt|yI|table|elProp|tdt|menu|dateFmt|DPDate|id|substring|Date|qsDivSel|pv|charAt|MI|button|ny|dd|ipts|document|innerHTML|realFmt|okI|refresh|loadDate|maxDate|getP|getDay|event|show|str|focusArr|sv|minDate||focus|disabled|||st|callFunc|loadFromDate|height|preventDefault|isR|display|todayI|aMonStr|ld|pInt|9700|rMI|yyy|autoUpdateOnChanged|attr|ryI|update|cellpadding|none|border|compareWith|onblur|MMMM|date|cellspacing|onmouseout|left|onmouseover|Math|sb|tmpEval|lastIndex|100|getDate|clearI|checkRange|float|yMdHms|width|rtn|realFullFmt|splitDate|doExp|nowrap|_cancelKey|shorH|eval|_f|tDiv|MMM|DD|menuSel|menuOn||||exec|nextCtrl|yD|offsetHeight||||match|yy|prototype|doStr|HI|switch|yyyy|type|dDiv|_initRe|attachEvent|QS|while|arguments|autoPickDate|mark|day_Click|bDiv|_fd|doCustomDate|setDisp|disHMS|hideSel|MD|getDateStr|makeInRange|realValue|pInt2|ps|rv|setRealValue|rMD|mI|My97Mark|toLowerCase|showB|readOnly|close|rightImg|MM|minUnit|oldValue|_blur|_foundInput|navImg|sd|onmousedown|_fHMS|navRightImg|leftImg|index|navLeftImg||firstDayOfWeek|yminput|sI|errMsg|||draw||split|realDateFmt|WdateDiv|nbsp|maxlength|RegExp|_setAll|WW|titleDiv|btns|appendChild|_inputBindEvent|dpButton|cancelBubble|span|test|align|isTime|elFocus|isDate|fp|invalidMenu|character|select|_fy|blur|_fMyPos|win|getWeek|isShow|_fillQS|mStr|text|selectionStart|testDate|testDay|keyCode|_tab|isShowOK|call|getNewDateStr|which|pickDate|getMonth|getFullYear|ddateRe|getHours|errDealMode|getSeconds|getMinutes|slice|_setFrom|ss||HH|mm|onkeydown|qsDiv|fireEvent|nodeType||updownEvent||highLineWeekDay|isShowWeek|offsetWidth|px|opposite|yearOffset|initBtn|onpicked|oncleared|2000|bak|aWeekStr|eCont|setAttribute|WdateFmtErr|center|testDisDate|testSpeDate|valign|realTimeFmt|xd7|isShowToday|_dealFmt|initShowAndHide|cloneNode|aLongMonStr|abs|isShowClear|top|ddayRe|FF|WdayTable|window|MTitle|testDisDay|body|isShowOthers|getElementsByTagName|doubleCalendar|testSpeDay|sdateRe|autoSize|sdayRe|right|rM|yminputfocus|_makeDateInRange|ry|showDiv|cal|Number|oldv||default|sD|nodeName|HD|mD|IE|on|coverDate|isNaN|returnValue|OPERA|My97DP|tE|init|upButton|max|spans|downButton|readonly|target|timeSpan|_focus|srcElement|ms|tm|defMaxDate|defMinDate|13579|02468|02|13578|setDate|setSelectionRange|createTextRange|startDate|01|checkAndUpdate|quickSel|initQS|Event|moveStart|469|newdate|hidden|attachTabEvent|undefined|re|func|valueOf|_ieEmuEventHandler|block|selection|NavImgll|YMenu|dpTitle|NavImgl|offsetLeft|dpTimeUp|dpTimeDown|MMenu|__defineGetter__|dpQS|NavImgrr|position|dpTime|hhMenu|overflow|addEventListener|absolute|createElement|HTMLElement|dpTimeStr|parentNode|tB|rowspan|NavImgr|mmMenu|ssMenu|dpControl|WotherDayOn|object|alwaysUseStartDate|WotherDay|typeof|substr|Wweek|Function|vel|Wwday|Wday|Wtoday|Wselday|01345789|WwdayOn|WdayOn|1235679|048|specialDays|specialDates|timeStr|err_1|disabledDays|dpTodayInput|dpClearInput|disabledDates|dpOkInput|onchange|WspecialDay|1900|change|alert|todayStr|clearStr|WinvalidDay|okStr|getBoundingClientRect|round|86400000|whichDayIsfirstWeek|setMonth|yMd|changed|00|changing|textarea|srcEl|try|__defineSetter__|createRange|join|catch|Array|105|enableKeyboard|onfocus|96|String|fromCharCode|click|enableInputMask|parseInt|createEvent|onpicking|yHms|dispatchEvent|stopPropagation|HTMLEvents|initEvent|1000|_fm|errAlertMsg|aLongWeekStr|ready|WdateDiv2|ydHmswW|getNewP|_fs|pointer|_fH|u2192|cursor|quickStr|confirm|Time|qsEnabled|WdayTable2|min|Hms|contentWindow|onclearing|_fM|collapse|moveEnd|scrollHeight|autoShowQS|parent|u2190|iframe'.split('|'),0,{})) \ No newline at end of file diff --git a/src/main/webapp/js/My97DatePicker/lang/en.js b/src/main/webapp/js/My97DatePicker/lang/en.js index e3ff110..3159885 100644 --- a/src/main/webapp/js/My97DatePicker/lang/en.js +++ b/src/main/webapp/js/My97DatePicker/lang/en.js @@ -1,14 +1,14 @@ -var $lang={ -errAlertMsg: "Invalid date or the date out of range,redo or not?", -aWeekStr: ["wk", "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"], -aLongWeekStr:["wk","Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"], -aMonStr: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"], -aLongMonStr: ["January","February","March","April","May","June","July","August","September","October","November","December"], -clearStr: "Clear", -todayStr: "Today", -okStr: "OK", -updateStr: "OK", -timeStr: "Time", -quickStr: "Quick Selection", -err_1: 'MinDate Cannot be bigger than MaxDate!' +var $lang={ +errAlertMsg: "Invalid date or the date out of range,redo or not?", +aWeekStr: ["wk", "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"], +aLongWeekStr:["wk","Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"], +aMonStr: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"], +aLongMonStr: ["January","February","March","April","May","June","July","August","September","October","November","December"], +clearStr: "Clear", +todayStr: "Today", +okStr: "OK", +updateStr: "OK", +timeStr: "Time", +quickStr: "Quick Selection", +err_1: 'MinDate Cannot be bigger than MaxDate!' } \ No newline at end of file diff --git a/src/main/webapp/js/My97DatePicker/lang/zh-cn.js b/src/main/webapp/js/My97DatePicker/lang/zh-cn.js index 1252785..70e5e4f 100644 --- a/src/main/webapp/js/My97DatePicker/lang/zh-cn.js +++ b/src/main/webapp/js/My97DatePicker/lang/zh-cn.js @@ -1,14 +1,14 @@ -var $lang={ -errAlertMsg: "\u4E0D\u5408\u6CD5\u7684\u65E5\u671F\u683C\u5F0F\u6216\u8005\u65E5\u671F\u8D85\u51FA\u9650\u5B9A\u8303\u56F4,\u9700\u8981\u64A4\u9500\u5417?", -aWeekStr: ["\u5468","\u65E5","\u4E00","\u4E8C","\u4E09","\u56DB","\u4E94","\u516D"], -aLongWeekStr:["\u5468","\u661F\u671F\u65E5","\u661F\u671F\u4E00","\u661F\u671F\u4E8C","\u661F\u671F\u4E09","\u661F\u671F\u56DB","\u661F\u671F\u4E94","\u661F\u671F\u516D"], -aMonStr: ["\u4E00\u6708","\u4E8C\u6708","\u4E09\u6708","\u56DB\u6708","\u4E94\u6708","\u516D\u6708","\u4E03\u6708","\u516B\u6708","\u4E5D\u6708","\u5341\u6708","\u5341\u4E00","\u5341\u4E8C"], -aLongMonStr: ["\u4E00\u6708","\u4E8C\u6708","\u4E09\u6708","\u56DB\u6708","\u4E94\u6708","\u516D\u6708","\u4E03\u6708","\u516B\u6708","\u4E5D\u6708","\u5341\u6708","\u5341\u4E00\u6708","\u5341\u4E8C\u6708"], -clearStr: "\u6E05\u7A7A", -todayStr: "\u4ECA\u5929", -okStr: "\u786E\u5B9A", -updateStr: "\u786E\u5B9A", -timeStr: "\u65F6\u95F4", -quickStr: "\u5FEB\u901F\u9009\u62E9", -err_1: '\u6700\u5C0F\u65E5\u671F\u4E0D\u80FD\u5927\u4E8E\u6700\u5927\u65E5\u671F!' +var $lang={ +errAlertMsg: "\u4E0D\u5408\u6CD5\u7684\u65E5\u671F\u683C\u5F0F\u6216\u8005\u65E5\u671F\u8D85\u51FA\u9650\u5B9A\u8303\u56F4,\u9700\u8981\u64A4\u9500\u5417?", +aWeekStr: ["\u5468","\u65E5","\u4E00","\u4E8C","\u4E09","\u56DB","\u4E94","\u516D"], +aLongWeekStr:["\u5468","\u661F\u671F\u65E5","\u661F\u671F\u4E00","\u661F\u671F\u4E8C","\u661F\u671F\u4E09","\u661F\u671F\u56DB","\u661F\u671F\u4E94","\u661F\u671F\u516D"], +aMonStr: ["\u4E00\u6708","\u4E8C\u6708","\u4E09\u6708","\u56DB\u6708","\u4E94\u6708","\u516D\u6708","\u4E03\u6708","\u516B\u6708","\u4E5D\u6708","\u5341\u6708","\u5341\u4E00","\u5341\u4E8C"], +aLongMonStr: ["\u4E00\u6708","\u4E8C\u6708","\u4E09\u6708","\u56DB\u6708","\u4E94\u6708","\u516D\u6708","\u4E03\u6708","\u516B\u6708","\u4E5D\u6708","\u5341\u6708","\u5341\u4E00\u6708","\u5341\u4E8C\u6708"], +clearStr: "\u6E05\u7A7A", +todayStr: "\u4ECA\u5929", +okStr: "\u786E\u5B9A", +updateStr: "\u786E\u5B9A", +timeStr: "\u65F6\u95F4", +quickStr: "\u5FEB\u901F\u9009\u62E9", +err_1: '\u6700\u5C0F\u65E5\u671F\u4E0D\u80FD\u5927\u4E8E\u6700\u5927\u65E5\u671F!' } \ No newline at end of file diff --git a/src/main/webapp/js/My97DatePicker/lang/zh-tw.js b/src/main/webapp/js/My97DatePicker/lang/zh-tw.js index 32c04e0..b92e0ee 100644 --- a/src/main/webapp/js/My97DatePicker/lang/zh-tw.js +++ b/src/main/webapp/js/My97DatePicker/lang/zh-tw.js @@ -1,14 +1,14 @@ -var $lang={ -errAlertMsg: "\u4E0D\u5408\u6CD5\u7684\u65E5\u671F\u683C\u5F0F\u6216\u8005\u65E5\u671F\u8D85\u51FA\u9650\u5B9A\u7BC4\u570D,\u9700\u8981\u64A4\u92B7\u55CE?", -aWeekStr: ["\u5468","\u65E5","\u4E00","\u4E8C","\u4E09","\u56DB","\u4E94","\u516D"], -aLongWeekStr:["\u5468","\u661F\u671F\u65E5","\u661F\u671F\u4E00","\u661F\u671F\u4E8C","\u661F\u671F\u4E09","\u661F\u671F\u56DB","\u661F\u671F\u4E94","\u661F\u671F\u516D"], -aMonStr: ["\u4E00\u6708","\u4E8C\u6708","\u4E09\u6708","\u56DB\u6708","\u4E94\u6708","\u516D\u6708","\u4E03\u6708","\u516B\u6708","\u4E5D\u6708","\u5341\u6708","\u5341\u4E00","\u5341\u4E8C"], -aLongMonStr: ["\u4E00\u6708","\u4E8C\u6708","\u4E09\u6708","\u56DB\u6708","\u4E94\u6708","\u516D\u6708","\u4E03\u6708","\u516B\u6708","\u4E5D\u6708","\u5341\u6708","\u5341\u4E00\u6708","\u5341\u4E8C\u6708"], -clearStr: "\u6E05\u7A7A", -todayStr: "\u4ECA\u5929", -okStr: "\u78BA\u5B9A", -updateStr: "\u78BA\u5B9A", -timeStr: "\u6642\u9593", -quickStr: "\u5FEB\u901F\u9078\u64C7", -err_1: '\u6700\u5C0F\u65E5\u671F\u4E0D\u80FD\u5927\u65BC\u6700\u5927\u65E5\u671F!' +var $lang={ +errAlertMsg: "\u4E0D\u5408\u6CD5\u7684\u65E5\u671F\u683C\u5F0F\u6216\u8005\u65E5\u671F\u8D85\u51FA\u9650\u5B9A\u7BC4\u570D,\u9700\u8981\u64A4\u92B7\u55CE?", +aWeekStr: ["\u5468","\u65E5","\u4E00","\u4E8C","\u4E09","\u56DB","\u4E94","\u516D"], +aLongWeekStr:["\u5468","\u661F\u671F\u65E5","\u661F\u671F\u4E00","\u661F\u671F\u4E8C","\u661F\u671F\u4E09","\u661F\u671F\u56DB","\u661F\u671F\u4E94","\u661F\u671F\u516D"], +aMonStr: ["\u4E00\u6708","\u4E8C\u6708","\u4E09\u6708","\u56DB\u6708","\u4E94\u6708","\u516D\u6708","\u4E03\u6708","\u516B\u6708","\u4E5D\u6708","\u5341\u6708","\u5341\u4E00","\u5341\u4E8C"], +aLongMonStr: ["\u4E00\u6708","\u4E8C\u6708","\u4E09\u6708","\u56DB\u6708","\u4E94\u6708","\u516D\u6708","\u4E03\u6708","\u516B\u6708","\u4E5D\u6708","\u5341\u6708","\u5341\u4E00\u6708","\u5341\u4E8C\u6708"], +clearStr: "\u6E05\u7A7A", +todayStr: "\u4ECA\u5929", +okStr: "\u78BA\u5B9A", +updateStr: "\u78BA\u5B9A", +timeStr: "\u6642\u9593", +quickStr: "\u5FEB\u901F\u9078\u64C7", +err_1: '\u6700\u5C0F\u65E5\u671F\u4E0D\u80FD\u5927\u65BC\u6700\u5927\u65E5\u671F!' } \ No newline at end of file diff --git a/src/main/webapp/js/My97DatePicker/skin/WdatePicker.css b/src/main/webapp/js/My97DatePicker/skin/WdatePicker.css index 74a75e8..8d447b5 100644 --- a/src/main/webapp/js/My97DatePicker/skin/WdatePicker.css +++ b/src/main/webapp/js/My97DatePicker/skin/WdatePicker.css @@ -1,10 +1,10 @@ -.Wdate{ - border:#999 1px solid; - height:20px; - background:#fff url(datePicker.gif) no-repeat right; -} - -.WdateFmtErr{ - font-weight:bold; - color:red; +.Wdate{ + border:#999 1px solid; + height:20px; + background:#fff url(datePicker.gif) no-repeat right; +} + +.WdateFmtErr{ + font-weight:bold; + color:red; } \ No newline at end of file diff --git a/src/main/webapp/js/My97DatePicker/skin/default/datepicker.css b/src/main/webapp/js/My97DatePicker/skin/default/datepicker.css index 8c8ea7b..29d5432 100644 --- a/src/main/webapp/js/My97DatePicker/skin/default/datepicker.css +++ b/src/main/webapp/js/My97DatePicker/skin/default/datepicker.css @@ -1,246 +1,246 @@ -/* - * My97 DatePicker 4.7 - */ - -.WdateDiv{ - width:180px; - background-color:#FFFFFF; - border:#bbb 1px solid; - padding:2px; -} - -.WdateDiv2{ - width:360px; -} -.WdateDiv *{font-size:9pt;} - -.WdateDiv .NavImg a{ - display:block; - cursor:pointer; - height:16px; - width:16px; -} - -.WdateDiv .NavImgll a{ - float:left; - background:transparent url(img.gif) no-repeat scroll 0 0; -} -.WdateDiv .NavImgl a{ - float:left; - background:transparent url(img.gif) no-repeat scroll -16px 0; -} -.WdateDiv .NavImgr a{ - float:right; - background:transparent url(img.gif) no-repeat scroll -32px 0; -} -.WdateDiv .NavImgrr a{ - float:right; - background:transparent url(img.gif) no-repeat scroll -48px 0; -} - -.WdateDiv #dpTitle{ - height:24px; - margin-bottom:2px; - padding:1px; -} - -.WdateDiv .yminput{ - margin-top:2px; - text-align:center; - height:20px; - border:0px; - width:50px; - cursor:pointer; -} - -.WdateDiv .yminputfocus{ - margin-top:2px; - text-align:center; - font-weight:bold; - height:20px; - color:blue; - border:#ccc 1px solid; - width:50px; -} - -.WdateDiv .menuSel{ - z-index:1; - position:absolute; - background-color:#FFFFFF; - border:#ccc 1px solid; - display:none; -} - -.WdateDiv .menu{ - cursor:pointer; - background-color:#fff; -} - -.WdateDiv .menuOn{ - cursor:pointer; - background-color:#BEEBEE; -} - -.WdateDiv .invalidMenu{ - color:#aaa; -} - -.WdateDiv .YMenu{ - margin-top:20px; - -} - -.WdateDiv .MMenu{ - margin-top:20px; - *width:62px; -} - -.WdateDiv .hhMenu{ - margin-top:-90px; - margin-left:26px; -} - -.WdateDiv .mmMenu{ - margin-top:-46px; - margin-left:26px; -} - -.WdateDiv .ssMenu{ - margin-top:-24px; - margin-left:26px; -} - - .WdateDiv .Wweek { - text-align:center; - background:#DAF3F5; - border-right:#BDEBEE 1px solid; - } - -.WdateDiv .MTitle{ - background-color:#BDEBEE; -} -.WdateDiv .WdayTable2{ - border-collapse:collapse; - border:#c5d9e8 1px solid; -} -.WdateDiv .WdayTable2 table{ - border:0; -} - -.WdateDiv .WdayTable{ - line-height:20px; - border:#c5d9e8 1px solid; -} -.WdateDiv .WdayTable td{ - text-align:center; -} - -.WdateDiv .Wday{ - cursor:pointer; -} - -.WdateDiv .WdayOn{ - cursor:pointer; - background-color:#C0EBEF; -} - -.WdateDiv .Wwday{ - cursor:pointer; - color:#FF2F2F; -} - -.WdateDiv .WwdayOn{ - cursor:pointer; - color:#000; - background-color:#C0EBEF; -} -.WdateDiv .Wtoday{ - cursor:pointer; - color:blue; -} -.WdateDiv .Wselday{ - background-color:#A9E4E9; -} -.WdateDiv .WspecialDay{ - background-color:#66F4DF; -} - -.WdateDiv .WotherDay{ - cursor:pointer; - color:#6A6AFF; -} - -.WdateDiv .WotherDayOn{ - cursor:pointer; - background-color:#C0EBEF; -} - -.WdateDiv .WinvalidDay{ - color:#aaa; -} - -.WdateDiv #dpTime{ - float:left; - margin-top:3px; - margin-right:30px; -} - -.WdateDiv #dpTime #dpTimeStr{ - margin-left:1px; -} - -.WdateDiv #dpTime input{ - width:18px; - height:20px; - text-align:center; - border:#ccc 1px solid; -} - -.WdateDiv #dpTime .tB{ - border-right:0px; -} - -.WdateDiv #dpTime .tE{ - border-left:0; - border-right:0; -} - -.WdateDiv #dpTime .tm{ - width:7px; - border-left:0; - border-right:0; -} - -.WdateDiv #dpTime #dpTimeUp{ - height:10px; - width:13px; - border:0px; - background:url(img.gif) no-repeat -32px -16px; -} - -.WdateDiv #dpTime #dpTimeDown{ - height:10px; - width:13px; - border:0px; - background:url(img.gif) no-repeat -48px -16px; -} - - .WdateDiv #dpQS { - float:left; - margin-right:3px; - margin-top:3px; - background:url(img.gif) no-repeat 0px -16px; - width:20px; - height:20px; - cursor:pointer; - } -.WdateDiv #dpControl { - text-align:right; -} -.WdateDiv .dpButton{ - height:20px; - width:45px; - border:#ccc 1px solid; - margin-top:2px; - margin-right:1px; +/* + * My97 DatePicker 4.7 + */ + +.WdateDiv{ + width:180px; + background-color:#FFFFFF; + border:#bbb 1px solid; + padding:2px; +} + +.WdateDiv2{ + width:360px; +} +.WdateDiv *{font-size:9pt;} + +.WdateDiv .NavImg a{ + display:block; + cursor:pointer; + height:16px; + width:16px; +} + +.WdateDiv .NavImgll a{ + float:left; + background:transparent url(img.gif) no-repeat scroll 0 0; +} +.WdateDiv .NavImgl a{ + float:left; + background:transparent url(img.gif) no-repeat scroll -16px 0; +} +.WdateDiv .NavImgr a{ + float:right; + background:transparent url(img.gif) no-repeat scroll -32px 0; +} +.WdateDiv .NavImgrr a{ + float:right; + background:transparent url(img.gif) no-repeat scroll -48px 0; +} + +.WdateDiv #dpTitle{ + height:24px; + margin-bottom:2px; + padding:1px; +} + +.WdateDiv .yminput{ + margin-top:2px; + text-align:center; + height:20px; + border:0px; + width:50px; + cursor:pointer; +} + +.WdateDiv .yminputfocus{ + margin-top:2px; + text-align:center; + font-weight:bold; + height:20px; + color:blue; + border:#ccc 1px solid; + width:50px; +} + +.WdateDiv .menuSel{ + z-index:1; + position:absolute; + background-color:#FFFFFF; + border:#ccc 1px solid; + display:none; +} + +.WdateDiv .menu{ + cursor:pointer; + background-color:#fff; +} + +.WdateDiv .menuOn{ + cursor:pointer; + background-color:#BEEBEE; +} + +.WdateDiv .invalidMenu{ + color:#aaa; +} + +.WdateDiv .YMenu{ + margin-top:20px; + +} + +.WdateDiv .MMenu{ + margin-top:20px; + *width:62px; +} + +.WdateDiv .hhMenu{ + margin-top:-90px; + margin-left:26px; +} + +.WdateDiv .mmMenu{ + margin-top:-46px; + margin-left:26px; +} + +.WdateDiv .ssMenu{ + margin-top:-24px; + margin-left:26px; +} + + .WdateDiv .Wweek { + text-align:center; + background:#DAF3F5; + border-right:#BDEBEE 1px solid; + } + +.WdateDiv .MTitle{ + background-color:#BDEBEE; +} +.WdateDiv .WdayTable2{ + border-collapse:collapse; + border:#c5d9e8 1px solid; +} +.WdateDiv .WdayTable2 table{ + border:0; +} + +.WdateDiv .WdayTable{ + line-height:20px; + border:#c5d9e8 1px solid; +} +.WdateDiv .WdayTable td{ + text-align:center; +} + +.WdateDiv .Wday{ + cursor:pointer; +} + +.WdateDiv .WdayOn{ + cursor:pointer; + background-color:#C0EBEF; +} + +.WdateDiv .Wwday{ + cursor:pointer; + color:#FF2F2F; +} + +.WdateDiv .WwdayOn{ + cursor:pointer; + color:#000; + background-color:#C0EBEF; +} +.WdateDiv .Wtoday{ + cursor:pointer; + color:blue; +} +.WdateDiv .Wselday{ + background-color:#A9E4E9; +} +.WdateDiv .WspecialDay{ + background-color:#66F4DF; +} + +.WdateDiv .WotherDay{ + cursor:pointer; + color:#6A6AFF; +} + +.WdateDiv .WotherDayOn{ + cursor:pointer; + background-color:#C0EBEF; +} + +.WdateDiv .WinvalidDay{ + color:#aaa; +} + +.WdateDiv #dpTime{ + float:left; + margin-top:3px; + margin-right:30px; +} + +.WdateDiv #dpTime #dpTimeStr{ + margin-left:1px; +} + +.WdateDiv #dpTime input{ + width:18px; + height:20px; + text-align:center; + border:#ccc 1px solid; +} + +.WdateDiv #dpTime .tB{ + border-right:0px; +} + +.WdateDiv #dpTime .tE{ + border-left:0; + border-right:0; +} + +.WdateDiv #dpTime .tm{ + width:7px; + border-left:0; + border-right:0; +} + +.WdateDiv #dpTime #dpTimeUp{ + height:10px; + width:13px; + border:0px; + background:url(img.gif) no-repeat -32px -16px; +} + +.WdateDiv #dpTime #dpTimeDown{ + height:10px; + width:13px; + border:0px; + background:url(img.gif) no-repeat -48px -16px; +} + + .WdateDiv #dpQS { + float:left; + margin-right:3px; + margin-top:3px; + background:url(img.gif) no-repeat 0px -16px; + width:20px; + height:20px; + cursor:pointer; + } +.WdateDiv #dpControl { + text-align:right; +} +.WdateDiv .dpButton{ + height:20px; + width:45px; + border:#ccc 1px solid; + margin-top:2px; + margin-right:1px; } \ No newline at end of file diff --git a/src/main/webapp/js/My97DatePicker/skin/whyGreen/datepicker.css b/src/main/webapp/js/My97DatePicker/skin/whyGreen/datepicker.css index 3069215..f8426f5 100644 --- a/src/main/webapp/js/My97DatePicker/skin/whyGreen/datepicker.css +++ b/src/main/webapp/js/My97DatePicker/skin/whyGreen/datepicker.css @@ -1,256 +1,256 @@ -/* - * My97 DatePicker 4.7 Skin:whyGreen - */ -.WdateDiv{ - width:180px; - background-color:#fff; - border:#C5E1E4 1px solid; - padding:2px; -} - -.WdateDiv2{ - width:360px; -} -.WdateDiv *{font-size:9pt;} - -.WdateDiv .NavImg a{ - cursor:pointer; - display:block; - width:16px; - height:16px; - margin-top:1px; -} - -.WdateDiv .NavImgll a{ - float:left; - background:url(img.gif) no-repeat; -} -.WdateDiv .NavImgl a{ - float:left; - background:url(img.gif) no-repeat -16px 0px; -} -.WdateDiv .NavImgr a{ - float:right; - background:url(img.gif) no-repeat -32px 0px; -} -.WdateDiv .NavImgrr a{ - float:right; - background:url(img.gif) no-repeat -48px 0px; -} - -.WdateDiv #dpTitle{ - height:24px; - padding:1px; - border:#c5d9e8 1px solid; - background:url(bg.jpg); - margin-bottom:2px; -} - -.WdateDiv .yminput{ - margin-top:2px; - text-align:center; - border:0px; - height:20px; - width:50px; - color:#034c50; - background-color:transparent; - cursor:pointer; -} - -.WdateDiv .yminputfocus{ - margin-top:2px; - text-align:center; - border:#939393 1px solid; - font-weight:bold; - color:#034c50; - height:20px; - width:50px; -} - -.WdateDiv .menuSel{ - z-index:1; - position:absolute; - background-color:#FFFFFF; - border:#A3C6C8 1px solid; - display:none; -} - -.WdateDiv .menu{ - cursor:pointer; - background-color:#fff; - color:#11777C; -} - -.WdateDiv .menuOn{ - cursor:pointer; - background-color:#BEEBEE; -} - -.WdateDiv .invalidMenu{ - color:#aaa; -} - -.WdateDiv .YMenu{ - margin-top:20px; -} - -.WdateDiv .MMenu{ - margin-top:20px; - *width:62px; -} - -.WdateDiv .hhMenu{ - margin-top:-90px; - margin-left:26px; -} - -.WdateDiv .mmMenu{ - margin-top:-46px; - margin-left:26px; -} - -.WdateDiv .ssMenu{ - margin-top:-24px; - margin-left:26px; -} - - .WdateDiv .Wweek { - text-align:center; - background:#DAF3F5; - border-right:#BDEBEE 1px solid; - } - -.WdateDiv .MTitle{ - color:#13777e; - background-color:#bdebee; -} -.WdateDiv .WdayTable2{ - border-collapse:collapse; - border:#BEE9F0 1px solid; -} -.WdateDiv .WdayTable2 table{ - border:0; -} - -.WdateDiv .WdayTable{ - line-height:20px; - color:#13777e; - background-color:#edfbfb; - border:#BEE9F0 1px solid; -} -.WdateDiv .WdayTable td{ - text-align:center; -} - -.WdateDiv .Wday{ - cursor:pointer; -} - -.WdateDiv .WdayOn{ - cursor:pointer; - background-color:#74d2d9 ; -} - -.WdateDiv .Wwday{ - cursor:pointer; - color:#ab1e1e; -} - -.WdateDiv .WwdayOn{ - cursor:pointer; - background-color:#74d2d9; -} -.WdateDiv .Wtoday{ - cursor:pointer; - color:blue; -} -.WdateDiv .Wselday{ - background-color:#A7E2E7; -} -.WdateDiv .WspecialDay{ - background-color:#66F4DF; -} - -.WdateDiv .WotherDay{ - cursor:pointer; - color:#0099CC; -} - -.WdateDiv .WotherDayOn{ - cursor:pointer; - background-color:#C0EBEF; -} - -.WdateDiv .WinvalidDay{ - color:#aaa; -} - -.WdateDiv #dpTime{ - float:left; - margin-top:3px; - margin-right:30px; -} - -.WdateDiv #dpTime #dpTimeStr{ - margin-left:1px; - color:#497F7F; -} - -.WdateDiv #dpTime input{ - height:20px; - width:18px; - text-align:center; - color:#333; - border:#61CAD0 1px solid; -} - -.WdateDiv #dpTime .tB{ - border-right:0px; -} - -.WdateDiv #dpTime .tE{ - border-left:0; - border-right:0; -} - -.WdateDiv #dpTime .tm{ - width:7px; - border-left:0; - border-right:0; -} - -.WdateDiv #dpTime #dpTimeUp{ - height:10px; - width:13px; - border:0px; - background:url(img.gif) no-repeat -32px -16px; -} - -.WdateDiv #dpTime #dpTimeDown{ - height:10px; - width:13px; - border:0px; - background:url(img.gif) no-repeat -48px -16px; -} - - .WdateDiv #dpQS { - float:left; - margin-right:3px; - margin-top:3px; - background:url(img.gif) no-repeat 0px -16px; - width:20px; - height:20px; - cursor:pointer; - } -.WdateDiv #dpControl { - text-align:right; - margin-top:3px; -} -.WdateDiv .dpButton{ - height:20px; - width:45px; - margin-top:2px; - border:#38B1B9 1px solid; - background-color:#CFEBEE; - color:#08575B; +/* + * My97 DatePicker 4.7 Skin:whyGreen + */ +.WdateDiv{ + width:180px; + background-color:#fff; + border:#C5E1E4 1px solid; + padding:2px; +} + +.WdateDiv2{ + width:360px; +} +.WdateDiv *{font-size:9pt;} + +.WdateDiv .NavImg a{ + cursor:pointer; + display:block; + width:16px; + height:16px; + margin-top:1px; +} + +.WdateDiv .NavImgll a{ + float:left; + background:url(img.gif) no-repeat; +} +.WdateDiv .NavImgl a{ + float:left; + background:url(img.gif) no-repeat -16px 0px; +} +.WdateDiv .NavImgr a{ + float:right; + background:url(img.gif) no-repeat -32px 0px; +} +.WdateDiv .NavImgrr a{ + float:right; + background:url(img.gif) no-repeat -48px 0px; +} + +.WdateDiv #dpTitle{ + height:24px; + padding:1px; + border:#c5d9e8 1px solid; + background:url(bg.jpg); + margin-bottom:2px; +} + +.WdateDiv .yminput{ + margin-top:2px; + text-align:center; + border:0px; + height:20px; + width:50px; + color:#034c50; + background-color:transparent; + cursor:pointer; +} + +.WdateDiv .yminputfocus{ + margin-top:2px; + text-align:center; + border:#939393 1px solid; + font-weight:bold; + color:#034c50; + height:20px; + width:50px; +} + +.WdateDiv .menuSel{ + z-index:1; + position:absolute; + background-color:#FFFFFF; + border:#A3C6C8 1px solid; + display:none; +} + +.WdateDiv .menu{ + cursor:pointer; + background-color:#fff; + color:#11777C; +} + +.WdateDiv .menuOn{ + cursor:pointer; + background-color:#BEEBEE; +} + +.WdateDiv .invalidMenu{ + color:#aaa; +} + +.WdateDiv .YMenu{ + margin-top:20px; +} + +.WdateDiv .MMenu{ + margin-top:20px; + *width:62px; +} + +.WdateDiv .hhMenu{ + margin-top:-90px; + margin-left:26px; +} + +.WdateDiv .mmMenu{ + margin-top:-46px; + margin-left:26px; +} + +.WdateDiv .ssMenu{ + margin-top:-24px; + margin-left:26px; +} + + .WdateDiv .Wweek { + text-align:center; + background:#DAF3F5; + border-right:#BDEBEE 1px solid; + } + +.WdateDiv .MTitle{ + color:#13777e; + background-color:#bdebee; +} +.WdateDiv .WdayTable2{ + border-collapse:collapse; + border:#BEE9F0 1px solid; +} +.WdateDiv .WdayTable2 table{ + border:0; +} + +.WdateDiv .WdayTable{ + line-height:20px; + color:#13777e; + background-color:#edfbfb; + border:#BEE9F0 1px solid; +} +.WdateDiv .WdayTable td{ + text-align:center; +} + +.WdateDiv .Wday{ + cursor:pointer; +} + +.WdateDiv .WdayOn{ + cursor:pointer; + background-color:#74d2d9 ; +} + +.WdateDiv .Wwday{ + cursor:pointer; + color:#ab1e1e; +} + +.WdateDiv .WwdayOn{ + cursor:pointer; + background-color:#74d2d9; +} +.WdateDiv .Wtoday{ + cursor:pointer; + color:blue; +} +.WdateDiv .Wselday{ + background-color:#A7E2E7; +} +.WdateDiv .WspecialDay{ + background-color:#66F4DF; +} + +.WdateDiv .WotherDay{ + cursor:pointer; + color:#0099CC; +} + +.WdateDiv .WotherDayOn{ + cursor:pointer; + background-color:#C0EBEF; +} + +.WdateDiv .WinvalidDay{ + color:#aaa; +} + +.WdateDiv #dpTime{ + float:left; + margin-top:3px; + margin-right:30px; +} + +.WdateDiv #dpTime #dpTimeStr{ + margin-left:1px; + color:#497F7F; +} + +.WdateDiv #dpTime input{ + height:20px; + width:18px; + text-align:center; + color:#333; + border:#61CAD0 1px solid; +} + +.WdateDiv #dpTime .tB{ + border-right:0px; +} + +.WdateDiv #dpTime .tE{ + border-left:0; + border-right:0; +} + +.WdateDiv #dpTime .tm{ + width:7px; + border-left:0; + border-right:0; +} + +.WdateDiv #dpTime #dpTimeUp{ + height:10px; + width:13px; + border:0px; + background:url(img.gif) no-repeat -32px -16px; +} + +.WdateDiv #dpTime #dpTimeDown{ + height:10px; + width:13px; + border:0px; + background:url(img.gif) no-repeat -48px -16px; +} + + .WdateDiv #dpQS { + float:left; + margin-right:3px; + margin-top:3px; + background:url(img.gif) no-repeat 0px -16px; + width:20px; + height:20px; + cursor:pointer; + } +.WdateDiv #dpControl { + text-align:right; + margin-top:3px; +} +.WdateDiv .dpButton{ + height:20px; + width:45px; + margin-top:2px; + border:#38B1B9 1px solid; + background-color:#CFEBEE; + color:#08575B; } \ No newline at end of file diff --git a/src/main/webapp/js/My97DatePicker/开发包/lang/en.js b/src/main/webapp/js/My97DatePicker/开发包/lang/en.js index e3ff110..3159885 100644 --- a/src/main/webapp/js/My97DatePicker/开发包/lang/en.js +++ b/src/main/webapp/js/My97DatePicker/开发包/lang/en.js @@ -1,14 +1,14 @@ -var $lang={ -errAlertMsg: "Invalid date or the date out of range,redo or not?", -aWeekStr: ["wk", "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"], -aLongWeekStr:["wk","Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"], -aMonStr: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"], -aLongMonStr: ["January","February","March","April","May","June","July","August","September","October","November","December"], -clearStr: "Clear", -todayStr: "Today", -okStr: "OK", -updateStr: "OK", -timeStr: "Time", -quickStr: "Quick Selection", -err_1: 'MinDate Cannot be bigger than MaxDate!' +var $lang={ +errAlertMsg: "Invalid date or the date out of range,redo or not?", +aWeekStr: ["wk", "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"], +aLongWeekStr:["wk","Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"], +aMonStr: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"], +aLongMonStr: ["January","February","March","April","May","June","July","August","September","October","November","December"], +clearStr: "Clear", +todayStr: "Today", +okStr: "OK", +updateStr: "OK", +timeStr: "Time", +quickStr: "Quick Selection", +err_1: 'MinDate Cannot be bigger than MaxDate!' } \ No newline at end of file diff --git a/src/main/webapp/js/My97DatePicker/开发包/lang/zh-cn.js b/src/main/webapp/js/My97DatePicker/开发包/lang/zh-cn.js index 5ffa216..89af055 100644 --- a/src/main/webapp/js/My97DatePicker/开发包/lang/zh-cn.js +++ b/src/main/webapp/js/My97DatePicker/开发包/lang/zh-cn.js @@ -1,14 +1,14 @@ -var $lang={ -errAlertMsg: "Ϸڸʽڳ޶Χ,Ҫ?", -aWeekStr: ["","","һ","","","","",""], -aLongWeekStr:["","","һ","ڶ","","","",""], -aMonStr: ["һ","","","","","","","","","ʮ","ʮһ","ʮ"], -aLongMonStr: ["һ","","","","","","","","","ʮ","ʮһ","ʮ"], -clearStr: "", -todayStr: "", -okStr: "ȷ", -updateStr: "ȷ", -timeStr: "ʱ", -quickStr: "ѡ", -err_1: 'Сڲܴ!' +var $lang={ +errAlertMsg: "Ϸڸʽڳ޶Χ,Ҫ?", +aWeekStr: ["","","һ","","","","",""], +aLongWeekStr:["","","һ","ڶ","","","",""], +aMonStr: ["һ","","","","","","","","","ʮ","ʮһ","ʮ"], +aLongMonStr: ["һ","","","","","","","","","ʮ","ʮһ","ʮ"], +clearStr: "", +todayStr: "", +okStr: "ȷ", +updateStr: "ȷ", +timeStr: "ʱ", +quickStr: "ѡ", +err_1: 'Сڲܴ!' } \ No newline at end of file diff --git a/src/main/webapp/js/My97DatePicker/开发包/lang/zh-tw.js b/src/main/webapp/js/My97DatePicker/开发包/lang/zh-tw.js index aa716ad..6e2e6ed 100644 --- a/src/main/webapp/js/My97DatePicker/开发包/lang/zh-tw.js +++ b/src/main/webapp/js/My97DatePicker/开发包/lang/zh-tw.js @@ -1,14 +1,14 @@ -var $lang={ -errAlertMsg: "Ϸڸʽڳ޶,ҪN?", -aWeekStr: ["","","һ","","","","",""], -aLongWeekStr:["","","һ","ڶ","","","",""], -aMonStr: ["һ","","","","","","","","","ʮ","ʮһ","ʮ"], -aLongMonStr: ["һ","","","","","","","","","ʮ","ʮһ","ʮ"], -clearStr: "", -todayStr: "", -okStr: "_", -updateStr: "_", -timeStr: "rg", -quickStr: "x", -err_1: 'Сڲܴ!' +var $lang={ +errAlertMsg: "Ϸڸʽڳ޶,ҪN?", +aWeekStr: ["","","һ","","","","",""], +aLongWeekStr:["","","һ","ڶ","","","",""], +aMonStr: ["һ","","","","","","","","","ʮ","ʮһ","ʮ"], +aLongMonStr: ["һ","","","","","","","","","ʮ","ʮһ","ʮ"], +clearStr: "", +todayStr: "", +okStr: "_", +updateStr: "_", +timeStr: "rg", +quickStr: "x", +err_1: 'Сڲܴ!' } \ No newline at end of file diff --git a/src/main/webapp/js/My97DatePicker/开发包/readme.txt b/src/main/webapp/js/My97DatePicker/开发包/readme.txt index 96f03c2..b3f7611 100644 --- a/src/main/webapp/js/My97DatePicker/开发包/readme.txt +++ b/src/main/webapp/js/My97DatePicker/开发包/readme.txt @@ -1,3 +1,3 @@ -ʽʱ,ɽļɾȥ - - +ʽʱ,ɽļɾȥ + + diff --git a/src/main/webapp/js/My97DatePicker/开发包/skin/WdatePicker.css b/src/main/webapp/js/My97DatePicker/开发包/skin/WdatePicker.css index 74a75e8..8d447b5 100644 --- a/src/main/webapp/js/My97DatePicker/开发包/skin/WdatePicker.css +++ b/src/main/webapp/js/My97DatePicker/开发包/skin/WdatePicker.css @@ -1,10 +1,10 @@ -.Wdate{ - border:#999 1px solid; - height:20px; - background:#fff url(datePicker.gif) no-repeat right; -} - -.WdateFmtErr{ - font-weight:bold; - color:red; +.Wdate{ + border:#999 1px solid; + height:20px; + background:#fff url(datePicker.gif) no-repeat right; +} + +.WdateFmtErr{ + font-weight:bold; + color:red; } \ No newline at end of file diff --git a/src/main/webapp/js/My97DatePicker/开发包/skin/default/datepicker.css b/src/main/webapp/js/My97DatePicker/开发包/skin/default/datepicker.css index ecf944f..03beece 100644 --- a/src/main/webapp/js/My97DatePicker/开发包/skin/default/datepicker.css +++ b/src/main/webapp/js/My97DatePicker/开发包/skin/default/datepicker.css @@ -1,267 +1,267 @@ -/* - * My97 DatePicker 4.7 - * Ƥ:default - */ - -/* ѡ DIV */ -.WdateDiv{ - width:180px; - background-color:#FFFFFF; - border:#bbb 1px solid; - padding:2px; -} -/* ˫Ŀ */ -.WdateDiv2{ - width:360px; -} -.WdateDiv *{font-size:9pt;} - -/**************************** - * ͼ ȫAǩ - ***************************/ -.WdateDiv .NavImg a{ - display:block; - cursor:pointer; - height:16px; - width:16px; -} - -.WdateDiv .NavImgll a{ - float:left; - background:transparent url(img.gif) no-repeat scroll 0 0; -} -.WdateDiv .NavImgl a{ - float:left; - background:transparent url(img.gif) no-repeat scroll -16px 0; -} -.WdateDiv .NavImgr a{ - float:right; - background:transparent url(img.gif) no-repeat scroll -32px 0; -} -.WdateDiv .NavImgrr a{ - float:right; - background:transparent url(img.gif) no-repeat scroll -48px 0; -} - -/**************************** - * · - ***************************/ -/* · DIV */ -.WdateDiv #dpTitle{ - height:24px; - margin-bottom:2px; - padding:1px; -} -/* · INPUT */ -.WdateDiv .yminput{ - margin-top:2px; - text-align:center; - height:20px; - border:0px; - width:50px; - cursor:pointer; -} -/* ·ýʱʽ INPUT */ -.WdateDiv .yminputfocus{ - margin-top:2px; - text-align:center; - font-weight:bold; - height:20px; - color:blue; - border:#ccc 1px solid; - width:50px; -} -/* ˵ѡ DIV */ -.WdateDiv .menuSel{ - z-index:1; - position:absolute; - background-color:#FFFFFF; - border:#ccc 1px solid; - display:none; -} -/* ˵ʽ TD */ -.WdateDiv .menu{ - cursor:pointer; - background-color:#fff; -} -/* ˵mouseoverʽ TD */ -.WdateDiv .menuOn{ - cursor:pointer; - background-color:#BEEBEE; -} -/* ˵Чʱʽ TD */ -.WdateDiv .invalidMenu{ - color:#aaa; -} -/* ѡƫ DIV */ -.WdateDiv .YMenu{ - margin-top:20px; - -} -/* ѡƫ DIV */ -.WdateDiv .MMenu{ - margin-top:20px; - *width:62px; -} -/* ʱѡλ DIV */ -.WdateDiv .hhMenu{ - margin-top:-90px; - margin-left:26px; -} -/* ѡλ DIV */ -.WdateDiv .mmMenu{ - margin-top:-46px; - margin-left:26px; -} -/* ѡλ DIV */ -.WdateDiv .ssMenu{ - margin-top:-24px; - margin-left:26px; -} - -/**************************** - * - ***************************/ - .WdateDiv .Wweek { - text-align:center; - background:#DAF3F5; - border-right:#BDEBEE 1px solid; - } -/**************************** - * , - ***************************/ -/* TR */ -.WdateDiv .MTitle{ - background-color:#BDEBEE; -} -.WdateDiv .WdayTable2{ - border-collapse:collapse; - border:#c5d9e8 1px solid; -} -.WdateDiv .WdayTable2 table{ - border:0; -} -/* TABLE */ -.WdateDiv .WdayTable{ - line-height:20px; - border:#c5d9e8 1px solid; -} -.WdateDiv .WdayTable td{ - text-align:center; -} -/* ڸʽ TD */ -.WdateDiv .Wday{ - cursor:pointer; -} -/* ڸmouseoverʽ TD */ -.WdateDiv .WdayOn{ - cursor:pointer; - background-color:#C0EBEF; -} -/* ĩڸʽ TD */ -.WdateDiv .Wwday{ - cursor:pointer; - color:#FF2F2F; -} -/* ĩڸmouseoverʽ TD */ -.WdateDiv .WwdayOn{ - cursor:pointer; - color:#000; - background-color:#C0EBEF; -} -.WdateDiv .Wtoday{ - cursor:pointer; - color:blue; -} -.WdateDiv .Wselday{ - background-color:#A9E4E9; -} -.WdateDiv .WspecialDay{ - background-color:#66F4DF; -} -/* ·ݵ */ -.WdateDiv .WotherDay{ - cursor:pointer; - color:#6A6AFF; -} -/* ·ݵmouseoverʽ */ -.WdateDiv .WotherDayOn{ - cursor:pointer; - background-color:#C0EBEF; -} -/* Чڵʽ,ڷΧڸʽ,ѡ */ -.WdateDiv .WinvalidDay{ - color:#aaa; -} - -/**************************** - * ʱ - ***************************/ -/* ʱ DIV */ -.WdateDiv #dpTime{ - float:left; - margin-top:3px; - margin-right:30px; -} -/* ʱ SPAN */ -.WdateDiv #dpTime #dpTimeStr{ - margin-left:1px; -} -/* ʱ INPUT */ -.WdateDiv #dpTime input{ - width:18px; - height:20px; - text-align:center; - border:#ccc 1px solid; -} -/* ʱ ʱ INPUT */ -.WdateDiv #dpTime .tB{ - border-right:0px; -} -/* ʱ ֺͼ ':' INPUT */ -.WdateDiv #dpTime .tE{ - border-left:0; - border-right:0; -} -/* ʱ INPUT */ -.WdateDiv #dpTime .tm{ - width:7px; - border-left:0; - border-right:0; -} -/* ʱұߵϰť BUTTON */ -.WdateDiv #dpTime #dpTimeUp{ - height:10px; - width:13px; - border:0px; - background:url(img.gif) no-repeat -32px -16px; -} -/* ʱұߵ°ť BUTTON */ -.WdateDiv #dpTime #dpTimeDown{ - height:10px; - width:13px; - border:0px; - background:url(img.gif) no-repeat -48px -16px; -} -/**************************** - * - ***************************/ - .WdateDiv #dpQS { - float:left; - margin-right:3px; - margin-top:3px; - background:url(img.gif) no-repeat 0px -16px; - width:20px; - height:20px; - cursor:pointer; - } -.WdateDiv #dpControl { - text-align:right; -} -.WdateDiv .dpButton{ - height:20px; - width:45px; - border:#ccc 1px solid; - margin-top:2px; - margin-right:1px; +/* + * My97 DatePicker 4.7 + * Ƥ:default + */ + +/* ѡ DIV */ +.WdateDiv{ + width:180px; + background-color:#FFFFFF; + border:#bbb 1px solid; + padding:2px; +} +/* ˫Ŀ */ +.WdateDiv2{ + width:360px; +} +.WdateDiv *{font-size:9pt;} + +/**************************** + * ͼ ȫAǩ + ***************************/ +.WdateDiv .NavImg a{ + display:block; + cursor:pointer; + height:16px; + width:16px; +} + +.WdateDiv .NavImgll a{ + float:left; + background:transparent url(img.gif) no-repeat scroll 0 0; +} +.WdateDiv .NavImgl a{ + float:left; + background:transparent url(img.gif) no-repeat scroll -16px 0; +} +.WdateDiv .NavImgr a{ + float:right; + background:transparent url(img.gif) no-repeat scroll -32px 0; +} +.WdateDiv .NavImgrr a{ + float:right; + background:transparent url(img.gif) no-repeat scroll -48px 0; +} + +/**************************** + * · + ***************************/ +/* · DIV */ +.WdateDiv #dpTitle{ + height:24px; + margin-bottom:2px; + padding:1px; +} +/* · INPUT */ +.WdateDiv .yminput{ + margin-top:2px; + text-align:center; + height:20px; + border:0px; + width:50px; + cursor:pointer; +} +/* ·ýʱʽ INPUT */ +.WdateDiv .yminputfocus{ + margin-top:2px; + text-align:center; + font-weight:bold; + height:20px; + color:blue; + border:#ccc 1px solid; + width:50px; +} +/* ˵ѡ DIV */ +.WdateDiv .menuSel{ + z-index:1; + position:absolute; + background-color:#FFFFFF; + border:#ccc 1px solid; + display:none; +} +/* ˵ʽ TD */ +.WdateDiv .menu{ + cursor:pointer; + background-color:#fff; +} +/* ˵mouseoverʽ TD */ +.WdateDiv .menuOn{ + cursor:pointer; + background-color:#BEEBEE; +} +/* ˵Чʱʽ TD */ +.WdateDiv .invalidMenu{ + color:#aaa; +} +/* ѡƫ DIV */ +.WdateDiv .YMenu{ + margin-top:20px; + +} +/* ѡƫ DIV */ +.WdateDiv .MMenu{ + margin-top:20px; + *width:62px; +} +/* ʱѡλ DIV */ +.WdateDiv .hhMenu{ + margin-top:-90px; + margin-left:26px; +} +/* ѡλ DIV */ +.WdateDiv .mmMenu{ + margin-top:-46px; + margin-left:26px; +} +/* ѡλ DIV */ +.WdateDiv .ssMenu{ + margin-top:-24px; + margin-left:26px; +} + +/**************************** + * + ***************************/ + .WdateDiv .Wweek { + text-align:center; + background:#DAF3F5; + border-right:#BDEBEE 1px solid; + } +/**************************** + * , + ***************************/ +/* TR */ +.WdateDiv .MTitle{ + background-color:#BDEBEE; +} +.WdateDiv .WdayTable2{ + border-collapse:collapse; + border:#c5d9e8 1px solid; +} +.WdateDiv .WdayTable2 table{ + border:0; +} +/* TABLE */ +.WdateDiv .WdayTable{ + line-height:20px; + border:#c5d9e8 1px solid; +} +.WdateDiv .WdayTable td{ + text-align:center; +} +/* ڸʽ TD */ +.WdateDiv .Wday{ + cursor:pointer; +} +/* ڸmouseoverʽ TD */ +.WdateDiv .WdayOn{ + cursor:pointer; + background-color:#C0EBEF; +} +/* ĩڸʽ TD */ +.WdateDiv .Wwday{ + cursor:pointer; + color:#FF2F2F; +} +/* ĩڸmouseoverʽ TD */ +.WdateDiv .WwdayOn{ + cursor:pointer; + color:#000; + background-color:#C0EBEF; +} +.WdateDiv .Wtoday{ + cursor:pointer; + color:blue; +} +.WdateDiv .Wselday{ + background-color:#A9E4E9; +} +.WdateDiv .WspecialDay{ + background-color:#66F4DF; +} +/* ·ݵ */ +.WdateDiv .WotherDay{ + cursor:pointer; + color:#6A6AFF; +} +/* ·ݵmouseoverʽ */ +.WdateDiv .WotherDayOn{ + cursor:pointer; + background-color:#C0EBEF; +} +/* Чڵʽ,ڷΧڸʽ,ѡ */ +.WdateDiv .WinvalidDay{ + color:#aaa; +} + +/**************************** + * ʱ + ***************************/ +/* ʱ DIV */ +.WdateDiv #dpTime{ + float:left; + margin-top:3px; + margin-right:30px; +} +/* ʱ SPAN */ +.WdateDiv #dpTime #dpTimeStr{ + margin-left:1px; +} +/* ʱ INPUT */ +.WdateDiv #dpTime input{ + width:18px; + height:20px; + text-align:center; + border:#ccc 1px solid; +} +/* ʱ ʱ INPUT */ +.WdateDiv #dpTime .tB{ + border-right:0px; +} +/* ʱ ֺͼ ':' INPUT */ +.WdateDiv #dpTime .tE{ + border-left:0; + border-right:0; +} +/* ʱ INPUT */ +.WdateDiv #dpTime .tm{ + width:7px; + border-left:0; + border-right:0; +} +/* ʱұߵϰť BUTTON */ +.WdateDiv #dpTime #dpTimeUp{ + height:10px; + width:13px; + border:0px; + background:url(img.gif) no-repeat -32px -16px; +} +/* ʱұߵ°ť BUTTON */ +.WdateDiv #dpTime #dpTimeDown{ + height:10px; + width:13px; + border:0px; + background:url(img.gif) no-repeat -48px -16px; +} +/**************************** + * + ***************************/ + .WdateDiv #dpQS { + float:left; + margin-right:3px; + margin-top:3px; + background:url(img.gif) no-repeat 0px -16px; + width:20px; + height:20px; + cursor:pointer; + } +.WdateDiv #dpControl { + text-align:right; +} +.WdateDiv .dpButton{ + height:20px; + width:45px; + border:#ccc 1px solid; + margin-top:2px; + margin-right:1px; } \ No newline at end of file diff --git a/src/main/webapp/js/My97DatePicker/开发包/skin/whyGreen/datepicker.css b/src/main/webapp/js/My97DatePicker/开发包/skin/whyGreen/datepicker.css index 2c3b9b7..208e733 100644 --- a/src/main/webapp/js/My97DatePicker/开发包/skin/whyGreen/datepicker.css +++ b/src/main/webapp/js/My97DatePicker/开发包/skin/whyGreen/datepicker.css @@ -1,277 +1,277 @@ -/* - * My97 DatePicker 4.7 - * Ƥ:whyGreen - */ - -/* ѡ DIV */ -.WdateDiv{ - width:180px; - background-color:#fff; - border:#C5E1E4 1px solid; - padding:2px; -} -/* ˫Ŀ */ -.WdateDiv2{ - width:360px; -} -.WdateDiv *{font-size:9pt;} - -/**************************** - * ͼ ȫAǩ - ***************************/ -.WdateDiv .NavImg a{ - cursor:pointer; - display:block; - width:16px; - height:16px; - margin-top:1px; -} - -.WdateDiv .NavImgll a{ - float:left; - background:url(img.gif) no-repeat; -} -.WdateDiv .NavImgl a{ - float:left; - background:url(img.gif) no-repeat -16px 0px; -} -.WdateDiv .NavImgr a{ - float:right; - background:url(img.gif) no-repeat -32px 0px; -} -.WdateDiv .NavImgrr a{ - float:right; - background:url(img.gif) no-repeat -48px 0px; -} -/**************************** - * · - ***************************/ -/* · DIV */ -.WdateDiv #dpTitle{ - height:24px; - padding:1px; - border:#c5d9e8 1px solid; - background:url(bg.jpg); - margin-bottom:2px; -} -/* · INPUT */ -.WdateDiv .yminput{ - margin-top:2px; - text-align:center; - border:0px; - height:20px; - width:50px; - color:#034c50; - background-color:transparent; - cursor:pointer; -} -/* ·ýʱʽ INPUT */ -.WdateDiv .yminputfocus{ - margin-top:2px; - text-align:center; - border:#939393 1px solid; - font-weight:bold; - color:#034c50; - height:20px; - width:50px; -} -/* ˵ѡ DIV */ -.WdateDiv .menuSel{ - z-index:1; - position:absolute; - background-color:#FFFFFF; - border:#A3C6C8 1px solid; - display:none; -} -/* ˵ʽ TD */ -.WdateDiv .menu{ - cursor:pointer; - background-color:#fff; - color:#11777C; -} -/* ˵mouseoverʽ TD */ -.WdateDiv .menuOn{ - cursor:pointer; - background-color:#BEEBEE; -} -/* ˵Чʱʽ TD */ -.WdateDiv .invalidMenu{ - color:#aaa; -} -/* ѡƫ DIV */ -.WdateDiv .YMenu{ - margin-top:20px; -} -/* ѡƫ DIV */ -.WdateDiv .MMenu{ - margin-top:20px; - *width:62px; -} -/* ʱѡλ DIV */ -.WdateDiv .hhMenu{ - margin-top:-90px; - margin-left:26px; -} -/* ѡλ DIV */ -.WdateDiv .mmMenu{ - margin-top:-46px; - margin-left:26px; -} -/* ѡλ DIV */ -.WdateDiv .ssMenu{ - margin-top:-24px; - margin-left:26px; -} - -/**************************** - * - ***************************/ - .WdateDiv .Wweek { - text-align:center; - background:#DAF3F5; - border-right:#BDEBEE 1px solid; - } -/**************************** - * , - ***************************/ - /* TR */ -.WdateDiv .MTitle{ - color:#13777e; - background-color:#bdebee; -} -.WdateDiv .WdayTable2{ - border-collapse:collapse; - border:#BEE9F0 1px solid; -} -.WdateDiv .WdayTable2 table{ - border:0; -} -/* TABLE */ -.WdateDiv .WdayTable{ - line-height:20px; - color:#13777e; - background-color:#edfbfb; - border:#BEE9F0 1px solid; -} -.WdateDiv .WdayTable td{ - text-align:center; -} -/* ڸʽ TD */ -.WdateDiv .Wday{ - cursor:pointer; -} -/* ڸmouseoverʽ TD */ -.WdateDiv .WdayOn{ - cursor:pointer; - background-color:#74d2d9 ; -} -/* ĩڸʽ TD */ -.WdateDiv .Wwday{ - cursor:pointer; - color:#ab1e1e; -} -/* ĩڸmouseoverʽ TD */ -.WdateDiv .WwdayOn{ - cursor:pointer; - background-color:#74d2d9; -} -.WdateDiv .Wtoday{ - cursor:pointer; - color:blue; -} -.WdateDiv .Wselday{ - background-color:#A7E2E7; -} -.WdateDiv .WspecialDay{ - background-color:#66F4DF; -} -/* ·ݵ */ -.WdateDiv .WotherDay{ - cursor:pointer; - color:#0099CC; -} -/* ·ݵmouseoverʽ */ -.WdateDiv .WotherDayOn{ - cursor:pointer; - background-color:#C0EBEF; -} -/* Чڵʽ,ڷΧڸʽ,ѡ */ -.WdateDiv .WinvalidDay{ - color:#aaa; -} - -/**************************** - * ʱ - ***************************/ -/* ʱ DIV */ -.WdateDiv #dpTime{ - float:left; - margin-top:3px; - margin-right:30px; -} -/* ʱ SPAN */ -.WdateDiv #dpTime #dpTimeStr{ - margin-left:1px; - color:#497F7F; -} -/* ʱ INPUT */ -.WdateDiv #dpTime input{ - height:20px; - width:18px; - text-align:center; - color:#333; - border:#61CAD0 1px solid; -} -/* ʱ ʱ INPUT */ -.WdateDiv #dpTime .tB{ - border-right:0px; -} -/* ʱ ֺͼ ':' INPUT */ -.WdateDiv #dpTime .tE{ - border-left:0; - border-right:0; -} -/* ʱ INPUT */ -.WdateDiv #dpTime .tm{ - width:7px; - border-left:0; - border-right:0; -} -/* ʱұߵϰť BUTTON */ -.WdateDiv #dpTime #dpTimeUp{ - height:10px; - width:13px; - border:0px; - background:url(img.gif) no-repeat -32px -16px; -} -/* ʱұߵ°ť BUTTON */ -.WdateDiv #dpTime #dpTimeDown{ - height:10px; - width:13px; - border:0px; - background:url(img.gif) no-repeat -48px -16px; -} -/**************************** - * - ***************************/ - .WdateDiv #dpQS { - float:left; - margin-right:3px; - margin-top:3px; - background:url(img.gif) no-repeat 0px -16px; - width:20px; - height:20px; - cursor:pointer; - } -.WdateDiv #dpControl { - text-align:right; - margin-top:3px; -} -.WdateDiv .dpButton{ - height:20px; - width:45px; - margin-top:2px; - border:#38B1B9 1px solid; - background-color:#CFEBEE; - color:#08575B; +/* + * My97 DatePicker 4.7 + * Ƥ:whyGreen + */ + +/* ѡ DIV */ +.WdateDiv{ + width:180px; + background-color:#fff; + border:#C5E1E4 1px solid; + padding:2px; +} +/* ˫Ŀ */ +.WdateDiv2{ + width:360px; +} +.WdateDiv *{font-size:9pt;} + +/**************************** + * ͼ ȫAǩ + ***************************/ +.WdateDiv .NavImg a{ + cursor:pointer; + display:block; + width:16px; + height:16px; + margin-top:1px; +} + +.WdateDiv .NavImgll a{ + float:left; + background:url(img.gif) no-repeat; +} +.WdateDiv .NavImgl a{ + float:left; + background:url(img.gif) no-repeat -16px 0px; +} +.WdateDiv .NavImgr a{ + float:right; + background:url(img.gif) no-repeat -32px 0px; +} +.WdateDiv .NavImgrr a{ + float:right; + background:url(img.gif) no-repeat -48px 0px; +} +/**************************** + * · + ***************************/ +/* · DIV */ +.WdateDiv #dpTitle{ + height:24px; + padding:1px; + border:#c5d9e8 1px solid; + background:url(bg.jpg); + margin-bottom:2px; +} +/* · INPUT */ +.WdateDiv .yminput{ + margin-top:2px; + text-align:center; + border:0px; + height:20px; + width:50px; + color:#034c50; + background-color:transparent; + cursor:pointer; +} +/* ·ýʱʽ INPUT */ +.WdateDiv .yminputfocus{ + margin-top:2px; + text-align:center; + border:#939393 1px solid; + font-weight:bold; + color:#034c50; + height:20px; + width:50px; +} +/* ˵ѡ DIV */ +.WdateDiv .menuSel{ + z-index:1; + position:absolute; + background-color:#FFFFFF; + border:#A3C6C8 1px solid; + display:none; +} +/* ˵ʽ TD */ +.WdateDiv .menu{ + cursor:pointer; + background-color:#fff; + color:#11777C; +} +/* ˵mouseoverʽ TD */ +.WdateDiv .menuOn{ + cursor:pointer; + background-color:#BEEBEE; +} +/* ˵Чʱʽ TD */ +.WdateDiv .invalidMenu{ + color:#aaa; +} +/* ѡƫ DIV */ +.WdateDiv .YMenu{ + margin-top:20px; +} +/* ѡƫ DIV */ +.WdateDiv .MMenu{ + margin-top:20px; + *width:62px; +} +/* ʱѡλ DIV */ +.WdateDiv .hhMenu{ + margin-top:-90px; + margin-left:26px; +} +/* ѡλ DIV */ +.WdateDiv .mmMenu{ + margin-top:-46px; + margin-left:26px; +} +/* ѡλ DIV */ +.WdateDiv .ssMenu{ + margin-top:-24px; + margin-left:26px; +} + +/**************************** + * + ***************************/ + .WdateDiv .Wweek { + text-align:center; + background:#DAF3F5; + border-right:#BDEBEE 1px solid; + } +/**************************** + * , + ***************************/ + /* TR */ +.WdateDiv .MTitle{ + color:#13777e; + background-color:#bdebee; +} +.WdateDiv .WdayTable2{ + border-collapse:collapse; + border:#BEE9F0 1px solid; +} +.WdateDiv .WdayTable2 table{ + border:0; +} +/* TABLE */ +.WdateDiv .WdayTable{ + line-height:20px; + color:#13777e; + background-color:#edfbfb; + border:#BEE9F0 1px solid; +} +.WdateDiv .WdayTable td{ + text-align:center; +} +/* ڸʽ TD */ +.WdateDiv .Wday{ + cursor:pointer; +} +/* ڸmouseoverʽ TD */ +.WdateDiv .WdayOn{ + cursor:pointer; + background-color:#74d2d9 ; +} +/* ĩڸʽ TD */ +.WdateDiv .Wwday{ + cursor:pointer; + color:#ab1e1e; +} +/* ĩڸmouseoverʽ TD */ +.WdateDiv .WwdayOn{ + cursor:pointer; + background-color:#74d2d9; +} +.WdateDiv .Wtoday{ + cursor:pointer; + color:blue; +} +.WdateDiv .Wselday{ + background-color:#A7E2E7; +} +.WdateDiv .WspecialDay{ + background-color:#66F4DF; +} +/* ·ݵ */ +.WdateDiv .WotherDay{ + cursor:pointer; + color:#0099CC; +} +/* ·ݵmouseoverʽ */ +.WdateDiv .WotherDayOn{ + cursor:pointer; + background-color:#C0EBEF; +} +/* Чڵʽ,ڷΧڸʽ,ѡ */ +.WdateDiv .WinvalidDay{ + color:#aaa; +} + +/**************************** + * ʱ + ***************************/ +/* ʱ DIV */ +.WdateDiv #dpTime{ + float:left; + margin-top:3px; + margin-right:30px; +} +/* ʱ SPAN */ +.WdateDiv #dpTime #dpTimeStr{ + margin-left:1px; + color:#497F7F; +} +/* ʱ INPUT */ +.WdateDiv #dpTime input{ + height:20px; + width:18px; + text-align:center; + color:#333; + border:#61CAD0 1px solid; +} +/* ʱ ʱ INPUT */ +.WdateDiv #dpTime .tB{ + border-right:0px; +} +/* ʱ ֺͼ ':' INPUT */ +.WdateDiv #dpTime .tE{ + border-left:0; + border-right:0; +} +/* ʱ INPUT */ +.WdateDiv #dpTime .tm{ + width:7px; + border-left:0; + border-right:0; +} +/* ʱұߵϰť BUTTON */ +.WdateDiv #dpTime #dpTimeUp{ + height:10px; + width:13px; + border:0px; + background:url(img.gif) no-repeat -32px -16px; +} +/* ʱұߵ°ť BUTTON */ +.WdateDiv #dpTime #dpTimeDown{ + height:10px; + width:13px; + border:0px; + background:url(img.gif) no-repeat -48px -16px; +} +/**************************** + * + ***************************/ + .WdateDiv #dpQS { + float:left; + margin-right:3px; + margin-top:3px; + background:url(img.gif) no-repeat 0px -16px; + width:20px; + height:20px; + cursor:pointer; + } +.WdateDiv #dpControl { + text-align:right; + margin-top:3px; +} +.WdateDiv .dpButton{ + height:20px; + width:45px; + margin-top:2px; + border:#38B1B9 1px solid; + background-color:#CFEBEE; + color:#08575B; } \ No newline at end of file diff --git a/src/main/webapp/js/easyui/changelog.txt b/src/main/webapp/js/easyui/changelog.txt index 07d601a..c12c800 100644 --- a/src/main/webapp/js/easyui/changelog.txt +++ b/src/main/webapp/js/easyui/changelog.txt @@ -1,456 +1,456 @@ -Version 1.4.2 -------------- -*Bug - * treegrid: The column will restore its size to original size after recreating the treegrid. fixed. -* Improvement - * draggable: Add 'delay' property that allows the user to delay the drag operation. - * tree: Add 'filter' property and 'doFilter' method. - * tabs: The 'add' method allows the user to insert a tab panel at a specified index. - * tabs: The user can determine what tab panel can be selected. - * tabs: Add 'justified' and 'narrow' properties. - * layout: Add 'unsplit' and 'split' methods. - * messager: Keyboard navigation features are supported now. - * form: Add 'onChange' event. - * combobox: Add 'queryParams' property. - * slider: Add 'range' property. - * menu: Add 'itemHeight','inline','noline' properties. - * panel: The 'header' property allows the user to customize the panel header. - * menubutton: Add 'hasDownArrow' property. -* New Plugins - * datalist: The plugin to render items in a list. - * navpanel: The root component for the mobile page. - * mobile: The plugin to provide the mobile page stack management and navigation. - -Version 1.4.1 -------------- -* Bug - * combogrid: The combogrid has different height than other combo components. fixed. - * datagrid: The row element loses some class style value after calling 'updateRow' method. fixed. - * menubutton: Calling 'enable' method on a disabled button can not work well. fixed. - * form: The filebox components in the form do not work correctly after calling 'clear' method. fixed. -* Improvement - * tabs: The 'update' method accepts 'type' option that allows the user to update the header,body,or both. - * panel: Add 'openAnimation','openDuration','closeAnimation' and 'closeDuration' properties to set the animation for opening or closing a panel. - * panel: Add 'footer' property that allows the user to add a footer bar to the bottom of panel. - * datagrid: Calling 'endEdit' method will accept the editing value correctly. - * datagrid: Add 'onBeforeSelect','onBeforeCheck','onBeforeUnselect','onBeforeUncheck' events. - * propertygrid: The user can edit a row by calling 'beginEdit' method. - * datebox: Add 'cloneFrom' method to create the datebox component quickly. - * datetimebox: Add 'cloneFrom' method to create the datetimebox component quickly. - -Version 1.4 -------------- -* Bug - * menu: The menu should not has a correct height when removed a menu item. fixed. - * datagrid: The 'fitColumns' method does not work normally when the datarid width is too small. fixed. -* Improvement - * The fluid/percentange size is supported now for all easyui components. - * menu: Add 'showItem', 'hideItem' and 'resize' methods. - * menu: Auto resize the height upon the window size. - * menu: Add 'duration' property that allows the user to define duration time in milliseconds to hide menu. - * validatebox: Add 'onBeforeValidate' and 'onValidate' events. - * combo: Extended from textbox now. - * combo: Add 'panelMinWidth','panelMaxWidth','panelMinHeight' and 'panelMaxHeight' properties. - * searchbox: Extended from textbox now. - * tree: The 'getRoot' method will return the top parent node of a specified node if pass a 'nodeEl' parameter. - * tree: Add 'queryParams' property. - * datetimebox: Add 'spinnerWidth' property. - * panel: Add 'doLayout' method to cause the panel to lay out its components. - * panel: Add 'clear' method to clear the panel's content. - * datagrid: The user is allowed to assign percent width to columns. - * form: Add 'ajax','novalidate' and 'queryParams' properties. - * linkbutton: Add 'resize' method. -* New Plugins - * textbox: A enhanced input field that allows users build their form easily. - * datetimespinner: A date and time spinner that allows to pick a specific day. - * filebox: The filebox component represents a file field of the forms. - -Version 1.3.6 -------------- -* Bug - * treegrid: The 'getChecked' method can not return correct checked rows. fixed. - * tree: The checkbox does not display properly on async tree when 'onlyLeafCheck' property is true. fixed. -* Improvement - * treegrid: All the selecting and checking methods are extended from datagrid component. - * linkbutton: The icon alignment is fully supported, possible values are: 'top','bottom','left','right'. - * linkbutton: Add 'size' property, possible values are: 'small','large'. - * linkbutton: Add 'onClick' event. - * menubutton: Add 'menuAlign' property that allows the user set top level menu alignment. - * combo: Add 'panelAlign' property, possible values are: 'left','right'. - * calendar: The 'formatter','styler' and 'validator' options are available to custom the calendar dates. - * calendar: Add 'onChange' event. - * panel: Add 'method','queryParams' and 'loader' options. - * panel: Add 'onLoadError' event. - * datagrid: Add 'onBeginEdit' event that fires when a row goes into edit mode. - * datagrid: Add 'onEndEdit' event that fires when finishing editing but before destroying editors. - * datagrid: Add 'sort' method and 'onBeforeSortColumn' event. - * datagrid: The 'combogrid' editor has been integrated into datagrid. - * datagrid: Add 'ctrlSelect' property that only allows multi-selection when ctrl+click is used. - * slider: Add 'converter' option that allows users determine how to convert a value to the slider position or the slider position to the value. - * searchbox: Add 'disabled' property. - * searchbox: Add 'disable','enable','clear','reset' methods. - * spinner: Add 'readonly' property, 'readonly' method and 'onChange' event. - -Version 1.3.5 -------------- -* Bug - * searchbox: The 'searcher' function can not offer 'name' parameter value correctly. fixed. - * combo: The 'isValid' method can not return boolean value. fixed. - * combo: Clicking combo will trigger the 'onHidePanel' event of other combo components that have hidden drop-down panels. fixed. - * combogrid: Some methods can not inherit from combo. fixed. -* Improvement - * datagrid: Improve performance on checking rows. - * menu: Allows to append a menu separator. - * menu: Add 'hideOnUnhover' property to indicate if the menu should be hidden when mouse exits it. - * slider: Add 'clear' and 'reset' methods. - * tabs: Add 'unselect' method that will trigger 'onUnselect' event. - * tabs: Add 'selected' property to specify what tab panel will be opened. - * tabs: The 'collapsible' property of tab panel is supported to determine if the tab panel can be collapsed. - * tabs: Add 'showHeader' property, 'showHeader' and 'hideHeader' methods. - * combobox: The 'disabled' property can be used to disable some items. - * tree: Improve loading performance. - * pagination: The 'layout' property can be used to customize the pagination layout. - * accordion: Add 'unselect' method that will trigger 'onUnselect' event. - * accordion: Add 'selected' and 'multiple' properties. - * accordion: Add 'getSelections' method. - * datebox: Add 'sharedCalendar' property that allows multiple datebox components share one calendar component. - -Version 1.3.4 -------------- -* Bug - * combobox: The onLoadSuccess event fires when parsing empty local data. fixed. - * form: Calling 'reset' method can not reset datebox field. fixed. -* Improvement - * mobile: The context menu and double click features are supported on mobile devices. - * combobox: The 'groupField' and 'groupFormatter' options are available to display items in groups. - * tree: When append or insert nodes, the 'data' parameter accepts one or more nodes data. - * tree: The 'getChecked' method accepts a single 'state' or an array of 'state'. - * tree: Add 'scrollTo' method. - * datagrid: The 'multiSort' property is added to support multiple column sorting. - * datagrid: The 'rowStyler' and column 'styler' can return CSS class name or inline styles. - * treegrid: Add 'load' method to load data and navigate to the first page. - * tabs: Add 'tabWidth' and 'tabHeight' properties. - * validatebox: The 'novalidate' property is available to indicate whether to perform the validation. - * validatebox: Add 'enableValidation' and 'disableValidation' methods. - * form: Add 'enableValidation' and 'disableValidation' methods. - * slider: Add 'onComplete' event. - * pagination: The 'buttons' property accepts the existing element. - -Version 1.3.3 -------------- -* Bug - * datagrid: Some style features are not supported by column styler function. fixed. - * datagrid: IE 31 stylesheet limit. fixed. - * treegrid: Some style features are not supported by column styler function. fixed. - * menu: The auto width of menu item displays incorrect in ie6. fixed. - * combo: The 'onHidePanel' event can not fire when clicked outside the combo area. fixed. -* Improvement - * datagrid: Add 'scrollTo' and 'highlightRow' methods. - * treegrid: Enable treegrid to parse data from element. - * combo: Add 'selectOnNavigation' and 'readonly' options. - * combobox: Add 'loadFilter' option to allow users to change data format before loading into combobox. - * tree: Add 'onBeforeDrop' callback event. - * validatebox: Dependent on tooltip plugin now, add 'deltaX' property. - * numberbox: The 'filter' options can be used to determine if the key pressed was accepted. - * linkbutton: The group button is available. - * layout: The 'minWidth','maxWidth','minHeight','maxHeight' and 'collapsible' properties are available for region panel. -* New Plugins - * tooltip: Display a popup message when moving mouse over an element. - -Version 1.3.2 -------------- -* Bug - * datagrid: The loading message window can not be centered when changing the width of datagrid. fixed. - * treegrid: The 'mergeCells' method can not work normally. fixed. - * propertygrid: Calling 'endEdit' method to stop editing a row will cause errors. fixed. - * tree: Can not load empty data when 'lines' property set to true. fixed. -* Improvement - * RTL feature is supported now. - * tabs: Add 'scrollBy' method to scroll the tab header by the specified amount of pixels - * tabs: Add 'toolPosition' property to set tab tools to left or right. - * tabs: Add 'tabPosition' property to define the tab position, possible values are: 'top','bottom','left','right'. - * datagrid: Add a column level property 'order' that allows users to define different default sort order per column. - * datagrid: Add a column level property 'halign' that allows users to define how to align the column header. - * datagrid: Add 'resizeHandle' property to define the resizing column position, by grabbing the left or right edge of the column. - * datagrid: Add 'freezeRow' method to freeze some rows that will always be displayed at the top when the datagrid is scrolled down. - * datagrid: Add 'clearChecked' method to clear all checked records. - * datagrid: Add 'data' property to initialize the datagrid data. - * linkbutton: Add 'iconAlgin' property to define the icon position, supported values are: 'left','right'. - * menu: Add 'minWidth' property. - * menu: The menu width can be automatically calculated. - * tree: New events are available including 'onBeforeDrag','onStartDrag','onDragEnter','onDragOver','onDragLeave',etc. - * combo: Add 'height' property to allow users to define the height of combo. - * combo: Add 'reset' method. - * numberbox: Add 'reset' method. - * spinner: Add 'reset' method. - * spinner: Add 'height' property to allow users to define the height of spinner. - * searchbox: Add 'height' property to allow users to define the height of searchbox. - * form: Add 'reset' method. - * validatebox: Add 'delay' property to delay validating from the last inputting value. - * validatebox: Add 'tipPosition' property to define the tip position, supported values are: 'left','right'. - * validatebox: Multiple validate rules on a field is supported now. - * slider: Add 'reversed' property to determine if the min value and max value will switch their positions. - * progressbar: Add 'height' property to allow users to define the height of progressbar. - -Version 1.3.1 -------------- -* Bug - * datagrid: Setting the 'pageNumber' property is not valid. fixed. - * datagrid: The id attribute of rows isn't adjusted properly while calling 'insertRow' or 'deleteRow' method. - * dialog: When load content from 'href', the script will run twice. fixed. - * propertygrid: The editors that extended from combo can not accept its changed value. fixed. -* Improvement - * droppable: Add 'disabled' property. - * droppable: Add 'options','enable' and 'disable' methods. - * tabs: The tab panel tools can be changed by calling 'update' method. - * messager: When show a message window, the user can define the window position by applying 'style' property. - * window: Prevent script on window body from running twice. - * window: Add 'hcenter','vcenter' and 'center' methods. - * tree: Add 'onBeforeCheck' callback event. - * tree: Extend the 'getChecked' method to allow users to get 'checked','unchecked' or 'indeterminate' nodes. - * treegrid: Add 'update' method to update a specified node. - * treegrid: Add 'insert' method to insert a new node. - * treegrid: Add 'pop' method to remove a node and get the removed node data. - -Version 1.3 ------------ -* Bug - * combogrid: When set to 'remote' query mode, the 'queryParams' parameters can't be sent to server. fixed. - * combotree: The tree nodes on drop-down panel can not be unchecked while calling 'clear' method. fixed. - * datetimebox: Setting 'showSeconds' property to false cannot hide seconds info. fixed. - * datagrid: Calling 'mergeCells' method can't auto resize the merged cell while header is hidden. fixed. - * dialog: Set cache to false and load data via ajax, the content cannot be refreshed. fixed. -* Improvement - * The HTML5 'data-options' attribute is available for components to declare all custom options, including properties and events. - * More detailed documentation is available. - * panel: Prevent script on panel body from running twice. - * accordion: Add 'getPanelIndex' method. - * accordion: The tools can be added on panel header. - * datetimebox: Add 'timeSeparator' option that allows users to define the time separator. - * pagination: Add 'refresh' and 'select' methods. - * datagrid: Auto resize the column width to fit the contents when the column width is not defined. - * datagrid: Double click on the right border of columns to auto resize the columns to the contents in the columns. - * datagrid: Add 'autoSizeColumn' method that allows users to adjust the column width to fit the contents. - * datagrid: Add 'getChecked' method to get all rows where the checkbox has been checked. - * datagrid: Add 'selectOnCheck' and 'checkOnSelect' properties and some checking methods to enhance the row selections. - * datagrid: Add 'pagePosition' property to allow users to display pager bar at either top,bottom or both places of the grid. - * datagrid: The buffer view and virtual scroll view are supported to display large amounts of records without pagination. - * tabs: Add 'disableTab' and 'enableTab' methods to allow users to disable or enable a tab panel. - -Version 1.2.6 -------------- -* Bug - * tabs: Call 'add' method with 'selected:false' option, the added tab panel is always selected. fixed. - * treegrid: The 'onSelect' and 'onUnselect' events can't be triggered. fixed. - * treegrid: Cannot display zero value field. fixed. -* Improvement - * propertygrid: Add 'expandGroup' and 'collapseGroup' methods. - * layout: Allow users to create collapsed layout panels by assigning 'collapsed' property to true. - * layout: Add 'add' and 'remove' methods that allow users to dynamically add or remove region panel. - * layout: Additional tool icons can be added on region panel header. - * calendar: Add 'firstDay' option that allow users to set first day of week. Sunday is 0, Monday is 1, ... - * tree: Add 'lines' option, true to display tree lines. - * tree: Add 'loadFilter' option that allow users to change data format before loading into the tree. - * tree: Add 'loader' option that allow users to define how to load data from remote server. - * treegrid: Add 'onClickCell' and 'onDblClickCell' callback function options. - * datagrid: Add 'autoRowHeight' property that allow users to determine if set the row height based on the contents of that row. - * datagrid: Improve performance to load large data set. - * datagrid: Add 'loader' option that allow users to define how to load data from remote server. - * treegrid: Add 'loader' option that allow users to define how to load data from remote server. - * combobox: Add 'onBeforeLoad' callback event function. - * combobox: Add 'loader' option that allow users to define how to load data from remote server. - * Add support for other loading mode such as dwr,xml,etc. -* New Plugins - * slider: Allows the user to choose a numeric value from a finite range. - -Version 1.2.5 -------------- -* Bug - * tabs: When add a new tab panel with href property, the content page is loaded twice. fixed. - * form: Failed to call 'load' method to load form input with complex name. fixed. - * draggable: End drag in ie9, the cursor cannot be restored. fixed. -* Improvement - * panel: The tools can be defined via html markup. - * tabs: Call 'close' method to close specified tab panel, users can pass tab title or index of tab panel. Other methods such 'select','getTab' and 'exists' are similar to 'close' method. - * tabs: Add 'getTabIndex' method. - * tabs: Users can define mini tools on tabs. - * tree: The mouse must move a specified distance to begin drag and drop operation. - * resizable: Add 'options','enable' and 'disable' methods. - * numberbox: Allow users to change number format. - * datagrid: The subgrid is supported now. - * searchbox: Add 'selectName' method to select searching type name. - -Version 1.2.4 -------------- -* Bug - * menu: The menu position is wrong when scroll bar appears. fixed. - * accordion: Cannot display the default selected panel in jQuery 1.6.2. fixed. - * tabs: Cannot display the default selected tab panel in jQuery 1.6.2. fixed. -* Improvement - * menu: Allow users to disable or enable menu item. - * combo: Add 'delay' property to set the delay time to do searching from the last key input event. - * treegrid: The 'getEditors' and 'getEditor' methods are supported now. - * treegrid: The 'loadFilter' option is supported now. - * messager: Add 'progress' method to display a message box with a progress bar. - * panel: Add 'extractor' option to allow users to extract panel content from ajax response. -* New Plugins - * searchbox: Allow users to type words into box and do searching operation. - * progressbar: To display the progress of a task. - -Version 1.2.3 -------------- -* Bug - * window: Cannot resize the window with iframe content. fixed. - * tree: The node will be removed when dragging to its child. fixed. - * combogrid: The onChange event fires multiple times. fixed. - * accordion: Cannot add batch new panels when animate property is set to true. fixed. -* Improvement - * treegrid: The footer row and row styler features are supported now. - * treegrid: Add 'getLevel','reloadFooter','getFooterRows' methods. - * treegrid: Support root nodes pagination and editable features. - * datagrid: Add 'getFooterRows','reloadFooter','insertRow' methods and improve editing performance. - * datagrid: Add 'loadFilter' option that allow users to change original source data to standard data format. - * draggable: Add 'onBeforeDrag' callback event function. - * validatebox: Add 'remote' validation type. - * combobox: Add 'method' option. -* New Plugins - * propertygrid: Allow users to edit property value in datagrid. - -Version 1.2.2 -------------- -* Bug - * datagrid: Apply fitColumns cannot work fine while set checkbox column. fixed. - * datagrid: The validateRow method cannot return boolean type value. fixed. - * numberbox: Cannot fix value in chrome when min or max property isn't defined. fixed. -* Improvement - * menu: Add some crud methods. - * combo: Add hasDownArrow property to determine whether to display the down arrow button. - * tree: Supports inline editing. - * calendar: Add some useful methods such as 'resize', 'moveTo' etc. - * timespinner: Add some useful methods. - * datebox: Refactoring based on combo and calendar plugin now. - * datagrid: Allow users to change row style in some conditions. - * datagrid: Users can use the footer row to display summary information. -* New Plugins - * datetimebox: Combines datebox with timespinner component. - -Version 1.2.1 -------------- -* Bug - * easyloader: Some dependencies cannot be loaded by their order. fixed. - * tree: The checkbox is setted incorrectly when removing a node. fixed. - * dialog: The dialog layout incorrectly when 'closed' property is setted to true. fixed. -* Improvement - * parser: Add onComplete callback function that can indicate whether the parse action is complete. - * menu: Add onClick callback function and some other methods. - * tree: Add some useful methods. - * tree: Drag and Drop feature is supported now. - * tree: Add onContextMenu callback function. - * tabs: Add onContextMenu callback function. - * tabs: Add 'tools' property that can create buttons on right bar. - * datagrid: Add onHeaderContextMenu and onRowContextMenu callback functions. - * datagrid: Custom view is supported. - * treegrid: Add onContextMenu callback function and append,remove methods. - -Version 1.2 -------------- -* Improvement - * tree: Add cascadeCheck,onlyLeafCheck properties and select event. - * combobox: Enable multiple selection. - * combotree: Enable multiple selection. - * tabs: Remember the trace of selection, when current tab panel is closed, the previous selected tab will be selected. - * datagrid: Extend from panel, so many properties defined in panel can be used for datagrid. -* New Plugins - * treegrid: Represent tabular data in hierarchical view, combines tree view and datagrid. - * combo: The basic component that allow user to extend their combo component such as combobox,combotree,etc. - * combogrid: Combines combobox with drop-down datagrid component. - * spinner: The basic plugin to create numberspinner,timespinner,etc. - * numberspinner: The numberbox that allow user to change value by clicking up and down spin buttons. - * timespinner: The time selector that allow user to quickly inc/dec a time. - -Version 1.1.2 -------------- -* Bug - * messager: When call show method in layout, the message window will be blocked. fixed. -* Improvement - * datagrid: Add validateRow method, remember the current editing row status when do editing action. - * datagrid: Add the ability to create merged cells. - * form: Add callback functions when loading data. - * panel,window,dialog: Add maximize,minimize,restore,collapse,expand methods. - * panel,tabs,accordion: The lazy loading feature is supported. - * tabs: Add getSelected,update,getTab methods. - * accordion: Add crud methods. - * linkbutton: Accept an id option to set the id attribute. - * tree: Enhance tree node operation. - -Version 1.1.1 -------------- -* Bug - * form: Cannot clear the value of combobox and combotree component. fixed. -* Improvement - * tree: Add some useful methods such as 'getRoot','getChildren','update',etc. - * datagrid: Add editable feature, improve performance while loading data. - * datebox: Add destroy method. - * combobox: Add destroy and clear method. - * combotree: Add destroy and clear method. - -Version 1.1 -------------- -* Bug - * messager: When call show method with timeout property setted, an error occurs while clicking the close button. fixed. - * combobox: The editable property of combobox plugin is invalid. fixed. - * window: The proxy box will not be removed when dragging or resizing exceed browser border in ie. fixed. -* Improvement - * menu: The menu item can use markup to display a different page. - * tree: The tree node can use markup to act as a tree menu. - * pagination: Add some event on refresh button and page list. - * datagrid: Add a 'param' parameter for reload method, with which users can pass query parameter when reload data. - * numberbox: Add required validation support, the usage is same as validatebox plugin. - * combobox: Add required validation support. - * combotree: Add required validation support. - * layout: Add some method that can get a region panel and attach event handlers. -* New Plugins - * droppable: A droppable plugin that supports drag drop operation. - * calendar: A calendar plugin that can either be embedded within a page or popup. - * datebox: Combines a textbox with a calendar that let users to select date. - * easyloader: A JavaScript loader that allows you to load plugin and their dependencies into your page. - -Version 1.0.5 -* Bug - * panel: The fit property of panel performs incorrectly. fixed. -* Improvement - * menu: Add a href attribute for menu item, with which user can display a different page in the current browser window. - * form: Add a validate method to do validation for validatebox component. - * dialog: The dialog can read collapsible,minimizable,maximizable and resizable attribute from markup. -* New Plugins - * validatebox: A validation plugin that checks to make sure the user's input value is valid. - -Version 1.0.4 -------------- -* Bug - * panel: When panel is invisible, it is abnormal when resized. fixed. - * panel: Memory leak in method 'destroy'. fixed. - * messager: Memory leak when messager box is closed. fixed. - * dialog: No onLoad event occurs when loading remote data. fixed. -* Improvement - * panel: Add method 'setTitle'. - * window: Add method 'setTitle'. - * dialog: Add method 'setTitle'. - * combotree: Add method 'getValue'. - * combobox: Add method 'getValue'. - * form: The 'load' method can load data and fill combobox and combotree field correctly. - -Version 1.0.3 -------------- -* Bug - * menu: When menu is show in a DIV container, it will be cropped. fixed. - * layout: If you collpase a region panel and then expand it immediately, the region panel will not show normally. fixed. - * accordion: If no panel selected then the first one will become selected and the first panel's body height will not set correctly. fixed. -* Improvement - * tree: Add some methods to support CRUD operation. - * datagrid: Toolbar can accept a new property named 'disabled' to disable the specified tool button. -* New Plugins - * combobox: Combines a textbox with a list of options that users are able to choose from. - * combotree: Combines combobox with drop-down tree component. - * numberbox: Make input element can only enter number char. - * dialog: rewrite the dialog plugin, dialog can contains toolbar and buttons. +Version 1.4.2 +------------- +*Bug + * treegrid: The column will restore its size to original size after recreating the treegrid. fixed. +* Improvement + * draggable: Add 'delay' property that allows the user to delay the drag operation. + * tree: Add 'filter' property and 'doFilter' method. + * tabs: The 'add' method allows the user to insert a tab panel at a specified index. + * tabs: The user can determine what tab panel can be selected. + * tabs: Add 'justified' and 'narrow' properties. + * layout: Add 'unsplit' and 'split' methods. + * messager: Keyboard navigation features are supported now. + * form: Add 'onChange' event. + * combobox: Add 'queryParams' property. + * slider: Add 'range' property. + * menu: Add 'itemHeight','inline','noline' properties. + * panel: The 'header' property allows the user to customize the panel header. + * menubutton: Add 'hasDownArrow' property. +* New Plugins + * datalist: The plugin to render items in a list. + * navpanel: The root component for the mobile page. + * mobile: The plugin to provide the mobile page stack management and navigation. + +Version 1.4.1 +------------- +* Bug + * combogrid: The combogrid has different height than other combo components. fixed. + * datagrid: The row element loses some class style value after calling 'updateRow' method. fixed. + * menubutton: Calling 'enable' method on a disabled button can not work well. fixed. + * form: The filebox components in the form do not work correctly after calling 'clear' method. fixed. +* Improvement + * tabs: The 'update' method accepts 'type' option that allows the user to update the header,body,or both. + * panel: Add 'openAnimation','openDuration','closeAnimation' and 'closeDuration' properties to set the animation for opening or closing a panel. + * panel: Add 'footer' property that allows the user to add a footer bar to the bottom of panel. + * datagrid: Calling 'endEdit' method will accept the editing value correctly. + * datagrid: Add 'onBeforeSelect','onBeforeCheck','onBeforeUnselect','onBeforeUncheck' events. + * propertygrid: The user can edit a row by calling 'beginEdit' method. + * datebox: Add 'cloneFrom' method to create the datebox component quickly. + * datetimebox: Add 'cloneFrom' method to create the datetimebox component quickly. + +Version 1.4 +------------- +* Bug + * menu: The menu should not has a correct height when removed a menu item. fixed. + * datagrid: The 'fitColumns' method does not work normally when the datarid width is too small. fixed. +* Improvement + * The fluid/percentange size is supported now for all easyui components. + * menu: Add 'showItem', 'hideItem' and 'resize' methods. + * menu: Auto resize the height upon the window size. + * menu: Add 'duration' property that allows the user to define duration time in milliseconds to hide menu. + * validatebox: Add 'onBeforeValidate' and 'onValidate' events. + * combo: Extended from textbox now. + * combo: Add 'panelMinWidth','panelMaxWidth','panelMinHeight' and 'panelMaxHeight' properties. + * searchbox: Extended from textbox now. + * tree: The 'getRoot' method will return the top parent node of a specified node if pass a 'nodeEl' parameter. + * tree: Add 'queryParams' property. + * datetimebox: Add 'spinnerWidth' property. + * panel: Add 'doLayout' method to cause the panel to lay out its components. + * panel: Add 'clear' method to clear the panel's content. + * datagrid: The user is allowed to assign percent width to columns. + * form: Add 'ajax','novalidate' and 'queryParams' properties. + * linkbutton: Add 'resize' method. +* New Plugins + * textbox: A enhanced input field that allows users build their form easily. + * datetimespinner: A date and time spinner that allows to pick a specific day. + * filebox: The filebox component represents a file field of the forms. + +Version 1.3.6 +------------- +* Bug + * treegrid: The 'getChecked' method can not return correct checked rows. fixed. + * tree: The checkbox does not display properly on async tree when 'onlyLeafCheck' property is true. fixed. +* Improvement + * treegrid: All the selecting and checking methods are extended from datagrid component. + * linkbutton: The icon alignment is fully supported, possible values are: 'top','bottom','left','right'. + * linkbutton: Add 'size' property, possible values are: 'small','large'. + * linkbutton: Add 'onClick' event. + * menubutton: Add 'menuAlign' property that allows the user set top level menu alignment. + * combo: Add 'panelAlign' property, possible values are: 'left','right'. + * calendar: The 'formatter','styler' and 'validator' options are available to custom the calendar dates. + * calendar: Add 'onChange' event. + * panel: Add 'method','queryParams' and 'loader' options. + * panel: Add 'onLoadError' event. + * datagrid: Add 'onBeginEdit' event that fires when a row goes into edit mode. + * datagrid: Add 'onEndEdit' event that fires when finishing editing but before destroying editors. + * datagrid: Add 'sort' method and 'onBeforeSortColumn' event. + * datagrid: The 'combogrid' editor has been integrated into datagrid. + * datagrid: Add 'ctrlSelect' property that only allows multi-selection when ctrl+click is used. + * slider: Add 'converter' option that allows users determine how to convert a value to the slider position or the slider position to the value. + * searchbox: Add 'disabled' property. + * searchbox: Add 'disable','enable','clear','reset' methods. + * spinner: Add 'readonly' property, 'readonly' method and 'onChange' event. + +Version 1.3.5 +------------- +* Bug + * searchbox: The 'searcher' function can not offer 'name' parameter value correctly. fixed. + * combo: The 'isValid' method can not return boolean value. fixed. + * combo: Clicking combo will trigger the 'onHidePanel' event of other combo components that have hidden drop-down panels. fixed. + * combogrid: Some methods can not inherit from combo. fixed. +* Improvement + * datagrid: Improve performance on checking rows. + * menu: Allows to append a menu separator. + * menu: Add 'hideOnUnhover' property to indicate if the menu should be hidden when mouse exits it. + * slider: Add 'clear' and 'reset' methods. + * tabs: Add 'unselect' method that will trigger 'onUnselect' event. + * tabs: Add 'selected' property to specify what tab panel will be opened. + * tabs: The 'collapsible' property of tab panel is supported to determine if the tab panel can be collapsed. + * tabs: Add 'showHeader' property, 'showHeader' and 'hideHeader' methods. + * combobox: The 'disabled' property can be used to disable some items. + * tree: Improve loading performance. + * pagination: The 'layout' property can be used to customize the pagination layout. + * accordion: Add 'unselect' method that will trigger 'onUnselect' event. + * accordion: Add 'selected' and 'multiple' properties. + * accordion: Add 'getSelections' method. + * datebox: Add 'sharedCalendar' property that allows multiple datebox components share one calendar component. + +Version 1.3.4 +------------- +* Bug + * combobox: The onLoadSuccess event fires when parsing empty local data. fixed. + * form: Calling 'reset' method can not reset datebox field. fixed. +* Improvement + * mobile: The context menu and double click features are supported on mobile devices. + * combobox: The 'groupField' and 'groupFormatter' options are available to display items in groups. + * tree: When append or insert nodes, the 'data' parameter accepts one or more nodes data. + * tree: The 'getChecked' method accepts a single 'state' or an array of 'state'. + * tree: Add 'scrollTo' method. + * datagrid: The 'multiSort' property is added to support multiple column sorting. + * datagrid: The 'rowStyler' and column 'styler' can return CSS class name or inline styles. + * treegrid: Add 'load' method to load data and navigate to the first page. + * tabs: Add 'tabWidth' and 'tabHeight' properties. + * validatebox: The 'novalidate' property is available to indicate whether to perform the validation. + * validatebox: Add 'enableValidation' and 'disableValidation' methods. + * form: Add 'enableValidation' and 'disableValidation' methods. + * slider: Add 'onComplete' event. + * pagination: The 'buttons' property accepts the existing element. + +Version 1.3.3 +------------- +* Bug + * datagrid: Some style features are not supported by column styler function. fixed. + * datagrid: IE 31 stylesheet limit. fixed. + * treegrid: Some style features are not supported by column styler function. fixed. + * menu: The auto width of menu item displays incorrect in ie6. fixed. + * combo: The 'onHidePanel' event can not fire when clicked outside the combo area. fixed. +* Improvement + * datagrid: Add 'scrollTo' and 'highlightRow' methods. + * treegrid: Enable treegrid to parse data from element. + * combo: Add 'selectOnNavigation' and 'readonly' options. + * combobox: Add 'loadFilter' option to allow users to change data format before loading into combobox. + * tree: Add 'onBeforeDrop' callback event. + * validatebox: Dependent on tooltip plugin now, add 'deltaX' property. + * numberbox: The 'filter' options can be used to determine if the key pressed was accepted. + * linkbutton: The group button is available. + * layout: The 'minWidth','maxWidth','minHeight','maxHeight' and 'collapsible' properties are available for region panel. +* New Plugins + * tooltip: Display a popup message when moving mouse over an element. + +Version 1.3.2 +------------- +* Bug + * datagrid: The loading message window can not be centered when changing the width of datagrid. fixed. + * treegrid: The 'mergeCells' method can not work normally. fixed. + * propertygrid: Calling 'endEdit' method to stop editing a row will cause errors. fixed. + * tree: Can not load empty data when 'lines' property set to true. fixed. +* Improvement + * RTL feature is supported now. + * tabs: Add 'scrollBy' method to scroll the tab header by the specified amount of pixels + * tabs: Add 'toolPosition' property to set tab tools to left or right. + * tabs: Add 'tabPosition' property to define the tab position, possible values are: 'top','bottom','left','right'. + * datagrid: Add a column level property 'order' that allows users to define different default sort order per column. + * datagrid: Add a column level property 'halign' that allows users to define how to align the column header. + * datagrid: Add 'resizeHandle' property to define the resizing column position, by grabbing the left or right edge of the column. + * datagrid: Add 'freezeRow' method to freeze some rows that will always be displayed at the top when the datagrid is scrolled down. + * datagrid: Add 'clearChecked' method to clear all checked records. + * datagrid: Add 'data' property to initialize the datagrid data. + * linkbutton: Add 'iconAlgin' property to define the icon position, supported values are: 'left','right'. + * menu: Add 'minWidth' property. + * menu: The menu width can be automatically calculated. + * tree: New events are available including 'onBeforeDrag','onStartDrag','onDragEnter','onDragOver','onDragLeave',etc. + * combo: Add 'height' property to allow users to define the height of combo. + * combo: Add 'reset' method. + * numberbox: Add 'reset' method. + * spinner: Add 'reset' method. + * spinner: Add 'height' property to allow users to define the height of spinner. + * searchbox: Add 'height' property to allow users to define the height of searchbox. + * form: Add 'reset' method. + * validatebox: Add 'delay' property to delay validating from the last inputting value. + * validatebox: Add 'tipPosition' property to define the tip position, supported values are: 'left','right'. + * validatebox: Multiple validate rules on a field is supported now. + * slider: Add 'reversed' property to determine if the min value and max value will switch their positions. + * progressbar: Add 'height' property to allow users to define the height of progressbar. + +Version 1.3.1 +------------- +* Bug + * datagrid: Setting the 'pageNumber' property is not valid. fixed. + * datagrid: The id attribute of rows isn't adjusted properly while calling 'insertRow' or 'deleteRow' method. + * dialog: When load content from 'href', the script will run twice. fixed. + * propertygrid: The editors that extended from combo can not accept its changed value. fixed. +* Improvement + * droppable: Add 'disabled' property. + * droppable: Add 'options','enable' and 'disable' methods. + * tabs: The tab panel tools can be changed by calling 'update' method. + * messager: When show a message window, the user can define the window position by applying 'style' property. + * window: Prevent script on window body from running twice. + * window: Add 'hcenter','vcenter' and 'center' methods. + * tree: Add 'onBeforeCheck' callback event. + * tree: Extend the 'getChecked' method to allow users to get 'checked','unchecked' or 'indeterminate' nodes. + * treegrid: Add 'update' method to update a specified node. + * treegrid: Add 'insert' method to insert a new node. + * treegrid: Add 'pop' method to remove a node and get the removed node data. + +Version 1.3 +----------- +* Bug + * combogrid: When set to 'remote' query mode, the 'queryParams' parameters can't be sent to server. fixed. + * combotree: The tree nodes on drop-down panel can not be unchecked while calling 'clear' method. fixed. + * datetimebox: Setting 'showSeconds' property to false cannot hide seconds info. fixed. + * datagrid: Calling 'mergeCells' method can't auto resize the merged cell while header is hidden. fixed. + * dialog: Set cache to false and load data via ajax, the content cannot be refreshed. fixed. +* Improvement + * The HTML5 'data-options' attribute is available for components to declare all custom options, including properties and events. + * More detailed documentation is available. + * panel: Prevent script on panel body from running twice. + * accordion: Add 'getPanelIndex' method. + * accordion: The tools can be added on panel header. + * datetimebox: Add 'timeSeparator' option that allows users to define the time separator. + * pagination: Add 'refresh' and 'select' methods. + * datagrid: Auto resize the column width to fit the contents when the column width is not defined. + * datagrid: Double click on the right border of columns to auto resize the columns to the contents in the columns. + * datagrid: Add 'autoSizeColumn' method that allows users to adjust the column width to fit the contents. + * datagrid: Add 'getChecked' method to get all rows where the checkbox has been checked. + * datagrid: Add 'selectOnCheck' and 'checkOnSelect' properties and some checking methods to enhance the row selections. + * datagrid: Add 'pagePosition' property to allow users to display pager bar at either top,bottom or both places of the grid. + * datagrid: The buffer view and virtual scroll view are supported to display large amounts of records without pagination. + * tabs: Add 'disableTab' and 'enableTab' methods to allow users to disable or enable a tab panel. + +Version 1.2.6 +------------- +* Bug + * tabs: Call 'add' method with 'selected:false' option, the added tab panel is always selected. fixed. + * treegrid: The 'onSelect' and 'onUnselect' events can't be triggered. fixed. + * treegrid: Cannot display zero value field. fixed. +* Improvement + * propertygrid: Add 'expandGroup' and 'collapseGroup' methods. + * layout: Allow users to create collapsed layout panels by assigning 'collapsed' property to true. + * layout: Add 'add' and 'remove' methods that allow users to dynamically add or remove region panel. + * layout: Additional tool icons can be added on region panel header. + * calendar: Add 'firstDay' option that allow users to set first day of week. Sunday is 0, Monday is 1, ... + * tree: Add 'lines' option, true to display tree lines. + * tree: Add 'loadFilter' option that allow users to change data format before loading into the tree. + * tree: Add 'loader' option that allow users to define how to load data from remote server. + * treegrid: Add 'onClickCell' and 'onDblClickCell' callback function options. + * datagrid: Add 'autoRowHeight' property that allow users to determine if set the row height based on the contents of that row. + * datagrid: Improve performance to load large data set. + * datagrid: Add 'loader' option that allow users to define how to load data from remote server. + * treegrid: Add 'loader' option that allow users to define how to load data from remote server. + * combobox: Add 'onBeforeLoad' callback event function. + * combobox: Add 'loader' option that allow users to define how to load data from remote server. + * Add support for other loading mode such as dwr,xml,etc. +* New Plugins + * slider: Allows the user to choose a numeric value from a finite range. + +Version 1.2.5 +------------- +* Bug + * tabs: When add a new tab panel with href property, the content page is loaded twice. fixed. + * form: Failed to call 'load' method to load form input with complex name. fixed. + * draggable: End drag in ie9, the cursor cannot be restored. fixed. +* Improvement + * panel: The tools can be defined via html markup. + * tabs: Call 'close' method to close specified tab panel, users can pass tab title or index of tab panel. Other methods such 'select','getTab' and 'exists' are similar to 'close' method. + * tabs: Add 'getTabIndex' method. + * tabs: Users can define mini tools on tabs. + * tree: The mouse must move a specified distance to begin drag and drop operation. + * resizable: Add 'options','enable' and 'disable' methods. + * numberbox: Allow users to change number format. + * datagrid: The subgrid is supported now. + * searchbox: Add 'selectName' method to select searching type name. + +Version 1.2.4 +------------- +* Bug + * menu: The menu position is wrong when scroll bar appears. fixed. + * accordion: Cannot display the default selected panel in jQuery 1.6.2. fixed. + * tabs: Cannot display the default selected tab panel in jQuery 1.6.2. fixed. +* Improvement + * menu: Allow users to disable or enable menu item. + * combo: Add 'delay' property to set the delay time to do searching from the last key input event. + * treegrid: The 'getEditors' and 'getEditor' methods are supported now. + * treegrid: The 'loadFilter' option is supported now. + * messager: Add 'progress' method to display a message box with a progress bar. + * panel: Add 'extractor' option to allow users to extract panel content from ajax response. +* New Plugins + * searchbox: Allow users to type words into box and do searching operation. + * progressbar: To display the progress of a task. + +Version 1.2.3 +------------- +* Bug + * window: Cannot resize the window with iframe content. fixed. + * tree: The node will be removed when dragging to its child. fixed. + * combogrid: The onChange event fires multiple times. fixed. + * accordion: Cannot add batch new panels when animate property is set to true. fixed. +* Improvement + * treegrid: The footer row and row styler features are supported now. + * treegrid: Add 'getLevel','reloadFooter','getFooterRows' methods. + * treegrid: Support root nodes pagination and editable features. + * datagrid: Add 'getFooterRows','reloadFooter','insertRow' methods and improve editing performance. + * datagrid: Add 'loadFilter' option that allow users to change original source data to standard data format. + * draggable: Add 'onBeforeDrag' callback event function. + * validatebox: Add 'remote' validation type. + * combobox: Add 'method' option. +* New Plugins + * propertygrid: Allow users to edit property value in datagrid. + +Version 1.2.2 +------------- +* Bug + * datagrid: Apply fitColumns cannot work fine while set checkbox column. fixed. + * datagrid: The validateRow method cannot return boolean type value. fixed. + * numberbox: Cannot fix value in chrome when min or max property isn't defined. fixed. +* Improvement + * menu: Add some crud methods. + * combo: Add hasDownArrow property to determine whether to display the down arrow button. + * tree: Supports inline editing. + * calendar: Add some useful methods such as 'resize', 'moveTo' etc. + * timespinner: Add some useful methods. + * datebox: Refactoring based on combo and calendar plugin now. + * datagrid: Allow users to change row style in some conditions. + * datagrid: Users can use the footer row to display summary information. +* New Plugins + * datetimebox: Combines datebox with timespinner component. + +Version 1.2.1 +------------- +* Bug + * easyloader: Some dependencies cannot be loaded by their order. fixed. + * tree: The checkbox is setted incorrectly when removing a node. fixed. + * dialog: The dialog layout incorrectly when 'closed' property is setted to true. fixed. +* Improvement + * parser: Add onComplete callback function that can indicate whether the parse action is complete. + * menu: Add onClick callback function and some other methods. + * tree: Add some useful methods. + * tree: Drag and Drop feature is supported now. + * tree: Add onContextMenu callback function. + * tabs: Add onContextMenu callback function. + * tabs: Add 'tools' property that can create buttons on right bar. + * datagrid: Add onHeaderContextMenu and onRowContextMenu callback functions. + * datagrid: Custom view is supported. + * treegrid: Add onContextMenu callback function and append,remove methods. + +Version 1.2 +------------- +* Improvement + * tree: Add cascadeCheck,onlyLeafCheck properties and select event. + * combobox: Enable multiple selection. + * combotree: Enable multiple selection. + * tabs: Remember the trace of selection, when current tab panel is closed, the previous selected tab will be selected. + * datagrid: Extend from panel, so many properties defined in panel can be used for datagrid. +* New Plugins + * treegrid: Represent tabular data in hierarchical view, combines tree view and datagrid. + * combo: The basic component that allow user to extend their combo component such as combobox,combotree,etc. + * combogrid: Combines combobox with drop-down datagrid component. + * spinner: The basic plugin to create numberspinner,timespinner,etc. + * numberspinner: The numberbox that allow user to change value by clicking up and down spin buttons. + * timespinner: The time selector that allow user to quickly inc/dec a time. + +Version 1.1.2 +------------- +* Bug + * messager: When call show method in layout, the message window will be blocked. fixed. +* Improvement + * datagrid: Add validateRow method, remember the current editing row status when do editing action. + * datagrid: Add the ability to create merged cells. + * form: Add callback functions when loading data. + * panel,window,dialog: Add maximize,minimize,restore,collapse,expand methods. + * panel,tabs,accordion: The lazy loading feature is supported. + * tabs: Add getSelected,update,getTab methods. + * accordion: Add crud methods. + * linkbutton: Accept an id option to set the id attribute. + * tree: Enhance tree node operation. + +Version 1.1.1 +------------- +* Bug + * form: Cannot clear the value of combobox and combotree component. fixed. +* Improvement + * tree: Add some useful methods such as 'getRoot','getChildren','update',etc. + * datagrid: Add editable feature, improve performance while loading data. + * datebox: Add destroy method. + * combobox: Add destroy and clear method. + * combotree: Add destroy and clear method. + +Version 1.1 +------------- +* Bug + * messager: When call show method with timeout property setted, an error occurs while clicking the close button. fixed. + * combobox: The editable property of combobox plugin is invalid. fixed. + * window: The proxy box will not be removed when dragging or resizing exceed browser border in ie. fixed. +* Improvement + * menu: The menu item can use markup to display a different page. + * tree: The tree node can use markup to act as a tree menu. + * pagination: Add some event on refresh button and page list. + * datagrid: Add a 'param' parameter for reload method, with which users can pass query parameter when reload data. + * numberbox: Add required validation support, the usage is same as validatebox plugin. + * combobox: Add required validation support. + * combotree: Add required validation support. + * layout: Add some method that can get a region panel and attach event handlers. +* New Plugins + * droppable: A droppable plugin that supports drag drop operation. + * calendar: A calendar plugin that can either be embedded within a page or popup. + * datebox: Combines a textbox with a calendar that let users to select date. + * easyloader: A JavaScript loader that allows you to load plugin and their dependencies into your page. + +Version 1.0.5 +* Bug + * panel: The fit property of panel performs incorrectly. fixed. +* Improvement + * menu: Add a href attribute for menu item, with which user can display a different page in the current browser window. + * form: Add a validate method to do validation for validatebox component. + * dialog: The dialog can read collapsible,minimizable,maximizable and resizable attribute from markup. +* New Plugins + * validatebox: A validation plugin that checks to make sure the user's input value is valid. + +Version 1.0.4 +------------- +* Bug + * panel: When panel is invisible, it is abnormal when resized. fixed. + * panel: Memory leak in method 'destroy'. fixed. + * messager: Memory leak when messager box is closed. fixed. + * dialog: No onLoad event occurs when loading remote data. fixed. +* Improvement + * panel: Add method 'setTitle'. + * window: Add method 'setTitle'. + * dialog: Add method 'setTitle'. + * combotree: Add method 'getValue'. + * combobox: Add method 'getValue'. + * form: The 'load' method can load data and fill combobox and combotree field correctly. + +Version 1.0.3 +------------- +* Bug + * menu: When menu is show in a DIV container, it will be cropped. fixed. + * layout: If you collpase a region panel and then expand it immediately, the region panel will not show normally. fixed. + * accordion: If no panel selected then the first one will become selected and the first panel's body height will not set correctly. fixed. +* Improvement + * tree: Add some methods to support CRUD operation. + * datagrid: Toolbar can accept a new property named 'disabled' to disable the specified tool button. +* New Plugins + * combobox: Combines a textbox with a list of options that users are able to choose from. + * combotree: Combines combobox with drop-down tree component. + * numberbox: Make input element can only enter number char. + * dialog: rewrite the dialog plugin, dialog can contains toolbar and buttons. diff --git a/src/main/webapp/js/easyui/demo-mobile/accordion/_content.html b/src/main/webapp/js/easyui/demo-mobile/accordion/_content.html index 9967402..f7b8e2e 100644 --- a/src/main/webapp/js/easyui/demo-mobile/accordion/_content.html +++ b/src/main/webapp/js/easyui/demo-mobile/accordion/_content.html @@ -1,18 +1,18 @@ - - - - - AJAX Content - - -

Here is the content loaded via AJAX.

-
    -
  • easyui is a collection of user-interface plugin based on jQuery.
  • -
  • easyui provides essential functionality for building modern, interactive, javascript applications.
  • -
  • using easyui you don't need to write many javascript code, you usually defines user-interface by writing some HTML markup.
  • -
  • complete framework for HTML5 web page.
  • -
  • easyui save your time and scales while developing your products.
  • -
  • easyui is very easy but powerful.
  • -
- + + + + + AJAX Content + + +

Here is the content loaded via AJAX.

+
    +
  • easyui is a collection of user-interface plugin based on jQuery.
  • +
  • easyui provides essential functionality for building modern, interactive, javascript applications.
  • +
  • using easyui you don't need to write many javascript code, you usually defines user-interface by writing some HTML markup.
  • +
  • complete framework for HTML5 web page.
  • +
  • easyui save your time and scales while developing your products.
  • +
  • easyui is very easy but powerful.
  • +
+ \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo-mobile/datagrid/rowediting.html b/src/main/webapp/js/easyui/demo-mobile/datagrid/rowediting.html index d9d354e..73ef901 100644 --- a/src/main/webapp/js/easyui/demo-mobile/datagrid/rowediting.html +++ b/src/main/webapp/js/easyui/demo-mobile/datagrid/rowediting.html @@ -1,104 +1,104 @@ - - - - - - Row Editing DataGrid - jQuery EasyUI Mobile Demo - - - - - - - - - - - - - - - - - -
Item IDProductList PriceUnit Cost
-
- - - + + + + + + Row Editing DataGrid - jQuery EasyUI Mobile Demo + + + + + + + + + + + + + + + + + +
Item IDProductList PriceUnit Cost
+
+
+
Row Editing
+
+ + + +
+
+
+ + + \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo-mobile/dialog/basic.html b/src/main/webapp/js/easyui/demo-mobile/dialog/basic.html index d02c84d..64a2aa5 100644 --- a/src/main/webapp/js/easyui/demo-mobile/dialog/basic.html +++ b/src/main/webapp/js/easyui/demo-mobile/dialog/basic.html @@ -1,46 +1,46 @@ - - - - - - Basic Dialog - jQuery EasyUI Mobile Demo - - - - - - - - -
-
-
-
Basic Dialog
-
-
- -
- Login -
- -
-
- -
-
- -
-
- Sign in -
-
-
- + + + + + + Basic Dialog - jQuery EasyUI Mobile Demo + + + + + + + + +
+
+
+
Basic Dialog
+
+
+ +
+ Login +
+ +
+
+ +
+
+ +
+
+ Sign in +
+
+
+ \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo-mobile/dialog/message.html b/src/main/webapp/js/easyui/demo-mobile/dialog/message.html index 0254dbe..ffaf1ef 100644 --- a/src/main/webapp/js/easyui/demo-mobile/dialog/message.html +++ b/src/main/webapp/js/easyui/demo-mobile/dialog/message.html @@ -1,41 +1,41 @@ - - - - - - Message Dialog - jQuery EasyUI Mobile Demo - - - - - - - - -
-
-
-
Message Dialog
-
-
- -
- Click me -
- -
-

This is a message dialog.

-
- OK -
-
-
- + + + + + + Message Dialog - jQuery EasyUI Mobile Demo + + + + + + + + +
+
+
+
Message Dialog
+
+
+ +
+ Click me +
+ +
+

This is a message dialog.

+
+ OK +
+
+
+ \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo-mobile/form/basic.html b/src/main/webapp/js/easyui/demo-mobile/form/basic.html index 3715b27..a0835ec 100644 --- a/src/main/webapp/js/easyui/demo-mobile/form/basic.html +++ b/src/main/webapp/js/easyui/demo-mobile/form/basic.html @@ -1,54 +1,54 @@ - - - - - - Basic Form - jQuery EasyUI Mobile Demo - - - - - - - - -
-
-
-
Basic Form
-
- Reset -
-
-
-
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
-
- - + + + + + + Basic Form - jQuery EasyUI Mobile Demo + + + + + + + + +
+
+
+
Basic Form
+
+ Reset +
+
+
+
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+
+ + \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo-mobile/layout/basic.html b/src/main/webapp/js/easyui/demo-mobile/layout/basic.html index c1ecaff..3f4c00d 100644 --- a/src/main/webapp/js/easyui/demo-mobile/layout/basic.html +++ b/src/main/webapp/js/easyui/demo-mobile/layout/basic.html @@ -1,32 +1,32 @@ - - - - - - Basic Layout - jQuery EasyUI Mobile Demo - - - - - - - - -
-
-
-
Layout
-
- Back -
-
- Search -
-
-
-
- -
-
- + + + + + + Basic Layout - jQuery EasyUI Mobile Demo + + + + + + + + +
+
+
+
Layout
+
+ Back +
+
+ Search +
+
+
+
+ +
+
+ \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo-mobile/menu/basic.html b/src/main/webapp/js/easyui/demo-mobile/menu/basic.html index fb97096..1697ede 100644 --- a/src/main/webapp/js/easyui/demo-mobile/menu/basic.html +++ b/src/main/webapp/js/easyui/demo-mobile/menu/basic.html @@ -1,39 +1,39 @@ - - - - - - Basic Menu - jQuery EasyUI Mobile Demo - - - - - - - - -
-
-
-
Menu
-
- - -
-
-
-
-
-
Undo
-
Redo
- -
Cut
-
Copy
-
Paste
- -
Toolbar
-
Delete
-
Select All
-
- + + + + + + Basic Menu - jQuery EasyUI Mobile Demo + + + + + + + + +
+
+
+
Menu
+
+ + +
+
+
+
+
+
Undo
+
Redo
+ +
Cut
+
Copy
+
Paste
+ +
Toolbar
+
Delete
+
Select All
+
+ \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo-mobile/menu/menubar.html b/src/main/webapp/js/easyui/demo-mobile/menu/menubar.html index 5ef8eef..488963f 100644 --- a/src/main/webapp/js/easyui/demo-mobile/menu/menubar.html +++ b/src/main/webapp/js/easyui/demo-mobile/menu/menubar.html @@ -1,45 +1,45 @@ - - - - - - Menubar - jQuery EasyUI Mobile Demo - - - - - - - - -
-
-
-
- Home - Edit - Help - About -
-
-
-
-
-
Undo
-
Redo
- -
Cut
-
Copy
-
Paste
- -
Toolbar
-
Delete
-
Select All
-
-
-
Help
-
Update
-
About
-
- + + + + + + Menubar - jQuery EasyUI Mobile Demo + + + + + + + + +
+
+
+
+ Home + Edit + Help + About +
+
+
+
+
+
Undo
+
Redo
+ +
Cut
+
Copy
+
Paste
+ +
Toolbar
+
Delete
+
Select All
+
+
+
Help
+
Update
+
About
+
+ \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo-mobile/panel/_content.html b/src/main/webapp/js/easyui/demo-mobile/panel/_content.html index 9967402..f7b8e2e 100644 --- a/src/main/webapp/js/easyui/demo-mobile/panel/_content.html +++ b/src/main/webapp/js/easyui/demo-mobile/panel/_content.html @@ -1,18 +1,18 @@ - - - - - AJAX Content - - -

Here is the content loaded via AJAX.

-
    -
  • easyui is a collection of user-interface plugin based on jQuery.
  • -
  • easyui provides essential functionality for building modern, interactive, javascript applications.
  • -
  • using easyui you don't need to write many javascript code, you usually defines user-interface by writing some HTML markup.
  • -
  • complete framework for HTML5 web page.
  • -
  • easyui save your time and scales while developing your products.
  • -
  • easyui is very easy but powerful.
  • -
- + + + + + AJAX Content + + +

Here is the content loaded via AJAX.

+
    +
  • easyui is a collection of user-interface plugin based on jQuery.
  • +
  • easyui provides essential functionality for building modern, interactive, javascript applications.
  • +
  • using easyui you don't need to write many javascript code, you usually defines user-interface by writing some HTML markup.
  • +
  • complete framework for HTML5 web page.
  • +
  • easyui save your time and scales while developing your products.
  • +
  • easyui is very easy but powerful.
  • +
+ \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo-mobile/panel/nav.html b/src/main/webapp/js/easyui/demo-mobile/panel/nav.html index c6feff2..5279a38 100644 --- a/src/main/webapp/js/easyui/demo-mobile/panel/nav.html +++ b/src/main/webapp/js/easyui/demo-mobile/panel/nav.html @@ -1,39 +1,39 @@ - - - - - - Navigation Panel - jQuery EasyUI Mobile Demo - - - - - - - - -
-
-
-
Navigation
-
-
- -
-
-
-
-
Panel2
-
- Back -
-
-
-
- Go Back -
-
- + + + + + + Navigation Panel - jQuery EasyUI Mobile Demo + + + + + + + + +
+
+
+
Navigation
+
+
+ +
+
+
+
+
Panel2
+
+ Back +
+
+
+
+ Go Back +
+
+ \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo-mobile/toolbar/basic.html b/src/main/webapp/js/easyui/demo-mobile/toolbar/basic.html index b62b2ac..3fb5230 100644 --- a/src/main/webapp/js/easyui/demo-mobile/toolbar/basic.html +++ b/src/main/webapp/js/easyui/demo-mobile/toolbar/basic.html @@ -1,63 +1,63 @@ - - - - - - Basic Toolbar - jQuery EasyUI Mobile Demo - - - - - - - - -
-
-
-
Basic Toolbar
-
- Back -
-
- Next -
-
-
-
    -
  • Large
  • -
  • Spotted Adult Female
  • -
  • Venomless
  • -
  • Rattleless
  • -
  • Green Adult
  • -
  • Tailless
  • -
  • With tail
  • -
  • Adult Female
  • -
-
-
-
-
- Detail -
- Back -
-
-
-
- Go Back -
-
- + + + + + + Basic Toolbar - jQuery EasyUI Mobile Demo + + + + + + + + +
+
+
+
Basic Toolbar
+
+ Back +
+
+ Next +
+
+
+
    +
  • Large
  • +
  • Spotted Adult Female
  • +
  • Venomless
  • +
  • Rattleless
  • +
  • Green Adult
  • +
  • Tailless
  • +
  • With tail
  • +
  • Adult Female
  • +
+
+
+
+
+ Detail +
+ Back +
+
+
+
+ Go Back +
+
+ \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo-mobile/toolbar/button.html b/src/main/webapp/js/easyui/demo-mobile/toolbar/button.html index 3db342a..14366a6 100644 --- a/src/main/webapp/js/easyui/demo-mobile/toolbar/button.html +++ b/src/main/webapp/js/easyui/demo-mobile/toolbar/button.html @@ -1,45 +1,45 @@ - - - - - - Toolbar Button - jQuery EasyUI Mobile Demo - - - - - - - - -
-
-
-
Toolbar Button
-
-
- -
    -
  • Large
  • -
  • Spotted Adult Female
  • -
  • Venomless
  • -
  • Rattleless
  • -
  • Green Adult
  • -
  • Tailless
  • -
  • With tail
  • -
  • Adult Female
  • -
-
- + + + + + + Toolbar Button - jQuery EasyUI Mobile Demo + + + + + + + + +
+
+
+
Toolbar Button
+
+
+ +
    +
  • Large
  • +
  • Spotted Adult Female
  • +
  • Venomless
  • +
  • Rattleless
  • +
  • Green Adult
  • +
  • Tailless
  • +
  • With tail
  • +
  • Adult Female
  • +
+
+ \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo-mobile/toolbar/menu.html b/src/main/webapp/js/easyui/demo-mobile/toolbar/menu.html index f053bcc..5d9e039 100644 --- a/src/main/webapp/js/easyui/demo-mobile/toolbar/menu.html +++ b/src/main/webapp/js/easyui/demo-mobile/toolbar/menu.html @@ -1,76 +1,76 @@ - - - - - - Menu on Toolbar - jQuery EasyUI Mobile Demo - - - - - - - - -
-
-
-
Menu on Toolbar
-
- -
-
- - -
-
-
-
-
Undo
-
Redo
- -
Cut
-
Copy
-
Paste
- -
Toolbar
-
Delete
-
Select All
-
-
    -
  • Large
  • -
  • Spotted Adult Female
  • -
  • Venomless
  • -
  • Rattleless
  • -
  • Green Adult
  • -
  • Tailless
  • -
  • With tail
  • -
  • Adult Female
  • -
-
-
-
-
- Detail -
- Back -
-
-
-
- Go Back -
-
- + + + + + + Menu on Toolbar - jQuery EasyUI Mobile Demo + + + + + + + + +
+
+
+
Menu on Toolbar
+
+ +
+
+ + +
+
+
+
+
Undo
+
Redo
+ +
Cut
+
Copy
+
Paste
+ +
Toolbar
+
Delete
+
Select All
+
+
    +
  • Large
  • +
  • Spotted Adult Female
  • +
  • Venomless
  • +
  • Rattleless
  • +
  • Green Adult
  • +
  • Tailless
  • +
  • With tail
  • +
  • Adult Female
  • +
+
+
+
+
+ Detail +
+ Back +
+
+
+
+ Go Back +
+
+ \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo-mobile/tree/basic.html b/src/main/webapp/js/easyui/demo-mobile/tree/basic.html index 9284505..7561c08 100644 --- a/src/main/webapp/js/easyui/demo-mobile/tree/basic.html +++ b/src/main/webapp/js/easyui/demo-mobile/tree/basic.html @@ -1,56 +1,56 @@ - - - - - - Basic Tree - jQuery EasyUI Mobile Demo - - - - - - - - -
-
-
-
Basic Tree
-
-
-
    -
  • - My Documents -
      -
    • - Photos -
        -
      • - Friend -
      • -
      • - Wife -
      • -
      • - Company -
      • -
      -
    • -
    • - Program Files -
        -
      • Intel
      • -
      • Java
      • -
      • Microsoft Office
      • -
      • Games
      • -
      -
    • -
    • index.html
    • -
    • about.html
    • -
    • welcome.html
    • -
    -
  • -
-
- + + + + + + Basic Tree - jQuery EasyUI Mobile Demo + + + + + + + + +
+
+
+
Basic Tree
+
+
+
    +
  • + My Documents +
      +
    • + Photos +
        +
      • + Friend +
      • +
      • + Wife +
      • +
      • + Company +
      • +
      +
    • +
    • + Program Files +
        +
      • Intel
      • +
      • Java
      • +
      • Microsoft Office
      • +
      • Games
      • +
      +
    • +
    • index.html
    • +
    • about.html
    • +
    • welcome.html
    • +
    +
  • +
+
+ \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo-mobile/tree/dnd.html b/src/main/webapp/js/easyui/demo-mobile/tree/dnd.html index ecb8e31..91f9860 100644 --- a/src/main/webapp/js/easyui/demo-mobile/tree/dnd.html +++ b/src/main/webapp/js/easyui/demo-mobile/tree/dnd.html @@ -1,56 +1,56 @@ - - - - - - Drag Drop Tree Nodes - jQuery EasyUI Mobile Demo - - - - - - - - -
-
-
-
Drag Drop Tree Nodes
-
-
-
    -
  • - My Documents -
      -
    • - Photos -
        -
      • - Friend -
      • -
      • - Wife -
      • -
      • - Company -
      • -
      -
    • -
    • - Program Files -
        -
      • Intel
      • -
      • Java
      • -
      • Microsoft Office
      • -
      • Games
      • -
      -
    • -
    • index.html
    • -
    • about.html
    • -
    • welcome.html
    • -
    -
  • -
-
- + + + + + + Drag Drop Tree Nodes - jQuery EasyUI Mobile Demo + + + + + + + + +
+
+
+
Drag Drop Tree Nodes
+
+
+
    +
  • + My Documents +
      +
    • + Photos +
        +
      • + Friend +
      • +
      • + Wife +
      • +
      • + Company +
      • +
      +
    • +
    • + Program Files +
        +
      • Intel
      • +
      • Java
      • +
      • Microsoft Office
      • +
      • Games
      • +
      +
    • +
    • index.html
    • +
    • about.html
    • +
    • welcome.html
    • +
    +
  • +
+
+ \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo/accordion/_content.html b/src/main/webapp/js/easyui/demo/accordion/_content.html index 9967402..f7b8e2e 100644 --- a/src/main/webapp/js/easyui/demo/accordion/_content.html +++ b/src/main/webapp/js/easyui/demo/accordion/_content.html @@ -1,18 +1,18 @@ - - - - - AJAX Content - - -

Here is the content loaded via AJAX.

-
    -
  • easyui is a collection of user-interface plugin based on jQuery.
  • -
  • easyui provides essential functionality for building modern, interactive, javascript applications.
  • -
  • using easyui you don't need to write many javascript code, you usually defines user-interface by writing some HTML markup.
  • -
  • complete framework for HTML5 web page.
  • -
  • easyui save your time and scales while developing your products.
  • -
  • easyui is very easy but powerful.
  • -
- + + + + + AJAX Content + + +

Here is the content loaded via AJAX.

+
    +
  • easyui is a collection of user-interface plugin based on jQuery.
  • +
  • easyui provides essential functionality for building modern, interactive, javascript applications.
  • +
  • using easyui you don't need to write many javascript code, you usually defines user-interface by writing some HTML markup.
  • +
  • complete framework for HTML5 web page.
  • +
  • easyui save your time and scales while developing your products.
  • +
  • easyui is very easy but powerful.
  • +
+ \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo/accordion/actions.html b/src/main/webapp/js/easyui/demo/accordion/actions.html index f895ebb..28935d7 100644 --- a/src/main/webapp/js/easyui/demo/accordion/actions.html +++ b/src/main/webapp/js/easyui/demo/accordion/actions.html @@ -1,51 +1,51 @@ - - - - - Accordion Actions - jQuery EasyUI Demo - - - - - - - -

Accordion Actions

-

Click the buttons below to add or remove accordion items.

-
- Select - Add - Remove -
-
-
-

Accordion for jQuery

-

Accordion is a part of easyui framework for jQuery. It lets you define your accordion component on web page more easily.

-
-
- - + + + + + Accordion Actions - jQuery EasyUI Demo + + + + + + + +

Accordion Actions

+

Click the buttons below to add or remove accordion items.

+
+ Select + Add + Remove +
+
+
+

Accordion for jQuery

+

Accordion is a part of easyui framework for jQuery. It lets you define your accordion component on web page more easily.

+
+
+ + \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo/accordion/ajax.html b/src/main/webapp/js/easyui/demo/accordion/ajax.html index e5c77f3..87c1a01 100644 --- a/src/main/webapp/js/easyui/demo/accordion/ajax.html +++ b/src/main/webapp/js/easyui/demo/accordion/ajax.html @@ -1,28 +1,28 @@ - - - - - Loading Accordion Content with AJAX - jQuery EasyUI Demo - - - - - - - -

Loading Accordion Content with AJAX

-

Click AJAX panel header to load content via AJAX.

-
-
-
-

Accordion for jQuery

-

Accordion is a part of easyui framework for jQuery. It lets you define your accordion component on web page more easily.

-
-
-

The accordion allows you to provide multiple panels and display one or more at a time. Each panel has built-in support for expanding and collapsing. Clicking on a panel header to expand or collapse that panel body. The panel content can be loaded via ajax by specifying a 'href' property. Users can define a panel to be selected. If it is not specified, then the first panel is taken by default.

-
-
-
-
- + + + + + Loading Accordion Content with AJAX - jQuery EasyUI Demo + + + + + + + +

Loading Accordion Content with AJAX

+

Click AJAX panel header to load content via AJAX.

+
+
+
+

Accordion for jQuery

+

Accordion is a part of easyui framework for jQuery. It lets you define your accordion component on web page more easily.

+
+
+

The accordion allows you to provide multiple panels and display one or more at a time. Each panel has built-in support for expanding and collapsing. Clicking on a panel header to expand or collapse that panel body. The panel content can be loaded via ajax by specifying a 'href' property. Users can define a panel to be selected. If it is not specified, then the first panel is taken by default.

+
+
+
+
+ \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo/accordion/basic.html b/src/main/webapp/js/easyui/demo/accordion/basic.html index 141deac..1f6c8f5 100644 --- a/src/main/webapp/js/easyui/demo/accordion/basic.html +++ b/src/main/webapp/js/easyui/demo/accordion/basic.html @@ -1,52 +1,52 @@ - - - - - Basic Accordion - jQuery EasyUI Demo - - - - - - - -

Basic Accordion

-

Click on panel header to show its content.

-
-
-
-

Accordion for jQuery

-

Accordion is a part of easyui framework for jQuery. It lets you define your accordion component on web page more easily.

-
-
-

The accordion allows you to provide multiple panels and display one or more at a time. Each panel has built-in support for expanding and collapsing. Clicking on a panel header to expand or collapse that panel body. The panel content can be loaded via ajax by specifying a 'href' property. Users can define a panel to be selected. If it is not specified, then the first panel is taken by default.

-
-
-
    -
  • - Foods -
      -
    • - Fruits -
        -
      • apple
      • -
      • orange
      • -
      -
    • -
    • - Vegetables -
        -
      • tomato
      • -
      • carrot
      • -
      • cabbage
      • -
      • potato
      • -
      • lettuce
      • -
      -
    • -
    -
  • -
-
-
- + + + + + Basic Accordion - jQuery EasyUI Demo + + + + + + + +

Basic Accordion

+

Click on panel header to show its content.

+
+
+
+

Accordion for jQuery

+

Accordion is a part of easyui framework for jQuery. It lets you define your accordion component on web page more easily.

+
+
+

The accordion allows you to provide multiple panels and display one or more at a time. Each panel has built-in support for expanding and collapsing. Clicking on a panel header to expand or collapse that panel body. The panel content can be loaded via ajax by specifying a 'href' property. Users can define a panel to be selected. If it is not specified, then the first panel is taken by default.

+
+
+
    +
  • + Foods +
      +
    • + Fruits +
        +
      • apple
      • +
      • orange
      • +
      +
    • +
    • + Vegetables +
        +
      • tomato
      • +
      • carrot
      • +
      • cabbage
      • +
      • potato
      • +
      • lettuce
      • +
      +
    • +
    +
  • +
+
+
+ \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo/accordion/datagrid_data1.json b/src/main/webapp/js/easyui/demo/accordion/datagrid_data1.json index 63d6473..e9a5be2 100644 --- a/src/main/webapp/js/easyui/demo/accordion/datagrid_data1.json +++ b/src/main/webapp/js/easyui/demo/accordion/datagrid_data1.json @@ -1,12 +1,12 @@ -{"total":28,"rows":[ - {"productid":"FI-SW-01","productname":"Koi","unitcost":10.00,"status":"P","listprice":36.50,"attr1":"Large","itemid":"EST-1"}, - {"productid":"K9-DL-01","productname":"Dalmation","unitcost":12.00,"status":"P","listprice":18.50,"attr1":"Spotted Adult Female","itemid":"EST-10"}, - {"productid":"RP-SN-01","productname":"Rattlesnake","unitcost":12.00,"status":"P","listprice":38.50,"attr1":"Venomless","itemid":"EST-11"}, - {"productid":"RP-SN-01","productname":"Rattlesnake","unitcost":12.00,"status":"P","listprice":26.50,"attr1":"Rattleless","itemid":"EST-12"}, - {"productid":"RP-LI-02","productname":"Iguana","unitcost":12.00,"status":"P","listprice":35.50,"attr1":"Green Adult","itemid":"EST-13"}, - {"productid":"FL-DSH-01","productname":"Manx","unitcost":12.00,"status":"P","listprice":158.50,"attr1":"Tailless","itemid":"EST-14"}, - {"productid":"FL-DSH-01","productname":"Manx","unitcost":12.00,"status":"P","listprice":83.50,"attr1":"With tail","itemid":"EST-15"}, - {"productid":"FL-DLH-02","productname":"Persian","unitcost":12.00,"status":"P","listprice":23.50,"attr1":"Adult Female","itemid":"EST-16"}, - {"productid":"FL-DLH-02","productname":"Persian","unitcost":12.00,"status":"P","listprice":89.50,"attr1":"Adult Male","itemid":"EST-17"}, - {"productid":"AV-CB-01","productname":"Amazon Parrot","unitcost":92.00,"status":"P","listprice":63.50,"attr1":"Adult Male","itemid":"EST-18"} -]} +{"total":28,"rows":[ + {"productid":"FI-SW-01","productname":"Koi","unitcost":10.00,"status":"P","listprice":36.50,"attr1":"Large","itemid":"EST-1"}, + {"productid":"K9-DL-01","productname":"Dalmation","unitcost":12.00,"status":"P","listprice":18.50,"attr1":"Spotted Adult Female","itemid":"EST-10"}, + {"productid":"RP-SN-01","productname":"Rattlesnake","unitcost":12.00,"status":"P","listprice":38.50,"attr1":"Venomless","itemid":"EST-11"}, + {"productid":"RP-SN-01","productname":"Rattlesnake","unitcost":12.00,"status":"P","listprice":26.50,"attr1":"Rattleless","itemid":"EST-12"}, + {"productid":"RP-LI-02","productname":"Iguana","unitcost":12.00,"status":"P","listprice":35.50,"attr1":"Green Adult","itemid":"EST-13"}, + {"productid":"FL-DSH-01","productname":"Manx","unitcost":12.00,"status":"P","listprice":158.50,"attr1":"Tailless","itemid":"EST-14"}, + {"productid":"FL-DSH-01","productname":"Manx","unitcost":12.00,"status":"P","listprice":83.50,"attr1":"With tail","itemid":"EST-15"}, + {"productid":"FL-DLH-02","productname":"Persian","unitcost":12.00,"status":"P","listprice":23.50,"attr1":"Adult Female","itemid":"EST-16"}, + {"productid":"FL-DLH-02","productname":"Persian","unitcost":12.00,"status":"P","listprice":89.50,"attr1":"Adult Male","itemid":"EST-17"}, + {"productid":"AV-CB-01","productname":"Amazon Parrot","unitcost":92.00,"status":"P","listprice":63.50,"attr1":"Adult Male","itemid":"EST-18"} +]} diff --git a/src/main/webapp/js/easyui/demo/accordion/expandable.html b/src/main/webapp/js/easyui/demo/accordion/expandable.html index a678953..8f20f16 100644 --- a/src/main/webapp/js/easyui/demo/accordion/expandable.html +++ b/src/main/webapp/js/easyui/demo/accordion/expandable.html @@ -1,33 +1,33 @@ - - - - - Keep Expandable Panel in Accordion - jQuery EasyUI Demo - - - - - - - -

Keep Expandable Panel in Accordion

-

Keep a expandable panel and prevent it from collapsing.

-
-
-
- -
-
-

Accordion for jQuery

-

Accordion is a part of easyui framework for jQuery. It lets you define your accordion component on web page more easily.

-
-
-

Content1

-
-
-

Content2

-
-
- - + + + + + Keep Expandable Panel in Accordion - jQuery EasyUI Demo + + + + + + + +

Keep Expandable Panel in Accordion

+

Keep a expandable panel and prevent it from collapsing.

+
+
+
+ +
+
+

Accordion for jQuery

+

Accordion is a part of easyui framework for jQuery. It lets you define your accordion component on web page more easily.

+
+
+

Content1

+
+
+

Content2

+
+
+ + \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo/accordion/fluid.html b/src/main/webapp/js/easyui/demo/accordion/fluid.html index 1848802..aaeb994 100644 --- a/src/main/webapp/js/easyui/demo/accordion/fluid.html +++ b/src/main/webapp/js/easyui/demo/accordion/fluid.html @@ -1,33 +1,33 @@ - - - - - Fluid Accordion - jQuery EasyUI Demo - - - - - - - -

Fluid Accordion

-

This example shows how to set the width of accordion to a percentage of its parent container.

-
-
-
-

width: 100%

-
-
-
-
-
- -
-
-

width: 50%

-
-
-
-
- + + + + + Fluid Accordion - jQuery EasyUI Demo + + + + + + + +

Fluid Accordion

+

This example shows how to set the width of accordion to a percentage of its parent container.

+
+
+
+

width: 100%

+
+
+
+
+
+ +
+
+

width: 50%

+
+
+
+
+ \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo/accordion/multiple.html b/src/main/webapp/js/easyui/demo/accordion/multiple.html index afd1b7f..d75bfbc 100644 --- a/src/main/webapp/js/easyui/demo/accordion/multiple.html +++ b/src/main/webapp/js/easyui/demo/accordion/multiple.html @@ -1,34 +1,34 @@ - - - - - Multiple Accordion Panels - jQuery EasyUI Demo - - - - - - - -

Multiple Accordion Panels

-

Enable 'multiple' mode to expand multiple panels at one time.

-
-
-
-

A programming language is a formal language designed to communicate instructions to a machine, particularly a computer. Programming languages can be used to create programs that control the behavior of a machine and/or to express algorithms precisely.

-
-
-

Java (Indonesian: Jawa) is an island of Indonesia. With a population of 135 million (excluding the 3.6 million on the island of Madura which is administered as part of the provinces of Java), Java is the world's most populous island, and one of the most densely populated places in the world.

-
-
-

C# is a multi-paradigm programming language encompassing strong typing, imperative, declarative, functional, generic, object-oriented (class-based), and component-oriented programming disciplines.

-
-
-

A dynamic, reflective, general-purpose object-oriented programming language.

-
-
-

Fortran (previously FORTRAN) is a general-purpose, imperative programming language that is especially suited to numeric computation and scientific computing.

-
-
- + + + + + Multiple Accordion Panels - jQuery EasyUI Demo + + + + + + + +

Multiple Accordion Panels

+

Enable 'multiple' mode to expand multiple panels at one time.

+
+
+
+

A programming language is a formal language designed to communicate instructions to a machine, particularly a computer. Programming languages can be used to create programs that control the behavior of a machine and/or to express algorithms precisely.

+
+
+

Java (Indonesian: Jawa) is an island of Indonesia. With a population of 135 million (excluding the 3.6 million on the island of Madura which is administered as part of the provinces of Java), Java is the world's most populous island, and one of the most densely populated places in the world.

+
+
+

C# is a multi-paradigm programming language encompassing strong typing, imperative, declarative, functional, generic, object-oriented (class-based), and component-oriented programming disciplines.

+
+
+

A dynamic, reflective, general-purpose object-oriented programming language.

+
+
+

Fortran (previously FORTRAN) is a general-purpose, imperative programming language that is especially suited to numeric computation and scientific computing.

+
+
+ \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo/accordion/tools.html b/src/main/webapp/js/easyui/demo/accordion/tools.html index 271694b..6351a91 100644 --- a/src/main/webapp/js/easyui/demo/accordion/tools.html +++ b/src/main/webapp/js/easyui/demo/accordion/tools.html @@ -1,48 +1,48 @@ - - - - - Accordion Tools - jQuery EasyUI Demo - - - - - - - -

Accordion Tools

-

Click the tools on top right of panel to perform actions.

-
-
-
-

Accordion for jQuery

-

Accordion is a part of easyui framework for jQuery. It lets you define your accordion component on web page more easily.

-
-
-

The accordion allows you to provide multiple panels and display one ore more at a time. Each panel has built-in support for expanding and collapsing. Clicking on a panel header to expand or collapse that panel body. The panel content can be loaded via ajax by specifying a 'href' property. Users can define a panel to be selected. If it is not specified, then the first panel is taken by default.

-
-
- - - - - - - - - - - -
Item IDProduct IDList PriceUnit CostAttributeStatus
-
-
- + + + + + Accordion Tools - jQuery EasyUI Demo + + + + + + + +

Accordion Tools

+

Click the tools on top right of panel to perform actions.

+
+
+
+

Accordion for jQuery

+

Accordion is a part of easyui framework for jQuery. It lets you define your accordion component on web page more easily.

+
+
+

The accordion allows you to provide multiple panels and display one ore more at a time. Each panel has built-in support for expanding and collapsing. Clicking on a panel header to expand or collapse that panel body. The panel content can be loaded via ajax by specifying a 'href' property. Users can define a panel to be selected. If it is not specified, then the first panel is taken by default.

+
+
+ + + + + + + + + + + +
Item IDProduct IDList PriceUnit CostAttributeStatus
+
+
+ \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo/calendar/basic.html b/src/main/webapp/js/easyui/demo/calendar/basic.html index 64f37fe..9d0d672 100644 --- a/src/main/webapp/js/easyui/demo/calendar/basic.html +++ b/src/main/webapp/js/easyui/demo/calendar/basic.html @@ -1,19 +1,19 @@ - - - - - Basic Calendar - jQuery EasyUI Demo - - - - - - - -

Basic Calendar

-

Click to select date.

-
-
- - + + + + + Basic Calendar - jQuery EasyUI Demo + + + + + + + +

Basic Calendar

+

Click to select date.

+
+
+ + \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo/calendar/custom.html b/src/main/webapp/js/easyui/demo/calendar/custom.html index f3fea45..7c570e6 100644 --- a/src/main/webapp/js/easyui/demo/calendar/custom.html +++ b/src/main/webapp/js/easyui/demo/calendar/custom.html @@ -1,46 +1,46 @@ - - - - - Custom Calendar - jQuery EasyUI Demo - - - - - - - -

Custom Calendar

-

This example shows how to custom the calendar date by using 'formatter' function.

-
- -
- - - - + + + + + Custom Calendar - jQuery EasyUI Demo + + + + + + + +

Custom Calendar

+

This example shows how to custom the calendar date by using 'formatter' function.

+
+ +
+ + + + \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo/calendar/disabledate.html b/src/main/webapp/js/easyui/demo/calendar/disabledate.html index ef2c7ea..0b1edeb 100644 --- a/src/main/webapp/js/easyui/demo/calendar/disabledate.html +++ b/src/main/webapp/js/easyui/demo/calendar/disabledate.html @@ -1,28 +1,28 @@ - - - - - Disable Calendar Date - jQuery EasyUI Demo - - - - - - - -

Disable Calendar Date

-

This example shows how to disable specified dates, only allows the user to select Mondays.

-
- -
- - + + + + + Disable Calendar Date - jQuery EasyUI Demo + + + + + + + +

Disable Calendar Date

+

This example shows how to disable specified dates, only allows the user to select Mondays.

+
+ +
+ + \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo/calendar/firstday.html b/src/main/webapp/js/easyui/demo/calendar/firstday.html index c636a07..dd414c5 100644 --- a/src/main/webapp/js/easyui/demo/calendar/firstday.html +++ b/src/main/webapp/js/easyui/demo/calendar/firstday.html @@ -1,30 +1,30 @@ - - - - - First Day of Week - jQuery EasyUI Demo - - - - - - - -

First Day of Week

-

Choose the first day of the week.

- -
- -
- -
- + + + + + First Day of Week - jQuery EasyUI Demo + + + + + + + +

First Day of Week

+

Choose the first day of the week.

+ +
+ +
+ +
+ \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo/calendar/fluid.html b/src/main/webapp/js/easyui/demo/calendar/fluid.html index e5e7070..3ca0fae 100644 --- a/src/main/webapp/js/easyui/demo/calendar/fluid.html +++ b/src/main/webapp/js/easyui/demo/calendar/fluid.html @@ -1,23 +1,23 @@ - - - - - Fluid Calendar - jQuery EasyUI Demo - - - - - - - -

Fluid Calendar

-

This example shows how to set the width of calendar to a percentage of its parent container.

-
-
-

width: 50%, height: 250px

-
-

width: 30%, height: 40%

-
-
- + + + + + Fluid Calendar - jQuery EasyUI Demo + + + + + + + +

Fluid Calendar

+

This example shows how to set the width of calendar to a percentage of its parent container.

+
+
+

width: 50%, height: 250px

+
+

width: 30%, height: 40%

+
+
+ \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo/combo/animation.html b/src/main/webapp/js/easyui/demo/combo/animation.html index 70f52a6..4a958e7 100644 --- a/src/main/webapp/js/easyui/demo/combo/animation.html +++ b/src/main/webapp/js/easyui/demo/combo/animation.html @@ -1,37 +1,37 @@ - - - - - Combo Animation - jQuery EasyUI Demo - - - - - - - -

Combo Animation

-

Change the animation type when open & close the drop-down panel.

-
- Animation Type: - -
- - - + + + + + Combo Animation - jQuery EasyUI Demo + + + + + + + +

Combo Animation

+

Change the animation type when open & close the drop-down panel.

+
+ Animation Type: + +
+ + + \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo/combo/basic.html b/src/main/webapp/js/easyui/demo/combo/basic.html index a0ec2c8..cba9b8d 100644 --- a/src/main/webapp/js/easyui/demo/combo/basic.html +++ b/src/main/webapp/js/easyui/demo/combo/basic.html @@ -1,42 +1,42 @@ - - - - - Basic Combo - jQuery EasyUI Demo - - - - - - - -

Basic Combo

-

Click the right arrow button to show drop down panel that can be filled with any content.

-
- -
-
Select a language
-
- Java
- C#
- Ruby
- Basic
- Fortran -
-
- - + + + + + Basic Combo - jQuery EasyUI Demo + + + + + + + +

Basic Combo

+

Click the right arrow button to show drop down panel that can be filled with any content.

+
+ +
+
Select a language
+
+ Java
+ C#
+ Ruby
+ Basic
+ Fortran +
+
+ + \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo/combobox/actions.html b/src/main/webapp/js/easyui/demo/combobox/actions.html index 0fccf56..d2605fc 100644 --- a/src/main/webapp/js/easyui/demo/combobox/actions.html +++ b/src/main/webapp/js/easyui/demo/combobox/actions.html @@ -1,86 +1,86 @@ - - - - - ComboBox Actions - jQuery EasyUI Demo - - - - - - - -

ComboBox

-

Click the buttons below to perform actions.

- - - - - - - + + + + + ComboBox Actions - jQuery EasyUI Demo + + + + + + + +

ComboBox

+

Click the buttons below to perform actions.

+ + + + + + + \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo/combobox/basic.html b/src/main/webapp/js/easyui/demo/combobox/basic.html index 6a9c4fa..bfa2b34 100644 --- a/src/main/webapp/js/easyui/demo/combobox/basic.html +++ b/src/main/webapp/js/easyui/demo/combobox/basic.html @@ -1,71 +1,71 @@ - - - - - Basic ComboBox - jQuery EasyUI Demo - - - - - - - -

Basic ComboBox

-

Type in ComboBox to try auto complete.

-
- - - - + + + + + Basic ComboBox - jQuery EasyUI Demo + + + + + + + +

Basic ComboBox

+

Type in ComboBox to try auto complete.

+
+ + + + \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo/combobox/combobox_data1.json b/src/main/webapp/js/easyui/demo/combobox/combobox_data1.json index 9c8f7f5..8bfba76 100644 --- a/src/main/webapp/js/easyui/demo/combobox/combobox_data1.json +++ b/src/main/webapp/js/easyui/demo/combobox/combobox_data1.json @@ -1,22 +1,22 @@ -[{ - "id":1, - "text":"Java", - "desc":"Write once, run anywhere" -},{ - "id":2, - "text":"C#", - "desc":"One of the programming languages designed for the Common Language Infrastructure" -},{ - "id":3, - "text":"Ruby", - "selected":true, - "desc":"A dynamic, reflective, general-purpose object-oriented programming language" -},{ - "id":4, - "text":"Perl", - "desc":"A high-level, general-purpose, interpreted, dynamic programming language" -},{ - "id":5, - "text":"Basic", - "desc":"A family of general-purpose, high-level programming languages" +[{ + "id":1, + "text":"Java", + "desc":"Write once, run anywhere" +},{ + "id":2, + "text":"C#", + "desc":"One of the programming languages designed for the Common Language Infrastructure" +},{ + "id":3, + "text":"Ruby", + "selected":true, + "desc":"A dynamic, reflective, general-purpose object-oriented programming language" +},{ + "id":4, + "text":"Perl", + "desc":"A high-level, general-purpose, interpreted, dynamic programming language" +},{ + "id":5, + "text":"Basic", + "desc":"A family of general-purpose, high-level programming languages" }] \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo/combobox/combobox_data2.json b/src/main/webapp/js/easyui/demo/combobox/combobox_data2.json index c3baf77..fcaca4f 100644 --- a/src/main/webapp/js/easyui/demo/combobox/combobox_data2.json +++ b/src/main/webapp/js/easyui/demo/combobox/combobox_data2.json @@ -1,47 +1,47 @@ -[{ - "value":"f20", - "text":"Firefox 2.0 or higher", - "group":"Firefox" -},{ - "value":"f15", - "text":"Firefox 1.5.x", - "group":"Firefox" -},{ - "value":"f10", - "text":"Firefox 1.0.x", - "group":"Firefox" -},{ - "value":"ie7", - "text":"Microsoft Internet Explorer 7.0 or higher", - "group":"Microsoft Internet Explorer" -},{ - "value":"ie6", - "text":"Microsoft Internet Explorer 6.x", - "group":"Microsoft Internet Explorer" -},{ - "value":"ie5", - "text":"Microsoft Internet Explorer 5.x", - "group":"Microsoft Internet Explorer" -},{ - "value":"ie4", - "text":"Microsoft Internet Explorer 4.x", - "group":"Microsoft Internet Explorer" -},{ - "value":"op9", - "text":"Opera 9.0 or higher", - "group":"Opera" -},{ - "value":"op8", - "text":"Opera 8.x", - "group":"Opera" -},{ - "value":"op7", - "text":"Opera 7.x", - "group":"Opera" -},{ - "value":"Safari", - "text":"Safari" -},{ - "value":"Other", - "text":"Other" +[{ + "value":"f20", + "text":"Firefox 2.0 or higher", + "group":"Firefox" +},{ + "value":"f15", + "text":"Firefox 1.5.x", + "group":"Firefox" +},{ + "value":"f10", + "text":"Firefox 1.0.x", + "group":"Firefox" +},{ + "value":"ie7", + "text":"Microsoft Internet Explorer 7.0 or higher", + "group":"Microsoft Internet Explorer" +},{ + "value":"ie6", + "text":"Microsoft Internet Explorer 6.x", + "group":"Microsoft Internet Explorer" +},{ + "value":"ie5", + "text":"Microsoft Internet Explorer 5.x", + "group":"Microsoft Internet Explorer" +},{ + "value":"ie4", + "text":"Microsoft Internet Explorer 4.x", + "group":"Microsoft Internet Explorer" +},{ + "value":"op9", + "text":"Opera 9.0 or higher", + "group":"Opera" +},{ + "value":"op8", + "text":"Opera 8.x", + "group":"Opera" +},{ + "value":"op7", + "text":"Opera 7.x", + "group":"Opera" +},{ + "value":"Safari", + "text":"Safari" +},{ + "value":"Other", + "text":"Other" }] \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo/combobox/customformat.html b/src/main/webapp/js/easyui/demo/combobox/customformat.html index 5c58fd1..82664ea 100644 --- a/src/main/webapp/js/easyui/demo/combobox/customformat.html +++ b/src/main/webapp/js/easyui/demo/combobox/customformat.html @@ -1,33 +1,33 @@ - - - - - Custom Format in ComboBox - jQuery EasyUI Demo - - - - - - - -

Custom Format in ComboBox

-

This sample shows how to custom the format of list item.

-
- - - + + + + + Custom Format in ComboBox - jQuery EasyUI Demo + + + + + + + +

Custom Format in ComboBox

+

This sample shows how to custom the format of list item.

+
+ + + \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo/combobox/dynamicdata.html b/src/main/webapp/js/easyui/demo/combobox/dynamicdata.html index 2548599..1857e48 100644 --- a/src/main/webapp/js/easyui/demo/combobox/dynamicdata.html +++ b/src/main/webapp/js/easyui/demo/combobox/dynamicdata.html @@ -1,23 +1,23 @@ - - - - - Load Dynamic ComboBox Data - jQuery EasyUI Demo - - - - - - - -

Load Dynamic ComboBox Data

-

Click the button below to load data.

- -
- LoadData -
- - - + + + + + Load Dynamic ComboBox Data - jQuery EasyUI Demo + + + + + + + +

Load Dynamic ComboBox Data

+

Click the button below to load data.

+ +
+ LoadData +
+ + + \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo/combobox/fluid.html b/src/main/webapp/js/easyui/demo/combobox/fluid.html index 289fcda..e621fae 100644 --- a/src/main/webapp/js/easyui/demo/combobox/fluid.html +++ b/src/main/webapp/js/easyui/demo/combobox/fluid.html @@ -1,36 +1,36 @@ - - - - - Fluid ComboBox - jQuery EasyUI Demo - - - - - - - -

Fluid ComboBox

-

This example shows how to set the width of combobox to a percentage of its parent container.

-
-

width: 50%

- -

width: 30%

- - - + + + + + Fluid ComboBox - jQuery EasyUI Demo + + + + + + + +

Fluid ComboBox

+

This example shows how to set the width of combobox to a percentage of its parent container.

+
+

width: 50%

+ +

width: 30%

+ + + \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo/combobox/group.html b/src/main/webapp/js/easyui/demo/combobox/group.html index baa8959..d1431b7 100644 --- a/src/main/webapp/js/easyui/demo/combobox/group.html +++ b/src/main/webapp/js/easyui/demo/combobox/group.html @@ -1,26 +1,26 @@ - - - - - Group ComboBox - jQuery EasyUI Demo - - - - - - - -

Group ComboBox

-

This example shows how to display combobox items in groups.

-
- - - - + + + + + Group ComboBox - jQuery EasyUI Demo + + + + + + + +

Group ComboBox

+

This example shows how to display combobox items in groups.

+
+ + + + \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo/combobox/icons.html b/src/main/webapp/js/easyui/demo/combobox/icons.html index ebd087d..4defb0a 100644 --- a/src/main/webapp/js/easyui/demo/combobox/icons.html +++ b/src/main/webapp/js/easyui/demo/combobox/icons.html @@ -1,32 +1,32 @@ - - - - - ComboBox with Extra Icons- jQuery EasyUI Demo - - - - - - - -

ComboBox with Extra Icons

-

The user can attach extra icons to the ComboBox.

-
- - - + + + + + ComboBox with Extra Icons- jQuery EasyUI Demo + + + + + + + +

ComboBox with Extra Icons

+

The user can attach extra icons to the ComboBox.

+
+ + + \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo/combobox/multiline.html b/src/main/webapp/js/easyui/demo/combobox/multiline.html index 74cbc58..2b8d156 100644 --- a/src/main/webapp/js/easyui/demo/combobox/multiline.html +++ b/src/main/webapp/js/easyui/demo/combobox/multiline.html @@ -1,71 +1,71 @@ - - - - - Multiline ComboBox - jQuery EasyUI Demo - - - - - - - -

Multiline ComboBox

-

This example shows how to create a multiline ComboBox.

-
- - - - + + + + + Multiline ComboBox - jQuery EasyUI Demo + + + + + + + +

Multiline ComboBox

+

This example shows how to create a multiline ComboBox.

+
+ + + + \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo/combobox/multiple.html b/src/main/webapp/js/easyui/demo/combobox/multiple.html index 79b5e69..3eb2526 100644 --- a/src/main/webapp/js/easyui/demo/combobox/multiple.html +++ b/src/main/webapp/js/easyui/demo/combobox/multiple.html @@ -1,29 +1,29 @@ - - - - - Multiple Select - jQuery EasyUI Demo - - - - - - - -

Load Dynamic ComboBox Data

-

Drop down the panel and select multiple items.

-
- - - - + + + + + Multiple Select - jQuery EasyUI Demo + + + + + + + +

Load Dynamic ComboBox Data

+

Drop down the panel and select multiple items.

+
+ + + + \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo/combobox/navigation.html b/src/main/webapp/js/easyui/demo/combobox/navigation.html index 3ea5d3c..4299d42 100644 --- a/src/main/webapp/js/easyui/demo/combobox/navigation.html +++ b/src/main/webapp/js/easyui/demo/combobox/navigation.html @@ -1,73 +1,73 @@ - - - - - Navigate ComboBox - jQuery EasyUI Demo - - - - - - - -

Navigate ComboBox

-

Navigate through combobox items width keyboard to select an item.

-
- - SelectOnNavigation -
- - - - + + + + + Navigate ComboBox - jQuery EasyUI Demo + + + + + + + +

Navigate ComboBox

+

Navigate through combobox items width keyboard to select an item.

+
+ + SelectOnNavigation +
+ + + + \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo/combobox/remotedata.html b/src/main/webapp/js/easyui/demo/combobox/remotedata.html index 46e75fd..42dda5d 100644 --- a/src/main/webapp/js/easyui/demo/combobox/remotedata.html +++ b/src/main/webapp/js/easyui/demo/combobox/remotedata.html @@ -1,27 +1,27 @@ - - - - - Binding to Remote Data - jQuery EasyUI Demo - - - - - - - -

Binding to Remote Data

-

The ComboBox is bound to a remote data.

-
- - - + + + + + Binding to Remote Data - jQuery EasyUI Demo + + + + + + + +

Binding to Remote Data

+

The ComboBox is bound to a remote data.

+
+ + + \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo/combobox/remotejsonp.html b/src/main/webapp/js/easyui/demo/combobox/remotejsonp.html index 0cbfe4e..d96285a 100644 --- a/src/main/webapp/js/easyui/demo/combobox/remotejsonp.html +++ b/src/main/webapp/js/easyui/demo/combobox/remotejsonp.html @@ -1,48 +1,48 @@ - - - - - Remote JSONP - jQuery EasyUI Demo - - - - - - - -

Remote JSONP

-

This sample shows how to use JSONP to retrieve data from a remote site.

-
- - - + + + + + Remote JSONP - jQuery EasyUI Demo + + + + + + + +

Remote JSONP

+

This sample shows how to use JSONP to retrieve data from a remote site.

+
+ + + \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo/combogrid/actions.html b/src/main/webapp/js/easyui/demo/combogrid/actions.html index c41d0c9..e09588a 100644 --- a/src/main/webapp/js/easyui/demo/combogrid/actions.html +++ b/src/main/webapp/js/easyui/demo/combogrid/actions.html @@ -1,53 +1,53 @@ - - - - - ComboGrid Actions - jQuery EasyUI Demo - - - - - - - -

ComboGrid Actions

-

Click the buttons below to perform actions.

- - - - + + + + + ComboGrid Actions - jQuery EasyUI Demo + + + + + + + +

ComboGrid Actions

+

Click the buttons below to perform actions.

+ + + + \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo/combogrid/basic.html b/src/main/webapp/js/easyui/demo/combogrid/basic.html index de430b6..9c71e52 100644 --- a/src/main/webapp/js/easyui/demo/combogrid/basic.html +++ b/src/main/webapp/js/easyui/demo/combogrid/basic.html @@ -1,34 +1,34 @@ - - - - - Basic ComboGrid - jQuery EasyUI Demo - - - - - - - -

Basic ComboGrid

-

Click the right arrow button to show the DataGrid.

-
- - + + + + + Basic ComboGrid - jQuery EasyUI Demo + + + + + + + +

Basic ComboGrid

+

Click the right arrow button to show the DataGrid.

+
+ + \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo/combogrid/datagrid_data1.json b/src/main/webapp/js/easyui/demo/combogrid/datagrid_data1.json index c74fa23..3a62a71 100644 --- a/src/main/webapp/js/easyui/demo/combogrid/datagrid_data1.json +++ b/src/main/webapp/js/easyui/demo/combogrid/datagrid_data1.json @@ -1,12 +1,12 @@ -{"total":28,"rows":[ - {"productid":"FI-SW-01","productname":"Koi","unitcost":10.00,"status":"P","listprice":36.50,"attr1":"Large","itemid":"EST-1"}, - {"productid":"K9-DL-01","productname":"Dalmation","unitcost":12.00,"status":"P","listprice":18.50,"attr1":"Spotted Adult Female","itemid":"EST-10"}, - {"productid":"RP-SN-01","productname":"Rattlesnake","unitcost":12.00,"status":"P","listprice":38.50,"attr1":"Venomless","itemid":"EST-11"}, - {"productid":"RP-SN-01","productname":"Rattlesnake","unitcost":12.00,"status":"P","listprice":26.50,"attr1":"Rattleless","itemid":"EST-12"}, - {"selected":true,"productid":"RP-LI-02","productname":"Iguana","unitcost":12.00,"status":"P","listprice":35.50,"attr1":"Green Adult","itemid":"EST-13"}, - {"productid":"FL-DSH-01","productname":"Manx","unitcost":12.00,"status":"P","listprice":158.50,"attr1":"Tailless","itemid":"EST-14"}, - {"productid":"FL-DSH-01","productname":"Manx","unitcost":12.00,"status":"P","listprice":83.50,"attr1":"With tail","itemid":"EST-15"}, - {"productid":"FL-DLH-02","productname":"Persian","unitcost":12.00,"status":"P","listprice":23.50,"attr1":"Adult Female","itemid":"EST-16"}, - {"productid":"FL-DLH-02","productname":"Persian","unitcost":12.00,"status":"P","listprice":89.50,"attr1":"Adult Male","itemid":"EST-17"}, - {"productid":"AV-CB-01","productname":"Amazon Parrot","unitcost":92.00,"status":"P","listprice":63.50,"attr1":"Adult Male","itemid":"EST-18"} -]} +{"total":28,"rows":[ + {"productid":"FI-SW-01","productname":"Koi","unitcost":10.00,"status":"P","listprice":36.50,"attr1":"Large","itemid":"EST-1"}, + {"productid":"K9-DL-01","productname":"Dalmation","unitcost":12.00,"status":"P","listprice":18.50,"attr1":"Spotted Adult Female","itemid":"EST-10"}, + {"productid":"RP-SN-01","productname":"Rattlesnake","unitcost":12.00,"status":"P","listprice":38.50,"attr1":"Venomless","itemid":"EST-11"}, + {"productid":"RP-SN-01","productname":"Rattlesnake","unitcost":12.00,"status":"P","listprice":26.50,"attr1":"Rattleless","itemid":"EST-12"}, + {"selected":true,"productid":"RP-LI-02","productname":"Iguana","unitcost":12.00,"status":"P","listprice":35.50,"attr1":"Green Adult","itemid":"EST-13"}, + {"productid":"FL-DSH-01","productname":"Manx","unitcost":12.00,"status":"P","listprice":158.50,"attr1":"Tailless","itemid":"EST-14"}, + {"productid":"FL-DSH-01","productname":"Manx","unitcost":12.00,"status":"P","listprice":83.50,"attr1":"With tail","itemid":"EST-15"}, + {"productid":"FL-DLH-02","productname":"Persian","unitcost":12.00,"status":"P","listprice":23.50,"attr1":"Adult Female","itemid":"EST-16"}, + {"productid":"FL-DLH-02","productname":"Persian","unitcost":12.00,"status":"P","listprice":89.50,"attr1":"Adult Male","itemid":"EST-17"}, + {"productid":"AV-CB-01","productname":"Amazon Parrot","unitcost":92.00,"status":"P","listprice":63.50,"attr1":"Adult Male","itemid":"EST-18"} +]} diff --git a/src/main/webapp/js/easyui/demo/combogrid/fluid.html b/src/main/webapp/js/easyui/demo/combogrid/fluid.html index 0392992..edf7fdb 100644 --- a/src/main/webapp/js/easyui/demo/combogrid/fluid.html +++ b/src/main/webapp/js/easyui/demo/combogrid/fluid.html @@ -1,54 +1,54 @@ - - - - - Fluid ComboGrid - jQuery EasyUI Demo - - - - - - - -

Fluid ComboGrid

-

This example shows how to set the width of ComboGrid to a percentage of its parent container.

-
-

width: 50%

- -

width: 30%

- - + + + + + Fluid ComboGrid - jQuery EasyUI Demo + + + + + + + +

Fluid ComboGrid

+

This example shows how to set the width of ComboGrid to a percentage of its parent container.

+
+

width: 50%

+ +

width: 30%

+ + \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo/combogrid/initvalue.html b/src/main/webapp/js/easyui/demo/combogrid/initvalue.html index 9a55c89..b88f245 100644 --- a/src/main/webapp/js/easyui/demo/combogrid/initvalue.html +++ b/src/main/webapp/js/easyui/demo/combogrid/initvalue.html @@ -1,33 +1,33 @@ - - - - - Initialize Value for ComboGrid - jQuery EasyUI Demo - - - - - - - -

Initialize Value for ComboGrid

-

Initialize value when ComboGrid is created.

-
- - + + + + + Initialize Value for ComboGrid - jQuery EasyUI Demo + + + + + + + +

Initialize Value for ComboGrid

+

Initialize value when ComboGrid is created.

+
+ + \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo/combogrid/multiple.html b/src/main/webapp/js/easyui/demo/combogrid/multiple.html index 60700f7..8f9cc80 100644 --- a/src/main/webapp/js/easyui/demo/combogrid/multiple.html +++ b/src/main/webapp/js/easyui/demo/combogrid/multiple.html @@ -1,37 +1,37 @@ - - - - - Multiple ComboGrid - jQuery EasyUI Demo - - - - - - - -

Multiple ComboGrid

-

Click the right arrow button to show the DataGrid and select items.

-
- - - + + + + + Multiple ComboGrid - jQuery EasyUI Demo + + + + + + + +

Multiple ComboGrid

+

Click the right arrow button to show the DataGrid and select items.

+
+ + + \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo/combogrid/navigation.html b/src/main/webapp/js/easyui/demo/combogrid/navigation.html index 7af03b8..646ba82 100644 --- a/src/main/webapp/js/easyui/demo/combogrid/navigation.html +++ b/src/main/webapp/js/easyui/demo/combogrid/navigation.html @@ -1,38 +1,38 @@ - - - - - Navigate ComboGrid - jQuery EasyUI Demo - - - - - - - -

Navigate ComboGrid

-

Navigate through grid items with keyboard to select an item.

-
- - SelectOnNavigation -
- - - + + + + + Navigate ComboGrid - jQuery EasyUI Demo + + + + + + + +

Navigate ComboGrid

+

Navigate through grid items with keyboard to select an item.

+
+ + SelectOnNavigation +
+ + + \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo/combotree/actions.html b/src/main/webapp/js/easyui/demo/combotree/actions.html index c1290bb..d5d86a3 100644 --- a/src/main/webapp/js/easyui/demo/combotree/actions.html +++ b/src/main/webapp/js/easyui/demo/combotree/actions.html @@ -1,39 +1,39 @@ - - - - - ComboTree Actions - jQuery EasyUI Demo - - - - - - - -

ComboTree Actions

-

Click the buttons below to perform actions

- - - - - + + + + + ComboTree Actions - jQuery EasyUI Demo + + + + + + + +

ComboTree Actions

+

Click the buttons below to perform actions

+ + + + + \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo/combotree/basic.html b/src/main/webapp/js/easyui/demo/combotree/basic.html index 4b62c88..c168d7a 100644 --- a/src/main/webapp/js/easyui/demo/combotree/basic.html +++ b/src/main/webapp/js/easyui/demo/combotree/basic.html @@ -1,19 +1,19 @@ - - - - - Basic ComboTree - jQuery EasyUI Demo - - - - - - - -

Basic ComboTree

-

Click the right arrow button to show the tree panel.

-
- - - + + + + + Basic ComboTree - jQuery EasyUI Demo + + + + + + + +

Basic ComboTree

+

Click the right arrow button to show the tree panel.

+
+ + + \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo/combotree/fluid.html b/src/main/webapp/js/easyui/demo/combotree/fluid.html index 5b78306..be131de 100644 --- a/src/main/webapp/js/easyui/demo/combotree/fluid.html +++ b/src/main/webapp/js/easyui/demo/combotree/fluid.html @@ -1,22 +1,22 @@ - - - - - Fluid ComboTree - jQuery EasyUI Demo - - - - - - - -

Fluid ComboTree

-

This example shows how to set the width of ComboTree to a percentage of its parent container.

-
-

width: 50%

- -

width: 30%, height: 26px

- - - + + + + + Fluid ComboTree - jQuery EasyUI Demo + + + + + + + +

Fluid ComboTree

+

This example shows how to set the width of ComboTree to a percentage of its parent container.

+
+

width: 50%

+ +

width: 30%, height: 26px

+ + + \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo/combotree/initvalue.html b/src/main/webapp/js/easyui/demo/combotree/initvalue.html index 801113a..a5ac8a8 100644 --- a/src/main/webapp/js/easyui/demo/combotree/initvalue.html +++ b/src/main/webapp/js/easyui/demo/combotree/initvalue.html @@ -1,19 +1,19 @@ - - - - - Initialize Value for ComboTree - jQuery EasyUI Demo - - - - - - - -

Initialize Value for ComboTree

-

Initialize Value when ComboTree is created.

-
- - - + + + + + Initialize Value for ComboTree - jQuery EasyUI Demo + + + + + + + +

Initialize Value for ComboTree

+

Initialize Value when ComboTree is created.

+
+ + + \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo/combotree/multiple.html b/src/main/webapp/js/easyui/demo/combotree/multiple.html index feb3bbe..704e86e 100644 --- a/src/main/webapp/js/easyui/demo/combotree/multiple.html +++ b/src/main/webapp/js/easyui/demo/combotree/multiple.html @@ -1,22 +1,22 @@ - - - - - Multiple ComboTree - jQuery EasyUI Demo - - - - - - - -

Multiple ComboTree

-

Click the right arrow button to show the tree panel and select multiple nodes.

-
- Cascade Check: - -
- - - + + + + + Multiple ComboTree - jQuery EasyUI Demo + + + + + + + +

Multiple ComboTree

+

Click the right arrow button to show the tree panel and select multiple nodes.

+
+ Cascade Check: + +
+ + + \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo/combotree/tree_data1.json b/src/main/webapp/js/easyui/demo/combotree/tree_data1.json index e0c6192..83fb0d6 100644 --- a/src/main/webapp/js/easyui/demo/combotree/tree_data1.json +++ b/src/main/webapp/js/easyui/demo/combotree/tree_data1.json @@ -1,49 +1,49 @@ -[{ - "id":1, - "text":"My Documents", - "children":[{ - "id":11, - "text":"Photos", - "state":"closed", - "children":[{ - "id":111, - "text":"Friend" - },{ - "id":112, - "text":"Wife" - },{ - "id":113, - "text":"Company" - }] - },{ - "id":12, - "text":"Program Files", - "children":[{ - "id":121, - "text":"Intel" - },{ - "id":122, - "text":"Java", - "attributes":{ - "p1":"Custom Attribute1", - "p2":"Custom Attribute2" - } - },{ - "id":123, - "text":"Microsoft Office" - },{ - "id":124, - "text":"Games", - "checked":true - }] - },{ - "id":13, - "text":"index.html" - },{ - "id":14, - "text":"about.html" - },{ - "id":15, - "text":"welcome.html" - }] -}] +[{ + "id":1, + "text":"My Documents", + "children":[{ + "id":11, + "text":"Photos", + "state":"closed", + "children":[{ + "id":111, + "text":"Friend" + },{ + "id":112, + "text":"Wife" + },{ + "id":113, + "text":"Company" + }] + },{ + "id":12, + "text":"Program Files", + "children":[{ + "id":121, + "text":"Intel" + },{ + "id":122, + "text":"Java", + "attributes":{ + "p1":"Custom Attribute1", + "p2":"Custom Attribute2" + } + },{ + "id":123, + "text":"Microsoft Office" + },{ + "id":124, + "text":"Games", + "checked":true + }] + },{ + "id":13, + "text":"index.html" + },{ + "id":14, + "text":"about.html" + },{ + "id":15, + "text":"welcome.html" + }] +}] diff --git a/src/main/webapp/js/easyui/demo/datagrid/aligncolumns.html b/src/main/webapp/js/easyui/demo/datagrid/aligncolumns.html index 6021962..cc86de6 100644 --- a/src/main/webapp/js/easyui/demo/datagrid/aligncolumns.html +++ b/src/main/webapp/js/easyui/demo/datagrid/aligncolumns.html @@ -1,32 +1,32 @@ - - - - - Aligning Columns in DataGrid - jQuery EasyUI Demo - - - - - - - -

Aligning Columns in DataGrid

-

Use align and halign properties to set the alignment of the columns and their header.

-
- - - - - - - - - - - - -
Item IDProductList PriceUnit CostAttributeStatus
- - + + + + + Aligning Columns in DataGrid - jQuery EasyUI Demo + + + + + + + +

Aligning Columns in DataGrid

+

Use align and halign properties to set the alignment of the columns and their header.

+
+ + + + + + + + + + + + +
Item IDProductList PriceUnit CostAttributeStatus
+ + \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo/datagrid/basic.html b/src/main/webapp/js/easyui/demo/datagrid/basic.html index 6870ac2..8dcc2f3 100644 --- a/src/main/webapp/js/easyui/demo/datagrid/basic.html +++ b/src/main/webapp/js/easyui/demo/datagrid/basic.html @@ -1,32 +1,32 @@ - - - - - Basic DataGrid - jQuery EasyUI Demo - - - - - - - -

Basic DataGrid

-

The DataGrid is created from markup, no JavaScript code needed.

-
- - - - - - - - - - - - -
Item IDProductList PriceUnit CostAttributeStatus
- - + + + + + Basic DataGrid - jQuery EasyUI Demo + + + + + + + +

Basic DataGrid

+

The DataGrid is created from markup, no JavaScript code needed.

+
+ + + + + + + + + + + + +
Item IDProductList PriceUnit CostAttributeStatus
+ + \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo/datagrid/cacheeditor.html b/src/main/webapp/js/easyui/demo/datagrid/cacheeditor.html index df55e30..c793c42 100644 --- a/src/main/webapp/js/easyui/demo/datagrid/cacheeditor.html +++ b/src/main/webapp/js/easyui/demo/datagrid/cacheeditor.html @@ -1,149 +1,149 @@ - - - - - Cache Editor for DataGrid - jQuery EasyUI Demo - - - - - - - -

Cache Editor for DataGrid

-

This example shows how to cache the editors for datagrid to improve the editing speed.

-
- - - - - - - - - - - - -
Item IDProductList PriceUnit CostAttributeStatus
- - - - - - + + + + + Cache Editor for DataGrid - jQuery EasyUI Demo + + + + + + + +

Cache Editor for DataGrid

+

This example shows how to cache the editors for datagrid to improve the editing speed.

+
+ + + + + + + + + + + + +
Item IDProductList PriceUnit CostAttributeStatus
+ + + + + + \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo/datagrid/cellediting.html b/src/main/webapp/js/easyui/demo/datagrid/cellediting.html index 385b2d4..b971c25 100644 --- a/src/main/webapp/js/easyui/demo/datagrid/cellediting.html +++ b/src/main/webapp/js/easyui/demo/datagrid/cellediting.html @@ -1,94 +1,94 @@ - - - - - Cell Editing in DataGrid - jQuery EasyUI Demo - - - - - - - -

Cell Editing in DataGrid

-

Click a cell to start editing.

-
- - - - - - - - - - - - -
Item IDProductList PriceUnit CostAttributeStatus
- - - + + + + + Cell Editing in DataGrid - jQuery EasyUI Demo + + + + + + + +

Cell Editing in DataGrid

+

Click a cell to start editing.

+
+ + + + + + + + + + + + +
Item IDProductList PriceUnit CostAttributeStatus
+ + + \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo/datagrid/cellstyle.html b/src/main/webapp/js/easyui/demo/datagrid/cellstyle.html index 9230ac2..3140fa3 100644 --- a/src/main/webapp/js/easyui/demo/datagrid/cellstyle.html +++ b/src/main/webapp/js/easyui/demo/datagrid/cellstyle.html @@ -1,42 +1,42 @@ - - - - - DataGrid Cell Style - jQuery EasyUI Demo - - - - - - - -

DataGrid Cell Style

-

The cells which listprice value is less than 30 are highlighted.

-
- - - - - - - - - - - -
Item IDProductList PriceUnit CostAttributeStatus
- - + + + + + DataGrid Cell Style - jQuery EasyUI Demo + + + + + + + +

DataGrid Cell Style

+

The cells which listprice value is less than 30 are highlighted.

+
+ + + + + + + + + + + +
Item IDProductList PriceUnit CostAttributeStatus
+ + \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo/datagrid/checkbox.html b/src/main/webapp/js/easyui/demo/datagrid/checkbox.html index ca1c81c..3ea251d 100644 --- a/src/main/webapp/js/easyui/demo/datagrid/checkbox.html +++ b/src/main/webapp/js/easyui/demo/datagrid/checkbox.html @@ -1,42 +1,42 @@ - - - - - CheckBox Selection on DataGrid - jQuery EasyUI Demo - - - - - - - -

CheckBox Selection on DataGrid

-

Click the checkbox on header to select or unselect all selections.

-
- - - - - - - - - - - - - -
Item IDProductList PriceUnit CostAttributeStatus
-
- Selection Mode: -
- SelectOnCheck:
- CheckOnSelect: -
- - + + + + + CheckBox Selection on DataGrid - jQuery EasyUI Demo + + + + + + + +

CheckBox Selection on DataGrid

+

Click the checkbox on header to select or unselect all selections.

+
+ + + + + + + + + + + + + +
Item IDProductList PriceUnit CostAttributeStatus
+
+ Selection Mode: +
+ SelectOnCheck:
+ CheckOnSelect: +
+ + \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo/datagrid/clientpagination.html b/src/main/webapp/js/easyui/demo/datagrid/clientpagination.html index 565a98f..e61d571 100644 --- a/src/main/webapp/js/easyui/demo/datagrid/clientpagination.html +++ b/src/main/webapp/js/easyui/demo/datagrid/clientpagination.html @@ -1,121 +1,121 @@ - - - - - Client Side Pagination in DataGrid - jQuery EasyUI Demo - - - - - - - -

Client Side Pagination in DataGrid

-

This sample shows how to implement client side pagination in DataGrid.

-
- - - - - - - - - - - - - -
Inv NoDateNameAmountPriceCostNote
- - + + + + + Client Side Pagination in DataGrid - jQuery EasyUI Demo + + + + + + + +

Client Side Pagination in DataGrid

+

This sample shows how to implement client side pagination in DataGrid.

+
+ + + + + + + + + + + + + +
Inv NoDateNameAmountPriceCostNote
+ + \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo/datagrid/columngroup.html b/src/main/webapp/js/easyui/demo/datagrid/columngroup.html index 9c3340e..af8f0f9 100644 --- a/src/main/webapp/js/easyui/demo/datagrid/columngroup.html +++ b/src/main/webapp/js/easyui/demo/datagrid/columngroup.html @@ -1,34 +1,34 @@ - - - - - Column Group - jQuery EasyUI Demo - - - - - - - -

Column Group

-

The header cells can be merged. Useful to group columns under a category.

-
- - - - - - - - - - - - - - -
Item IDProductItem Details
List PriceUnit CostAttributeStatus
- - + + + + + Column Group - jQuery EasyUI Demo + + + + + + + +

Column Group

+

The header cells can be merged. Useful to group columns under a category.

+
+ + + + + + + + + + + + + + +
Item IDProductItem Details
List PriceUnit CostAttributeStatus
+ + \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo/datagrid/complextoolbar.html b/src/main/webapp/js/easyui/demo/datagrid/complextoolbar.html index 35c9ba1..2ee44a5 100644 --- a/src/main/webapp/js/easyui/demo/datagrid/complextoolbar.html +++ b/src/main/webapp/js/easyui/demo/datagrid/complextoolbar.html @@ -1,50 +1,50 @@ - - - - - DataGrid Complex Toolbar - jQuery EasyUI Demo - - - - - - - -

DataGrid Complex Toolbar

-

The DataGrid toolbar can be defined from a <div> markup, so you can define the layout of toolbar easily.

-
- - - - - - - - - - - -
Item IDProductList PriceUnit CostAttributeStatus
-
- Date From: - To: - Language: - - Search -
-
- - - - - -
- + + + + + DataGrid Complex Toolbar - jQuery EasyUI Demo + + + + + + + +

DataGrid Complex Toolbar

+

The DataGrid toolbar can be defined from a <div> markup, so you can define the layout of toolbar easily.

+
+ + + + + + + + + + + +
Item IDProductList PriceUnit CostAttributeStatus
+
+ Date From: + To: + Language: + + Search +
+
+ + + + + +
+ \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo/datagrid/contextmenu.html b/src/main/webapp/js/easyui/demo/datagrid/contextmenu.html index 96f3c6d..e9a64fa 100644 --- a/src/main/webapp/js/easyui/demo/datagrid/contextmenu.html +++ b/src/main/webapp/js/easyui/demo/datagrid/contextmenu.html @@ -1,81 +1,81 @@ - - - - - Context Menu on DataGrid - jQuery EasyUI Demo - - - - - - - -

Context Menu on DataGrid

-

Right click on the header of DataGrid to display context menu.

-
-
- - + + + + + Context Menu on DataGrid - jQuery EasyUI Demo + + + + + + + +

Context Menu on DataGrid

+

Right click on the header of DataGrid to display context menu.

+
+
+ + \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo/datagrid/custompager.html b/src/main/webapp/js/easyui/demo/datagrid/custompager.html index c4c62d7..baa66a4 100644 --- a/src/main/webapp/js/easyui/demo/datagrid/custompager.html +++ b/src/main/webapp/js/easyui/demo/datagrid/custompager.html @@ -1,53 +1,53 @@ - - - - - Custom DataGrid Pager - jQuery EasyUI Demo - - - - - - - -

Custom DataGrid Pager

-

You can append some buttons to the standard datagrid pager bar.

-
- - - - - - - - - - - -
Item IDProductList PriceUnit CostAttributeStatus
- - + + + + + Custom DataGrid Pager - jQuery EasyUI Demo + + + + + + + +

Custom DataGrid Pager

+

You can append some buttons to the standard datagrid pager bar.

+
+ + + + + + + + + + + +
Item IDProductList PriceUnit CostAttributeStatus
+ + \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo/datagrid/datagrid_data1.json b/src/main/webapp/js/easyui/demo/datagrid/datagrid_data1.json index 63d6473..e9a5be2 100644 --- a/src/main/webapp/js/easyui/demo/datagrid/datagrid_data1.json +++ b/src/main/webapp/js/easyui/demo/datagrid/datagrid_data1.json @@ -1,12 +1,12 @@ -{"total":28,"rows":[ - {"productid":"FI-SW-01","productname":"Koi","unitcost":10.00,"status":"P","listprice":36.50,"attr1":"Large","itemid":"EST-1"}, - {"productid":"K9-DL-01","productname":"Dalmation","unitcost":12.00,"status":"P","listprice":18.50,"attr1":"Spotted Adult Female","itemid":"EST-10"}, - {"productid":"RP-SN-01","productname":"Rattlesnake","unitcost":12.00,"status":"P","listprice":38.50,"attr1":"Venomless","itemid":"EST-11"}, - {"productid":"RP-SN-01","productname":"Rattlesnake","unitcost":12.00,"status":"P","listprice":26.50,"attr1":"Rattleless","itemid":"EST-12"}, - {"productid":"RP-LI-02","productname":"Iguana","unitcost":12.00,"status":"P","listprice":35.50,"attr1":"Green Adult","itemid":"EST-13"}, - {"productid":"FL-DSH-01","productname":"Manx","unitcost":12.00,"status":"P","listprice":158.50,"attr1":"Tailless","itemid":"EST-14"}, - {"productid":"FL-DSH-01","productname":"Manx","unitcost":12.00,"status":"P","listprice":83.50,"attr1":"With tail","itemid":"EST-15"}, - {"productid":"FL-DLH-02","productname":"Persian","unitcost":12.00,"status":"P","listprice":23.50,"attr1":"Adult Female","itemid":"EST-16"}, - {"productid":"FL-DLH-02","productname":"Persian","unitcost":12.00,"status":"P","listprice":89.50,"attr1":"Adult Male","itemid":"EST-17"}, - {"productid":"AV-CB-01","productname":"Amazon Parrot","unitcost":92.00,"status":"P","listprice":63.50,"attr1":"Adult Male","itemid":"EST-18"} -]} +{"total":28,"rows":[ + {"productid":"FI-SW-01","productname":"Koi","unitcost":10.00,"status":"P","listprice":36.50,"attr1":"Large","itemid":"EST-1"}, + {"productid":"K9-DL-01","productname":"Dalmation","unitcost":12.00,"status":"P","listprice":18.50,"attr1":"Spotted Adult Female","itemid":"EST-10"}, + {"productid":"RP-SN-01","productname":"Rattlesnake","unitcost":12.00,"status":"P","listprice":38.50,"attr1":"Venomless","itemid":"EST-11"}, + {"productid":"RP-SN-01","productname":"Rattlesnake","unitcost":12.00,"status":"P","listprice":26.50,"attr1":"Rattleless","itemid":"EST-12"}, + {"productid":"RP-LI-02","productname":"Iguana","unitcost":12.00,"status":"P","listprice":35.50,"attr1":"Green Adult","itemid":"EST-13"}, + {"productid":"FL-DSH-01","productname":"Manx","unitcost":12.00,"status":"P","listprice":158.50,"attr1":"Tailless","itemid":"EST-14"}, + {"productid":"FL-DSH-01","productname":"Manx","unitcost":12.00,"status":"P","listprice":83.50,"attr1":"With tail","itemid":"EST-15"}, + {"productid":"FL-DLH-02","productname":"Persian","unitcost":12.00,"status":"P","listprice":23.50,"attr1":"Adult Female","itemid":"EST-16"}, + {"productid":"FL-DLH-02","productname":"Persian","unitcost":12.00,"status":"P","listprice":89.50,"attr1":"Adult Male","itemid":"EST-17"}, + {"productid":"AV-CB-01","productname":"Amazon Parrot","unitcost":92.00,"status":"P","listprice":63.50,"attr1":"Adult Male","itemid":"EST-18"} +]} diff --git a/src/main/webapp/js/easyui/demo/datagrid/datagrid_data2.json b/src/main/webapp/js/easyui/demo/datagrid/datagrid_data2.json index ce91bab..4a27e14 100644 --- a/src/main/webapp/js/easyui/demo/datagrid/datagrid_data2.json +++ b/src/main/webapp/js/easyui/demo/datagrid/datagrid_data2.json @@ -1,15 +1,15 @@ -{"total":28,"rows":[ - {"productid":"FI-SW-01","unitcost":10.00,"status":"P","listprice":36.50,"attr1":"Large","itemid":"EST-1"}, - {"productid":"K9-DL-01","unitcost":12.00,"status":"P","listprice":18.50,"attr1":"Spotted Adult Female","itemid":"EST-10"}, - {"productid":"RP-SN-01","unitcost":12.00,"status":"P","listprice":28.50,"attr1":"Venomless","itemid":"EST-11"}, - {"productid":"RP-SN-01","unitcost":12.00,"status":"P","listprice":26.50,"attr1":"Rattleless","itemid":"EST-12"}, - {"productid":"RP-LI-02","unitcost":12.00,"status":"P","listprice":35.50,"attr1":"Green Adult","itemid":"EST-13"}, - {"productid":"FL-DSH-01","unitcost":12.00,"status":"P","listprice":158.50,"attr1":"Tailless","itemid":"EST-14"}, - {"productid":"FL-DSH-01","unitcost":12.00,"status":"P","listprice":83.50,"attr1":"With tail","itemid":"EST-15"}, - {"productid":"FL-DLH-02","unitcost":12.00,"status":"P","listprice":63.50,"attr1":"Adult Female","itemid":"EST-16"}, - {"productid":"FL-DLH-02","unitcost":12.00,"status":"P","listprice":89.50,"attr1":"Adult Male","itemid":"EST-17"}, - {"productid":"AV-CB-01","unitcost":92.00,"status":"P","listprice":63.50,"attr1":"Adult Male","itemid":"EST-18"} -],"footer":[ - {"unitcost":19.80,"listprice":60.40,"productid":"Average:"}, - {"unitcost":198.00,"listprice":604.00,"productid":"Total:"} -]} +{"total":28,"rows":[ + {"productid":"FI-SW-01","unitcost":10.00,"status":"P","listprice":36.50,"attr1":"Large","itemid":"EST-1"}, + {"productid":"K9-DL-01","unitcost":12.00,"status":"P","listprice":18.50,"attr1":"Spotted Adult Female","itemid":"EST-10"}, + {"productid":"RP-SN-01","unitcost":12.00,"status":"P","listprice":28.50,"attr1":"Venomless","itemid":"EST-11"}, + {"productid":"RP-SN-01","unitcost":12.00,"status":"P","listprice":26.50,"attr1":"Rattleless","itemid":"EST-12"}, + {"productid":"RP-LI-02","unitcost":12.00,"status":"P","listprice":35.50,"attr1":"Green Adult","itemid":"EST-13"}, + {"productid":"FL-DSH-01","unitcost":12.00,"status":"P","listprice":158.50,"attr1":"Tailless","itemid":"EST-14"}, + {"productid":"FL-DSH-01","unitcost":12.00,"status":"P","listprice":83.50,"attr1":"With tail","itemid":"EST-15"}, + {"productid":"FL-DLH-02","unitcost":12.00,"status":"P","listprice":63.50,"attr1":"Adult Female","itemid":"EST-16"}, + {"productid":"FL-DLH-02","unitcost":12.00,"status":"P","listprice":89.50,"attr1":"Adult Male","itemid":"EST-17"}, + {"productid":"AV-CB-01","unitcost":92.00,"status":"P","listprice":63.50,"attr1":"Adult Male","itemid":"EST-18"} +],"footer":[ + {"unitcost":19.80,"listprice":60.40,"productid":"Average:"}, + {"unitcost":198.00,"listprice":604.00,"productid":"Total:"} +]} diff --git a/src/main/webapp/js/easyui/demo/datagrid/fluid.html b/src/main/webapp/js/easyui/demo/datagrid/fluid.html index 463f570..b67e9ca 100644 --- a/src/main/webapp/js/easyui/demo/datagrid/fluid.html +++ b/src/main/webapp/js/easyui/demo/datagrid/fluid.html @@ -1,32 +1,32 @@ - - - - - Fluid DataGrid - jQuery EasyUI Demo - - - - - - - -

Fluid DataGrid

-

This example shows how to assign percentage width to a column in DataGrid.

-
- - - - - - - - - - - - -
Item ID(15%)Product(15%)List Price(15%)Unit Cost(15%)Attribute(25%)Status(15%)
- - + + + + + Fluid DataGrid - jQuery EasyUI Demo + + + + + + + +

Fluid DataGrid

+

This example shows how to assign percentage width to a column in DataGrid.

+
+ + + + + + + + + + + + +
Item ID(15%)Product(15%)List Price(15%)Unit Cost(15%)Attribute(25%)Status(15%)
+ + \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo/datagrid/footer.html b/src/main/webapp/js/easyui/demo/datagrid/footer.html index ccb8885..53a3fbd 100644 --- a/src/main/webapp/js/easyui/demo/datagrid/footer.html +++ b/src/main/webapp/js/easyui/demo/datagrid/footer.html @@ -1,38 +1,38 @@ - - - - - Footer Rows in DataGrid - jQuery EasyUI Demo - - - - - - - -

Footer Rows in DataGrid

-

The summary informations can be displayed in footer rows.

-
- - - - - - - - - - - -
Item IDProduct IDList PriceUnit CostAttributeStatus
- - + + + + + Footer Rows in DataGrid - jQuery EasyUI Demo + + + + + + + +

Footer Rows in DataGrid

+

The summary informations can be displayed in footer rows.

+
+ + + + + + + + + + + +
Item IDProduct IDList PriceUnit CostAttributeStatus
+ + \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo/datagrid/formatcolumns.html b/src/main/webapp/js/easyui/demo/datagrid/formatcolumns.html index e5a2e02..c2b0076 100644 --- a/src/main/webapp/js/easyui/demo/datagrid/formatcolumns.html +++ b/src/main/webapp/js/easyui/demo/datagrid/formatcolumns.html @@ -1,39 +1,39 @@ - - - - - Format DataGrid Columns - jQuery EasyUI Demo - - - - - - - -

Format DataGrid Columns

-

The list price value will show red color when less than 30.

-
- - - - - - - - - - - -
Item IDProductList PriceUnit CostAttributeStatus
- - + + + + + Format DataGrid Columns - jQuery EasyUI Demo + + + + + + + +

Format DataGrid Columns

+

The list price value will show red color when less than 30.

+
+ + + + + + + + + + + +
Item IDProductList PriceUnit CostAttributeStatus
+ + \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo/datagrid/frozencolumns.html b/src/main/webapp/js/easyui/demo/datagrid/frozencolumns.html index 3542017..2bc21b1 100644 --- a/src/main/webapp/js/easyui/demo/datagrid/frozencolumns.html +++ b/src/main/webapp/js/easyui/demo/datagrid/frozencolumns.html @@ -1,35 +1,35 @@ - - - - - Frozen Columns in DataGrid - jQuery EasyUI Demo - - - - - - - -

Frozen Columns in DataGrid

-

You can freeze some columns that can't scroll out of view.

-
- - - - - - - - - - - - - - - -
Item IDProduct
List PriceUnit CostAttributeStatus
- - + + + + + Frozen Columns in DataGrid - jQuery EasyUI Demo + + + + + + + +

Frozen Columns in DataGrid

+

You can freeze some columns that can't scroll out of view.

+
+ + + + + + + + + + + + + + + +
Item IDProduct
List PriceUnit CostAttributeStatus
+ + \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo/datagrid/frozenrows.html b/src/main/webapp/js/easyui/demo/datagrid/frozenrows.html index be27afd..72310dd 100644 --- a/src/main/webapp/js/easyui/demo/datagrid/frozenrows.html +++ b/src/main/webapp/js/easyui/demo/datagrid/frozenrows.html @@ -1,44 +1,44 @@ - - - - - Frozen Rows in DataGrid - jQuery EasyUI Demo - - - - - - - -

Frozen Rows in DataGrid

-

This sample shows how to freeze some rows that will always be displayed at the top when the datagrid is scrolled down.

-
- - - - - - - - - - - - - - - -
Item IDProduct
List PriceUnit CostAttributeStatus
- - + + + + + Frozen Rows in DataGrid - jQuery EasyUI Demo + + + + + + + +

Frozen Rows in DataGrid

+

This sample shows how to freeze some rows that will always be displayed at the top when the datagrid is scrolled down.

+
+ + + + + + + + + + + + + + + +
Item IDProduct
List PriceUnit CostAttributeStatus
+ + \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo/datagrid/mergecells.html b/src/main/webapp/js/easyui/demo/datagrid/mergecells.html index 3d0ff75..a50f934 100644 --- a/src/main/webapp/js/easyui/demo/datagrid/mergecells.html +++ b/src/main/webapp/js/easyui/demo/datagrid/mergecells.html @@ -1,58 +1,58 @@ - - - - - Merge Cells for DataGrid - jQuery EasyUI Demo - - - - - - - -

Merge Cells for DataGrid

-

Cells in DataGrid body can be merged.

-
- - - - - - - - - - - -
ProductItem IDList PriceUnit CostAttributeStatus
- - + + + + + Merge Cells for DataGrid - jQuery EasyUI Demo + + + + + + + +

Merge Cells for DataGrid

+

Cells in DataGrid body can be merged.

+
+ + + + + + + + + + + +
ProductItem IDList PriceUnit CostAttributeStatus
+ + \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo/datagrid/multisorting.html b/src/main/webapp/js/easyui/demo/datagrid/multisorting.html index d7337f3..a04c3ef 100644 --- a/src/main/webapp/js/easyui/demo/datagrid/multisorting.html +++ b/src/main/webapp/js/easyui/demo/datagrid/multisorting.html @@ -1,37 +1,37 @@ - - - - - Multiple Sorting - jQuery EasyUI Demo - - - - - - - -

Multiple Sorting

-

Set 'multiSort' property to true to enable multiple column sorting.

-
- - - - - - - - - - - - -
Item IDProductList PriceUnit CostAttributeStatus
- - + + + + + Multiple Sorting - jQuery EasyUI Demo + + + + + + + +

Multiple Sorting

+

Set 'multiSort' property to true to enable multiple column sorting.

+
+ + + + + + + + + + + + +
Item IDProductList PriceUnit CostAttributeStatus
+ + \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo/datagrid/products.json b/src/main/webapp/js/easyui/demo/datagrid/products.json index b0b6a93..2c512bc 100644 --- a/src/main/webapp/js/easyui/demo/datagrid/products.json +++ b/src/main/webapp/js/easyui/demo/datagrid/products.json @@ -1,9 +1,9 @@ -[ -{"productid":"FI-SW-01","productname":"Koi"}, -{"productid":"K9-DL-01","productname":"Dalmation"}, -{"productid":"RP-SN-01","productname":"Rattlesnake"}, -{"productid":"RP-LI-02","productname":"Iguana"}, -{"productid":"FL-DSH-01","productname":"Manx"}, -{"productid":"FL-DLH-02","productname":"Persian"}, -{"productid":"AV-CB-01","productname":"Amazon Parrot"} -] +[ +{"productid":"FI-SW-01","productname":"Koi"}, +{"productid":"K9-DL-01","productname":"Dalmation"}, +{"productid":"RP-SN-01","productname":"Rattlesnake"}, +{"productid":"RP-LI-02","productname":"Iguana"}, +{"productid":"FL-DSH-01","productname":"Manx"}, +{"productid":"FL-DLH-02","productname":"Persian"}, +{"productid":"AV-CB-01","productname":"Amazon Parrot"} +] diff --git a/src/main/webapp/js/easyui/demo/datagrid/rowborder.html b/src/main/webapp/js/easyui/demo/datagrid/rowborder.html index 21843f4..24a18b7 100644 --- a/src/main/webapp/js/easyui/demo/datagrid/rowborder.html +++ b/src/main/webapp/js/easyui/demo/datagrid/rowborder.html @@ -1,60 +1,60 @@ - - - - - Row Border in DataGrid - jQuery EasyUI Demo - - - - - - - -

Row Border in DataGrid

-

This sample shows how to change the row border style of datagrid.

-
- Border: - - Striped: - -
- - - - - - - - - - - -
Item IDProductList PriceUnit CostAttributeStatus
- - - - + + + + + Row Border in DataGrid - jQuery EasyUI Demo + + + + + + + +

Row Border in DataGrid

+

This sample shows how to change the row border style of datagrid.

+
+ Border: + + Striped: + +
+ + + + + + + + + + + +
Item IDProductList PriceUnit CostAttributeStatus
+ + + + \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo/datagrid/rowediting.html b/src/main/webapp/js/easyui/demo/datagrid/rowediting.html index 8729e5e..0bde624 100644 --- a/src/main/webapp/js/easyui/demo/datagrid/rowediting.html +++ b/src/main/webapp/js/easyui/demo/datagrid/rowediting.html @@ -1,114 +1,114 @@ - - - - - Row Editing in DataGrid - jQuery EasyUI Demo - - - - - - - -

Row Editing in DataGrid

-

Click the row to start editing.

-
- - - - - - - - - - - - -
Item IDProductList PriceUnit CostAttributeStatus
- - - - - + + + + + Row Editing in DataGrid - jQuery EasyUI Demo + + + + + + + +

Row Editing in DataGrid

+

Click the row to start editing.

+
+ + + + + + + + + + + + +
Item IDProductList PriceUnit CostAttributeStatus
+ + + + + \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo/datagrid/rowstyle.html b/src/main/webapp/js/easyui/demo/datagrid/rowstyle.html index d4e36a8..d65a5c8 100644 --- a/src/main/webapp/js/easyui/demo/datagrid/rowstyle.html +++ b/src/main/webapp/js/easyui/demo/datagrid/rowstyle.html @@ -1,41 +1,41 @@ - - - - - DataGrid Row Style - jQuery EasyUI Demo - - - - - - - -

DataGrid Row Style

-

The rows which listprice value is less than 30 are highlighted.

-
- - - - - - - - - - - -
Item IDProductList PriceUnit CostAttributeStatus
- - + + + + + DataGrid Row Style - jQuery EasyUI Demo + + + + + + + +

DataGrid Row Style

+

The rows which listprice value is less than 30 are highlighted.

+
+ + + + + + + + + + + +
Item IDProductList PriceUnit CostAttributeStatus
+ + \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo/datagrid/selection.html b/src/main/webapp/js/easyui/demo/datagrid/selection.html index d6b4047..1118561 100644 --- a/src/main/webapp/js/easyui/demo/datagrid/selection.html +++ b/src/main/webapp/js/easyui/demo/datagrid/selection.html @@ -1,57 +1,57 @@ - - - - - DataGrid Selection - jQuery EasyUI Demo - - - - - - - -

DataGrid Selection

-

Choose a selection mode and select one or more rows.

- - - - - - - - - - - - -
Item IDProductList PriceUnit CostAttributeStatus
-
- Selection Mode: - -
- - + + + + + DataGrid Selection - jQuery EasyUI Demo + + + + + + + +

DataGrid Selection

+

Choose a selection mode and select one or more rows.

+ + + + + + + + + + + + +
Item IDProductList PriceUnit CostAttributeStatus
+
+ Selection Mode: + +
+ + \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo/datagrid/simpletoolbar.html b/src/main/webapp/js/easyui/demo/datagrid/simpletoolbar.html index 4c67f56..cbb918b 100644 --- a/src/main/webapp/js/easyui/demo/datagrid/simpletoolbar.html +++ b/src/main/webapp/js/easyui/demo/datagrid/simpletoolbar.html @@ -1,45 +1,45 @@ - - - - - DataGrid with Toolbar - jQuery EasyUI Demo - - - - - - - -

DataGrid with Toolbar

-

Put buttons on top toolbar of DataGrid.

-
- - - - - - - - - - - -
Item IDProductList PriceUnit CostAttributeStatus
- - + + + + + DataGrid with Toolbar - jQuery EasyUI Demo + + + + + + + +

DataGrid with Toolbar

+

Put buttons on top toolbar of DataGrid.

+
+ + + + + + + + + + + +
Item IDProductList PriceUnit CostAttributeStatus
+ + \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo/datagrid/transform.html b/src/main/webapp/js/easyui/demo/datagrid/transform.html index 9379832..ddc3a30 100644 --- a/src/main/webapp/js/easyui/demo/datagrid/transform.html +++ b/src/main/webapp/js/easyui/demo/datagrid/transform.html @@ -1,46 +1,46 @@ - - - - - Transform DataGrid from Table - jQuery EasyUI Demo - - - - - - - -

Transform DataGrid from Table

-

Transform DataGrid from an existing, unformatted html table.

-
- Transform -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Item IDProductList PriceAttribute
EST-1FI-SW-0136.50Large
EST-10K9-DL-0118.50Spotted Adult Female
EST-11RP-SN-0128.50Venomless
EST-12RP-SN-0126.50Rattleless
EST-13RP-LI-0235.50Green Adult
- + + + + + Transform DataGrid from Table - jQuery EasyUI Demo + + + + + + + +

Transform DataGrid from Table

+

Transform DataGrid from an existing, unformatted html table.

+
+ Transform +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Item IDProductList PriceAttribute
EST-1FI-SW-0136.50Large
EST-10K9-DL-0118.50Spotted Adult Female
EST-11RP-SN-0128.50Venomless
EST-12RP-SN-0126.50Rattleless
EST-13RP-LI-0235.50Green Adult
+ \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo/datebox/basic.html b/src/main/webapp/js/easyui/demo/datebox/basic.html index 2a55d8c..eb3417b 100644 --- a/src/main/webapp/js/easyui/demo/datebox/basic.html +++ b/src/main/webapp/js/easyui/demo/datebox/basic.html @@ -1,18 +1,18 @@ - - - - - Basic DateBox - jQuery EasyUI Demo - - - - - - - -

Basic DateBox

-

Click the calendar image on the right side.

-
- - + + + + + Basic DateBox - jQuery EasyUI Demo + + + + + + + +

Basic DateBox

+

Click the calendar image on the right side.

+
+ + \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo/datebox/buttons.html b/src/main/webapp/js/easyui/demo/datebox/buttons.html index 357316c..7ba5e5c 100644 --- a/src/main/webapp/js/easyui/demo/datebox/buttons.html +++ b/src/main/webapp/js/easyui/demo/datebox/buttons.html @@ -1,28 +1,28 @@ - - - - - DateBox Buttons - jQuery EasyUI Demo - - - - - - - -

DateBox Buttons

-

This example shows how to customize the datebox buttons underneath the calendar.

-
- - - - + + + + + DateBox Buttons - jQuery EasyUI Demo + + + + + + + +

DateBox Buttons

+

This example shows how to customize the datebox buttons underneath the calendar.

+
+ + + + \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo/datebox/clone.html b/src/main/webapp/js/easyui/demo/datebox/clone.html index 75948b0..1decfa7 100644 --- a/src/main/webapp/js/easyui/demo/datebox/clone.html +++ b/src/main/webapp/js/easyui/demo/datebox/clone.html @@ -1,27 +1,27 @@ - - - - - Clone DateBox - jQuery EasyUI Demo - - - - - - - -

Clone DateBox

-

Click the 'Clone' button to clone datebox components from the exiting datebox.

-
- Clone -
- -
- - + + + + + Clone DateBox - jQuery EasyUI Demo + + + + + + + +

Clone DateBox

+

Click the 'Clone' button to clone datebox components from the exiting datebox.

+
+ Clone +
+ +
+ + \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo/datebox/dateformat.html b/src/main/webapp/js/easyui/demo/datebox/dateformat.html index 5aff044..ead2064 100644 --- a/src/main/webapp/js/easyui/demo/datebox/dateformat.html +++ b/src/main/webapp/js/easyui/demo/datebox/dateformat.html @@ -1,39 +1,39 @@ - - - - - Date Format - jQuery EasyUI Demo - - - - - - - -

Date Format

-

Different date formats are applied to different DateBox components.

-
- - - - + + + + + Date Format - jQuery EasyUI Demo + + + + + + + +

Date Format

+

Different date formats are applied to different DateBox components.

+
+ + + + \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo/datebox/events.html b/src/main/webapp/js/easyui/demo/datebox/events.html index 21d1c6e..bf5c912 100644 --- a/src/main/webapp/js/easyui/demo/datebox/events.html +++ b/src/main/webapp/js/easyui/demo/datebox/events.html @@ -1,27 +1,27 @@ - - - - - DateBox Events - jQuery EasyUI Demo - - - - - - - -

DateBox Events

-

Click the calendar image on the right side.

-
- -
- Selected Date: - -
- - + + + + + DateBox Events - jQuery EasyUI Demo + + + + + + + +

DateBox Events

+

Click the calendar image on the right side.

+
+ +
+ Selected Date: + +
+ + \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo/datebox/fluid.html b/src/main/webapp/js/easyui/demo/datebox/fluid.html index fdf40ac..b30f70a 100644 --- a/src/main/webapp/js/easyui/demo/datebox/fluid.html +++ b/src/main/webapp/js/easyui/demo/datebox/fluid.html @@ -1,21 +1,21 @@ - - - - - Fluid DateBox - jQuery EasyUI Demo - - - - - - - -

Fluid DateBox

-

This example shows how to set the width of DateBox to a percentage of its parent container.

-
-

width: 50%

- -

width: 30%

- - + + + + + Fluid DateBox - jQuery EasyUI Demo + + + + + + + +

Fluid DateBox

+

This example shows how to set the width of DateBox to a percentage of its parent container.

+
+

width: 50%

+ +

width: 30%

+ + \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo/datebox/restrict.html b/src/main/webapp/js/easyui/demo/datebox/restrict.html index 3a4b105..84c8884 100644 --- a/src/main/webapp/js/easyui/demo/datebox/restrict.html +++ b/src/main/webapp/js/easyui/demo/datebox/restrict.html @@ -1,30 +1,30 @@ - - - - - Restrict Date Range in DateBox - jQuery EasyUI Demo - - - - - - - -

Restrict Date Range in DateBox

-

This example shows how to restrict the user to select only ten days from now.

-
- - - + + + + + Restrict Date Range in DateBox - jQuery EasyUI Demo + + + + + + + +

Restrict Date Range in DateBox

+

This example shows how to restrict the user to select only ten days from now.

+
+ + + \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo/datebox/validate.html b/src/main/webapp/js/easyui/demo/datebox/validate.html index ae45228..fae9b07 100644 --- a/src/main/webapp/js/easyui/demo/datebox/validate.html +++ b/src/main/webapp/js/easyui/demo/datebox/validate.html @@ -1,30 +1,30 @@ - - - - - Validate DateBox - jQuery EasyUI Demo - - - - - - - -

Validate DateBox

-

When the selected date is greater than specified date. The field validator will raise an error.

-
- - - + + + + + Validate DateBox - jQuery EasyUI Demo + + + + + + + +

Validate DateBox

+

When the selected date is greater than specified date. The field validator will raise an error.

+
+ + + \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo/datetimebox/basic.html b/src/main/webapp/js/easyui/demo/datetimebox/basic.html index fa92ff3..a09f245 100644 --- a/src/main/webapp/js/easyui/demo/datetimebox/basic.html +++ b/src/main/webapp/js/easyui/demo/datetimebox/basic.html @@ -1,18 +1,18 @@ - - - - - Basic DateTimeBox - jQuery EasyUI Demo - - - - - - - -

Basic DateTimeBox

-

Click the calendar image on the right side.

-
- - + + + + + Basic DateTimeBox - jQuery EasyUI Demo + + + + + + + +

Basic DateTimeBox

+

Click the calendar image on the right side.

+
+ + \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo/datetimebox/fluid.html b/src/main/webapp/js/easyui/demo/datetimebox/fluid.html index af4f08f..87b1ca2 100644 --- a/src/main/webapp/js/easyui/demo/datetimebox/fluid.html +++ b/src/main/webapp/js/easyui/demo/datetimebox/fluid.html @@ -1,21 +1,21 @@ - - - - - Fluid DateTimeBox - jQuery EasyUI Demo - - - - - - - -

Fluid DateTimeBox

-

This example shows how to set the width of DateTimeBox to a percentage of its parent container.

-
-

width: 50%

- -

width: 30%

- - + + + + + Fluid DateTimeBox - jQuery EasyUI Demo + + + + + + + +

Fluid DateTimeBox

+

This example shows how to set the width of DateTimeBox to a percentage of its parent container.

+
+

width: 50%

+ +

width: 30%

+ + \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo/datetimebox/initvalue.html b/src/main/webapp/js/easyui/demo/datetimebox/initvalue.html index 26f6c61..c9d2e11 100644 --- a/src/main/webapp/js/easyui/demo/datetimebox/initvalue.html +++ b/src/main/webapp/js/easyui/demo/datetimebox/initvalue.html @@ -1,19 +1,19 @@ - - - - - Initialize Value for DateTime - jQuery EasyUI Demo - - - - - - - -

Initialize Value for DateTime

-

The value is initialized when DateTimeBox has been created.

-
- - - + + + + + Initialize Value for DateTime - jQuery EasyUI Demo + + + + + + + +

Initialize Value for DateTime

+

The value is initialized when DateTimeBox has been created.

+
+ + + \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo/datetimebox/showseconds.html b/src/main/webapp/js/easyui/demo/datetimebox/showseconds.html index 938d9b8..54f9c37 100644 --- a/src/main/webapp/js/easyui/demo/datetimebox/showseconds.html +++ b/src/main/webapp/js/easyui/demo/datetimebox/showseconds.html @@ -1,22 +1,22 @@ - - - - - Display Seconds - jQuery EasyUI Demo - - - - - - - -

Display Seconds

-

The user can decide to display seconds part or not.

-
- Show Seconds: - -
- - - + + + + + Display Seconds - jQuery EasyUI Demo + + + + + + + +

Display Seconds

+

The user can decide to display seconds part or not.

+
+ Show Seconds: + +
+ + + \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo/demo.css b/src/main/webapp/js/easyui/demo/demo.css index 72ffb54..5c01467 100644 --- a/src/main/webapp/js/easyui/demo/demo.css +++ b/src/main/webapp/js/easyui/demo/demo.css @@ -1,21 +1,21 @@ -*{ - font-size:12px; -} -body { - font-family:verdana,helvetica,arial,sans-serif; - padding:20px; - font-size:12px; - margin:0; -} -h2 { - font-size:18px; - font-weight:bold; - margin:0; - margin-bottom:15px; -} -.demo-info{ - padding:0 0 12px 0; -} -.demo-tip{ - display:none; -} +*{ + font-size:12px; +} +body { + font-family:verdana,helvetica,arial,sans-serif; + padding:20px; + font-size:12px; + margin:0; +} +h2 { + font-size:18px; + font-weight:bold; + margin:0; + margin-bottom:15px; +} +.demo-info{ + padding:0 0 12px 0; +} +.demo-tip{ + display:none; +} diff --git a/src/main/webapp/js/easyui/demo/dialog/basic.html b/src/main/webapp/js/easyui/demo/dialog/basic.html index 37ca830..e745b37 100644 --- a/src/main/webapp/js/easyui/demo/dialog/basic.html +++ b/src/main/webapp/js/easyui/demo/dialog/basic.html @@ -1,23 +1,23 @@ - - - - - Basic Dialog - jQuery EasyUI Demo - - - - - - - -

Basic Dialog

-

Click below button to open or close dialog.

-
- Open - Close -
-
- The dialog content. -
- + + + + + Basic Dialog - jQuery EasyUI Demo + + + + + + + +

Basic Dialog

+

Click below button to open or close dialog.

+
+ Open + Close +
+
+ The dialog content. +
+ \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo/dialog/complextoolbar.html b/src/main/webapp/js/easyui/demo/dialog/complextoolbar.html index adaa97b..175fa73 100644 --- a/src/main/webapp/js/easyui/demo/dialog/complextoolbar.html +++ b/src/main/webapp/js/easyui/demo/dialog/complextoolbar.html @@ -1,46 +1,46 @@ - - - - - Complex Toolbar on Dialog - jQuery EasyUI Demo - - - - - - - -

Complex Toolbar on Dialog

-

This sample shows how to create complex toolbar on dialog.

-
- Open - Close -
-
- The dialog content. -
-
- - - - - -
- Edit - Help - - -
-
-
- Save - Close -
- - + + + + + Complex Toolbar on Dialog - jQuery EasyUI Demo + + + + + + + +

Complex Toolbar on Dialog

+

This sample shows how to create complex toolbar on dialog.

+
+ Open + Close +
+
+ The dialog content. +
+
+ + + + + +
+ Edit + Help + + +
+
+
+ Save + Close +
+ + \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo/dialog/fluid.html b/src/main/webapp/js/easyui/demo/dialog/fluid.html index f64f72e..b9809f0 100644 --- a/src/main/webapp/js/easyui/demo/dialog/fluid.html +++ b/src/main/webapp/js/easyui/demo/dialog/fluid.html @@ -1,24 +1,24 @@ - - - - - Fluid Dialog - jQuery EasyUI Demo - - - - - - - -

Fluid Dialog

-

This example shows how to set the width of Dialog to a percentage of its parent container.

-
-
-

width: 80%; height: 200px

-
- + + + + + Fluid Dialog - jQuery EasyUI Demo + + + + + + + +

Fluid Dialog

+

This example shows how to set the width of Dialog to a percentage of its parent container.

+
+
+

width: 80%; height: 200px

+
+ \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo/dialog/toolbarbuttons.html b/src/main/webapp/js/easyui/demo/dialog/toolbarbuttons.html index 12e2307..35013a5 100644 --- a/src/main/webapp/js/easyui/demo/dialog/toolbarbuttons.html +++ b/src/main/webapp/js/easyui/demo/dialog/toolbarbuttons.html @@ -1,52 +1,52 @@ - - - - - Toolbar and Buttons - jQuery EasyUI Demo - - - - - - - -

Toolbar and Buttons

-

The toolbar and buttons can be added to dialog.

-
- Open - Close -
-
- The dialog content. -
- - + + + + + Toolbar and Buttons - jQuery EasyUI Demo + + + + + + + +

Toolbar and Buttons

+

The toolbar and buttons can be added to dialog.

+
+ Open + Close +
+
+ The dialog content. +
+ + \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo/draggable/basic.html b/src/main/webapp/js/easyui/demo/draggable/basic.html index 3a73cf2..0c96a05 100644 --- a/src/main/webapp/js/easyui/demo/draggable/basic.html +++ b/src/main/webapp/js/easyui/demo/draggable/basic.html @@ -1,21 +1,21 @@ - - - - - Basic Draggable - jQuery EasyUI Demo - - - - - - - -

Basic Draggable

-

Move the boxes below by clicking on it with mouse.

-
-
-
-
Title
-
- + + + + + Basic Draggable - jQuery EasyUI Demo + + + + + + + +

Basic Draggable

+

Move the boxes below by clicking on it with mouse.

+
+
+
+
Title
+
+ \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo/draggable/constrain.html b/src/main/webapp/js/easyui/demo/draggable/constrain.html index b72e3ff..a2dfa6c 100644 --- a/src/main/webapp/js/easyui/demo/draggable/constrain.html +++ b/src/main/webapp/js/easyui/demo/draggable/constrain.html @@ -1,35 +1,35 @@ - - - - - Constrain Draggable - jQuery EasyUI Demo - - - - - - - -

Constrain Draggable

-

The draggable object can only be moved within its parent container.

-
-
-
-
-
- - - + + + + + Constrain Draggable - jQuery EasyUI Demo + + + + + + + +

Constrain Draggable

+

The draggable object can only be moved within its parent container.

+
+
+
+
+
+ + + \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo/draggable/snap.html b/src/main/webapp/js/easyui/demo/draggable/snap.html index c3ddd05..5f0103a 100644 --- a/src/main/webapp/js/easyui/demo/draggable/snap.html +++ b/src/main/webapp/js/easyui/demo/draggable/snap.html @@ -1,37 +1,37 @@ - - - - - Snap Draggable - jQuery EasyUI Demo - - - - - - - -

Snap Draggable

-

This sample shows how to snap a draggable object to a 20x20 grid.

-
-
-
-
-
- - - + + + + + Snap Draggable - jQuery EasyUI Demo + + + + + + + +

Snap Draggable

+

This sample shows how to snap a draggable object to a 20x20 grid.

+
+
+
+
+
+ + + \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo/droppable/accept.html b/src/main/webapp/js/easyui/demo/droppable/accept.html index 8da0d42..cf56d08 100644 --- a/src/main/webapp/js/easyui/demo/droppable/accept.html +++ b/src/main/webapp/js/easyui/demo/droppable/accept.html @@ -1,78 +1,78 @@ - - - - - Accept a Drop - jQuery EasyUI Demo - - - - - - - -

Accept a Drop

-

Some draggable object can not be accepted.

-
-
- drag me! -
Drag 1
-
Drag 2
-
Drag 3
-
-
- drop here! -
-
- - - - + + + + + Accept a Drop - jQuery EasyUI Demo + + + + + + + +

Accept a Drop

+

Some draggable object can not be accepted.

+
+
+ drag me! +
Drag 1
+
Drag 2
+
Drag 3
+
+
+ drop here! +
+
+ + + + \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo/droppable/basic.html b/src/main/webapp/js/easyui/demo/droppable/basic.html index 7738c06..ecf803a 100644 --- a/src/main/webapp/js/easyui/demo/droppable/basic.html +++ b/src/main/webapp/js/easyui/demo/droppable/basic.html @@ -1,77 +1,77 @@ - - - - - Basic Droppable - jQuery EasyUI Demo - - - - - - - -

Basic Droppable

-

Drag the boxed on left to the target area on right.

-
-
-
Source
-
-
Apple
-
Peach
-
Orange
-
-
-
-
Target
-
-
-
-
- - - + + + + + Basic Droppable - jQuery EasyUI Demo + + + + + + + +

Basic Droppable

+

Drag the boxed on left to the target area on right.

+
+
+
Source
+
+
Apple
+
Peach
+
Orange
+
+
+
+
Target
+
+
+
+
+ + + \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo/droppable/sort.html b/src/main/webapp/js/easyui/demo/droppable/sort.html index 1d99cd8..37c0d2f 100644 --- a/src/main/webapp/js/easyui/demo/droppable/sort.html +++ b/src/main/webapp/js/easyui/demo/droppable/sort.html @@ -1,71 +1,71 @@ - - - - - Change Items Order - jQuery EasyUI Demo - - - - - - - -

Change Items Order

-

Drag the list items to change their order.

-
-
    -
  • Drag 1
  • -
  • Drag 2
  • -
  • Drag 3
  • -
  • Drag 4
  • -
  • Drag 5
  • -
  • Drag 6
  • -
- - - - + + + + + Change Items Order - jQuery EasyUI Demo + + + + + + + +

Change Items Order

+

Drag the list items to change their order.

+
+
    +
  • Drag 1
  • +
  • Drag 2
  • +
  • Drag 3
  • +
  • Drag 4
  • +
  • Drag 5
  • +
  • Drag 6
  • +
+ + + + \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo/easyloader/basic.html b/src/main/webapp/js/easyui/demo/easyloader/basic.html index 0d7ba7b..44a09eb 100644 --- a/src/main/webapp/js/easyui/demo/easyloader/basic.html +++ b/src/main/webapp/js/easyui/demo/easyloader/basic.html @@ -1,75 +1,75 @@ - - - - - Basic EasyLoader - jQuery EasyUI Demo - - - - - - - -

Basic EasyLoader

-
-
-
Click the buttons below to load components dynamically.
-
- -
-
-
- - - - + + + + + Basic EasyLoader - jQuery EasyUI Demo + + + + + + + +

Basic EasyLoader

+
+
+
Click the buttons below to load components dynamically.
+
+ +
+
+
+ + + + \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo/form/basic.html b/src/main/webapp/js/easyui/demo/form/basic.html index 1aac45f..65e25c2 100644 --- a/src/main/webapp/js/easyui/demo/form/basic.html +++ b/src/main/webapp/js/easyui/demo/form/basic.html @@ -1,59 +1,59 @@ - - - - - Basic Form - jQuery EasyUI Demo - - - - - - - -

Basic Form

-

Fill the form and submit it.

-
-
-
-
- - - - - - - - - - - - - - - - - - - - - -
Name:
Email:
Subject:
Message:
Language: - -
-
-
- Submit - Clear -
-
-
- - + + + + + Basic Form - jQuery EasyUI Demo + + + + + + + +

Basic Form

+

Fill the form and submit it.

+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + +
Name:
Email:
Subject:
Message:
Language: + +
+
+
+ Submit + Clear +
+
+
+ + \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo/form/form_data1.json b/src/main/webapp/js/easyui/demo/form/form_data1.json index 3a58567..7103c83 100644 --- a/src/main/webapp/js/easyui/demo/form/form_data1.json +++ b/src/main/webapp/js/easyui/demo/form/form_data1.json @@ -1,7 +1,7 @@ -{ - "name":"easyui", - "email":"easyui@gmail.com", - "subject":"Subject Title", - "message":"Message Content", - "language":"de" +{ + "name":"easyui", + "email":"easyui@gmail.com", + "subject":"Subject Title", + "message":"Message Content", + "language":"de" } \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo/form/load.html b/src/main/webapp/js/easyui/demo/form/load.html index c668970..8c0788d 100644 --- a/src/main/webapp/js/easyui/demo/form/load.html +++ b/src/main/webapp/js/easyui/demo/form/load.html @@ -1,68 +1,68 @@ - - - - - Load Form Data - jQuery EasyUI Demo - - - - - - - -

Load Form Data

-

Click the buttons below to load form data.

- -
-
-
- - - - - - - - - - - - - - - - - - - - - -
Name:
Email:
Subject:
Message:
Language: - -
-
-
-
- - + + + + + Load Form Data - jQuery EasyUI Demo + + + + + + + +

Load Form Data

+

Click the buttons below to load form data.

+ +
+
+
+ + + + + + + + + + + + + + + + + + + + + +
Name:
Email:
Subject:
Message:
Language: + +
+
+
+
+ + \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo/form/validateonsubmit.html b/src/main/webapp/js/easyui/demo/form/validateonsubmit.html index 119206c..15f8c5d 100644 --- a/src/main/webapp/js/easyui/demo/form/validateonsubmit.html +++ b/src/main/webapp/js/easyui/demo/form/validateonsubmit.html @@ -1,63 +1,63 @@ - - - - - Validate Form on Submit - jQuery EasyUI Demo - - - - - - - -

Validate Form on Submit

-

The form does not perform validation before being submitted.

-
-
-
-
- - - - - - - - - - - - - - - - - - - - - -
Name:
Email:
Subject:
Message:
Language: - -
-
-
- Submit - Clear -
-
-
- - + + + + + Validate Form on Submit - jQuery EasyUI Demo + + + + + + + +

Validate Form on Submit

+

The form does not perform validation before being submitted.

+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + +
Name:
Email:
Subject:
Message:
Language: + +
+
+
+ Submit + Clear +
+
+
+ + \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo/layout/_content.html b/src/main/webapp/js/easyui/demo/layout/_content.html index 76f2506..66c1bd5 100644 --- a/src/main/webapp/js/easyui/demo/layout/_content.html +++ b/src/main/webapp/js/easyui/demo/layout/_content.html @@ -1,18 +1,18 @@ - - - - - AJAX Content - - -

jQuery EasyUI framework help you build your web page easily.

-
    -
  • easyui is a collection of user-interface plugin based on jQuery.
  • -
  • easyui provides essential functionality for building modern, interactive, javascript applications.
  • -
  • using easyui you don't need to write many javascript code, you usually defines user-interface by writing some HTML markup.
  • -
  • complete framework for HTML5 web page.
  • -
  • easyui save your time and scales while developing your products.
  • -
  • easyui is very easy but powerful.
  • -
- + + + + + AJAX Content + + +

jQuery EasyUI framework help you build your web page easily.

+
    +
  • easyui is a collection of user-interface plugin based on jQuery.
  • +
  • easyui provides essential functionality for building modern, interactive, javascript applications.
  • +
  • using easyui you don't need to write many javascript code, you usually defines user-interface by writing some HTML markup.
  • +
  • complete framework for HTML5 web page.
  • +
  • easyui save your time and scales while developing your products.
  • +
  • easyui is very easy but powerful.
  • +
+ \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo/layout/addremove.html b/src/main/webapp/js/easyui/demo/layout/addremove.html index ede2889..34977c4 100644 --- a/src/main/webapp/js/easyui/demo/layout/addremove.html +++ b/src/main/webapp/js/easyui/demo/layout/addremove.html @@ -1,53 +1,53 @@ - - - - - Add and Remove Layout - jQuery EasyUI Demo - - - - - - - -

Add and Remove Layout

-

Click the buttons below to add or remove region panel of layout.

-
- Select Region Panel: - - Add - Remove -
-
-
-
-
-
-
-
- - + + + + + Add and Remove Layout - jQuery EasyUI Demo + + + + + + + +

Add and Remove Layout

+

Click the buttons below to add or remove region panel of layout.

+
+ Select Region Panel: + + Add + Remove +
+
+
+
+
+
+
+
+ + \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo/layout/autoheight.html b/src/main/webapp/js/easyui/demo/layout/autoheight.html index b9ccc7e..0c882f2 100644 --- a/src/main/webapp/js/easyui/demo/layout/autoheight.html +++ b/src/main/webapp/js/easyui/demo/layout/autoheight.html @@ -1,59 +1,59 @@ - - - - - Auto Height for Layout - jQuery EasyUI Demo - - - - - - - -

Auto Height for Layout

-

This example shows how to auto adjust layout height after dynamically adding items.

- -
-
-
-
-
-

Panel Content.

-

Panel Content.

-

Panel Content.

-

Panel Content.

-

Panel Content.

-
-
- - + + + + + Auto Height for Layout - jQuery EasyUI Demo + + + + + + + +

Auto Height for Layout

+

This example shows how to auto adjust layout height after dynamically adding items.

+ +
+
+
+
+
+

Panel Content.

+

Panel Content.

+

Panel Content.

+

Panel Content.

+

Panel Content.

+
+
+ + \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo/layout/basic.html b/src/main/webapp/js/easyui/demo/layout/basic.html index f428724..29e2c39 100644 --- a/src/main/webapp/js/easyui/demo/layout/basic.html +++ b/src/main/webapp/js/easyui/demo/layout/basic.html @@ -1,39 +1,39 @@ - - - - - Basic Layout - jQuery EasyUI Demo - - - - - - - -

Basic Layout

-

The layout contains north,south,west,east and center regions.

-
-
-
-
-
-
-
- - - - - - - - - - - -
Item IDProduct IDList PriceUnit CostAttributeStatus
-
-
- - + + + + + Basic Layout - jQuery EasyUI Demo + + + + + + + +

Basic Layout

+

The layout contains north,south,west,east and center regions.

+
+
+
+
+
+
+
+ + + + + + + + + + + +
Item IDProduct IDList PriceUnit CostAttributeStatus
+
+
+ + \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo/layout/complex.html b/src/main/webapp/js/easyui/demo/layout/complex.html index 9d1ab66..833eb09 100644 --- a/src/main/webapp/js/easyui/demo/layout/complex.html +++ b/src/main/webapp/js/easyui/demo/layout/complex.html @@ -1,57 +1,57 @@ - - - - - Complex Layout - jQuery EasyUI Demo - - - - - - - -

Complex Layout

-

This sample shows how to create a complex layout.

-
-
-
-
-
-
    -
    -
    -
    -
    - content1 -
    -
    - content2 -
    -
    - content3 -
    -
    -
    -
    -
    -
    -
    - - - - - - - - - - - -
    Item IDProduct IDList PriceUnit CostAttributeStatus
    -
    -
    -
    -
    - + + + + + Complex Layout - jQuery EasyUI Demo + + + + + + + +

    Complex Layout

    +

    This sample shows how to create a complex layout.

    +
    +
    +
    +
    +
    +
      +
      +
      +
      +
      + content1 +
      +
      + content2 +
      +
      + content3 +
      +
      +
      +
      +
      +
      +
      + + + + + + + + + + + +
      Item IDProduct IDList PriceUnit CostAttributeStatus
      +
      +
      +
      +
      + \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo/layout/datagrid_data1.json b/src/main/webapp/js/easyui/demo/layout/datagrid_data1.json index 63d6473..e9a5be2 100644 --- a/src/main/webapp/js/easyui/demo/layout/datagrid_data1.json +++ b/src/main/webapp/js/easyui/demo/layout/datagrid_data1.json @@ -1,12 +1,12 @@ -{"total":28,"rows":[ - {"productid":"FI-SW-01","productname":"Koi","unitcost":10.00,"status":"P","listprice":36.50,"attr1":"Large","itemid":"EST-1"}, - {"productid":"K9-DL-01","productname":"Dalmation","unitcost":12.00,"status":"P","listprice":18.50,"attr1":"Spotted Adult Female","itemid":"EST-10"}, - {"productid":"RP-SN-01","productname":"Rattlesnake","unitcost":12.00,"status":"P","listprice":38.50,"attr1":"Venomless","itemid":"EST-11"}, - {"productid":"RP-SN-01","productname":"Rattlesnake","unitcost":12.00,"status":"P","listprice":26.50,"attr1":"Rattleless","itemid":"EST-12"}, - {"productid":"RP-LI-02","productname":"Iguana","unitcost":12.00,"status":"P","listprice":35.50,"attr1":"Green Adult","itemid":"EST-13"}, - {"productid":"FL-DSH-01","productname":"Manx","unitcost":12.00,"status":"P","listprice":158.50,"attr1":"Tailless","itemid":"EST-14"}, - {"productid":"FL-DSH-01","productname":"Manx","unitcost":12.00,"status":"P","listprice":83.50,"attr1":"With tail","itemid":"EST-15"}, - {"productid":"FL-DLH-02","productname":"Persian","unitcost":12.00,"status":"P","listprice":23.50,"attr1":"Adult Female","itemid":"EST-16"}, - {"productid":"FL-DLH-02","productname":"Persian","unitcost":12.00,"status":"P","listprice":89.50,"attr1":"Adult Male","itemid":"EST-17"}, - {"productid":"AV-CB-01","productname":"Amazon Parrot","unitcost":92.00,"status":"P","listprice":63.50,"attr1":"Adult Male","itemid":"EST-18"} -]} +{"total":28,"rows":[ + {"productid":"FI-SW-01","productname":"Koi","unitcost":10.00,"status":"P","listprice":36.50,"attr1":"Large","itemid":"EST-1"}, + {"productid":"K9-DL-01","productname":"Dalmation","unitcost":12.00,"status":"P","listprice":18.50,"attr1":"Spotted Adult Female","itemid":"EST-10"}, + {"productid":"RP-SN-01","productname":"Rattlesnake","unitcost":12.00,"status":"P","listprice":38.50,"attr1":"Venomless","itemid":"EST-11"}, + {"productid":"RP-SN-01","productname":"Rattlesnake","unitcost":12.00,"status":"P","listprice":26.50,"attr1":"Rattleless","itemid":"EST-12"}, + {"productid":"RP-LI-02","productname":"Iguana","unitcost":12.00,"status":"P","listprice":35.50,"attr1":"Green Adult","itemid":"EST-13"}, + {"productid":"FL-DSH-01","productname":"Manx","unitcost":12.00,"status":"P","listprice":158.50,"attr1":"Tailless","itemid":"EST-14"}, + {"productid":"FL-DSH-01","productname":"Manx","unitcost":12.00,"status":"P","listprice":83.50,"attr1":"With tail","itemid":"EST-15"}, + {"productid":"FL-DLH-02","productname":"Persian","unitcost":12.00,"status":"P","listprice":23.50,"attr1":"Adult Female","itemid":"EST-16"}, + {"productid":"FL-DLH-02","productname":"Persian","unitcost":12.00,"status":"P","listprice":89.50,"attr1":"Adult Male","itemid":"EST-17"}, + {"productid":"AV-CB-01","productname":"Amazon Parrot","unitcost":92.00,"status":"P","listprice":63.50,"attr1":"Adult Male","itemid":"EST-18"} +]} diff --git a/src/main/webapp/js/easyui/demo/layout/fluid.html b/src/main/webapp/js/easyui/demo/layout/fluid.html index 8ddd50f..42f8c55 100644 --- a/src/main/webapp/js/easyui/demo/layout/fluid.html +++ b/src/main/webapp/js/easyui/demo/layout/fluid.html @@ -1,24 +1,24 @@ - - - - - Fluid Layout - jQuery EasyUI Demo - - - - - - - -

      Fluid Layout

      -

      Percentage width of region panel in a layout.

      -
      -
      -
      -

      width: 30%

      -
      -
      -
      -
      - + + + + + Fluid Layout - jQuery EasyUI Demo + + + + + + + +

      Fluid Layout

      +

      Percentage width of region panel in a layout.

      +
      +
      +
      +

      width: 30%

      +
      +
      +
      +
      + \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo/layout/full.html b/src/main/webapp/js/easyui/demo/layout/full.html index 13eb94a..c83bf07 100644 --- a/src/main/webapp/js/easyui/demo/layout/full.html +++ b/src/main/webapp/js/easyui/demo/layout/full.html @@ -1,19 +1,19 @@ - - - - - Full Layout - jQuery EasyUI Demo - - - - - - - -
      north region
      -
      west content
      -
      east region
      -
      south region
      -
      - + + + + + Full Layout - jQuery EasyUI Demo + + + + + + + +
      north region
      +
      west content
      +
      east region
      +
      south region
      +
      + \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo/layout/nestedlayout.html b/src/main/webapp/js/easyui/demo/layout/nestedlayout.html index 227e573..1f8cc04 100644 --- a/src/main/webapp/js/easyui/demo/layout/nestedlayout.html +++ b/src/main/webapp/js/easyui/demo/layout/nestedlayout.html @@ -1,31 +1,31 @@ - - - - - Nested Layout - jQuery EasyUI Demo - - - - - - - -

      Nested Layout

      -

      The layout region panel contains another layout or other components.

      -
      -
      -
      -
      -
      -
      -
      -
      -
      -
      -
      -
      -
      -
      - - + + + + + Nested Layout - jQuery EasyUI Demo + + + + + + + +

      Nested Layout

      +

      The layout region panel contains another layout or other components.

      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      + + \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo/layout/nocollapsible.html b/src/main/webapp/js/easyui/demo/layout/nocollapsible.html index 5854b2d..a6914a0 100644 --- a/src/main/webapp/js/easyui/demo/layout/nocollapsible.html +++ b/src/main/webapp/js/easyui/demo/layout/nocollapsible.html @@ -1,34 +1,34 @@ - - - - - No collapsible button in Layout - jQuery EasyUI Demo - - - - - - - -

      No collapsible button in Layout

      -

      The layout region panel has no collapsible button.

      -
      -
      -
      -
      -
      - -
      -
      -
      -
      -
      - - + + + + + No collapsible button in Layout - jQuery EasyUI Demo + + + + + + + +

      No collapsible button in Layout

      +

      The layout region panel has no collapsible button.

      +
      +
      +
      +
      +
      + +
      +
      +
      +
      +
      + + \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo/layout/propertygrid_data1.json b/src/main/webapp/js/easyui/demo/layout/propertygrid_data1.json index a458d83..12b2d00 100644 --- a/src/main/webapp/js/easyui/demo/layout/propertygrid_data1.json +++ b/src/main/webapp/js/easyui/demo/layout/propertygrid_data1.json @@ -1,20 +1,20 @@ -{"total":7,"rows":[ - {"name":"Name","value":"Bill Smith","group":"ID Settings","editor":"text"}, - {"name":"Address","value":"","group":"ID Settings","editor":"text"}, - {"name":"Age","value":"40","group":"ID Settings","editor":"numberbox"}, - {"name":"Birthday","value":"01/02/2012","group":"ID Settings","editor":"datebox"}, - {"name":"SSN","value":"123-456-7890","group":"ID Settings","editor":"text"}, - {"name":"Email","value":"bill@gmail.com","group":"Marketing Settings","editor":{ - "type":"validatebox", - "options":{ - "validType":"email" - } - }}, - {"name":"FrequentBuyer","value":"false","group":"Marketing Settings","editor":{ - "type":"checkbox", - "options":{ - "on":true, - "off":false - } - }} +{"total":7,"rows":[ + {"name":"Name","value":"Bill Smith","group":"ID Settings","editor":"text"}, + {"name":"Address","value":"","group":"ID Settings","editor":"text"}, + {"name":"Age","value":"40","group":"ID Settings","editor":"numberbox"}, + {"name":"Birthday","value":"01/02/2012","group":"ID Settings","editor":"datebox"}, + {"name":"SSN","value":"123-456-7890","group":"ID Settings","editor":"text"}, + {"name":"Email","value":"bill@gmail.com","group":"Marketing Settings","editor":{ + "type":"validatebox", + "options":{ + "validType":"email" + } + }}, + {"name":"FrequentBuyer","value":"false","group":"Marketing Settings","editor":{ + "type":"checkbox", + "options":{ + "on":true, + "off":false + } + }} ]} \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo/layout/tree_data1.json b/src/main/webapp/js/easyui/demo/layout/tree_data1.json index e0c6192..83fb0d6 100644 --- a/src/main/webapp/js/easyui/demo/layout/tree_data1.json +++ b/src/main/webapp/js/easyui/demo/layout/tree_data1.json @@ -1,49 +1,49 @@ -[{ - "id":1, - "text":"My Documents", - "children":[{ - "id":11, - "text":"Photos", - "state":"closed", - "children":[{ - "id":111, - "text":"Friend" - },{ - "id":112, - "text":"Wife" - },{ - "id":113, - "text":"Company" - }] - },{ - "id":12, - "text":"Program Files", - "children":[{ - "id":121, - "text":"Intel" - },{ - "id":122, - "text":"Java", - "attributes":{ - "p1":"Custom Attribute1", - "p2":"Custom Attribute2" - } - },{ - "id":123, - "text":"Microsoft Office" - },{ - "id":124, - "text":"Games", - "checked":true - }] - },{ - "id":13, - "text":"index.html" - },{ - "id":14, - "text":"about.html" - },{ - "id":15, - "text":"welcome.html" - }] -}] +[{ + "id":1, + "text":"My Documents", + "children":[{ + "id":11, + "text":"Photos", + "state":"closed", + "children":[{ + "id":111, + "text":"Friend" + },{ + "id":112, + "text":"Wife" + },{ + "id":113, + "text":"Company" + }] + },{ + "id":12, + "text":"Program Files", + "children":[{ + "id":121, + "text":"Intel" + },{ + "id":122, + "text":"Java", + "attributes":{ + "p1":"Custom Attribute1", + "p2":"Custom Attribute2" + } + },{ + "id":123, + "text":"Microsoft Office" + },{ + "id":124, + "text":"Games", + "checked":true + }] + },{ + "id":13, + "text":"index.html" + },{ + "id":14, + "text":"about.html" + },{ + "id":15, + "text":"welcome.html" + }] +}] diff --git a/src/main/webapp/js/easyui/demo/linkbutton/basic.html b/src/main/webapp/js/easyui/demo/linkbutton/basic.html index d46c47f..741d68c 100644 --- a/src/main/webapp/js/easyui/demo/linkbutton/basic.html +++ b/src/main/webapp/js/easyui/demo/linkbutton/basic.html @@ -1,33 +1,33 @@ - - - - - Basic LinkButton - jQuery EasyUI Demo - - - - - - - -

      Basic LinkButton

      -

      Buttons can be created from <a> or <button> elements.

      -
      -

      Basic Buttons

      -
      - Add - Remove - Save - Cut - Text Button -
      -

      Fixed Width Buttons

      -
      - Search - Print - Reload - Help -
      - - + + + + + Basic LinkButton - jQuery EasyUI Demo + + + + + + + +

      Basic LinkButton

      +

      Buttons can be created from <a> or <button> elements.

      +
      +

      Basic Buttons

      +
      + Add + Remove + Save + Cut + Text Button +
      +

      Fixed Width Buttons

      +
      + Search + Print + Reload + Help +
      + + \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo/linkbutton/fluid.html b/src/main/webapp/js/easyui/demo/linkbutton/fluid.html index cb033e7..b1027b9 100644 --- a/src/main/webapp/js/easyui/demo/linkbutton/fluid.html +++ b/src/main/webapp/js/easyui/demo/linkbutton/fluid.html @@ -1,33 +1,33 @@ - - - - - Fluid LinkButton - jQuery EasyUI Demo - - - - - - - -

      Fluid LinkButton

      -

      This example shows how to set the width of LinkButton to a percentage of its parent container.

      -
      -

      width: 15%

      -
      - Add - Remove - Save - Cut - Text Button -
      -

      width: 20%

      -
      - Search - Print - Reload - Help -
      - - + + + + + Fluid LinkButton - jQuery EasyUI Demo + + + + + + + +

      Fluid LinkButton

      +

      This example shows how to set the width of LinkButton to a percentage of its parent container.

      +
      +

      width: 15%

      +
      + Add + Remove + Save + Cut + Text Button +
      +

      width: 20%

      +
      + Search + Print + Reload + Help +
      + + \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo/linkbutton/group.html b/src/main/webapp/js/easyui/demo/linkbutton/group.html index 4c1293d..852db67 100644 --- a/src/main/webapp/js/easyui/demo/linkbutton/group.html +++ b/src/main/webapp/js/easyui/demo/linkbutton/group.html @@ -1,33 +1,33 @@ - - - - - Button Group - jQuery EasyUI Demo - - - - - - - -

      Button Group

      -

      In a button group only one button can be selected.

      -
      - -
      - - - + + + + + Button Group - jQuery EasyUI Demo + + + + + + + +

      Button Group

      +

      In a button group only one button can be selected.

      +
      + +
      + + + \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo/linkbutton/iconalign.html b/src/main/webapp/js/easyui/demo/linkbutton/iconalign.html index 21835f0..99a8ec2 100644 --- a/src/main/webapp/js/easyui/demo/linkbutton/iconalign.html +++ b/src/main/webapp/js/easyui/demo/linkbutton/iconalign.html @@ -1,32 +1,32 @@ - - - - - Icon Align on LinkButton - jQuery EasyUI Demo - - - - - - - -

      Icon Align on LinkButton

      -

      Change the icon align to place icon on left, right, top or bottom of button.

      -
      -
      - Select Icon Align: - -
      -
      - Add - Remove - Save - Cut -
      - + + + + + Icon Align on LinkButton - jQuery EasyUI Demo + + + + + + + +

      Icon Align on LinkButton

      +

      Change the icon align to place icon on left, right, top or bottom of button.

      +
      +
      + Select Icon Align: + +
      +
      + Add + Remove + Save + Cut +
      + \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo/linkbutton/plain.html b/src/main/webapp/js/easyui/demo/linkbutton/plain.html index 71c89cd..0143c20 100644 --- a/src/main/webapp/js/easyui/demo/linkbutton/plain.html +++ b/src/main/webapp/js/easyui/demo/linkbutton/plain.html @@ -1,28 +1,28 @@ - - - - - Plain LinkButton - jQuery EasyUI Demo - - - - - - - -

      Plain LinkButton

      -

      The buttons with plain style have transparent background.

      -
      - - - + + + + + Plain LinkButton - jQuery EasyUI Demo + + + + + + + +

      Plain LinkButton

      +

      The buttons with plain style have transparent background.

      +
      + + + \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo/linkbutton/size.html b/src/main/webapp/js/easyui/demo/linkbutton/size.html index 3e121bb..265ecb5 100644 --- a/src/main/webapp/js/easyui/demo/linkbutton/size.html +++ b/src/main/webapp/js/easyui/demo/linkbutton/size.html @@ -1,34 +1,34 @@ - - - - - LinkButton Size - jQuery EasyUI Demo - - - - - - - -

      LinkButton Size

      -

      This sample shows how to display small buttons and large buttons.

      -
      -

      Small Buttons

      -
      - Add - Remove - Save - Cut - Text Button -
      -

      Large Buttons

      - - - + + + + + LinkButton Size - jQuery EasyUI Demo + + + + + + + +

      LinkButton Size

      +

      This sample shows how to display small buttons and large buttons.

      +
      +

      Small Buttons

      +
      + Add + Remove + Save + Cut + Text Button +
      +

      Large Buttons

      + + + \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo/linkbutton/style.html b/src/main/webapp/js/easyui/demo/linkbutton/style.html index fe61dd9..fd46c2b 100644 --- a/src/main/webapp/js/easyui/demo/linkbutton/style.html +++ b/src/main/webapp/js/easyui/demo/linkbutton/style.html @@ -1,31 +1,31 @@ - - - - - Style LinkButton - jQuery EasyUI Demo - - - - - - - -

      Style LinkButton

      -

      This example shows how to style a linkbutton.

      -
      - - - - - + + + + + Style LinkButton - jQuery EasyUI Demo + + + + + + + +

      Style LinkButton

      +

      This example shows how to style a linkbutton.

      +
      + + + + + \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo/linkbutton/toggle.html b/src/main/webapp/js/easyui/demo/linkbutton/toggle.html index 352001a..ebab0d1 100644 --- a/src/main/webapp/js/easyui/demo/linkbutton/toggle.html +++ b/src/main/webapp/js/easyui/demo/linkbutton/toggle.html @@ -1,25 +1,25 @@ - - - - - Toggle Button - jQuery EasyUI Demo - - - - - - - -

      Toggle Button

      -

      Click the button below to switch its selected state.

      -
      -
      - Add - Remove - Save - Cut - Text Button -
      - - + + + + + Toggle Button - jQuery EasyUI Demo + + + + + + + +

      Toggle Button

      +

      Click the button below to switch its selected state.

      +
      +
      + Add + Remove + Save + Cut + Text Button +
      + + \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo/menu/basic.html b/src/main/webapp/js/easyui/demo/menu/basic.html index c1bf0d3..ac6e171 100644 --- a/src/main/webapp/js/easyui/demo/menu/basic.html +++ b/src/main/webapp/js/easyui/demo/menu/basic.html @@ -1,68 +1,68 @@ - - - - - Basic Menu - jQuery EasyUI Demo - - - - - - - -

      Basic Menu

      -

      Right click on page to display menu.

      -
      - -
      -
      New
      -
      - Open -
      -
      Word
      -
      Excel
      -
      PowerPoint
      -
      - M1 -
      -
      sub1
      -
      sub2
      -
      - Sub -
      -
      sub21
      -
      sub22
      -
      sub23
      -
      -
      -
      sub3
      -
      -
      -
      - Window Demos -
      -
      Window
      -
      Dialog
      - -
      -
      -
      -
      -
      Save
      -
      Print
      - -
      Exit
      -
      - - + + + + + Basic Menu - jQuery EasyUI Demo + + + + + + + +

      Basic Menu

      +

      Right click on page to display menu.

      +
      + +
      +
      New
      +
      + Open +
      +
      Word
      +
      Excel
      +
      PowerPoint
      +
      + M1 +
      +
      sub1
      +
      sub2
      +
      + Sub +
      +
      sub21
      +
      sub22
      +
      sub23
      +
      +
      +
      sub3
      +
      +
      +
      + Window Demos +
      +
      Window
      +
      Dialog
      + +
      +
      +
      +
      +
      Save
      +
      Print
      + +
      Exit
      +
      + + \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo/menu/customitem.html b/src/main/webapp/js/easyui/demo/menu/customitem.html index e420131..bf4df9c 100644 --- a/src/main/webapp/js/easyui/demo/menu/customitem.html +++ b/src/main/webapp/js/easyui/demo/menu/customitem.html @@ -1,55 +1,55 @@ - - - - - Custom Menu Item - jQuery EasyUI Demo - - - - - - - -

      Custom Menu Item

      -

      Right click on page to display menu, move to the 'Open' item to display its custom sub content.

      -
      -
      -
      New
      -
      - Open - -
      -
      Save
      -
      Print
      - -
      Exit
      -
      - - - + + + + + Custom Menu Item - jQuery EasyUI Demo + + + + + + + +

      Custom Menu Item

      +

      Right click on page to display menu, move to the 'Open' item to display its custom sub content.

      +
      +
      +
      New
      +
      + Open + +
      +
      Save
      +
      Print
      + +
      Exit
      +
      + + + \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo/menu/events.html b/src/main/webapp/js/easyui/demo/menu/events.html index c26b060..41f4b57 100644 --- a/src/main/webapp/js/easyui/demo/menu/events.html +++ b/src/main/webapp/js/easyui/demo/menu/events.html @@ -1,40 +1,40 @@ - - - - - Menu Events - jQuery EasyUI Demo - - - - - - - -

      Menu Events

      -

      Right click on page to display menu and click an item.

      -
      -
      -
      New
      -
      Save
      -
      Print
      - -
      Exit
      -
      -
      -
      - - + + + + + Menu Events - jQuery EasyUI Demo + + + + + + + +

      Menu Events

      +

      Right click on page to display menu and click an item.

      +
      +
      +
      New
      +
      Save
      +
      Print
      + +
      Exit
      +
      +
      +
      + + \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo/menu/inline.html b/src/main/webapp/js/easyui/demo/menu/inline.html index e23e3ae..5fa0d99 100644 --- a/src/main/webapp/js/easyui/demo/menu/inline.html +++ b/src/main/webapp/js/easyui/demo/menu/inline.html @@ -1,59 +1,59 @@ - - - - - Inline Menu - jQuery EasyUI Demo - - - - - - - -

      Inline Menu

      -

      The inline menu stays inside its parent container.

      -
      - -
      -
      -
      New
      -
      - Open -
      -
      Word
      -
      Excel
      -
      PowerPoint
      -
      - M1 -
      -
      sub1
      -
      sub2
      -
      - Sub -
      -
      sub21
      -
      sub22
      -
      sub23
      -
      -
      -
      sub3
      -
      -
      -
      - Window Demos -
      -
      Window
      -
      Dialog
      - -
      -
      -
      -
      -
      Save
      -
      Print
      - -
      Exit
      -
      -
      - + + + + + Inline Menu - jQuery EasyUI Demo + + + + + + + +

      Inline Menu

      +

      The inline menu stays inside its parent container.

      +
      + +
      +
      +
      New
      +
      + Open +
      +
      Word
      +
      Excel
      +
      PowerPoint
      +
      + M1 +
      +
      sub1
      +
      sub2
      +
      + Sub +
      +
      sub21
      +
      sub22
      +
      sub23
      +
      +
      +
      sub3
      +
      +
      +
      + Window Demos +
      +
      Window
      +
      Dialog
      + +
      +
      +
      +
      +
      Save
      +
      Print
      + +
      Exit
      +
      +
      + \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo/menubutton/actions.html b/src/main/webapp/js/easyui/demo/menubutton/actions.html index 5d447fe..6623d3d 100644 --- a/src/main/webapp/js/easyui/demo/menubutton/actions.html +++ b/src/main/webapp/js/easyui/demo/menubutton/actions.html @@ -1,58 +1,58 @@ - - - - - MenuButton Actions - jQuery EasyUI Demo - - - - - - - -

      MenuButton Actions

      -

      Click the buttons below to perform actions.

      - -
      - Home - Edit - Help - About -
      -
      -
      Undo
      -
      Redo
      - -
      Cut
      -
      Copy
      -
      Paste
      - -
      - Toolbar -
      -
      Address
      -
      Link
      -
      Navigation Toolbar
      -
      Bookmark Toolbar
      - -
      New Toolbar...
      -
      -
      -
      Delete
      -
      Select All
      -
      -
      -
      Help
      -
      Update
      -
      About
      -
      - - - + + + + + MenuButton Actions - jQuery EasyUI Demo + + + + + + + +

      MenuButton Actions

      +

      Click the buttons below to perform actions.

      + +
      + Home + Edit + Help + About +
      +
      +
      Undo
      +
      Redo
      + +
      Cut
      +
      Copy
      +
      Paste
      + +
      + Toolbar +
      +
      Address
      +
      Link
      +
      Navigation Toolbar
      +
      Bookmark Toolbar
      + +
      New Toolbar...
      +
      +
      +
      Delete
      +
      Select All
      +
      +
      +
      Help
      +
      Update
      +
      About
      +
      + + + \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo/menubutton/alignment.html b/src/main/webapp/js/easyui/demo/menubutton/alignment.html index f34f89a..5362745 100644 --- a/src/main/webapp/js/easyui/demo/menubutton/alignment.html +++ b/src/main/webapp/js/easyui/demo/menubutton/alignment.html @@ -1,69 +1,69 @@ - - - - - Menu Alignment on MenuButton - jQuery EasyUI Demo - - - - - - - -

      Menu Alignment on MenuButton

      -

      This example shows how to change the alignment of the top level menu.

      -
      - Change Alignment: - -
      -
      - Home - Edit - Help - About - -
      -
      -
      Undo
      -
      Redo
      - -
      Cut
      -
      Copy
      -
      Paste
      - -
      - Toolbar -
      -
      Address
      -
      Link
      -
      Navigation Toolbar
      -
      Bookmark Toolbar
      - -
      New Toolbar...
      -
      -
      -
      Delete
      -
      Select All
      -
      -
      -
      Help
      -
      Update
      -
      About
      -
      -
      -
      History
      -
      Faq
      -
      Our Team
      -
      - - + + + + + Menu Alignment on MenuButton - jQuery EasyUI Demo + + + + + + + +

      Menu Alignment on MenuButton

      +

      This example shows how to change the alignment of the top level menu.

      +
      + Change Alignment: + +
      +
      + Home + Edit + Help + About + +
      +
      +
      Undo
      +
      Redo
      + +
      Cut
      +
      Copy
      +
      Paste
      + +
      + Toolbar +
      +
      Address
      +
      Link
      +
      Navigation Toolbar
      +
      Bookmark Toolbar
      + +
      New Toolbar...
      +
      +
      +
      Delete
      +
      Select All
      +
      +
      +
      Help
      +
      Update
      +
      About
      +
      +
      +
      History
      +
      Faq
      +
      Our Team
      +
      + + \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo/menubutton/basic.html b/src/main/webapp/js/easyui/demo/menubutton/basic.html index 932309b..e277296 100644 --- a/src/main/webapp/js/easyui/demo/menubutton/basic.html +++ b/src/main/webapp/js/easyui/demo/menubutton/basic.html @@ -1,54 +1,54 @@ - - - - - Basic MenuButton - jQuery EasyUI Demo - - - - - - - -

      Basic MenuButton

      -

      Move mouse over the button to drop down menu.

      -
      -
      - Home - Edit - Help - About -
      -
      -
      Undo
      -
      Redo
      - -
      Cut
      -
      Copy
      -
      Paste
      - -
      - Toolbar -
      -
      Address
      -
      Link
      -
      Navigation Toolbar
      -
      Bookmark Toolbar
      - -
      New Toolbar...
      -
      -
      -
      Delete
      -
      Select All
      -
      -
      -
      Help
      -
      Update
      -
      About
      -
      - - + + + + + Basic MenuButton - jQuery EasyUI Demo + + + + + + + +

      Basic MenuButton

      +

      Move mouse over the button to drop down menu.

      +
      +
      + Home + Edit + Help + About +
      +
      +
      Undo
      +
      Redo
      + +
      Cut
      +
      Copy
      +
      Paste
      + +
      + Toolbar +
      +
      Address
      +
      Link
      +
      Navigation Toolbar
      +
      Bookmark Toolbar
      + +
      New Toolbar...
      +
      +
      +
      Delete
      +
      Select All
      +
      +
      +
      Help
      +
      Update
      +
      About
      +
      + + \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo/messager/alert.html b/src/main/webapp/js/easyui/demo/messager/alert.html index a69c166..ff7129d 100644 --- a/src/main/webapp/js/easyui/demo/messager/alert.html +++ b/src/main/webapp/js/easyui/demo/messager/alert.html @@ -1,40 +1,40 @@ - - - - - Alert Messager - jQuery EasyUI Demo - - - - - - - -

      Alert Messager

      -

      Click on each button to display different alert message box.

      - - - + + + + + Alert Messager - jQuery EasyUI Demo + + + + + + + +

      Alert Messager

      +

      Click on each button to display different alert message box.

      + + + \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo/messager/basic.html b/src/main/webapp/js/easyui/demo/messager/basic.html index 65026ef..373c7ca 100644 --- a/src/main/webapp/js/easyui/demo/messager/basic.html +++ b/src/main/webapp/js/easyui/demo/messager/basic.html @@ -1,56 +1,56 @@ - - - - - Basic Messager - jQuery EasyUI Demo - - - - - - - -

      Basic Messager

      -

      Click on each button to see a distinct message box.

      -
      - Show - Slide - Fade - Progress -
      - - + + + + + Basic Messager - jQuery EasyUI Demo + + + + + + + +

      Basic Messager

      +

      Click on each button to see a distinct message box.

      +
      + Show + Slide + Fade + Progress +
      + + \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo/messager/interactive.html b/src/main/webapp/js/easyui/demo/messager/interactive.html index e712243..9ba70bf 100644 --- a/src/main/webapp/js/easyui/demo/messager/interactive.html +++ b/src/main/webapp/js/easyui/demo/messager/interactive.html @@ -1,36 +1,36 @@ - - - - - Interactive Messager - jQuery EasyUI Demo - - - - - - - -

      Interactive Messager

      -

      Click on each button to display interactive message box.

      -
      - Confirm - Prompt -
      - - + + + + + Interactive Messager - jQuery EasyUI Demo + + + + + + + +

      Interactive Messager

      +

      Click on each button to display interactive message box.

      +
      + Confirm + Prompt +
      + + \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo/messager/position.html b/src/main/webapp/js/easyui/demo/messager/position.html index 6a6273e..58886f1 100644 --- a/src/main/webapp/js/easyui/demo/messager/position.html +++ b/src/main/webapp/js/easyui/demo/messager/position.html @@ -1,140 +1,140 @@ - - - - - Message Box Position - jQuery EasyUI Demo - - - - - - - -

      Message Box Position

      -

      Click the buttons below to display message box on different position.

      - - - + + + + + Message Box Position - jQuery EasyUI Demo + + + + + + + +

      Message Box Position

      +

      Click the buttons below to display message box on different position.

      + + + \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo/numberbox/basic.html b/src/main/webapp/js/easyui/demo/numberbox/basic.html index 6ff11b7..945c7c1 100644 --- a/src/main/webapp/js/easyui/demo/numberbox/basic.html +++ b/src/main/webapp/js/easyui/demo/numberbox/basic.html @@ -1,24 +1,24 @@ - - - - - Basic NumberBox - jQuery EasyUI Demo - - - - - - - -

      Basic NumberBox

      -

      The NumberBox can only accept inputing numbers.

      -
      -
      -

      List Price:

      - -

      Amount:

      - -
      - - + + + + + Basic NumberBox - jQuery EasyUI Demo + + + + + + + +

      Basic NumberBox

      +

      The NumberBox can only accept inputing numbers.

      +
      +
      +

      List Price:

      + +

      Amount:

      + +
      + + \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo/numberbox/fluid.html b/src/main/webapp/js/easyui/demo/numberbox/fluid.html index 507a59f..8a66bf7 100644 --- a/src/main/webapp/js/easyui/demo/numberbox/fluid.html +++ b/src/main/webapp/js/easyui/demo/numberbox/fluid.html @@ -1,24 +1,24 @@ - - - - - Fluid NumberBox - jQuery EasyUI Demo - - - - - - - -

      Fluid NumberBox

      -

      This example shows how to set the width of NumberBox to a percentage of its parent container.

      -
      -
      -

      width: 100%

      - -

      width: 50%

      - -
      - - + + + + + Fluid NumberBox - jQuery EasyUI Demo + + + + + + + +

      Fluid NumberBox

      +

      This example shows how to set the width of NumberBox to a percentage of its parent container.

      +
      +
      +

      width: 100%

      + +

      width: 50%

      + +
      + + \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo/numberbox/format.html b/src/main/webapp/js/easyui/demo/numberbox/format.html index 6dfe901..ec5b6ff 100644 --- a/src/main/webapp/js/easyui/demo/numberbox/format.html +++ b/src/main/webapp/js/easyui/demo/numberbox/format.html @@ -1,40 +1,40 @@ - - - - - Format NumberBox - jQuery EasyUI Demo - - - - - - - -

      Format NumberBox

      -

      Number formatting is the ability to control how a number is displayed.

      -
      - - - - - - - - - - - - - - - - - - - - - -
      Number in the United States
      Number in France
      Currency:USD
      Currency:EUR
      - - + + + + + Format NumberBox - jQuery EasyUI Demo + + + + + + + +

      Format NumberBox

      +

      Number formatting is the ability to control how a number is displayed.

      +
      + + + + + + + + + + + + + + + + + + + + + +
      Number in the United States
      Number in France
      Currency:USD
      Currency:EUR
      + + \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo/numberbox/range.html b/src/main/webapp/js/easyui/demo/numberbox/range.html index 1bbe75c..f2b96c0 100644 --- a/src/main/webapp/js/easyui/demo/numberbox/range.html +++ b/src/main/webapp/js/easyui/demo/numberbox/range.html @@ -1,25 +1,25 @@ - - - - - Number Range - jQuery EasyUI Demo - - - - - - - -

      Number Range

      -

      The value is constrained to a specified range.

      -
      -
      -

      Amount:

      - -

      Weight:

      - -

      Age:

      - -
      - + + + + + Number Range - jQuery EasyUI Demo + + + + + + + +

      Number Range

      +

      The value is constrained to a specified range.

      +
      +
      +

      Amount:

      + +

      Weight:

      + +

      Age:

      + +
      + \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo/numberspinner/basic.html b/src/main/webapp/js/easyui/demo/numberspinner/basic.html index 38fc05b..a8b8863 100644 --- a/src/main/webapp/js/easyui/demo/numberspinner/basic.html +++ b/src/main/webapp/js/easyui/demo/numberspinner/basic.html @@ -1,25 +1,25 @@ - - - - - Basic NumberSpinner - jQuery EasyUI Demo - - - - - - - -

      Basic NumberSpinner

      -

      Click spinner button to change value.

      -
      - -
      - Value: -
      - + + + + + Basic NumberSpinner - jQuery EasyUI Demo + + + + + + + +

      Basic NumberSpinner

      +

      Click spinner button to change value.

      +
      + +
      + Value: +
      + \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo/numberspinner/fluid.html b/src/main/webapp/js/easyui/demo/numberspinner/fluid.html index 668822d..e0ce155 100644 --- a/src/main/webapp/js/easyui/demo/numberspinner/fluid.html +++ b/src/main/webapp/js/easyui/demo/numberspinner/fluid.html @@ -1,21 +1,21 @@ - - - - - Fluid NumberSpinner - jQuery EasyUI Demo - - - - - - - -

      Fluid NumberSpinner

      -

      This example shows how to set the width of NumberSpinner to a percentage of its parent container.

      -
      -

      width: 50%

      - -

      width: 30%

      - - + + + + + Fluid NumberSpinner - jQuery EasyUI Demo + + + + + + + +

      Fluid NumberSpinner

      +

      This example shows how to set the width of NumberSpinner to a percentage of its parent container.

      +
      +

      width: 50%

      + +

      width: 30%

      + + \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo/numberspinner/increment.html b/src/main/webapp/js/easyui/demo/numberspinner/increment.html index 7562573..95b5a5f 100644 --- a/src/main/webapp/js/easyui/demo/numberspinner/increment.html +++ b/src/main/webapp/js/easyui/demo/numberspinner/increment.html @@ -1,18 +1,18 @@ - - - - - Increment Number - jQuery EasyUI Demo - - - - - - - -

      Increment Number

      -

      The sample shows how to set the increment step.

      -
      - - + + + + + Increment Number - jQuery EasyUI Demo + + + + + + + +

      Increment Number

      +

      The sample shows how to set the increment step.

      +
      + + \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo/numberspinner/range.html b/src/main/webapp/js/easyui/demo/numberspinner/range.html index f31d81c..00e1307 100644 --- a/src/main/webapp/js/easyui/demo/numberspinner/range.html +++ b/src/main/webapp/js/easyui/demo/numberspinner/range.html @@ -1,18 +1,18 @@ - - - - - Number Range - jQuery EasyUI Demo - - - - - - - -

      Number Range

      -

      The value is constrained to a range between 10 and 100.

      -
      - - + + + + + Number Range - jQuery EasyUI Demo + + + + + + + +

      Number Range

      +

      The value is constrained to a range between 10 and 100.

      +
      + + \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo/pagination/attaching.html b/src/main/webapp/js/easyui/demo/pagination/attaching.html index 0e56bb3..5c87427 100644 --- a/src/main/webapp/js/easyui/demo/pagination/attaching.html +++ b/src/main/webapp/js/easyui/demo/pagination/attaching.html @@ -1,32 +1,32 @@ - - - - - Attaching Other Components - jQuery EasyUI Demo - - - - - - - -

      Attaching Other Components

      -

      Any other components can be attached to page bar.

      -
      -
      -
      -
      -
      - - - - - -
      - - - -
      -
      - + + + + + Attaching Other Components - jQuery EasyUI Demo + + + + + + + +

      Attaching Other Components

      +

      Any other components can be attached to page bar.

      +
      +
      +
      +
      +
      + + + + + +
      + + + +
      +
      + \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo/pagination/basic.html b/src/main/webapp/js/easyui/demo/pagination/basic.html index bcdba63..98f7c49 100644 --- a/src/main/webapp/js/easyui/demo/pagination/basic.html +++ b/src/main/webapp/js/easyui/demo/pagination/basic.html @@ -1,20 +1,20 @@ - - - - - Basic Pagination - jQuery EasyUI Demo - - - - - - - -

      Basic Pagination

      -

      The user can change page number and page size on page bar.

      -
      -
      -
      -
      - + + + + + Basic Pagination - jQuery EasyUI Demo + + + + + + + +

      Basic Pagination

      +

      The user can change page number and page size on page bar.

      +
      +
      +
      +
      + \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo/pagination/custombuttons.html b/src/main/webapp/js/easyui/demo/pagination/custombuttons.html index 113e921..2a75b88 100644 --- a/src/main/webapp/js/easyui/demo/pagination/custombuttons.html +++ b/src/main/webapp/js/easyui/demo/pagination/custombuttons.html @@ -1,38 +1,38 @@ - - - - - Custom Pagination Buttons - jQuery EasyUI Demo - - - - - - - -

      Custom Pagination Buttons

      -

      The customized buttons can be appended to page bar.

      -
      -
      -
      -
      - - + + + + + Custom Pagination Buttons - jQuery EasyUI Demo + + + + + + + +

      Custom Pagination Buttons

      +

      The customized buttons can be appended to page bar.

      +
      +
      +
      +
      + + \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo/pagination/layout.html b/src/main/webapp/js/easyui/demo/pagination/layout.html index 1288397..dcb679a 100644 --- a/src/main/webapp/js/easyui/demo/pagination/layout.html +++ b/src/main/webapp/js/easyui/demo/pagination/layout.html @@ -1,62 +1,62 @@ - - - - - Pagination Layout - jQuery EasyUI Demo - - - - - - - -

      Pagination Layout

      -

      The pagination layout supports various types of pages which you can choose.

      -
      -
      -
      -
      -
      - -
      - - + + + + + Pagination Layout - jQuery EasyUI Demo + + + + + + + +

      Pagination Layout

      +

      The pagination layout supports various types of pages which you can choose.

      +
      +
      +
      +
      +
      + +
      + + \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo/pagination/links.html b/src/main/webapp/js/easyui/demo/pagination/links.html index 3b7ee25..5ec8b38 100644 --- a/src/main/webapp/js/easyui/demo/pagination/links.html +++ b/src/main/webapp/js/easyui/demo/pagination/links.html @@ -1,23 +1,23 @@ - - - - - Pagination Links - jQuery EasyUI Demo - - - - - - - -

      Pagination Links

      -

      The example shows how to customize numbered pagination links.

      -
      -
      -
      -
      - + + + + + Pagination Links - jQuery EasyUI Demo + + + + + + + +

      Pagination Links

      +

      The example shows how to customize numbered pagination links.

      +
      +
      +
      +
      + \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo/pagination/simple.html b/src/main/webapp/js/easyui/demo/pagination/simple.html index 521f75f..ca59ae2 100644 --- a/src/main/webapp/js/easyui/demo/pagination/simple.html +++ b/src/main/webapp/js/easyui/demo/pagination/simple.html @@ -1,25 +1,25 @@ - - - - - Simplify Pagination - jQuery EasyUI Demo - - - - - - - -

      Simplify Pagination

      -

      The sample shows how to simplify pagination.

      -
      -
      -
      -
      - + + + + + Simplify Pagination - jQuery EasyUI Demo + + + + + + + +

      Simplify Pagination

      +

      The sample shows how to simplify pagination.

      +
      +
      +
      +
      + \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo/panel/_content.html b/src/main/webapp/js/easyui/demo/panel/_content.html index 9967402..f7b8e2e 100644 --- a/src/main/webapp/js/easyui/demo/panel/_content.html +++ b/src/main/webapp/js/easyui/demo/panel/_content.html @@ -1,18 +1,18 @@ - - - - - AJAX Content - - -

      Here is the content loaded via AJAX.

      -
        -
      • easyui is a collection of user-interface plugin based on jQuery.
      • -
      • easyui provides essential functionality for building modern, interactive, javascript applications.
      • -
      • using easyui you don't need to write many javascript code, you usually defines user-interface by writing some HTML markup.
      • -
      • complete framework for HTML5 web page.
      • -
      • easyui save your time and scales while developing your products.
      • -
      • easyui is very easy but powerful.
      • -
      - + + + + + AJAX Content + + +

      Here is the content loaded via AJAX.

      +
        +
      • easyui is a collection of user-interface plugin based on jQuery.
      • +
      • easyui provides essential functionality for building modern, interactive, javascript applications.
      • +
      • using easyui you don't need to write many javascript code, you usually defines user-interface by writing some HTML markup.
      • +
      • complete framework for HTML5 web page.
      • +
      • easyui save your time and scales while developing your products.
      • +
      • easyui is very easy but powerful.
      • +
      + \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo/panel/basic.html b/src/main/webapp/js/easyui/demo/panel/basic.html index ec0e535..e2220df 100644 --- a/src/main/webapp/js/easyui/demo/panel/basic.html +++ b/src/main/webapp/js/easyui/demo/panel/basic.html @@ -1,31 +1,31 @@ - - - - - Basic Panel - jQuery EasyUI Demo - - - - - - - -

      Basic Panel

      -

      The panel is a container for other components or elements.

      -
      - Open - Close -
      -
      -

      jQuery EasyUI framework helps you build your web pages easily.

      -
        -
      • easyui is a collection of user-interface plugin based on jQuery.
      • -
      • easyui provides essential functionality for building modem, interactive, javascript applications.
      • -
      • using easyui you don't need to write many javascript code, you usually defines user-interface by writing some HTML markup.
      • -
      • complete framework for HTML5 web page.
      • -
      • easyui save your time and scales while developing your products.
      • -
      • easyui is very easy but powerful.
      • -
      -
      - + + + + + Basic Panel - jQuery EasyUI Demo + + + + + + + +

      Basic Panel

      +

      The panel is a container for other components or elements.

      +
      + Open + Close +
      +
      +

      jQuery EasyUI framework helps you build your web pages easily.

      +
        +
      • easyui is a collection of user-interface plugin based on jQuery.
      • +
      • easyui provides essential functionality for building modem, interactive, javascript applications.
      • +
      • using easyui you don't need to write many javascript code, you usually defines user-interface by writing some HTML markup.
      • +
      • complete framework for HTML5 web page.
      • +
      • easyui save your time and scales while developing your products.
      • +
      • easyui is very easy but powerful.
      • +
      +
      + \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo/panel/customtools.html b/src/main/webapp/js/easyui/demo/panel/customtools.html index 670001e..299b7fa 100644 --- a/src/main/webapp/js/easyui/demo/panel/customtools.html +++ b/src/main/webapp/js/easyui/demo/panel/customtools.html @@ -1,35 +1,35 @@ - - - - - Custom Panel Tools - jQuery EasyUI Demo - - - - - - - -

      Custom Panel Tools

      -

      Click the right top buttons to perform actions with panel.

      -
      -
      -

      jQuery EasyUI framework helps you build your web pages easily.

      -
        -
      • easyui is a collection of user-interface plugin based on jQuery.
      • -
      • easyui provides essential functionality for building modem, interactive, javascript applications.
      • -
      • using easyui you don't need to write many javascript code, you usually defines user-interface by writing some HTML markup.
      • -
      • complete framework for HTML5 web page.
      • -
      • easyui save your time and scales while developing your products.
      • -
      • easyui is very easy but powerful.
      • -
      -
      -
      - - - - -
      - + + + + + Custom Panel Tools - jQuery EasyUI Demo + + + + + + + +

      Custom Panel Tools

      +

      Click the right top buttons to perform actions with panel.

      +
      +
      +

      jQuery EasyUI framework helps you build your web pages easily.

      +
        +
      • easyui is a collection of user-interface plugin based on jQuery.
      • +
      • easyui provides essential functionality for building modem, interactive, javascript applications.
      • +
      • using easyui you don't need to write many javascript code, you usually defines user-interface by writing some HTML markup.
      • +
      • complete framework for HTML5 web page.
      • +
      • easyui save your time and scales while developing your products.
      • +
      • easyui is very easy but powerful.
      • +
      +
      +
      + + + + +
      + \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo/panel/fluid.html b/src/main/webapp/js/easyui/demo/panel/fluid.html index 72510f2..ff2be88 100644 --- a/src/main/webapp/js/easyui/demo/panel/fluid.html +++ b/src/main/webapp/js/easyui/demo/panel/fluid.html @@ -1,21 +1,21 @@ - - - - - Fluid Panel - jQuery EasyUI Demo - - - - - - - -

      Fluid Panel

      -

      This example shows how to set the width of Panel to a percentage of its parent container.

      -
      -
      -
      -

      The panel has a width of 100%.

      -

      - + + + + + Fluid Panel - jQuery EasyUI Demo + + + + + + + +

      Fluid Panel

      +

      This example shows how to set the width of Panel to a percentage of its parent container.

      +
      +
      +
      +

      The panel has a width of 100%.

      +

      + \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo/panel/footer.html b/src/main/webapp/js/easyui/demo/panel/footer.html index 31e6385..e04a87b 100644 --- a/src/main/webapp/js/easyui/demo/panel/footer.html +++ b/src/main/webapp/js/easyui/demo/panel/footer.html @@ -1,22 +1,22 @@ - - - - - Panel Footer - jQuery EasyUI Demo - - - - - - - -

      Panel Footer

      -

      The panel footer is displayed at the bottom of the panel and can consist of any other components.

      -
      -
      -
      - - + + + + + Panel Footer - jQuery EasyUI Demo + + + + + + + +

      Panel Footer

      +

      The panel footer is displayed at the bottom of the panel and can consist of any other components.

      +
      +
      +
      + + \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo/panel/loadcontent.html b/src/main/webapp/js/easyui/demo/panel/loadcontent.html index 6db638d..c4b1417 100644 --- a/src/main/webapp/js/easyui/demo/panel/loadcontent.html +++ b/src/main/webapp/js/easyui/demo/panel/loadcontent.html @@ -1,27 +1,27 @@ - - - - - Load Panel Content - jQuery EasyUI Demo - - - - - - - -

      Load Panel Content

      -

      Click the refresh button on top right of panel to load content.

      -
      -
      -
      - + + + + + Load Panel Content - jQuery EasyUI Demo + + + + + + + +

      Load Panel Content

      +

      Click the refresh button on top right of panel to load content.

      +
      +
      +
      + \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo/panel/nestedpanel.html b/src/main/webapp/js/easyui/demo/panel/nestedpanel.html index 28f5170..a2c1320 100644 --- a/src/main/webapp/js/easyui/demo/panel/nestedpanel.html +++ b/src/main/webapp/js/easyui/demo/panel/nestedpanel.html @@ -1,30 +1,30 @@ - - - - - Nested Panel - jQuery EasyUI Demo - - - - - - - -

      Nested Panel

      -

      The panel can be placed inside containers and can contain other components.

      -
      -
      -
      -
      - Left Content -
      -
      - Right Content -
      -
      - Center Content -
      -
      -
      - + + + + + Nested Panel - jQuery EasyUI Demo + + + + + + + +

      Nested Panel

      +

      The panel can be placed inside containers and can contain other components.

      +
      +
      +
      +
      + Left Content +
      +
      + Right Content +
      +
      + Center Content +
      +
      +
      + \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo/panel/paneltools.html b/src/main/webapp/js/easyui/demo/panel/paneltools.html index 47efc11..eb0d87f 100644 --- a/src/main/webapp/js/easyui/demo/panel/paneltools.html +++ b/src/main/webapp/js/easyui/demo/panel/paneltools.html @@ -1,37 +1,37 @@ - - - - - Panel Tools - jQuery EasyUI Demo - - - - - - - -

      Panel Tools

      -

      Click the right top buttons to perform actions with panel.

      - -
      -
      -

      jQuery EasyUI framework helps you build your web pages easily.

      -
        -
      • easyui is a collection of user-interface plugin based on jQuery.
      • -
      • easyui provides essential functionality for building modem, interactive, javascript applications.
      • -
      • using easyui you don't need to write many javascript code, you usually defines user-interface by writing some HTML markup.
      • -
      • complete framework for HTML5 web page.
      • -
      • easyui save your time and scales while developing your products.
      • -
      • easyui is very easy but powerful.
      • -
      -
      -
      - - + + + + + Panel Tools - jQuery EasyUI Demo + + + + + + + +

      Panel Tools

      +

      Click the right top buttons to perform actions with panel.

      + +
      +
      +

      jQuery EasyUI framework helps you build your web pages easily.

      +
        +
      • easyui is a collection of user-interface plugin based on jQuery.
      • +
      • easyui provides essential functionality for building modem, interactive, javascript applications.
      • +
      • using easyui you don't need to write many javascript code, you usually defines user-interface by writing some HTML markup.
      • +
      • complete framework for HTML5 web page.
      • +
      • easyui save your time and scales while developing your products.
      • +
      • easyui is very easy but powerful.
      • +
      +
      +
      + + \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo/progressbar/basic.html b/src/main/webapp/js/easyui/demo/progressbar/basic.html index 966d556..910777b 100644 --- a/src/main/webapp/js/easyui/demo/progressbar/basic.html +++ b/src/main/webapp/js/easyui/demo/progressbar/basic.html @@ -1,30 +1,30 @@ - - - - - Basic ProgressBar - jQuery EasyUI Demo - - - - - - - -

      Basic ProgressBar

      -

      Click the button below to show progress information.

      -
      - Start -
      -
      - - + + + + + Basic ProgressBar - jQuery EasyUI Demo + + + + + + + +

      Basic ProgressBar

      +

      Click the button below to show progress information.

      +
      + Start +
      +
      + + \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo/progressbar/fluid.html b/src/main/webapp/js/easyui/demo/progressbar/fluid.html index 613e180..de88af2 100644 --- a/src/main/webapp/js/easyui/demo/progressbar/fluid.html +++ b/src/main/webapp/js/easyui/demo/progressbar/fluid.html @@ -1,21 +1,21 @@ - - - - - Fluid ProgressBar - jQuery EasyUI Demo - - - - - - - -

      Fluid ProgressBar

      -

      This example shows how to set the width of ProgressBar to a percentage of its parent container.

      -
      -

      width: 50%

      -
      -

      width: 30%

      -
      - + + + + + Fluid ProgressBar - jQuery EasyUI Demo + + + + + + + +

      Fluid ProgressBar

      +

      This example shows how to set the width of ProgressBar to a percentage of its parent container.

      +
      +

      width: 50%

      +
      +

      width: 30%

      +
      + \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo/propertygrid/basic.html b/src/main/webapp/js/easyui/demo/propertygrid/basic.html index 8f7743c..a7c3cb5 100644 --- a/src/main/webapp/js/easyui/demo/propertygrid/basic.html +++ b/src/main/webapp/js/easyui/demo/propertygrid/basic.html @@ -1,61 +1,61 @@ - - - - - Basic PropertyGrid - jQuery EasyUI Demo - - - - - - - -

      Basic PropertyGrid

      -

      Click on row to change each property value.

      - - -
      - - - + + + + + Basic PropertyGrid - jQuery EasyUI Demo + + + + + + + +

      Basic PropertyGrid

      +

      Click on row to change each property value.

      + + +
      + + + \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo/propertygrid/customcolumns.html b/src/main/webapp/js/easyui/demo/propertygrid/customcolumns.html index 0a683ef..a8aabd3 100644 --- a/src/main/webapp/js/easyui/demo/propertygrid/customcolumns.html +++ b/src/main/webapp/js/easyui/demo/propertygrid/customcolumns.html @@ -1,31 +1,31 @@ - - - - - Customize Columns of PropertyGrid - jQuery EasyUI Demo - - - - - - - -

      Customize Columns of PropertyGrid

      -

      The columns of PropertyGrid can be changed.

      -
      - -
      - - + + + + + Customize Columns of PropertyGrid - jQuery EasyUI Demo + + + + + + + +

      Customize Columns of PropertyGrid

      +

      The columns of PropertyGrid can be changed.

      +
      + +
      + + \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo/propertygrid/groupformat.html b/src/main/webapp/js/easyui/demo/propertygrid/groupformat.html index d4eb883..27cc305 100644 --- a/src/main/webapp/js/easyui/demo/propertygrid/groupformat.html +++ b/src/main/webapp/js/easyui/demo/propertygrid/groupformat.html @@ -1,30 +1,30 @@ - - - - - Group Format - jQuery EasyUI Demo - - - - - - - -

      Group Format

      -

      The user can change the group information.

      -
      - -
      - - + + + + + Group Format - jQuery EasyUI Demo + + + + + + + +

      Group Format

      +

      The user can change the group information.

      +
      + +
      + + \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo/propertygrid/propertygrid_data1.json b/src/main/webapp/js/easyui/demo/propertygrid/propertygrid_data1.json index a458d83..12b2d00 100644 --- a/src/main/webapp/js/easyui/demo/propertygrid/propertygrid_data1.json +++ b/src/main/webapp/js/easyui/demo/propertygrid/propertygrid_data1.json @@ -1,20 +1,20 @@ -{"total":7,"rows":[ - {"name":"Name","value":"Bill Smith","group":"ID Settings","editor":"text"}, - {"name":"Address","value":"","group":"ID Settings","editor":"text"}, - {"name":"Age","value":"40","group":"ID Settings","editor":"numberbox"}, - {"name":"Birthday","value":"01/02/2012","group":"ID Settings","editor":"datebox"}, - {"name":"SSN","value":"123-456-7890","group":"ID Settings","editor":"text"}, - {"name":"Email","value":"bill@gmail.com","group":"Marketing Settings","editor":{ - "type":"validatebox", - "options":{ - "validType":"email" - } - }}, - {"name":"FrequentBuyer","value":"false","group":"Marketing Settings","editor":{ - "type":"checkbox", - "options":{ - "on":true, - "off":false - } - }} +{"total":7,"rows":[ + {"name":"Name","value":"Bill Smith","group":"ID Settings","editor":"text"}, + {"name":"Address","value":"","group":"ID Settings","editor":"text"}, + {"name":"Age","value":"40","group":"ID Settings","editor":"numberbox"}, + {"name":"Birthday","value":"01/02/2012","group":"ID Settings","editor":"datebox"}, + {"name":"SSN","value":"123-456-7890","group":"ID Settings","editor":"text"}, + {"name":"Email","value":"bill@gmail.com","group":"Marketing Settings","editor":{ + "type":"validatebox", + "options":{ + "validType":"email" + } + }}, + {"name":"FrequentBuyer","value":"false","group":"Marketing Settings","editor":{ + "type":"checkbox", + "options":{ + "on":true, + "off":false + } + }} ]} \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo/resizable/basic.html b/src/main/webapp/js/easyui/demo/resizable/basic.html index 7b9e747..a4d5a61 100644 --- a/src/main/webapp/js/easyui/demo/resizable/basic.html +++ b/src/main/webapp/js/easyui/demo/resizable/basic.html @@ -1,24 +1,24 @@ - - - - - Basic Resizable - jQuery EasyUI Demo - - - - - - - -

      Basic Resizable

      -

      Click on the edge of box and move the edge to resize the box.

      -
      -
      -
      Resize Me
      -
      -
      -
      Title
      -
      Drag and Resize Me
      -
      - + + + + + Basic Resizable - jQuery EasyUI Demo + + + + + + + +

      Basic Resizable

      +

      Click on the edge of box and move the edge to resize the box.

      +
      +
      +
      Resize Me
      +
      +
      +
      Title
      +
      Drag and Resize Me
      +
      + \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo/searchbox/basic.html b/src/main/webapp/js/easyui/demo/searchbox/basic.html index a4f0151..1eb5275 100644 --- a/src/main/webapp/js/easyui/demo/searchbox/basic.html +++ b/src/main/webapp/js/easyui/demo/searchbox/basic.html @@ -1,23 +1,23 @@ - - - - - Basic SearchBox - jQuery EasyUI Demo - - - - - - - -

      Basic SearchBox

      -

      Click search button or press enter key in input box to do searching.

      -
      - - - + + + + + Basic SearchBox - jQuery EasyUI Demo + + + + + + + +

      Basic SearchBox

      +

      Click search button or press enter key in input box to do searching.

      +
      + + + \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo/searchbox/category.html b/src/main/webapp/js/easyui/demo/searchbox/category.html index dad4476..5a2b866 100644 --- a/src/main/webapp/js/easyui/demo/searchbox/category.html +++ b/src/main/webapp/js/easyui/demo/searchbox/category.html @@ -1,28 +1,28 @@ - - - - - Search Category - jQuery EasyUI Demo - - - - - - - -

      Search Category

      -

      Select a category and click search button or press enter key in input box to do searching.

      -
      - -
      -
      All News
      -
      Sports News
      -
      - - - + + + + + Search Category - jQuery EasyUI Demo + + + + + + + +

      Search Category

      +

      Select a category and click search button or press enter key in input box to do searching.

      +
      + +
      +
      All News
      +
      Sports News
      +
      + + + \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo/searchbox/fluid.html b/src/main/webapp/js/easyui/demo/searchbox/fluid.html index 8539c5b..946aaff 100644 --- a/src/main/webapp/js/easyui/demo/searchbox/fluid.html +++ b/src/main/webapp/js/easyui/demo/searchbox/fluid.html @@ -1,25 +1,25 @@ - - - - - Fluid SearchBox - jQuery EasyUI Demo - - - - - - - -

      Fluid SearchBox

      -

      This example shows how to set the width of SearchBox to a percentage of its parent container.

      -
      -

      width: 50%

      - -

      width: 30%

      - -
      -
      All News
      -
      Sports News
      -
      - + + + + + Fluid SearchBox - jQuery EasyUI Demo + + + + + + + +

      Fluid SearchBox

      +

      This example shows how to set the width of SearchBox to a percentage of its parent container.

      +
      +

      width: 50%

      + +

      width: 30%

      + +
      +
      All News
      +
      Sports News
      +
      + \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo/slider/basic.html b/src/main/webapp/js/easyui/demo/slider/basic.html index a71f0e4..e2a0f59 100644 --- a/src/main/webapp/js/easyui/demo/slider/basic.html +++ b/src/main/webapp/js/easyui/demo/slider/basic.html @@ -1,18 +1,18 @@ - - - - - Basic Slider - jQuery EasyUI Demo - - - - - - - -

      Basic Slider

      -

      Drag the slider to change value.

      -
      - - + + + + + Basic Slider - jQuery EasyUI Demo + + + + + + + +

      Basic Slider

      +

      Drag the slider to change value.

      +
      + + \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo/slider/fluid.html b/src/main/webapp/js/easyui/demo/slider/fluid.html index 7459276..17ff2dd 100644 --- a/src/main/webapp/js/easyui/demo/slider/fluid.html +++ b/src/main/webapp/js/easyui/demo/slider/fluid.html @@ -1,21 +1,21 @@ - - - - - Fluid Slider - jQuery EasyUI Demo - - - - - - - -

      Fluid Slider

      -

      This example shows how to set the width of Slider to a percentage of its parent container.

      -
      -

      width: 50%

      - -

      width: 30%

      - - + + + + + Fluid Slider - jQuery EasyUI Demo + + + + + + + +

      Fluid Slider

      +

      This example shows how to set the width of Slider to a percentage of its parent container.

      +
      +

      width: 50%

      + +

      width: 30%

      + + \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo/slider/formattip.html b/src/main/webapp/js/easyui/demo/slider/formattip.html index 6b5c398..f0d666b 100644 --- a/src/main/webapp/js/easyui/demo/slider/formattip.html +++ b/src/main/webapp/js/easyui/demo/slider/formattip.html @@ -1,28 +1,28 @@ - - - - - Format Tip Information - jQuery EasyUI Demo - - - - - - - -

      Format Tip Information

      -

      This sample shows how to format tip information.

      -
      - -
      jQuery EasyUI
      - - + + + + + Format Tip Information - jQuery EasyUI Demo + + + + + + + +

      Format Tip Information

      +

      This sample shows how to format tip information.

      +
      + +
      jQuery EasyUI
      + + \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo/slider/nonlinear.html b/src/main/webapp/js/easyui/demo/slider/nonlinear.html index b07c61b..7570833 100644 --- a/src/main/webapp/js/easyui/demo/slider/nonlinear.html +++ b/src/main/webapp/js/easyui/demo/slider/nonlinear.html @@ -1,58 +1,58 @@ - - - - - Non Linear Slider - jQuery EasyUI Demo - - - - - - - -

      Non Linear Slider

      -

      This example shows how to create a slider with a non-linear scale.

      -
      -
      - -
      -
      -
      -
      - - - + + + + + Non Linear Slider - jQuery EasyUI Demo + + + + + + + +

      Non Linear Slider

      +

      This example shows how to create a slider with a non-linear scale.

      +
      +
      + +
      +
      +
      +
      + + + \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo/slider/range.html b/src/main/webapp/js/easyui/demo/slider/range.html index 67398d1..0120ce0 100644 --- a/src/main/webapp/js/easyui/demo/slider/range.html +++ b/src/main/webapp/js/easyui/demo/slider/range.html @@ -1,23 +1,23 @@ - - - - - Range Slider - jQuery EasyUI Demo - - - - - - - -

      Range Slider

      -

      This sample shows how to define a range slider.

      -
      - - + + + + + Range Slider - jQuery EasyUI Demo + + + + + + + +

      Range Slider

      +

      This sample shows how to define a range slider.

      +
      + + \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo/slider/rule.html b/src/main/webapp/js/easyui/demo/slider/rule.html index 652b4e5..6f0e08c 100644 --- a/src/main/webapp/js/easyui/demo/slider/rule.html +++ b/src/main/webapp/js/easyui/demo/slider/rule.html @@ -1,21 +1,21 @@ - - - - - Slider Rule - jQuery EasyUI Demo - - - - - - - -

      Slider Rule

      -

      This sample shows how to define slider rule.

      -
      - - + + + + + Slider Rule - jQuery EasyUI Demo + + + + + + + +

      Slider Rule

      +

      This sample shows how to define slider rule.

      +
      + + \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo/slider/vertical.html b/src/main/webapp/js/easyui/demo/slider/vertical.html index 59d3b49..6bc8b59 100644 --- a/src/main/webapp/js/easyui/demo/slider/vertical.html +++ b/src/main/webapp/js/easyui/demo/slider/vertical.html @@ -1,25 +1,25 @@ - - - - - Vertical Slider - jQuery EasyUI Demo - - - - - - - -

      Vertical Slider

      -

      This sample shows how to create a vertical slider.

      -
      -
      - -
      - + + + + + Vertical Slider - jQuery EasyUI Demo + + + + + + + +

      Vertical Slider

      +

      This sample shows how to create a vertical slider.

      +
      +
      + +
      + \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo/splitbutton/actions.html b/src/main/webapp/js/easyui/demo/splitbutton/actions.html index 3110484..0fa343e 100644 --- a/src/main/webapp/js/easyui/demo/splitbutton/actions.html +++ b/src/main/webapp/js/easyui/demo/splitbutton/actions.html @@ -1,64 +1,64 @@ - - - - - SplitButton Actions - jQuery EasyUI Demo - - - - - - - -

      SplitButton Actions

      -

      Click the buttons below to perform actions.

      - -
      - Home - Edit - Ok - Help -
      -
      -
      Undo
      -
      Redo
      - -
      Cut
      -
      Copy
      -
      Paste
      - -
      - Toolbar -
      -
      Address
      -
      Link
      -
      Navigation Toolbar
      -
      Bookmark Toolbar
      - -
      New Toolbar...
      -
      -
      -
      Delete
      -
      Select All
      -
      -
      -
      Ok
      -
      Cancel
      -
      -
      -
      Help
      -
      Update
      -
      - About - -
      -
      - - + + + + + SplitButton Actions - jQuery EasyUI Demo + + + + + + + +

      SplitButton Actions

      +

      Click the buttons below to perform actions.

      + +
      + Home + Edit + Ok + Help +
      +
      +
      Undo
      +
      Redo
      + +
      Cut
      +
      Copy
      +
      Paste
      + +
      + Toolbar +
      +
      Address
      +
      Link
      +
      Navigation Toolbar
      +
      Bookmark Toolbar
      + +
      New Toolbar...
      +
      +
      +
      Delete
      +
      Select All
      +
      +
      +
      Ok
      +
      Cancel
      +
      +
      +
      Help
      +
      Update
      +
      + About + +
      +
      + + \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo/splitbutton/basic.html b/src/main/webapp/js/easyui/demo/splitbutton/basic.html index 795d526..2f31ec1 100644 --- a/src/main/webapp/js/easyui/demo/splitbutton/basic.html +++ b/src/main/webapp/js/easyui/demo/splitbutton/basic.html @@ -1,61 +1,61 @@ - - - - - Basic SplitButton - jQuery EasyUI Demo - - - - - - - -

      Basic SplitButton

      -

      Move mouse over the arrow area of button to drop down menu.

      -
      -
      - Home - Edit - Ok - Help -
      -
      -
      Undo
      -
      Redo
      - -
      Cut
      -
      Copy
      -
      Paste
      - -
      - Toolbar -
      -
      Address
      -
      Link
      -
      Navigation Toolbar
      -
      Bookmark Toolbar
      - -
      New Toolbar...
      -
      -
      -
      Delete
      -
      Select All
      -
      -
      -
      Ok
      -
      Cancel
      -
      -
      -
      Help
      -
      Update
      -
      - About - -
      -
      - - + + + + + Basic SplitButton - jQuery EasyUI Demo + + + + + + + +

      Basic SplitButton

      +

      Move mouse over the arrow area of button to drop down menu.

      +
      +
      + Home + Edit + Ok + Help +
      +
      +
      Undo
      +
      Redo
      + +
      Cut
      +
      Copy
      +
      Paste
      + +
      + Toolbar +
      +
      Address
      +
      Link
      +
      Navigation Toolbar
      +
      Bookmark Toolbar
      + +
      New Toolbar...
      +
      +
      +
      Delete
      +
      Select All
      +
      +
      +
      Ok
      +
      Cancel
      +
      +
      +
      Help
      +
      Update
      +
      + About + +
      +
      + + \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo/tabs/_content.html b/src/main/webapp/js/easyui/demo/tabs/_content.html index 9967402..f7b8e2e 100644 --- a/src/main/webapp/js/easyui/demo/tabs/_content.html +++ b/src/main/webapp/js/easyui/demo/tabs/_content.html @@ -1,18 +1,18 @@ - - - - - AJAX Content - - -

      Here is the content loaded via AJAX.

      -
        -
      • easyui is a collection of user-interface plugin based on jQuery.
      • -
      • easyui provides essential functionality for building modern, interactive, javascript applications.
      • -
      • using easyui you don't need to write many javascript code, you usually defines user-interface by writing some HTML markup.
      • -
      • complete framework for HTML5 web page.
      • -
      • easyui save your time and scales while developing your products.
      • -
      • easyui is very easy but powerful.
      • -
      - + + + + + AJAX Content + + +

      Here is the content loaded via AJAX.

      +
        +
      • easyui is a collection of user-interface plugin based on jQuery.
      • +
      • easyui provides essential functionality for building modern, interactive, javascript applications.
      • +
      • using easyui you don't need to write many javascript code, you usually defines user-interface by writing some HTML markup.
      • +
      • complete framework for HTML5 web page.
      • +
      • easyui save your time and scales while developing your products.
      • +
      • easyui is very easy but powerful.
      • +
      + \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo/tabs/autoheight.html b/src/main/webapp/js/easyui/demo/tabs/autoheight.html index 8fd287a..e34a3dc 100644 --- a/src/main/webapp/js/easyui/demo/tabs/autoheight.html +++ b/src/main/webapp/js/easyui/demo/tabs/autoheight.html @@ -1,36 +1,36 @@ - - - - - Auto Height for Tabs - jQuery EasyUI Demo - - - - - - - -

      Auto Height for Tabs

      -

      The tabs height is auto adjusted according to tab panel content.

      -
      -
      -
      -

      jQuery EasyUI framework helps you build your web pages easily.

      -
        -
      • easyui is a collection of user-interface plugin based on jQuery.
      • -
      • easyui provides essential functionality for building modem, interactive, javascript applications.
      • -
      • using easyui you don't need to write many javascript code, you usually defines user-interface by writing some HTML markup.
      • -
      • complete framework for HTML5 web page.
      • -
      • easyui save your time and scales while developing your products.
      • -
      • easyui is very easy but powerful.
      • -
      -
      -
      -
        -
        -
        - This is the help content. -
        -
        - + + + + + Auto Height for Tabs - jQuery EasyUI Demo + + + + + + + +

        Auto Height for Tabs

        +

        The tabs height is auto adjusted according to tab panel content.

        +
        +
        +
        +

        jQuery EasyUI framework helps you build your web pages easily.

        +
          +
        • easyui is a collection of user-interface plugin based on jQuery.
        • +
        • easyui provides essential functionality for building modem, interactive, javascript applications.
        • +
        • using easyui you don't need to write many javascript code, you usually defines user-interface by writing some HTML markup.
        • +
        • complete framework for HTML5 web page.
        • +
        • easyui save your time and scales while developing your products.
        • +
        • easyui is very easy but powerful.
        • +
        +
        +
        +
          +
          +
          + This is the help content. +
          +
          + \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo/tabs/basic.html b/src/main/webapp/js/easyui/demo/tabs/basic.html index c5a7ce6..293b91c 100644 --- a/src/main/webapp/js/easyui/demo/tabs/basic.html +++ b/src/main/webapp/js/easyui/demo/tabs/basic.html @@ -1,36 +1,36 @@ - - - - - Basic Tabs - jQuery EasyUI Demo - - - - - - - -

          Basic Tabs

          -

          Click tab strip to swap tab panel content.

          -
          -
          -
          -

          jQuery EasyUI framework helps you build your web pages easily.

          -
            -
          • easyui is a collection of user-interface plugin based on jQuery.
          • -
          • easyui provides essential functionality for building modem, interactive, javascript applications.
          • -
          • using easyui you don't need to write many javascript code, you usually defines user-interface by writing some HTML markup.
          • -
          • complete framework for HTML5 web page.
          • -
          • easyui save your time and scales while developing your products.
          • -
          • easyui is very easy but powerful.
          • -
          -
          -
          -
            -
            -
            - This is the help content. -
            -
            - + + + + + Basic Tabs - jQuery EasyUI Demo + + + + + + + +

            Basic Tabs

            +

            Click tab strip to swap tab panel content.

            +
            +
            +
            +

            jQuery EasyUI framework helps you build your web pages easily.

            +
              +
            • easyui is a collection of user-interface plugin based on jQuery.
            • +
            • easyui provides essential functionality for building modem, interactive, javascript applications.
            • +
            • using easyui you don't need to write many javascript code, you usually defines user-interface by writing some HTML markup.
            • +
            • complete framework for HTML5 web page.
            • +
            • easyui save your time and scales while developing your products.
            • +
            • easyui is very easy but powerful.
            • +
            +
            +
            +
              +
              +
              + This is the help content. +
              +
              + \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo/tabs/dropdown.html b/src/main/webapp/js/easyui/demo/tabs/dropdown.html index e13426c..7c9daac 100644 --- a/src/main/webapp/js/easyui/demo/tabs/dropdown.html +++ b/src/main/webapp/js/easyui/demo/tabs/dropdown.html @@ -1,55 +1,55 @@ - - - - - Tabs with DropDown - jQuery EasyUI Demo - - - - - - - -

              Tabs with DropDown

              -

              This sample shows how to add a dropdown menu over a tab strip.

              -
              -
              -
              -

              jQuery EasyUI framework helps you build your web pages easily.

              -
                -
              • easyui is a collection of user-interface plugin based on jQuery.
              • -
              • easyui provides essential functionality for building modem, interactive, javascript applications.
              • -
              • using easyui you don't need to write many javascript code, you usually defines user-interface by writing some HTML markup.
              • -
              • complete framework for HTML5 web page.
              • -
              • easyui save your time and scales while developing your products.
              • -
              • easyui is very easy but powerful.
              • -
              -
              -
              -
                -
                -
                - This is the help content. -
                -
                -
                -
                Welcome
                -
                Help Contents
                -
                Search
                -
                Dynamic Help
                -
                - - - + + + + + Tabs with DropDown - jQuery EasyUI Demo + + + + + + + +

                Tabs with DropDown

                +

                This sample shows how to add a dropdown menu over a tab strip.

                +
                +
                +
                +

                jQuery EasyUI framework helps you build your web pages easily.

                +
                  +
                • easyui is a collection of user-interface plugin based on jQuery.
                • +
                • easyui provides essential functionality for building modem, interactive, javascript applications.
                • +
                • using easyui you don't need to write many javascript code, you usually defines user-interface by writing some HTML markup.
                • +
                • complete framework for HTML5 web page.
                • +
                • easyui save your time and scales while developing your products.
                • +
                • easyui is very easy but powerful.
                • +
                +
                +
                +
                  +
                  +
                  + This is the help content. +
                  +
                  +
                  +
                  Welcome
                  +
                  Help Contents
                  +
                  Search
                  +
                  Dynamic Help
                  +
                  + + + \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo/tabs/fixedwidth.html b/src/main/webapp/js/easyui/demo/tabs/fixedwidth.html index 1803066..390e987 100644 --- a/src/main/webapp/js/easyui/demo/tabs/fixedwidth.html +++ b/src/main/webapp/js/easyui/demo/tabs/fixedwidth.html @@ -1,37 +1,37 @@ - - - - - Fixed Tab Width - jQuery EasyUI Demo - - - - - - - -

                  Fixed Tab Width

                  -

                  The tab strips have fixed width and height.

                  -
                  -
                  -
                  -

                  Home Content.

                  -
                  -
                  -

                  Maps Content.

                  -
                  -
                  -

                  Journal Content.

                  -
                  -
                  -

                  History Content.

                  -
                  -
                  -

                  References Content.

                  -
                  -
                  -

                  Contact Content.

                  -
                  -
                  - + + + + + Fixed Tab Width - jQuery EasyUI Demo + + + + + + + +

                  Fixed Tab Width

                  +

                  The tab strips have fixed width and height.

                  +
                  +
                  +
                  +

                  Home Content.

                  +
                  +
                  +

                  Maps Content.

                  +
                  +
                  +

                  Journal Content.

                  +
                  +
                  +

                  History Content.

                  +
                  +
                  +

                  References Content.

                  +
                  +
                  +

                  Contact Content.

                  +
                  +
                  + \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo/tabs/fluid.html b/src/main/webapp/js/easyui/demo/tabs/fluid.html index 42cf7fc..d31d6fb 100644 --- a/src/main/webapp/js/easyui/demo/tabs/fluid.html +++ b/src/main/webapp/js/easyui/demo/tabs/fluid.html @@ -1,24 +1,24 @@ - - - - - Fluid Tabs - jQuery EasyUI Demo - - - - - - - -

                  Fluid Tabs

                  -

                  This example shows how to set the width of Tabs to a percentage of its parent container.

                  -
                  -
                  -
                  -

                  The tabs has a width of 100%.

                  -
                  -
                  -
                  -
                  - + + + + + Fluid Tabs - jQuery EasyUI Demo + + + + + + + +

                  Fluid Tabs

                  +

                  This example shows how to set the width of Tabs to a percentage of its parent container.

                  +
                  +
                  +
                  +

                  The tabs has a width of 100%.

                  +
                  +
                  +
                  +
                  + \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo/tabs/hover.html b/src/main/webapp/js/easyui/demo/tabs/hover.html index 04419c8..5b62ac9 100644 --- a/src/main/webapp/js/easyui/demo/tabs/hover.html +++ b/src/main/webapp/js/easyui/demo/tabs/hover.html @@ -1,46 +1,46 @@ - - - - - Hover Tabs - jQuery EasyUI Demo - - - - - - - -

                  Hover Tabs

                  -

                  Move mouse over the tab strip to open the tab panel.

                  -
                  -
                  -
                  -

                  jQuery EasyUI framework helps you build your web pages easily.

                  -
                    -
                  • easyui is a collection of user-interface plugin based on jQuery.
                  • -
                  • easyui provides essential functionality for building modem, interactive, javascript applications.
                  • -
                  • using easyui you don't need to write many javascript code, you usually defines user-interface by writing some HTML markup.
                  • -
                  • complete framework for HTML5 web page.
                  • -
                  • easyui save your time and scales while developing your products.
                  • -
                  • easyui is very easy but powerful.
                  • -
                  -
                  -
                  -
                    -
                    -
                    - This is the help content. -
                    -
                    - - + + + + + Hover Tabs - jQuery EasyUI Demo + + + + + + + +

                    Hover Tabs

                    +

                    Move mouse over the tab strip to open the tab panel.

                    +
                    +
                    +
                    +

                    jQuery EasyUI framework helps you build your web pages easily.

                    +
                      +
                    • easyui is a collection of user-interface plugin based on jQuery.
                    • +
                    • easyui provides essential functionality for building modem, interactive, javascript applications.
                    • +
                    • using easyui you don't need to write many javascript code, you usually defines user-interface by writing some HTML markup.
                    • +
                    • complete framework for HTML5 web page.
                    • +
                    • easyui save your time and scales while developing your products.
                    • +
                    • easyui is very easy but powerful.
                    • +
                    +
                    +
                    +
                      +
                      +
                      + This is the help content. +
                      +
                      + + \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo/tabs/nestedtabs.html b/src/main/webapp/js/easyui/demo/tabs/nestedtabs.html index 6f78600..94c2ac5 100644 --- a/src/main/webapp/js/easyui/demo/tabs/nestedtabs.html +++ b/src/main/webapp/js/easyui/demo/tabs/nestedtabs.html @@ -1,54 +1,54 @@ - - - - - Nested Tabs - jQuery EasyUI Demo - - - - - - - -

                      Nested Tabs

                      -

                      The tab panel can contain sub tabs or other components.

                      -
                      -
                      -
                      -
                      -
                      Content 1
                      -
                      Content 2
                      -
                      Content 3
                      -
                      -
                      -
                      -
                      - -
                      -
                      - - - - - - - - - - - - - - - - - - - - -
                      Title1Title2Title3
                      d11d12d13
                      d21d22d23
                      -
                      -
                      - - + + + + + Nested Tabs - jQuery EasyUI Demo + + + + + + + +

                      Nested Tabs

                      +

                      The tab panel can contain sub tabs or other components.

                      +
                      +
                      +
                      +
                      +
                      Content 1
                      +
                      Content 2
                      +
                      Content 3
                      +
                      +
                      +
                      +
                      + +
                      +
                      + + + + + + + + + + + + + + + + + + + + +
                      Title1Title2Title3
                      d11d12d13
                      d21d22d23
                      +
                      +
                      + + \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo/tabs/striptools.html b/src/main/webapp/js/easyui/demo/tabs/striptools.html index 13ca5b4..83e6ba0 100644 --- a/src/main/webapp/js/easyui/demo/tabs/striptools.html +++ b/src/main/webapp/js/easyui/demo/tabs/striptools.html @@ -1,39 +1,39 @@ - - - - - Tabs Strip Tools - jQuery EasyUI Demo - - - - - - - -

                      Tabs Strip Tools

                      -

                      Click the mini-buttons on the tab strip to perform actions.

                      -
                      -
                      -
                      -

                      jQuery EasyUI framework helps you build your web pages easily.

                      -
                        -
                      • easyui is a collection of user-interface plugin based on jQuery.
                      • -
                      • easyui provides essential functionality for building modem, interactive, javascript applications.
                      • -
                      • using easyui you don't need to write many javascript code, you usually defines user-interface by writing some HTML markup.
                      • -
                      • complete framework for HTML5 web page.
                      • -
                      • easyui save your time and scales while developing your products.
                      • -
                      • easyui is very easy but powerful.
                      • -
                      -
                      -
                      - This is the help content. -
                      -
                      -
                      - - - -
                      - - + + + + + Tabs Strip Tools - jQuery EasyUI Demo + + + + + + + +

                      Tabs Strip Tools

                      +

                      Click the mini-buttons on the tab strip to perform actions.

                      +
                      +
                      +
                      +

                      jQuery EasyUI framework helps you build your web pages easily.

                      +
                        +
                      • easyui is a collection of user-interface plugin based on jQuery.
                      • +
                      • easyui provides essential functionality for building modem, interactive, javascript applications.
                      • +
                      • using easyui you don't need to write many javascript code, you usually defines user-interface by writing some HTML markup.
                      • +
                      • complete framework for HTML5 web page.
                      • +
                      • easyui save your time and scales while developing your products.
                      • +
                      • easyui is very easy but powerful.
                      • +
                      +
                      +
                      + This is the help content. +
                      +
                      +
                      + + + +
                      + + \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo/tabs/style.html b/src/main/webapp/js/easyui/demo/tabs/style.html index adcb507..f27eae1 100644 --- a/src/main/webapp/js/easyui/demo/tabs/style.html +++ b/src/main/webapp/js/easyui/demo/tabs/style.html @@ -1,51 +1,51 @@ - - - - - Tabs Style - jQuery EasyUI Demo - - - - - - - -

                      Tabs Style

                      -

                      Click the options below to change the tabs style.

                      -
                      - plain
                      - narrow
                      - pill
                      - justified -
                      -
                      -
                      -

                      jQuery EasyUI framework helps you build your web pages easily.

                      -
                        -
                      • easyui is a collection of user-interface plugin based on jQuery.
                      • -
                      • easyui provides essential functionality for building modem, interactive, javascript applications.
                      • -
                      • using easyui you don't need to write many javascript code, you usually defines user-interface by writing some HTML markup.
                      • -
                      • complete framework for HTML5 web page.
                      • -
                      • easyui save your time and scales while developing your products.
                      • -
                      • easyui is very easy but powerful.
                      • -
                      -
                      -
                      -
                        -
                        -
                        - This is the help content. -
                        -
                        - - + + + + + Tabs Style - jQuery EasyUI Demo + + + + + + + +

                        Tabs Style

                        +

                        Click the options below to change the tabs style.

                        +
                        + plain
                        + narrow
                        + pill
                        + justified +
                        +
                        +
                        +

                        jQuery EasyUI framework helps you build your web pages easily.

                        +
                          +
                        • easyui is a collection of user-interface plugin based on jQuery.
                        • +
                        • easyui provides essential functionality for building modem, interactive, javascript applications.
                        • +
                        • using easyui you don't need to write many javascript code, you usually defines user-interface by writing some HTML markup.
                        • +
                        • complete framework for HTML5 web page.
                        • +
                        • easyui save your time and scales while developing your products.
                        • +
                        • easyui is very easy but powerful.
                        • +
                        +
                        +
                        +
                          +
                          +
                          + This is the help content. +
                          +
                          + + \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo/tabs/tabimage.html b/src/main/webapp/js/easyui/demo/tabs/tabimage.html index 415cbef..e9df65d 100644 --- a/src/main/webapp/js/easyui/demo/tabs/tabimage.html +++ b/src/main/webapp/js/easyui/demo/tabs/tabimage.html @@ -1,41 +1,41 @@ - - - - - Tabs with Images - jQuery EasyUI Demo - - - - - - - -

                          Tabs with Images

                          -

                          The tab strip can display big images.

                          -
                          -
                          -
                          -

                          A modem (modulator-demodulator) is a device that modulates an analog carrier signal to encode digital information, and also demodulates such a carrier signal to decode the transmitted information.

                          -
                          -
                          -

                          In computing, an image scanner—often abbreviated to just scanner—is a device that optically scans images, printed text, handwriting, or an object, and converts it to a digital image.

                          -
                          -
                          -

                          A personal digital assistant (PDA), also known as a palmtop computer, or personal data assistant, is a mobile device that functions as a personal information manager. PDAs are largely considered obsolete with the widespread adoption of smartphones.

                          -
                          -
                          -

                          A tablet computer, or simply tablet, is a one-piece mobile computer. Devices typically have a touchscreen, with finger or stylus gestures replacing the conventional computer mouse.

                          -
                          -
                          - - + + + + + Tabs with Images - jQuery EasyUI Demo + + + + + + + +

                          Tabs with Images

                          +

                          The tab strip can display big images.

                          +
                          +
                          +
                          +

                          A modem (modulator-demodulator) is a device that modulates an analog carrier signal to encode digital information, and also demodulates such a carrier signal to decode the transmitted information.

                          +
                          +
                          +

                          In computing, an image scanner—often abbreviated to just scanner—is a device that optically scans images, printed text, handwriting, or an object, and converts it to a digital image.

                          +
                          +
                          +

                          A personal digital assistant (PDA), also known as a palmtop computer, or personal data assistant, is a mobile device that functions as a personal information manager. PDAs are largely considered obsolete with the widespread adoption of smartphones.

                          +
                          +
                          +

                          A tablet computer, or simply tablet, is a one-piece mobile computer. Devices typically have a touchscreen, with finger or stylus gestures replacing the conventional computer mouse.

                          +
                          +
                          + + \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo/tabs/tabposition.html b/src/main/webapp/js/easyui/demo/tabs/tabposition.html index 4354736..9f1bc19 100644 --- a/src/main/webapp/js/easyui/demo/tabs/tabposition.html +++ b/src/main/webapp/js/easyui/demo/tabs/tabposition.html @@ -1,45 +1,45 @@ - - - - - Tab Position - jQuery EasyUI Demo - - - - - - - -

                          Tab Position

                          -

                          Click the 'position' drop-down list and select an item to change the tab position.

                          -
                          - Position: - -
                          -
                          -
                          -

                          jQuery EasyUI framework helps you build your web pages easily.

                          -
                            -
                          • easyui is a collection of user-interface plugin based on jQuery.
                          • -
                          • easyui provides essential functionality for building modem, interactive, javascript applications.
                          • -
                          • using easyui you don't need to write many javascript code, you usually defines user-interface by writing some HTML markup.
                          • -
                          • complete framework for HTML5 web page.
                          • -
                          • easyui save your time and scales while developing your products.
                          • -
                          • easyui is very easy but powerful.
                          • -
                          -
                          -
                          -
                            -
                            -
                            - This is the help content. -
                            -
                            - - + + + + + Tab Position - jQuery EasyUI Demo + + + + + + + +

                            Tab Position

                            +

                            Click the 'position' drop-down list and select an item to change the tab position.

                            +
                            + Position: + +
                            +
                            +
                            +

                            jQuery EasyUI framework helps you build your web pages easily.

                            +
                              +
                            • easyui is a collection of user-interface plugin based on jQuery.
                            • +
                            • easyui provides essential functionality for building modem, interactive, javascript applications.
                            • +
                            • using easyui you don't need to write many javascript code, you usually defines user-interface by writing some HTML markup.
                            • +
                            • complete framework for HTML5 web page.
                            • +
                            • easyui save your time and scales while developing your products.
                            • +
                            • easyui is very easy but powerful.
                            • +
                            +
                            +
                            +
                              +
                              +
                              + This is the help content. +
                              +
                              + + \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo/tabs/tabstools.html b/src/main/webapp/js/easyui/demo/tabs/tabstools.html index 9c8fa10..48bdda8 100644 --- a/src/main/webapp/js/easyui/demo/tabs/tabstools.html +++ b/src/main/webapp/js/easyui/demo/tabs/tabstools.html @@ -1,41 +1,41 @@ - - - - - Tabs Tools - jQuery EasyUI Demo - - - - - - - -

                              Tabs Tools

                              -

                              Click the buttons on the top right of tabs header to add or remove tab panel.

                              -
                              -
                              -
                              -
                              - - -
                              - - + + + + + Tabs Tools - jQuery EasyUI Demo + + + + + + + +

                              Tabs Tools

                              +

                              Click the buttons on the top right of tabs header to add or remove tab panel.

                              +
                              +
                              +
                              +
                              + + +
                              + + \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo/tabs/tree_data1.json b/src/main/webapp/js/easyui/demo/tabs/tree_data1.json index e0c6192..83fb0d6 100644 --- a/src/main/webapp/js/easyui/demo/tabs/tree_data1.json +++ b/src/main/webapp/js/easyui/demo/tabs/tree_data1.json @@ -1,49 +1,49 @@ -[{ - "id":1, - "text":"My Documents", - "children":[{ - "id":11, - "text":"Photos", - "state":"closed", - "children":[{ - "id":111, - "text":"Friend" - },{ - "id":112, - "text":"Wife" - },{ - "id":113, - "text":"Company" - }] - },{ - "id":12, - "text":"Program Files", - "children":[{ - "id":121, - "text":"Intel" - },{ - "id":122, - "text":"Java", - "attributes":{ - "p1":"Custom Attribute1", - "p2":"Custom Attribute2" - } - },{ - "id":123, - "text":"Microsoft Office" - },{ - "id":124, - "text":"Games", - "checked":true - }] - },{ - "id":13, - "text":"index.html" - },{ - "id":14, - "text":"about.html" - },{ - "id":15, - "text":"welcome.html" - }] -}] +[{ + "id":1, + "text":"My Documents", + "children":[{ + "id":11, + "text":"Photos", + "state":"closed", + "children":[{ + "id":111, + "text":"Friend" + },{ + "id":112, + "text":"Wife" + },{ + "id":113, + "text":"Company" + }] + },{ + "id":12, + "text":"Program Files", + "children":[{ + "id":121, + "text":"Intel" + },{ + "id":122, + "text":"Java", + "attributes":{ + "p1":"Custom Attribute1", + "p2":"Custom Attribute2" + } + },{ + "id":123, + "text":"Microsoft Office" + },{ + "id":124, + "text":"Games", + "checked":true + }] + },{ + "id":13, + "text":"index.html" + },{ + "id":14, + "text":"about.html" + },{ + "id":15, + "text":"welcome.html" + }] +}] diff --git a/src/main/webapp/js/easyui/demo/timespinner/actions.html b/src/main/webapp/js/easyui/demo/timespinner/actions.html index b03229f..62a70bf 100644 --- a/src/main/webapp/js/easyui/demo/timespinner/actions.html +++ b/src/main/webapp/js/easyui/demo/timespinner/actions.html @@ -1,38 +1,38 @@ - - - - - TimeSpinner Actions - jQuery EasyUI Demo - - - - - - - -

                              TimeSpinner Actions

                              -

                              Click the buttons below to perform actions.

                              - - - - + + + + + TimeSpinner Actions - jQuery EasyUI Demo + + + + + + + +

                              TimeSpinner Actions

                              +

                              Click the buttons below to perform actions.

                              + + + + \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo/timespinner/basic.html b/src/main/webapp/js/easyui/demo/timespinner/basic.html index 55c88b9..8c32d30 100644 --- a/src/main/webapp/js/easyui/demo/timespinner/basic.html +++ b/src/main/webapp/js/easyui/demo/timespinner/basic.html @@ -1,18 +1,18 @@ - - - - - Basic TimeSpinner - jQuery EasyUI Demo - - - - - - - -

                              Basic TimeSpinner

                              -

                              Click spin button to adjust time.

                              -
                              - - + + + + + Basic TimeSpinner - jQuery EasyUI Demo + + + + + + + +

                              Basic TimeSpinner

                              +

                              Click spin button to adjust time.

                              +
                              + + \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo/timespinner/fluid.html b/src/main/webapp/js/easyui/demo/timespinner/fluid.html index 1b3ce46..8588fe9 100644 --- a/src/main/webapp/js/easyui/demo/timespinner/fluid.html +++ b/src/main/webapp/js/easyui/demo/timespinner/fluid.html @@ -1,21 +1,21 @@ - - - - - Fluid TimeSpinner - jQuery EasyUI Demo - - - - - - - -

                              Fluid TimeSpinner

                              -

                              This example shows how to set the width of TimeSpinner to a percentage of its parent container.

                              -
                              -

                              width: 50%

                              - -

                              width: 30%

                              - - + + + + + Fluid TimeSpinner - jQuery EasyUI Demo + + + + + + + +

                              Fluid TimeSpinner

                              +

                              This example shows how to set the width of TimeSpinner to a percentage of its parent container.

                              +
                              +

                              width: 50%

                              + +

                              width: 30%

                              + + \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo/timespinner/range.html b/src/main/webapp/js/easyui/demo/timespinner/range.html index 24ece66..63bbf55 100644 --- a/src/main/webapp/js/easyui/demo/timespinner/range.html +++ b/src/main/webapp/js/easyui/demo/timespinner/range.html @@ -1,20 +1,20 @@ - - - - - Time Range - jQuery EasyUI Demo - - - - - - - -

                              Time Range

                              -

                              The time value is constrained in specified range.

                              -
                              - From 08:30 to 18:00 -
                              - - + + + + + Time Range - jQuery EasyUI Demo + + + + + + + +

                              Time Range

                              +

                              The time value is constrained in specified range.

                              +
                              + From 08:30 to 18:00 +
                              + + \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo/tooltip/_content.html b/src/main/webapp/js/easyui/demo/tooltip/_content.html index 9967402..f7b8e2e 100644 --- a/src/main/webapp/js/easyui/demo/tooltip/_content.html +++ b/src/main/webapp/js/easyui/demo/tooltip/_content.html @@ -1,18 +1,18 @@ - - - - - AJAX Content - - -

                              Here is the content loaded via AJAX.

                              -
                                -
                              • easyui is a collection of user-interface plugin based on jQuery.
                              • -
                              • easyui provides essential functionality for building modern, interactive, javascript applications.
                              • -
                              • using easyui you don't need to write many javascript code, you usually defines user-interface by writing some HTML markup.
                              • -
                              • complete framework for HTML5 web page.
                              • -
                              • easyui save your time and scales while developing your products.
                              • -
                              • easyui is very easy but powerful.
                              • -
                              - + + + + + AJAX Content + + +

                              Here is the content loaded via AJAX.

                              +
                                +
                              • easyui is a collection of user-interface plugin based on jQuery.
                              • +
                              • easyui provides essential functionality for building modern, interactive, javascript applications.
                              • +
                              • using easyui you don't need to write many javascript code, you usually defines user-interface by writing some HTML markup.
                              • +
                              • complete framework for HTML5 web page.
                              • +
                              • easyui save your time and scales while developing your products.
                              • +
                              • easyui is very easy but powerful.
                              • +
                              + \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo/tooltip/_dialog.html b/src/main/webapp/js/easyui/demo/tooltip/_dialog.html index ddcdc07..2c1b464 100644 --- a/src/main/webapp/js/easyui/demo/tooltip/_dialog.html +++ b/src/main/webapp/js/easyui/demo/tooltip/_dialog.html @@ -1,23 +1,23 @@ - - - - - Dialog Content - - -
                              -
                              -
                              User Name:
                              - -
                              -
                              -
                              Password:
                              - -
                              -
                              - Login - Cancel -
                              -
                              - + + + + + Dialog Content + + +
                              +
                              +
                              User Name:
                              + +
                              +
                              +
                              Password:
                              + +
                              +
                              + Login + Cancel +
                              +
                              + \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo/tooltip/ajax.html b/src/main/webapp/js/easyui/demo/tooltip/ajax.html index c0095fa..2de45de 100644 --- a/src/main/webapp/js/easyui/demo/tooltip/ajax.html +++ b/src/main/webapp/js/easyui/demo/tooltip/ajax.html @@ -1,32 +1,32 @@ - - - - - Ajax Tooltip - jQuery EasyUI Demo - - - - - - - -

                              Ajax Tooltip

                              -

                              The tooltip content can be loaded via AJAX.

                              -
                              - Hove me to display tooltip content via AJAX. - + + + + + Ajax Tooltip - jQuery EasyUI Demo + + + + + + + +

                              Ajax Tooltip

                              +

                              The tooltip content can be loaded via AJAX.

                              +
                              + Hove me to display tooltip content via AJAX. + \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo/tooltip/basic.html b/src/main/webapp/js/easyui/demo/tooltip/basic.html index 3fb1362..b9ad0e0 100644 --- a/src/main/webapp/js/easyui/demo/tooltip/basic.html +++ b/src/main/webapp/js/easyui/demo/tooltip/basic.html @@ -1,20 +1,20 @@ - - - - - Basic Tooltip - jQuery EasyUI Demo - - - - - - - -

                              Basic Tooltip

                              -

                              Hover the links to display tooltip message.

                              -
                              -

                              The tooltip can use each elements title attribute. - Hover me to display tooltip. -

                              - + + + + + Basic Tooltip - jQuery EasyUI Demo + + + + + + + +

                              Basic Tooltip

                              +

                              Hover the links to display tooltip message.

                              +
                              +

                              The tooltip can use each elements title attribute. + Hover me to display tooltip. +

                              + \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo/tooltip/customcontent.html b/src/main/webapp/js/easyui/demo/tooltip/customcontent.html index 68ce13c..3e1ce97 100644 --- a/src/main/webapp/js/easyui/demo/tooltip/customcontent.html +++ b/src/main/webapp/js/easyui/demo/tooltip/customcontent.html @@ -1,32 +1,32 @@ - - - - - Custom Tooltip Content - jQuery EasyUI Demo - - - - - - - -

                              Custom Tooltip Content

                              -

                              Access to each elements attribute to get the tooltip content.

                              -
                              -
                              -
                              -
                              - - - + + + + + Custom Tooltip Content - jQuery EasyUI Demo + + + + + + + +

                              Custom Tooltip Content

                              +

                              Access to each elements attribute to get the tooltip content.

                              +
                              +
                              +
                              +
                              + + + \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo/tooltip/customstyle.html b/src/main/webapp/js/easyui/demo/tooltip/customstyle.html index 13f10ac..b5c8f3e 100644 --- a/src/main/webapp/js/easyui/demo/tooltip/customstyle.html +++ b/src/main/webapp/js/easyui/demo/tooltip/customstyle.html @@ -1,52 +1,52 @@ - - - - - Custom Tooltip Style - jQuery EasyUI Demo - - - - - - - -

                              Custom Tooltip Style

                              -

                              This sample shows how to change the tooltip style.

                              -
                              -
                              -
                              Hover Me
                              -
                              -
                              -
                              Hover Me
                              -
                              - - + + + + + Custom Tooltip Style - jQuery EasyUI Demo + + + + + + + +

                              Custom Tooltip Style

                              +

                              This sample shows how to change the tooltip style.

                              +
                              +
                              +
                              Hover Me
                              +
                              +
                              +
                              Hover Me
                              +
                              + + \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo/tooltip/position.html b/src/main/webapp/js/easyui/demo/tooltip/position.html index 8707b25..ac97d67 100644 --- a/src/main/webapp/js/easyui/demo/tooltip/position.html +++ b/src/main/webapp/js/easyui/demo/tooltip/position.html @@ -1,34 +1,34 @@ - - - - - Tooltip Position - jQuery EasyUI Demo - - - - - - - -

                              Tooltip Position

                              -

                              Click the drop-down list below to change where the tooltip appears.

                              -
                              - Select position: - -
                              -
                              Hover Me
                              -
                              - - + + + + + Tooltip Position - jQuery EasyUI Demo + + + + + + + +

                              Tooltip Position

                              +

                              Click the drop-down list below to change where the tooltip appears.

                              +
                              + Select position: + +
                              +
                              Hover Me
                              +
                              + + \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo/tooltip/toolbar.html b/src/main/webapp/js/easyui/demo/tooltip/toolbar.html index c376ea2..ac1dff7 100644 --- a/src/main/webapp/js/easyui/demo/tooltip/toolbar.html +++ b/src/main/webapp/js/easyui/demo/tooltip/toolbar.html @@ -1,40 +1,40 @@ - - - - - Tooltip as Toolbar - jQuery EasyUI Demo - - - - - - - -

                              Tooltip as Toolbar

                              -

                              This sample shows how to create a tooltip style toolbar.

                              -
                              -
                              -

                              Hover me to display toolbar.

                              -
                              -
                              -
                              - - - - - -
                              -
                              - + + + + + Tooltip as Toolbar - jQuery EasyUI Demo + + + + + + + +

                              Tooltip as Toolbar

                              +

                              This sample shows how to create a tooltip style toolbar.

                              +
                              +
                              +

                              Hover me to display toolbar.

                              +
                              +
                              +
                              + + + + + +
                              +
                              + \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo/tooltip/tooltipdialog.html b/src/main/webapp/js/easyui/demo/tooltip/tooltipdialog.html index a22bcac..caee524 100644 --- a/src/main/webapp/js/easyui/demo/tooltip/tooltipdialog.html +++ b/src/main/webapp/js/easyui/demo/tooltip/tooltipdialog.html @@ -1,44 +1,44 @@ - - - - - Tooltip Dialog - jQuery EasyUI Demo - - - - - - - -

                              Tooltip Dialog

                              -

                              This sample shows how to create a tooltip dialog.

                              -
                              -
                              -

                              Click here to see the tooltip dialog. -

                              - - + + + + + Tooltip Dialog - jQuery EasyUI Demo + + + + + + + +

                              Tooltip Dialog

                              +

                              This sample shows how to create a tooltip dialog.

                              +
                              +
                              +

                              Click here to see the tooltip dialog. +

                              + + \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo/tree/actions.html b/src/main/webapp/js/easyui/demo/tree/actions.html index 4b194e7..b5e2d4b 100644 --- a/src/main/webapp/js/easyui/demo/tree/actions.html +++ b/src/main/webapp/js/easyui/demo/tree/actions.html @@ -1,47 +1,47 @@ - - - - - Tree Actions - jQuery EasyUI Demo - - - - - - - -

                              Tree Actions

                              -

                              Click the buttons below to perform actions.

                              - -
                              -
                                -
                                - - + + + + + Tree Actions - jQuery EasyUI Demo + + + + + + + +

                                Tree Actions

                                +

                                Click the buttons below to perform actions.

                                + +
                                +
                                  +
                                  + + \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo/tree/animation.html b/src/main/webapp/js/easyui/demo/tree/animation.html index 83fb263..d7ea6cc 100644 --- a/src/main/webapp/js/easyui/demo/tree/animation.html +++ b/src/main/webapp/js/easyui/demo/tree/animation.html @@ -1,20 +1,20 @@ - - - - - Animation Tree - jQuery EasyUI Demo - - - - - - - -

                                  Animation Tree

                                  -

                                  Apply 'animate' property to true to enable animation effect.

                                  -
                                  -
                                  -
                                    -
                                    - + + + + + Animation Tree - jQuery EasyUI Demo + + + + + + + +

                                    Animation Tree

                                    +

                                    Apply 'animate' property to true to enable animation effect.

                                    +
                                    +
                                    +
                                      +
                                      + \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo/tree/basic.html b/src/main/webapp/js/easyui/demo/tree/basic.html index 96f4396..9d937a7 100644 --- a/src/main/webapp/js/easyui/demo/tree/basic.html +++ b/src/main/webapp/js/easyui/demo/tree/basic.html @@ -1,53 +1,53 @@ - - - - - Basic Tree - jQuery EasyUI Demo - - - - - - - -

                                      Basic Tree

                                      -

                                      Click the arrow on the left to expand or collapse nodes.

                                      -
                                      -
                                      -
                                        -
                                      • - My Documents -
                                          -
                                        • - Photos -
                                            -
                                          • - Friend -
                                          • -
                                          • - Wife -
                                          • -
                                          • - Company -
                                          • -
                                          -
                                        • -
                                        • - Program Files -
                                            -
                                          • Intel
                                          • -
                                          • Java
                                          • -
                                          • Microsoft Office
                                          • -
                                          • Games
                                          • -
                                          -
                                        • -
                                        • index.html
                                        • -
                                        • about.html
                                        • -
                                        • welcome.html
                                        • -
                                        -
                                      • -
                                      -
                                      - - + + + + + Basic Tree - jQuery EasyUI Demo + + + + + + + +

                                      Basic Tree

                                      +

                                      Click the arrow on the left to expand or collapse nodes.

                                      +
                                      +
                                      +
                                        +
                                      • + My Documents +
                                          +
                                        • + Photos +
                                            +
                                          • + Friend +
                                          • +
                                          • + Wife +
                                          • +
                                          • + Company +
                                          • +
                                          +
                                        • +
                                        • + Program Files +
                                            +
                                          • Intel
                                          • +
                                          • Java
                                          • +
                                          • Microsoft Office
                                          • +
                                          • Games
                                          • +
                                          +
                                        • +
                                        • index.html
                                        • +
                                        • about.html
                                        • +
                                        • welcome.html
                                        • +
                                        +
                                      • +
                                      +
                                      + + \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo/tree/checkbox.html b/src/main/webapp/js/easyui/demo/tree/checkbox.html index 2d1f8d5..734266e 100644 --- a/src/main/webapp/js/easyui/demo/tree/checkbox.html +++ b/src/main/webapp/js/easyui/demo/tree/checkbox.html @@ -1,37 +1,37 @@ - - - - - CheckBox Tree - jQuery EasyUI Demo - - - - - - - -

                                      CheckBox Tree

                                      -

                                      Tree nodes with check boxes.

                                      - -
                                      - CascadeCheck - OnlyLeafCheck -
                                      -
                                      -
                                        -
                                        - - + + + + + CheckBox Tree - jQuery EasyUI Demo + + + + + + + +

                                        CheckBox Tree

                                        +

                                        Tree nodes with check boxes.

                                        + +
                                        + CascadeCheck + OnlyLeafCheck +
                                        +
                                        +
                                          +
                                          + + \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo/tree/contextmenu.html b/src/main/webapp/js/easyui/demo/tree/contextmenu.html index 342fcf3..67f14d0 100644 --- a/src/main/webapp/js/easyui/demo/tree/contextmenu.html +++ b/src/main/webapp/js/easyui/demo/tree/contextmenu.html @@ -1,65 +1,65 @@ - - - - - Tree Context Menu - jQuery EasyUI Demo - - - - - - - -

                                          Tree Context Menu

                                          -

                                          Right click on a node to display context menu.

                                          -
                                          -
                                          -
                                            -
                                            -
                                            -
                                            Append
                                            -
                                            Remove
                                            - -
                                            Expand
                                            -
                                            Collapse
                                            -
                                            - - + + + + + Tree Context Menu - jQuery EasyUI Demo + + + + + + + +

                                            Tree Context Menu

                                            +

                                            Right click on a node to display context menu.

                                            +
                                            +
                                            +
                                              +
                                              +
                                              +
                                              Append
                                              +
                                              Remove
                                              + +
                                              Expand
                                              +
                                              Collapse
                                              +
                                              + + \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo/tree/dnd.html b/src/main/webapp/js/easyui/demo/tree/dnd.html index 4be5bbd..fdf4c1f 100644 --- a/src/main/webapp/js/easyui/demo/tree/dnd.html +++ b/src/main/webapp/js/easyui/demo/tree/dnd.html @@ -1,20 +1,20 @@ - - - - - Drag Drop Tree Nodes - jQuery EasyUI Demo - - - - - - - -

                                              Drag Drop Tree Nodes

                                              -

                                              Press mouse down and drag a node to another position.

                                              -
                                              -
                                              -
                                                -
                                                - + + + + + Drag Drop Tree Nodes - jQuery EasyUI Demo + + + + + + + +

                                                Drag Drop Tree Nodes

                                                +

                                                Press mouse down and drag a node to another position.

                                                +
                                                +
                                                +
                                                  +
                                                  + \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo/tree/editable.html b/src/main/webapp/js/easyui/demo/tree/editable.html index 9d3b62c..afbb8c6 100644 --- a/src/main/webapp/js/easyui/demo/tree/editable.html +++ b/src/main/webapp/js/easyui/demo/tree/editable.html @@ -1,27 +1,27 @@ - - - - - Editable Tree - jQuery EasyUI Demo - - - - - - - -

                                                  Editable Tree

                                                  -

                                                  Click the node to begin edit, press enter key to stop edit or esc key to cancel edit.

                                                  -
                                                  -
                                                  -
                                                    -
                                                    - + + + + + Editable Tree - jQuery EasyUI Demo + + + + + + + +

                                                    Editable Tree

                                                    +

                                                    Click the node to begin edit, press enter key to stop edit or esc key to cancel edit.

                                                    +
                                                    +
                                                    +
                                                      +
                                                      + \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo/tree/formatting.html b/src/main/webapp/js/easyui/demo/tree/formatting.html index 187f588..e83d180 100644 --- a/src/main/webapp/js/easyui/demo/tree/formatting.html +++ b/src/main/webapp/js/easyui/demo/tree/formatting.html @@ -1,32 +1,32 @@ - - - - - Formatting Tree Nodes - jQuery EasyUI Demo - - - - - - - -

                                                      Formatting Tree Nodes

                                                      -

                                                      This example shows how to display extra information on nodes.

                                                      -
                                                      -
                                                      -
                                                        -
                                                      -
                                                      - + + + + + Formatting Tree Nodes - jQuery EasyUI Demo + + + + + + + +

                                                      Formatting Tree Nodes

                                                      +

                                                      This example shows how to display extra information on nodes.

                                                      +
                                                      +
                                                      +
                                                        +
                                                      +
                                                      + \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo/tree/icons.html b/src/main/webapp/js/easyui/demo/tree/icons.html index c4cecb8..c50df79 100644 --- a/src/main/webapp/js/easyui/demo/tree/icons.html +++ b/src/main/webapp/js/easyui/demo/tree/icons.html @@ -1,20 +1,20 @@ - - - - - Tree Node Icons - jQuery EasyUI Demo - - - - - - - -

                                                      Tree Node Icons

                                                      -

                                                      This sample illustrates how to add icons to tree node.

                                                      -
                                                      -
                                                      -
                                                        -
                                                        - + + + + + Tree Node Icons - jQuery EasyUI Demo + + + + + + + +

                                                        Tree Node Icons

                                                        +

                                                        This sample illustrates how to add icons to tree node.

                                                        +
                                                        +
                                                        +
                                                          +
                                                          + \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo/tree/lazyload.html b/src/main/webapp/js/easyui/demo/tree/lazyload.html index 865cee6..014b255 100644 --- a/src/main/webapp/js/easyui/demo/tree/lazyload.html +++ b/src/main/webapp/js/easyui/demo/tree/lazyload.html @@ -1,82 +1,82 @@ - - - - - Lazy Load Tree Nodes - jQuery EasyUI Demo - - - - - - - -

                                                          Lazy Load Tree Nodes

                                                          -

                                                          Get full hierarchical tree data but lazy load nodes level by level.

                                                          -
                                                          -
                                                          -
                                                            -
                                                            - - + + + + + Lazy Load Tree Nodes - jQuery EasyUI Demo + + + + + + + +

                                                            Lazy Load Tree Nodes

                                                            +

                                                            Get full hierarchical tree data but lazy load nodes level by level.

                                                            +
                                                            +
                                                            +
                                                              +
                                                              + + \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo/tree/lines.html b/src/main/webapp/js/easyui/demo/tree/lines.html index 681a16b..820ac44 100644 --- a/src/main/webapp/js/easyui/demo/tree/lines.html +++ b/src/main/webapp/js/easyui/demo/tree/lines.html @@ -1,20 +1,20 @@ - - - - - Tree Lines - jQuery EasyUI Demo - - - - - - - -

                                                              Tree Lines

                                                              -

                                                              This sample shows how to show tree lines.

                                                              -
                                                              -
                                                              -
                                                                -
                                                                - + + + + + Tree Lines - jQuery EasyUI Demo + + + + + + + +

                                                                Tree Lines

                                                                +

                                                                This sample shows how to show tree lines.

                                                                +
                                                                +
                                                                +
                                                                  +
                                                                  + \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo/tree/tree_data1.json b/src/main/webapp/js/easyui/demo/tree/tree_data1.json index e0c6192..83fb0d6 100644 --- a/src/main/webapp/js/easyui/demo/tree/tree_data1.json +++ b/src/main/webapp/js/easyui/demo/tree/tree_data1.json @@ -1,49 +1,49 @@ -[{ - "id":1, - "text":"My Documents", - "children":[{ - "id":11, - "text":"Photos", - "state":"closed", - "children":[{ - "id":111, - "text":"Friend" - },{ - "id":112, - "text":"Wife" - },{ - "id":113, - "text":"Company" - }] - },{ - "id":12, - "text":"Program Files", - "children":[{ - "id":121, - "text":"Intel" - },{ - "id":122, - "text":"Java", - "attributes":{ - "p1":"Custom Attribute1", - "p2":"Custom Attribute2" - } - },{ - "id":123, - "text":"Microsoft Office" - },{ - "id":124, - "text":"Games", - "checked":true - }] - },{ - "id":13, - "text":"index.html" - },{ - "id":14, - "text":"about.html" - },{ - "id":15, - "text":"welcome.html" - }] -}] +[{ + "id":1, + "text":"My Documents", + "children":[{ + "id":11, + "text":"Photos", + "state":"closed", + "children":[{ + "id":111, + "text":"Friend" + },{ + "id":112, + "text":"Wife" + },{ + "id":113, + "text":"Company" + }] + },{ + "id":12, + "text":"Program Files", + "children":[{ + "id":121, + "text":"Intel" + },{ + "id":122, + "text":"Java", + "attributes":{ + "p1":"Custom Attribute1", + "p2":"Custom Attribute2" + } + },{ + "id":123, + "text":"Microsoft Office" + },{ + "id":124, + "text":"Games", + "checked":true + }] + },{ + "id":13, + "text":"index.html" + },{ + "id":14, + "text":"about.html" + },{ + "id":15, + "text":"welcome.html" + }] +}] diff --git a/src/main/webapp/js/easyui/demo/tree/tree_data2.json b/src/main/webapp/js/easyui/demo/tree/tree_data2.json index a6e2251..14e3429 100644 --- a/src/main/webapp/js/easyui/demo/tree/tree_data2.json +++ b/src/main/webapp/js/easyui/demo/tree/tree_data2.json @@ -1,61 +1,61 @@ -[{ - "id":1, - "text":"My Documents", - "children":[{ - "id":11, - "text":"Photos", - "state":"closed", - "children":[{ - "id":111, - "text":"Friend" - },{ - "id":112, - "text":"Wife" - },{ - "id":113, - "text":"Company" - }] - },{ - "id":12, - "text":"Program Files", - "state":"closed", - "children":[{ - "id":121, - "text":"Intel" - },{ - "id":122, - "text":"Java" - },{ - "id":123, - "text":"Microsoft Office" - },{ - "id":124, - "text":"Games" - }] - },{ - "id":16, - "text":"Actions", - "children":[{ - "text":"Add", - "iconCls":"icon-add" - },{ - "text":"Remove", - "iconCls":"icon-remove" - },{ - "text":"Save", - "iconCls":"icon-save" - },{ - "text":"Search", - "iconCls":"icon-search" - }] - },{ - "id":13, - "text":"index.html" - },{ - "id":14, - "text":"about.html" - },{ - "id":15, - "text":"welcome.html" - }] -}] +[{ + "id":1, + "text":"My Documents", + "children":[{ + "id":11, + "text":"Photos", + "state":"closed", + "children":[{ + "id":111, + "text":"Friend" + },{ + "id":112, + "text":"Wife" + },{ + "id":113, + "text":"Company" + }] + },{ + "id":12, + "text":"Program Files", + "state":"closed", + "children":[{ + "id":121, + "text":"Intel" + },{ + "id":122, + "text":"Java" + },{ + "id":123, + "text":"Microsoft Office" + },{ + "id":124, + "text":"Games" + }] + },{ + "id":16, + "text":"Actions", + "children":[{ + "text":"Add", + "iconCls":"icon-add" + },{ + "text":"Remove", + "iconCls":"icon-remove" + },{ + "text":"Save", + "iconCls":"icon-save" + },{ + "text":"Search", + "iconCls":"icon-search" + }] + },{ + "id":13, + "text":"index.html" + },{ + "id":14, + "text":"about.html" + },{ + "id":15, + "text":"welcome.html" + }] +}] diff --git a/src/main/webapp/js/easyui/demo/treegrid/actions.html b/src/main/webapp/js/easyui/demo/treegrid/actions.html index 6249a9e..31430a5 100644 --- a/src/main/webapp/js/easyui/demo/treegrid/actions.html +++ b/src/main/webapp/js/easyui/demo/treegrid/actions.html @@ -1,64 +1,64 @@ - - - - - TreeGrid Actions - jQuery EasyUI Demo - - - - - - - -

                                                                  TreeGrid Actions

                                                                  -

                                                                  Click the buttons below to perform actions.

                                                                  - - - - - - - - - - - -
                                                                  Task NamePersonsBegin DateEnd DateProgress
                                                                  - - + + + + + TreeGrid Actions - jQuery EasyUI Demo + + + + + + + +

                                                                  TreeGrid Actions

                                                                  +

                                                                  Click the buttons below to perform actions.

                                                                  + + + + + + + + + + + +
                                                                  Task NamePersonsBegin DateEnd DateProgress
                                                                  + + \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo/treegrid/basic.html b/src/main/webapp/js/easyui/demo/treegrid/basic.html index 3b5076b..7daefeb 100644 --- a/src/main/webapp/js/easyui/demo/treegrid/basic.html +++ b/src/main/webapp/js/easyui/demo/treegrid/basic.html @@ -1,34 +1,34 @@ - - - - - Basic TreeGrid - jQuery EasyUI Demo - - - - - - - -

                                                                  Basic TreeGrid

                                                                  -

                                                                  TreeGrid allows you to expand or collapse group rows.

                                                                  -
                                                                  - - - - - - - - -
                                                                  NameSizeModified Date
                                                                  - - + + + + + Basic TreeGrid - jQuery EasyUI Demo + + + + + + + +

                                                                  Basic TreeGrid

                                                                  +

                                                                  TreeGrid allows you to expand or collapse group rows.

                                                                  +
                                                                  + + + + + + + + +
                                                                  NameSizeModified Date
                                                                  + + \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo/treegrid/clientpagination.html b/src/main/webapp/js/easyui/demo/treegrid/clientpagination.html index a2c7e8f..644f32b 100644 --- a/src/main/webapp/js/easyui/demo/treegrid/clientpagination.html +++ b/src/main/webapp/js/easyui/demo/treegrid/clientpagination.html @@ -1,161 +1,161 @@ - - - - - Client Side Pagination in TreeGrid - jQuery EasyUI Demo - - - - - - - -

                                                                  Client Side Pagination in TreeGrid

                                                                  -

                                                                  This sample shows how to implement client side pagination in TreeGrid.

                                                                  -
                                                                  - - - - - - - - - - -
                                                                  Task NamePersonsBegin DateEnd DateProgress
                                                                  - - + + + + + Client Side Pagination in TreeGrid - jQuery EasyUI Demo + + + + + + + +

                                                                  Client Side Pagination in TreeGrid

                                                                  +

                                                                  This sample shows how to implement client side pagination in TreeGrid.

                                                                  +
                                                                  + + + + + + + + + + +
                                                                  Task NamePersonsBegin DateEnd DateProgress
                                                                  + + \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo/treegrid/contextmenu.html b/src/main/webapp/js/easyui/demo/treegrid/contextmenu.html index 38c7424..eebf20f 100644 --- a/src/main/webapp/js/easyui/demo/treegrid/contextmenu.html +++ b/src/main/webapp/js/easyui/demo/treegrid/contextmenu.html @@ -1,104 +1,104 @@ - - - - - TreeGrid ContextMenu - jQuery EasyUI Demo - - - - - - - -

                                                                  TreeGrid ContextMenu

                                                                  -

                                                                  Right click to display the context menu.

                                                                  -
                                                                  - - - - - - - - - - -
                                                                  Task NamePersonsBegin DateEnd DateProgress
                                                                  -
                                                                  -
                                                                  Append
                                                                  -
                                                                  Remove
                                                                  - -
                                                                  Collapse
                                                                  -
                                                                  Expand
                                                                  -
                                                                  - - + + + + + TreeGrid ContextMenu - jQuery EasyUI Demo + + + + + + + +

                                                                  TreeGrid ContextMenu

                                                                  +

                                                                  Right click to display the context menu.

                                                                  +
                                                                  + + + + + + + + + + +
                                                                  Task NamePersonsBegin DateEnd DateProgress
                                                                  +
                                                                  +
                                                                  Append
                                                                  +
                                                                  Remove
                                                                  + +
                                                                  Collapse
                                                                  +
                                                                  Expand
                                                                  +
                                                                  + + \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo/treegrid/editable.html b/src/main/webapp/js/easyui/demo/treegrid/editable.html index 0b79d39..30713e6 100644 --- a/src/main/webapp/js/easyui/demo/treegrid/editable.html +++ b/src/main/webapp/js/easyui/demo/treegrid/editable.html @@ -1,93 +1,93 @@ - - - - - Editable TreeGrid - jQuery EasyUI Demo - - - - - - - -

                                                                  Editable TreeGrid

                                                                  -

                                                                  Select one node and click edit button to perform editing.

                                                                  -
                                                                  - Edit - Save - Cancel -
                                                                  - - - - - - - - - - -
                                                                  Task NamePersonsBegin DateEnd DateProgress
                                                                  - - - + + + + + Editable TreeGrid - jQuery EasyUI Demo + + + + + + + +

                                                                  Editable TreeGrid

                                                                  +

                                                                  Select one node and click edit button to perform editing.

                                                                  +
                                                                  + Edit + Save + Cancel +
                                                                  + + + + + + + + + + +
                                                                  Task NamePersonsBegin DateEnd DateProgress
                                                                  + + + \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo/treegrid/fluid.html b/src/main/webapp/js/easyui/demo/treegrid/fluid.html index 1fd82f6..e0c8c0e 100644 --- a/src/main/webapp/js/easyui/demo/treegrid/fluid.html +++ b/src/main/webapp/js/easyui/demo/treegrid/fluid.html @@ -1,33 +1,33 @@ - - - - - Fluid TreeGrid - jQuery EasyUI Demo - - - - - - - -

                                                                  Fluid TreeGrid

                                                                  -

                                                                  This example shows how to assign percentage width to a column in TreeGrid.

                                                                  -
                                                                  - - - - - - - - -
                                                                  Name(50%)Size(20%)Modified Date(30%)
                                                                  - - + + + + + Fluid TreeGrid - jQuery EasyUI Demo + + + + + + + +

                                                                  Fluid TreeGrid

                                                                  +

                                                                  This example shows how to assign percentage width to a column in TreeGrid.

                                                                  +
                                                                  + + + + + + + + +
                                                                  Name(50%)Size(20%)Modified Date(30%)
                                                                  + + \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo/treegrid/footer.html b/src/main/webapp/js/easyui/demo/treegrid/footer.html index d03e756..5d1cff9 100644 --- a/src/main/webapp/js/easyui/demo/treegrid/footer.html +++ b/src/main/webapp/js/easyui/demo/treegrid/footer.html @@ -1,55 +1,55 @@ - - - - - TreeGrid with Footer - jQuery EasyUI Demo - - - - - - - -

                                                                  TreeGrid with Footer

                                                                  -

                                                                  Show summary information on TreeGrid footer.

                                                                  -
                                                                  -
                                                                  - - + + + + + TreeGrid with Footer - jQuery EasyUI Demo + + + + + + + +

                                                                  TreeGrid with Footer

                                                                  +

                                                                  Show summary information on TreeGrid footer.

                                                                  +
                                                                  +
                                                                  + + \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo/treegrid/lines.html b/src/main/webapp/js/easyui/demo/treegrid/lines.html index 935f862..78cf623 100644 --- a/src/main/webapp/js/easyui/demo/treegrid/lines.html +++ b/src/main/webapp/js/easyui/demo/treegrid/lines.html @@ -1,35 +1,35 @@ - - - - - TreeGrid Lines - jQuery EasyUI Demo - - - - - - - -

                                                                  TreeGrid Lines

                                                                  -

                                                                  This example shows how to show treegrid lines.

                                                                  -
                                                                  - - - - - - - - -
                                                                  NameSizeModified Date
                                                                  - - + + + + + TreeGrid Lines - jQuery EasyUI Demo + + + + + + + +

                                                                  TreeGrid Lines

                                                                  +

                                                                  This example shows how to show treegrid lines.

                                                                  +
                                                                  + + + + + + + + +
                                                                  NameSizeModified Date
                                                                  + + \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo/treegrid/reports.html b/src/main/webapp/js/easyui/demo/treegrid/reports.html index 062e6c8..94f27f4 100644 --- a/src/main/webapp/js/easyui/demo/treegrid/reports.html +++ b/src/main/webapp/js/easyui/demo/treegrid/reports.html @@ -1,49 +1,49 @@ - - - - - Reports using TreeGrid - jQuery EasyUI Demo - - - - - - - -

                                                                  Reports using TreeGrid

                                                                  -

                                                                  Using TreeGrid to show complex reports.

                                                                  -
                                                                  - - - - - - - - - - - - - - - - - - - - - - -
                                                                  Region
                                                                  20092010
                                                                  1st qrt.2st qrt.3st qrt.4st qrt.1st qrt.2st qrt.3st qrt.4st qrt.
                                                                  - - + + + + + Reports using TreeGrid - jQuery EasyUI Demo + + + + + + + +

                                                                  Reports using TreeGrid

                                                                  +

                                                                  Using TreeGrid to show complex reports.

                                                                  +
                                                                  + + + + + + + + + + + + + + + + + + + + + + +
                                                                  Region
                                                                  20092010
                                                                  1st qrt.2st qrt.3st qrt.4st qrt.1st qrt.2st qrt.3st qrt.4st qrt.
                                                                  + + \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo/treegrid/treegrid_data1.json b/src/main/webapp/js/easyui/demo/treegrid/treegrid_data1.json index 6cc1097..0313d46 100644 --- a/src/main/webapp/js/easyui/demo/treegrid/treegrid_data1.json +++ b/src/main/webapp/js/easyui/demo/treegrid/treegrid_data1.json @@ -1,73 +1,73 @@ -[{ - "id":1, - "name":"C", - "size":"", - "date":"02/19/2010", - "children":[{ - "id":2, - "name":"Program Files", - "size":"120 MB", - "date":"03/20/2010", - "children":[{ - "id":21, - "name":"Java", - "size":"", - "date":"01/13/2010", - "state":"closed", - "children":[{ - "id":211, - "name":"java.exe", - "size":"142 KB", - "date":"01/13/2010" - },{ - "id":212, - "name":"jawt.dll", - "size":"5 KB", - "date":"01/13/2010" - }] - },{ - "id":22, - "name":"MySQL", - "size":"", - "date":"01/13/2010", - "state":"closed", - "children":[{ - "id":221, - "name":"my.ini", - "size":"10 KB", - "date":"02/26/2009" - },{ - "id":222, - "name":"my-huge.ini", - "size":"5 KB", - "date":"02/26/2009" - },{ - "id":223, - "name":"my-large.ini", - "size":"5 KB", - "date":"02/26/2009" - }] - }] - },{ - "id":3, - "name":"eclipse", - "size":"", - "date":"01/20/2010", - "children":[{ - "id":31, - "name":"eclipse.exe", - "size":"56 KB", - "date":"05/19/2009" - },{ - "id":32, - "name":"eclipse.ini", - "size":"1 KB", - "date":"04/20/2010" - },{ - "id":33, - "name":"notice.html", - "size":"7 KB", - "date":"03/17/2005" - }] - }] +[{ + "id":1, + "name":"C", + "size":"", + "date":"02/19/2010", + "children":[{ + "id":2, + "name":"Program Files", + "size":"120 MB", + "date":"03/20/2010", + "children":[{ + "id":21, + "name":"Java", + "size":"", + "date":"01/13/2010", + "state":"closed", + "children":[{ + "id":211, + "name":"java.exe", + "size":"142 KB", + "date":"01/13/2010" + },{ + "id":212, + "name":"jawt.dll", + "size":"5 KB", + "date":"01/13/2010" + }] + },{ + "id":22, + "name":"MySQL", + "size":"", + "date":"01/13/2010", + "state":"closed", + "children":[{ + "id":221, + "name":"my.ini", + "size":"10 KB", + "date":"02/26/2009" + },{ + "id":222, + "name":"my-huge.ini", + "size":"5 KB", + "date":"02/26/2009" + },{ + "id":223, + "name":"my-large.ini", + "size":"5 KB", + "date":"02/26/2009" + }] + }] + },{ + "id":3, + "name":"eclipse", + "size":"", + "date":"01/20/2010", + "children":[{ + "id":31, + "name":"eclipse.exe", + "size":"56 KB", + "date":"05/19/2009" + },{ + "id":32, + "name":"eclipse.ini", + "size":"1 KB", + "date":"04/20/2010" + },{ + "id":33, + "name":"notice.html", + "size":"7 KB", + "date":"03/17/2005" + }] + }] }] \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo/treegrid/treegrid_data2.json b/src/main/webapp/js/easyui/demo/treegrid/treegrid_data2.json index 52c2c05..f917507 100644 --- a/src/main/webapp/js/easyui/demo/treegrid/treegrid_data2.json +++ b/src/main/webapp/js/easyui/demo/treegrid/treegrid_data2.json @@ -1,11 +1,11 @@ -{"total":7,"rows":[ - {"id":1,"name":"All Tasks","begin":"3/4/2010","end":"3/20/2010","progress":60,"iconCls":"icon-ok"}, - {"id":2,"name":"Designing","begin":"3/4/2010","end":"3/10/2010","progress":100,"_parentId":1,"state":"closed"}, - {"id":21,"name":"Database","persons":2,"begin":"3/4/2010","end":"3/6/2010","progress":100,"_parentId":2}, - {"id":22,"name":"UML","persons":1,"begin":"3/7/2010","end":"3/8/2010","progress":100,"_parentId":2}, - {"id":23,"name":"Export Document","persons":1,"begin":"3/9/2010","end":"3/10/2010","progress":100,"_parentId":2}, - {"id":3,"name":"Coding","persons":2,"begin":"3/11/2010","end":"3/18/2010","progress":80}, - {"id":4,"name":"Testing","persons":1,"begin":"3/19/2010","end":"3/20/2010","progress":20} -],"footer":[ - {"name":"Total Persons:","persons":7,"iconCls":"icon-sum"} -]} +{"total":7,"rows":[ + {"id":1,"name":"All Tasks","begin":"3/4/2010","end":"3/20/2010","progress":60,"iconCls":"icon-ok"}, + {"id":2,"name":"Designing","begin":"3/4/2010","end":"3/10/2010","progress":100,"_parentId":1,"state":"closed"}, + {"id":21,"name":"Database","persons":2,"begin":"3/4/2010","end":"3/6/2010","progress":100,"_parentId":2}, + {"id":22,"name":"UML","persons":1,"begin":"3/7/2010","end":"3/8/2010","progress":100,"_parentId":2}, + {"id":23,"name":"Export Document","persons":1,"begin":"3/9/2010","end":"3/10/2010","progress":100,"_parentId":2}, + {"id":3,"name":"Coding","persons":2,"begin":"3/11/2010","end":"3/18/2010","progress":80}, + {"id":4,"name":"Testing","persons":1,"begin":"3/19/2010","end":"3/20/2010","progress":20} +],"footer":[ + {"name":"Total Persons:","persons":7,"iconCls":"icon-sum"} +]} diff --git a/src/main/webapp/js/easyui/demo/treegrid/treegrid_data3.json b/src/main/webapp/js/easyui/demo/treegrid/treegrid_data3.json index 7015d31..0475c38 100644 --- a/src/main/webapp/js/easyui/demo/treegrid/treegrid_data3.json +++ b/src/main/webapp/js/easyui/demo/treegrid/treegrid_data3.json @@ -1,13 +1,13 @@ -{"total":9,"rows":[ - {"id":1,"region":"Wyoming"}, - {"id":11,"region":"Albin","f1":2000,"f2":1800,"f3":1903,"f4":2183,"f5":2133,"f6":1923,"f7":2018,"f8":1838,"_parentId":1}, - {"id":12,"region":"Canon","f1":2000,"f2":1800,"f3":1903,"f4":2183,"f5":2133,"f6":1923,"f7":2018,"f8":1838,"_parentId":1}, - {"id":13,"region":"Egbert","f1":2000,"f2":1800,"f3":1903,"f4":2183,"f5":2133,"f6":1923,"f7":2018,"f8":1838,"_parentId":1}, - {"id":2,"region":"Washington"}, - {"id":21,"region":"Bellingham","f1":2000,"f2":1800,"f3":1903,"f4":2183,"f5":2133,"f6":1923,"f7":2018,"f8":1838,"_parentId":2}, - {"id":22,"region":"Chehalis","f1":2000,"f2":1800,"f3":1903,"f4":2183,"f5":2133,"f6":1923,"f7":2018,"f8":1838,"_parentId":2}, - {"id":23,"region":"Ellensburg","f1":2000,"f2":1800,"f3":1903,"f4":2183,"f5":2133,"f6":1923,"f7":2018,"f8":1838,"_parentId":2}, - {"id":24,"region":"Monroe","f1":2000,"f2":1800,"f3":1903,"f4":2183,"f5":2133,"f6":1923,"f7":2018,"f8":1838,"_parentId":2} -],"footer":[ - {"region":"Total","f1":14000,"f2":12600,"f3":13321,"f4":15281,"f5":14931,"f6":13461,"f7":14126,"f8":12866} +{"total":9,"rows":[ + {"id":1,"region":"Wyoming"}, + {"id":11,"region":"Albin","f1":2000,"f2":1800,"f3":1903,"f4":2183,"f5":2133,"f6":1923,"f7":2018,"f8":1838,"_parentId":1}, + {"id":12,"region":"Canon","f1":2000,"f2":1800,"f3":1903,"f4":2183,"f5":2133,"f6":1923,"f7":2018,"f8":1838,"_parentId":1}, + {"id":13,"region":"Egbert","f1":2000,"f2":1800,"f3":1903,"f4":2183,"f5":2133,"f6":1923,"f7":2018,"f8":1838,"_parentId":1}, + {"id":2,"region":"Washington"}, + {"id":21,"region":"Bellingham","f1":2000,"f2":1800,"f3":1903,"f4":2183,"f5":2133,"f6":1923,"f7":2018,"f8":1838,"_parentId":2}, + {"id":22,"region":"Chehalis","f1":2000,"f2":1800,"f3":1903,"f4":2183,"f5":2133,"f6":1923,"f7":2018,"f8":1838,"_parentId":2}, + {"id":23,"region":"Ellensburg","f1":2000,"f2":1800,"f3":1903,"f4":2183,"f5":2133,"f6":1923,"f7":2018,"f8":1838,"_parentId":2}, + {"id":24,"region":"Monroe","f1":2000,"f2":1800,"f3":1903,"f4":2183,"f5":2133,"f6":1923,"f7":2018,"f8":1838,"_parentId":2} +],"footer":[ + {"region":"Total","f1":14000,"f2":12600,"f3":13321,"f4":15281,"f5":14931,"f6":13461,"f7":14126,"f8":12866} ]} \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo/validatebox/basic.html b/src/main/webapp/js/easyui/demo/validatebox/basic.html index 5df5f5e..701bca2 100644 --- a/src/main/webapp/js/easyui/demo/validatebox/basic.html +++ b/src/main/webapp/js/easyui/demo/validatebox/basic.html @@ -1,50 +1,50 @@ - - - - - Basic ValidateBox - jQuery EasyUI Demo - - - - - - - -

                                                                  Basic ValidateBox

                                                                  -

                                                                  It's easy to add validate logic to a input box.

                                                                  -
                                                                  -
                                                                  - - - - - - - - - - - - - - - - - - - - - -
                                                                  User Name:
                                                                  Email:
                                                                  Birthday:
                                                                  URL:
                                                                  Phone:
                                                                  -
                                                                  - - - + + + + + Basic ValidateBox - jQuery EasyUI Demo + + + + + + + +

                                                                  Basic ValidateBox

                                                                  +

                                                                  It's easy to add validate logic to a input box.

                                                                  +
                                                                  +
                                                                  + + + + + + + + + + + + + + + + + + + + + +
                                                                  User Name:
                                                                  Email:
                                                                  Birthday:
                                                                  URL:
                                                                  Phone:
                                                                  +
                                                                  + + + \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo/validatebox/customtooltip.html b/src/main/webapp/js/easyui/demo/validatebox/customtooltip.html index e997f13..8574793 100644 --- a/src/main/webapp/js/easyui/demo/validatebox/customtooltip.html +++ b/src/main/webapp/js/easyui/demo/validatebox/customtooltip.html @@ -1,95 +1,95 @@ - - - - - Custom ValidateBox Tooltip - jQuery EasyUI Demo - - - - - - - -

                                                                  Custom ValidateBox Tooltip

                                                                  -

                                                                  This sample shows how to display another tooltip message on a valid textbox.

                                                                  -
                                                                  -
                                                                  - - - - - - - - - - - - - - - - - - - - - -
                                                                  User Name:
                                                                  Email:
                                                                  Birthday:
                                                                  URL:
                                                                  Phone:
                                                                  -
                                                                  - - - + + + + + Custom ValidateBox Tooltip - jQuery EasyUI Demo + + + + + + + +

                                                                  Custom ValidateBox Tooltip

                                                                  +

                                                                  This sample shows how to display another tooltip message on a valid textbox.

                                                                  +
                                                                  +
                                                                  + + + + + + + + + + + + + + + + + + + + + +
                                                                  User Name:
                                                                  Email:
                                                                  Birthday:
                                                                  URL:
                                                                  Phone:
                                                                  +
                                                                  + + + \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo/validatebox/validateonblur.html b/src/main/webapp/js/easyui/demo/validatebox/validateonblur.html index dc02112..5709efa 100644 --- a/src/main/webapp/js/easyui/demo/validatebox/validateonblur.html +++ b/src/main/webapp/js/easyui/demo/validatebox/validateonblur.html @@ -1,57 +1,57 @@ - - - - - Validate On Blur - jQuery EasyUI Demo - - - - - - - -

                                                                  Validate On Blur

                                                                  -

                                                                  Active validation on first blur event.

                                                                  -
                                                                  -
                                                                  - - - - - - - - - - - - - - - - - - - - - -
                                                                  User Name:
                                                                  Email:
                                                                  Birthday:
                                                                  URL:
                                                                  Phone:
                                                                  -
                                                                  - - - - + + + + + Validate On Blur - jQuery EasyUI Demo + + + + + + + +

                                                                  Validate On Blur

                                                                  +

                                                                  Active validation on first blur event.

                                                                  +
                                                                  +
                                                                  + + + + + + + + + + + + + + + + + + + + + +
                                                                  User Name:
                                                                  Email:
                                                                  Birthday:
                                                                  URL:
                                                                  Phone:
                                                                  +
                                                                  + + + + \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo/window/basic.html b/src/main/webapp/js/easyui/demo/window/basic.html index fb40246..4c3c551 100644 --- a/src/main/webapp/js/easyui/demo/window/basic.html +++ b/src/main/webapp/js/easyui/demo/window/basic.html @@ -1,23 +1,23 @@ - - - - - Basic Window - jQuery EasyUI Demo - - - - - - - -

                                                                  Basic Window

                                                                  -

                                                                  Window can be dragged freely on screen.

                                                                  -
                                                                  - Open - Close -
                                                                  -
                                                                  - The window content. -
                                                                  - + + + + + Basic Window - jQuery EasyUI Demo + + + + + + + +

                                                                  Basic Window

                                                                  +

                                                                  Window can be dragged freely on screen.

                                                                  +
                                                                  + Open + Close +
                                                                  +
                                                                  + The window content. +
                                                                  + \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo/window/customtools.html b/src/main/webapp/js/easyui/demo/window/customtools.html index 4a0e2c4..1a22ad1 100644 --- a/src/main/webapp/js/easyui/demo/window/customtools.html +++ b/src/main/webapp/js/easyui/demo/window/customtools.html @@ -1,30 +1,30 @@ - - - - - Custom Window Tools - jQuery EasyUI Demo - - - - - - - -

                                                                  Custom Window Tools

                                                                  -

                                                                  Click the right top buttons to perform actions.

                                                                  -
                                                                  - Open - Close -
                                                                  -
                                                                  - The window content. -
                                                                  -
                                                                  - - - - -
                                                                  - - + + + + + Custom Window Tools - jQuery EasyUI Demo + + + + + + + +

                                                                  Custom Window Tools

                                                                  +

                                                                  Click the right top buttons to perform actions.

                                                                  +
                                                                  + Open + Close +
                                                                  +
                                                                  + The window content. +
                                                                  +
                                                                  + + + + +
                                                                  + + \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo/window/fluid.html b/src/main/webapp/js/easyui/demo/window/fluid.html index 13406fa..11b3967 100644 --- a/src/main/webapp/js/easyui/demo/window/fluid.html +++ b/src/main/webapp/js/easyui/demo/window/fluid.html @@ -1,24 +1,24 @@ - - - - - Fluid Window - jQuery EasyUI Demo - - - - - - - -

                                                                  Fluid Window

                                                                  -

                                                                  This example shows how to set the width of Window to a percentage of its parent container.

                                                                  -
                                                                  -
                                                                  -

                                                                  The window has a width of 80%.

                                                                  -
                                                                  - + + + + + Fluid Window - jQuery EasyUI Demo + + + + + + + +

                                                                  Fluid Window

                                                                  +

                                                                  This example shows how to set the width of Window to a percentage of its parent container.

                                                                  +
                                                                  +
                                                                  +

                                                                  The window has a width of 80%.

                                                                  +
                                                                  + \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo/window/footer.html b/src/main/webapp/js/easyui/demo/window/footer.html index 60e8b9a..ba29d53 100644 --- a/src/main/webapp/js/easyui/demo/window/footer.html +++ b/src/main/webapp/js/easyui/demo/window/footer.html @@ -1,24 +1,24 @@ - - - - - Window with a Footer - jQuery EasyUI Demo - - - - - - - -

                                                                  Window with a Footer

                                                                  -

                                                                  This example shows how to attach a footer bar to the window.

                                                                  -
                                                                  - Open - Close -
                                                                  -
                                                                  - The window content. -
                                                                  - - + + + + + Window with a Footer - jQuery EasyUI Demo + + + + + + + +

                                                                  Window with a Footer

                                                                  +

                                                                  This example shows how to attach a footer bar to the window.

                                                                  +
                                                                  + Open + Close +
                                                                  +
                                                                  + The window content. +
                                                                  + + \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo/window/inlinewindow.html b/src/main/webapp/js/easyui/demo/window/inlinewindow.html index f272bb1..8335880 100644 --- a/src/main/webapp/js/easyui/demo/window/inlinewindow.html +++ b/src/main/webapp/js/easyui/demo/window/inlinewindow.html @@ -1,26 +1,26 @@ - - - - - Inline Window - jQuery EasyUI Demo - - - - - - - -

                                                                  Inline Window

                                                                  -

                                                                  The inline window stay inside its parent.

                                                                  -
                                                                  - Open - Close -
                                                                  -
                                                                  -
                                                                  - This window stay inside its parent -
                                                                  -
                                                                  - - + + + + + Inline Window - jQuery EasyUI Demo + + + + + + + +

                                                                  Inline Window

                                                                  +

                                                                  The inline window stay inside its parent.

                                                                  +
                                                                  + Open + Close +
                                                                  +
                                                                  +
                                                                  + This window stay inside its parent +
                                                                  +
                                                                  + + \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo/window/modalwindow.html b/src/main/webapp/js/easyui/demo/window/modalwindow.html index ee273ec..59e79ca 100644 --- a/src/main/webapp/js/easyui/demo/window/modalwindow.html +++ b/src/main/webapp/js/easyui/demo/window/modalwindow.html @@ -1,24 +1,24 @@ - - - - - Modal Window - jQuery EasyUI Demo - - - - - - - -

                                                                  Modal Window

                                                                  -

                                                                  Click the open button below to open the modal window.

                                                                  -
                                                                  - Open - Close -
                                                                  -
                                                                  - The window content. -
                                                                  - - + + + + + Modal Window - jQuery EasyUI Demo + + + + + + + +

                                                                  Modal Window

                                                                  +

                                                                  Click the open button below to open the modal window.

                                                                  +
                                                                  + Open + Close +
                                                                  +
                                                                  + The window content. +
                                                                  + + \ No newline at end of file diff --git a/src/main/webapp/js/easyui/demo/window/windowlayout.html b/src/main/webapp/js/easyui/demo/window/windowlayout.html index d799272..7311ef6 100644 --- a/src/main/webapp/js/easyui/demo/window/windowlayout.html +++ b/src/main/webapp/js/easyui/demo/window/windowlayout.html @@ -1,33 +1,33 @@ - - - - - Window Layout - jQuery EasyUI Demo - - - - - - - -

                                                                  Window Layout

                                                                  -

                                                                  Using layout on window.

                                                                  -
                                                                  - Open - Close -
                                                                  -
                                                                  -
                                                                  -
                                                                  -
                                                                  - jQuery EasyUI framework help you build your web page easily. -
                                                                  -
                                                                  - Ok - Cancel -
                                                                  -
                                                                  -
                                                                  - - + + + + + Window Layout - jQuery EasyUI Demo + + + + + + + +

                                                                  Window Layout

                                                                  +

                                                                  Using layout on window.

                                                                  +
                                                                  + Open + Close +
                                                                  +
                                                                  +
                                                                  +
                                                                  +
                                                                  + jQuery EasyUI framework help you build your web page easily. +
                                                                  +
                                                                  + Ok + Cancel +
                                                                  +
                                                                  +
                                                                  + + \ No newline at end of file diff --git a/src/main/webapp/js/easyui/easyloader.js b/src/main/webapp/js/easyui/easyloader.js index 909094e..ac9f2a4 100644 --- a/src/main/webapp/js/easyui/easyloader.js +++ b/src/main/webapp/js/easyui/easyloader.js @@ -1,12 +1,12 @@ -/** - * jQuery EasyUI 1.4.2 - * - * Copyright (c) 2009-2015 www.jeasyui.com. All rights reserved. - * - * Licensed under the GPL license: http://www.gnu.org/licenses/gpl.txt - * To use it on other terms please contact us at info@jeasyui.com - * - */ +/** + * jQuery EasyUI 1.4.2 + * + * Copyright (c) 2009-2015 www.jeasyui.com. All rights reserved. + * + * Licensed under the GPL license: http://www.gnu.org/licenses/gpl.txt + * To use it on other terms please contact us at info@jeasyui.com + * + */ (function(){ var _1={draggable:{js:"jquery.draggable.js"},droppable:{js:"jquery.droppable.js"},resizable:{js:"jquery.resizable.js"},linkbutton:{js:"jquery.linkbutton.js",css:"linkbutton.css"},progressbar:{js:"jquery.progressbar.js",css:"progressbar.css"},tooltip:{js:"jquery.tooltip.js",css:"tooltip.css"},pagination:{js:"jquery.pagination.js",css:"pagination.css",dependencies:["linkbutton"]},datagrid:{js:"jquery.datagrid.js",css:"datagrid.css",dependencies:["panel","resizable","linkbutton","pagination"]},treegrid:{js:"jquery.treegrid.js",css:"tree.css",dependencies:["datagrid"]},propertygrid:{js:"jquery.propertygrid.js",css:"propertygrid.css",dependencies:["datagrid"]},datalist:{js:"jquery.datalist.js",css:"datalist.css",dependencies:["datagrid"]},panel:{js:"jquery.panel.js",css:"panel.css"},window:{js:"jquery.window.js",css:"window.css",dependencies:["resizable","draggable","panel"]},dialog:{js:"jquery.dialog.js",css:"dialog.css",dependencies:["linkbutton","window"]},messager:{js:"jquery.messager.js",css:"messager.css",dependencies:["linkbutton","window","progressbar"]},layout:{js:"jquery.layout.js",css:"layout.css",dependencies:["resizable","panel"]},form:{js:"jquery.form.js"},menu:{js:"jquery.menu.js",css:"menu.css"},tabs:{js:"jquery.tabs.js",css:"tabs.css",dependencies:["panel","linkbutton"]},menubutton:{js:"jquery.menubutton.js",css:"menubutton.css",dependencies:["linkbutton","menu"]},splitbutton:{js:"jquery.splitbutton.js",css:"splitbutton.css",dependencies:["menubutton"]},accordion:{js:"jquery.accordion.js",css:"accordion.css",dependencies:["panel"]},calendar:{js:"jquery.calendar.js",css:"calendar.css"},textbox:{js:"jquery.textbox.js",css:"textbox.css",dependencies:["validatebox","linkbutton"]},filebox:{js:"jquery.filebox.js",css:"filebox.css",dependencies:["textbox"]},combo:{js:"jquery.combo.js",css:"combo.css",dependencies:["panel","textbox"]},combobox:{js:"jquery.combobox.js",css:"combobox.css",dependencies:["combo"]},combotree:{js:"jquery.combotree.js",dependencies:["combo","tree"]},combogrid:{js:"jquery.combogrid.js",dependencies:["combo","datagrid"]},validatebox:{js:"jquery.validatebox.js",css:"validatebox.css",dependencies:["tooltip"]},numberbox:{js:"jquery.numberbox.js",dependencies:["textbox"]},searchbox:{js:"jquery.searchbox.js",css:"searchbox.css",dependencies:["menubutton","textbox"]},spinner:{js:"jquery.spinner.js",css:"spinner.css",dependencies:["textbox"]},numberspinner:{js:"jquery.numberspinner.js",dependencies:["spinner","numberbox"]},timespinner:{js:"jquery.timespinner.js",dependencies:["spinner"]},tree:{js:"jquery.tree.js",css:"tree.css",dependencies:["draggable","droppable"]},datebox:{js:"jquery.datebox.js",css:"datebox.css",dependencies:["calendar","combo"]},datetimebox:{js:"jquery.datetimebox.js",dependencies:["datebox","timespinner"]},slider:{js:"jquery.slider.js",dependencies:["draggable"]},tooltip:{js:"jquery.tooltip.js"},parser:{js:"jquery.parser.js"},mobile:{js:"jquery.mobile.js"}}; var _2={"af":"easyui-lang-af.js","ar":"easyui-lang-ar.js","bg":"easyui-lang-bg.js","ca":"easyui-lang-ca.js","cs":"easyui-lang-cs.js","cz":"easyui-lang-cz.js","da":"easyui-lang-da.js","de":"easyui-lang-de.js","el":"easyui-lang-el.js","en":"easyui-lang-en.js","es":"easyui-lang-es.js","fr":"easyui-lang-fr.js","it":"easyui-lang-it.js","jp":"easyui-lang-jp.js","nl":"easyui-lang-nl.js","pl":"easyui-lang-pl.js","pt_BR":"easyui-lang-pt_BR.js","ru":"easyui-lang-ru.js","sv_SE":"easyui-lang-sv_SE.js","tr":"easyui-lang-tr.js","zh_CN":"easyui-lang-zh_CN.js","zh_TW":"easyui-lang-zh_TW.js"}; diff --git a/src/main/webapp/js/easyui/jquery.easyui.min.js b/src/main/webapp/js/easyui/jquery.easyui.min.js index 78a6a7b..0ad2493 100644 --- a/src/main/webapp/js/easyui/jquery.easyui.min.js +++ b/src/main/webapp/js/easyui/jquery.easyui.min.js @@ -1,12 +1,12 @@ -/** - * jQuery EasyUI 1.4.2 - * - * Copyright (c) 2009-2015 www.jeasyui.com. All rights reserved. - * - * Licensed under the GPL license: http://www.gnu.org/licenses/gpl.txt - * To use it on other terms please contact us at info@jeasyui.com - * - */ +/** + * jQuery EasyUI 1.4.2 + * + * Copyright (c) 2009-2015 www.jeasyui.com. All rights reserved. + * + * Licensed under the GPL license: http://www.gnu.org/licenses/gpl.txt + * To use it on other terms please contact us at info@jeasyui.com + * + */ (function($){ $.parser={auto:true,onComplete:function(_1){ },plugins:["draggable","droppable","resizable","pagination","tooltip","linkbutton","menu","menubutton","splitbutton","progressbar","tree","textbox","filebox","combo","combobox","combotree","combogrid","numberbox","validatebox","searchbox","spinner","numberspinner","timespinner","datetimespinner","calendar","datebox","datetimebox","slider","layout","panel","datagrid","propertygrid","treegrid","datalist","tabs","accordion","window","dialog","form"],parse:function(_2){ diff --git a/src/main/webapp/js/easyui/jquery.easyui.mobile.js b/src/main/webapp/js/easyui/jquery.easyui.mobile.js index 3daf209..b7fed1d 100644 --- a/src/main/webapp/js/easyui/jquery.easyui.mobile.js +++ b/src/main/webapp/js/easyui/jquery.easyui.mobile.js @@ -1,12 +1,12 @@ -/** - * jQuery EasyUI 1.4.2 - * - * Copyright (c) 2009-2015 www.jeasyui.com. All rights reserved. - * - * Licensed under the GPL license: http://www.gnu.org/licenses/gpl.txt - * To use it on other terms please contact us at info@jeasyui.com - * - */ +/** + * jQuery EasyUI 1.4.2 + * + * Copyright (c) 2009-2015 www.jeasyui.com. All rights reserved. + * + * Licensed under the GPL license: http://www.gnu.org/licenses/gpl.txt + * To use it on other terms please contact us at info@jeasyui.com + * + */ (function($){ $.fn.navpanel=function(_1,_2){ if(typeof _1=="string"){ diff --git a/src/main/webapp/js/easyui/locale/easyui-lang-af.js b/src/main/webapp/js/easyui/locale/easyui-lang-af.js index 963fbc7..482c10c 100644 --- a/src/main/webapp/js/easyui/locale/easyui-lang-af.js +++ b/src/main/webapp/js/easyui/locale/easyui-lang-af.js @@ -1,44 +1,44 @@ -if ($.fn.pagination){ - $.fn.pagination.defaults.beforePageText = 'Bladsy'; - $.fn.pagination.defaults.afterPageText = 'Van {pages}'; - $.fn.pagination.defaults.displayMsg = 'Wys (from) tot (to) van (total) items'; -} -if ($.fn.datagrid){ - $.fn.datagrid.defaults.loadMsg = 'Verwerking, wag asseblief ...'; -} -if ($.fn.treegrid && $.fn.datagrid){ - $.fn.treegrid.defaults.loadMsg = $.fn.datagrid.defaults.loadMsg; -} -if ($.messager){ - $.messager.defaults.ok = 'Ok'; - $.messager.defaults.cancel = 'Die styl'; -} -$.map(['validatebox','textbox','filebox','searchbox', - 'combo','combobox','combogrid','combotree', - 'datebox','datetimebox','numberbox', - 'spinner','numberspinner','timespinner','datetimespinner'], function(plugin){ - if ($.fn[plugin]){ - $.fn[plugin].defaults.missingMessage = 'Die veld is verpligtend.'; - } -}); -if ($.fn.validatebox){ - $.fn.validatebox.defaults.rules.email.message = "Gee 'n geldige e-pos adres."; - $.fn.validatebox.defaults.rules.url.message = "Gee 'n geldige URL nie."; - $.fn.validatebox.defaults.rules.length.message = "Voer 'n waarde tussen {0} en {1}."; -} -if ($.fn.calendar){ - $.fn.calendar.defaults.weeks = ['S','M','T','W','T','F','S']; - $.fn.calendar.defaults.months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']; -} -if ($.fn.datebox){ - $.fn.datebox.defaults.currentText = 'Vandag'; - $.fn.datebox.defaults.closeText = 'Sluit'; - $.fn.datebox.defaults.okText = 'Ok'; -} -if ($.fn.datetimebox && $.fn.datebox){ - $.extend($.fn.datetimebox.defaults,{ - currentText: $.fn.datebox.defaults.currentText, - closeText: $.fn.datebox.defaults.closeText, - okText: $.fn.datebox.defaults.okText - }); -} +if ($.fn.pagination){ + $.fn.pagination.defaults.beforePageText = 'Bladsy'; + $.fn.pagination.defaults.afterPageText = 'Van {pages}'; + $.fn.pagination.defaults.displayMsg = 'Wys (from) tot (to) van (total) items'; +} +if ($.fn.datagrid){ + $.fn.datagrid.defaults.loadMsg = 'Verwerking, wag asseblief ...'; +} +if ($.fn.treegrid && $.fn.datagrid){ + $.fn.treegrid.defaults.loadMsg = $.fn.datagrid.defaults.loadMsg; +} +if ($.messager){ + $.messager.defaults.ok = 'Ok'; + $.messager.defaults.cancel = 'Die styl'; +} +$.map(['validatebox','textbox','filebox','searchbox', + 'combo','combobox','combogrid','combotree', + 'datebox','datetimebox','numberbox', + 'spinner','numberspinner','timespinner','datetimespinner'], function(plugin){ + if ($.fn[plugin]){ + $.fn[plugin].defaults.missingMessage = 'Die veld is verpligtend.'; + } +}); +if ($.fn.validatebox){ + $.fn.validatebox.defaults.rules.email.message = "Gee 'n geldige e-pos adres."; + $.fn.validatebox.defaults.rules.url.message = "Gee 'n geldige URL nie."; + $.fn.validatebox.defaults.rules.length.message = "Voer 'n waarde tussen {0} en {1}."; +} +if ($.fn.calendar){ + $.fn.calendar.defaults.weeks = ['S','M','T','W','T','F','S']; + $.fn.calendar.defaults.months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']; +} +if ($.fn.datebox){ + $.fn.datebox.defaults.currentText = 'Vandag'; + $.fn.datebox.defaults.closeText = 'Sluit'; + $.fn.datebox.defaults.okText = 'Ok'; +} +if ($.fn.datetimebox && $.fn.datebox){ + $.extend($.fn.datetimebox.defaults,{ + currentText: $.fn.datebox.defaults.currentText, + closeText: $.fn.datebox.defaults.closeText, + okText: $.fn.datebox.defaults.okText + }); +} diff --git a/src/main/webapp/js/easyui/locale/easyui-lang-am.js b/src/main/webapp/js/easyui/locale/easyui-lang-am.js index 59f9db0..51f4a71 100644 --- a/src/main/webapp/js/easyui/locale/easyui-lang-am.js +++ b/src/main/webapp/js/easyui/locale/easyui-lang-am.js @@ -1,46 +1,46 @@ -if ($.fn.pagination){ - $.fn.pagination.defaults.beforePageText = 'Էջ'; - $.fn.pagination.defaults.afterPageText = 'ից {pages}'; - $.fn.pagination.defaults.displayMsg = 'Դիտել {from}-ից {to}-ը {total} գրառումից'; -} -if ($.fn.datagrid){ - $.fn.datagrid.defaults.loadMsg = 'Մշակվում է, խնդրում ենք սպասել ...'; -} -if ($.fn.treegrid && $.fn.datagrid){ - $.fn.treegrid.defaults.loadMsg = $.fn.datagrid.defaults.loadMsg; -} -if ($.messager){ - $.messager.defaults.ok = 'Այո'; - $.messager.defaults.cancel = 'Փակել'; -} -$.map(['validatebox','textbox','filebox','searchbox', - 'combo','combobox','combogrid','combotree', - 'datebox','datetimebox','numberbox', - 'spinner','numberspinner','timespinner','datetimespinner'], function(plugin){ - if ($.fn[plugin]){ - $.fn[plugin].defaults.missingMessage = 'Այս դաշտը պարտադիր է.'; - } -}); -if ($.fn.validatebox){ - $.fn.validatebox.defaults.rules.email.message = 'Խնդրում ենք մուտքագրել գործող e-mail հասցե.'; - $.fn.validatebox.defaults.rules.url.message = 'Խնդրում ենք մուտքագրել գործող URL.'; - $.fn.validatebox.defaults.rules.length.message = 'Խնդրում ենք մուտքագրել արժեք {0} {1}.'; - $.fn.validatebox.defaults.rules.remote.message = 'Խնդրում ենք ուղղել այս դաշտը.'; -} -if ($.fn.calendar){ - $.fn.calendar.defaults.firstDay = 1; - $.fn.calendar.defaults.weeks = ['Կ.','Ե.','Ե.','Չ.','Հ.','Ու.','Շ.']; - $.fn.calendar.defaults.months = ['Հունվար', 'Փետրվար', 'Մարտ', 'Ապրիլ', 'Մայիս', 'Հունիս', 'Հուլիս', 'Օգոստոս', 'Սեպտեմբեր', 'Հոկտեմբեր', 'Նոյեմբեր', 'Դեկտեմբեր']; -} -if ($.fn.datebox){ - $.fn.datebox.defaults.currentText = 'Այսօր'; - $.fn.datebox.defaults.closeText = 'Փակել'; - $.fn.datebox.defaults.okText = 'Այո'; -} -if ($.fn.datetimebox && $.fn.datebox){ - $.extend($.fn.datetimebox.defaults,{ - currentText: $.fn.datebox.defaults.currentText, - closeText: $.fn.datebox.defaults.closeText, - okText: $.fn.datebox.defaults.okText - }); -} +if ($.fn.pagination){ + $.fn.pagination.defaults.beforePageText = 'Էջ'; + $.fn.pagination.defaults.afterPageText = 'ից {pages}'; + $.fn.pagination.defaults.displayMsg = 'Դիտել {from}-ից {to}-ը {total} գրառումից'; +} +if ($.fn.datagrid){ + $.fn.datagrid.defaults.loadMsg = 'Մշակվում է, խնդրում ենք սպասել ...'; +} +if ($.fn.treegrid && $.fn.datagrid){ + $.fn.treegrid.defaults.loadMsg = $.fn.datagrid.defaults.loadMsg; +} +if ($.messager){ + $.messager.defaults.ok = 'Այո'; + $.messager.defaults.cancel = 'Փակել'; +} +$.map(['validatebox','textbox','filebox','searchbox', + 'combo','combobox','combogrid','combotree', + 'datebox','datetimebox','numberbox', + 'spinner','numberspinner','timespinner','datetimespinner'], function(plugin){ + if ($.fn[plugin]){ + $.fn[plugin].defaults.missingMessage = 'Այս դաշտը պարտադիր է.'; + } +}); +if ($.fn.validatebox){ + $.fn.validatebox.defaults.rules.email.message = 'Խնդրում ենք մուտքագրել գործող e-mail հասցե.'; + $.fn.validatebox.defaults.rules.url.message = 'Խնդրում ենք մուտքագրել գործող URL.'; + $.fn.validatebox.defaults.rules.length.message = 'Խնդրում ենք մուտքագրել արժեք {0} {1}.'; + $.fn.validatebox.defaults.rules.remote.message = 'Խնդրում ենք ուղղել այս դաշտը.'; +} +if ($.fn.calendar){ + $.fn.calendar.defaults.firstDay = 1; + $.fn.calendar.defaults.weeks = ['Կ.','Ե.','Ե.','Չ.','Հ.','Ու.','Շ.']; + $.fn.calendar.defaults.months = ['Հունվար', 'Փետրվար', 'Մարտ', 'Ապրիլ', 'Մայիս', 'Հունիս', 'Հուլիս', 'Օգոստոս', 'Սեպտեմբեր', 'Հոկտեմբեր', 'Նոյեմբեր', 'Դեկտեմբեր']; +} +if ($.fn.datebox){ + $.fn.datebox.defaults.currentText = 'Այսօր'; + $.fn.datebox.defaults.closeText = 'Փակել'; + $.fn.datebox.defaults.okText = 'Այո'; +} +if ($.fn.datetimebox && $.fn.datebox){ + $.extend($.fn.datetimebox.defaults,{ + currentText: $.fn.datebox.defaults.currentText, + closeText: $.fn.datebox.defaults.closeText, + okText: $.fn.datebox.defaults.okText + }); +} diff --git a/src/main/webapp/js/easyui/locale/easyui-lang-ar.js b/src/main/webapp/js/easyui/locale/easyui-lang-ar.js index 85accfa..9f56d45 100644 --- a/src/main/webapp/js/easyui/locale/easyui-lang-ar.js +++ b/src/main/webapp/js/easyui/locale/easyui-lang-ar.js @@ -1,45 +1,45 @@ -if ($.fn.pagination){ - $.fn.pagination.defaults.beforePageText = 'صفحة'; - $.fn.pagination.defaults.afterPageText = 'من {pages}'; - $.fn.pagination.defaults.displayMsg = 'عرض {from} إلى {to} من {total} عنصر'; -} -if ($.fn.datagrid){ - $.fn.datagrid.defaults.loadMsg = 'معالجة, الرجاء الإنتظار ...'; -} -if ($.fn.treegrid && $.fn.datagrid){ - $.fn.treegrid.defaults.loadMsg = $.fn.datagrid.defaults.loadMsg; -} -if ($.messager){ - $.messager.defaults.ok = 'موافق'; - $.messager.defaults.cancel = 'إلغاء'; -} -$.map(['validatebox','textbox','filebox','searchbox', - 'combo','combobox','combogrid','combotree', - 'datebox','datetimebox','numberbox', - 'spinner','numberspinner','timespinner','datetimespinner'], function(plugin){ - if ($.fn[plugin]){ - $.fn[plugin].defaults.missingMessage = 'هذا الحقل مطلوب.'; - } -}); -if ($.fn.validatebox){ - $.fn.validatebox.defaults.rules.email.message = 'الرجاء إدخال بريد إلكتروني صحيح.'; - $.fn.validatebox.defaults.rules.url.message = 'الرجاء إدخال رابط صحيح.'; - $.fn.validatebox.defaults.rules.length.message = 'الرجاء إدخال قيمة بين {0} و {1}.'; - $.fn.validatebox.defaults.rules.remote.message = 'الرجاء التأكد من الحقل.'; -} -if ($.fn.calendar){ - $.fn.calendar.defaults.weeks = ['S','M','T','W','T','F','S']; - $.fn.calendar.defaults.months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']; -} -if ($.fn.datebox){ - $.fn.datebox.defaults.currentText = 'اليوم'; - $.fn.datebox.defaults.closeText = 'إغلاق'; - $.fn.datebox.defaults.okText = 'موافق'; -} -if ($.fn.datetimebox && $.fn.datebox){ - $.extend($.fn.datetimebox.defaults,{ - currentText: $.fn.datebox.defaults.currentText, - closeText: $.fn.datebox.defaults.closeText, - okText: $.fn.datebox.defaults.okText - }); -} +if ($.fn.pagination){ + $.fn.pagination.defaults.beforePageText = 'صفحة'; + $.fn.pagination.defaults.afterPageText = 'من {pages}'; + $.fn.pagination.defaults.displayMsg = 'عرض {from} إلى {to} من {total} عنصر'; +} +if ($.fn.datagrid){ + $.fn.datagrid.defaults.loadMsg = 'معالجة, الرجاء الإنتظار ...'; +} +if ($.fn.treegrid && $.fn.datagrid){ + $.fn.treegrid.defaults.loadMsg = $.fn.datagrid.defaults.loadMsg; +} +if ($.messager){ + $.messager.defaults.ok = 'موافق'; + $.messager.defaults.cancel = 'إلغاء'; +} +$.map(['validatebox','textbox','filebox','searchbox', + 'combo','combobox','combogrid','combotree', + 'datebox','datetimebox','numberbox', + 'spinner','numberspinner','timespinner','datetimespinner'], function(plugin){ + if ($.fn[plugin]){ + $.fn[plugin].defaults.missingMessage = 'هذا الحقل مطلوب.'; + } +}); +if ($.fn.validatebox){ + $.fn.validatebox.defaults.rules.email.message = 'الرجاء إدخال بريد إلكتروني صحيح.'; + $.fn.validatebox.defaults.rules.url.message = 'الرجاء إدخال رابط صحيح.'; + $.fn.validatebox.defaults.rules.length.message = 'الرجاء إدخال قيمة بين {0} و {1}.'; + $.fn.validatebox.defaults.rules.remote.message = 'الرجاء التأكد من الحقل.'; +} +if ($.fn.calendar){ + $.fn.calendar.defaults.weeks = ['S','M','T','W','T','F','S']; + $.fn.calendar.defaults.months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']; +} +if ($.fn.datebox){ + $.fn.datebox.defaults.currentText = 'اليوم'; + $.fn.datebox.defaults.closeText = 'إغلاق'; + $.fn.datebox.defaults.okText = 'موافق'; +} +if ($.fn.datetimebox && $.fn.datebox){ + $.extend($.fn.datetimebox.defaults,{ + currentText: $.fn.datebox.defaults.currentText, + closeText: $.fn.datebox.defaults.closeText, + okText: $.fn.datebox.defaults.okText + }); +} diff --git a/src/main/webapp/js/easyui/locale/easyui-lang-bg.js b/src/main/webapp/js/easyui/locale/easyui-lang-bg.js index daba595..56df9a7 100644 --- a/src/main/webapp/js/easyui/locale/easyui-lang-bg.js +++ b/src/main/webapp/js/easyui/locale/easyui-lang-bg.js @@ -1,44 +1,44 @@ -if ($.fn.pagination){ - $.fn.pagination.defaults.beforePageText = 'Страница'; - $.fn.pagination.defaults.afterPageText = 'от {pages}'; - $.fn.pagination.defaults.displayMsg = 'Показани {from} за {to} от {total} продукти'; -} -if ($.fn.datagrid){ - $.fn.datagrid.defaults.loadMsg = 'Обработка, моля изчакайте ...'; -} -if ($.fn.treegrid && $.fn.datagrid){ - $.fn.treegrid.defaults.loadMsg = $.fn.datagrid.defaults.loadMsg; -} -if ($.messager){ - $.messager.defaults.ok = 'Добре'; - $.messager.defaults.cancel = 'Задрасквам'; -} -$.map(['validatebox','textbox','filebox','searchbox', - 'combo','combobox','combogrid','combotree', - 'datebox','datetimebox','numberbox', - 'spinner','numberspinner','timespinner','datetimespinner'], function(plugin){ - if ($.fn[plugin]){ - $.fn[plugin].defaults.missingMessage = 'Това поле е задължително.'; - } -}); -if ($.fn.validatebox){ - $.fn.validatebox.defaults.rules.email.message = 'Моля, въведете валиден имейл адрес.'; - $.fn.validatebox.defaults.rules.url.message = 'Моля въведете валиден URL.'; - $.fn.validatebox.defaults.rules.length.message = 'Моля, въведете стойност между {0} и {1}.'; -} -if ($.fn.calendar){ - $.fn.calendar.defaults.weeks = ['S','M','T','W','T','F','S']; - $.fn.calendar.defaults.months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']; -} -if ($.fn.datebox){ - $.fn.datebox.defaults.currentText = 'Днес'; - $.fn.datebox.defaults.closeText = 'Близо'; - $.fn.datebox.defaults.okText = 'Добре'; -} -if ($.fn.datetimebox && $.fn.datebox){ - $.extend($.fn.datetimebox.defaults,{ - currentText: $.fn.datebox.defaults.currentText, - closeText: $.fn.datebox.defaults.closeText, - okText: $.fn.datebox.defaults.okText - }); -} +if ($.fn.pagination){ + $.fn.pagination.defaults.beforePageText = 'Страница'; + $.fn.pagination.defaults.afterPageText = 'от {pages}'; + $.fn.pagination.defaults.displayMsg = 'Показани {from} за {to} от {total} продукти'; +} +if ($.fn.datagrid){ + $.fn.datagrid.defaults.loadMsg = 'Обработка, моля изчакайте ...'; +} +if ($.fn.treegrid && $.fn.datagrid){ + $.fn.treegrid.defaults.loadMsg = $.fn.datagrid.defaults.loadMsg; +} +if ($.messager){ + $.messager.defaults.ok = 'Добре'; + $.messager.defaults.cancel = 'Задрасквам'; +} +$.map(['validatebox','textbox','filebox','searchbox', + 'combo','combobox','combogrid','combotree', + 'datebox','datetimebox','numberbox', + 'spinner','numberspinner','timespinner','datetimespinner'], function(plugin){ + if ($.fn[plugin]){ + $.fn[plugin].defaults.missingMessage = 'Това поле е задължително.'; + } +}); +if ($.fn.validatebox){ + $.fn.validatebox.defaults.rules.email.message = 'Моля, въведете валиден имейл адрес.'; + $.fn.validatebox.defaults.rules.url.message = 'Моля въведете валиден URL.'; + $.fn.validatebox.defaults.rules.length.message = 'Моля, въведете стойност между {0} и {1}.'; +} +if ($.fn.calendar){ + $.fn.calendar.defaults.weeks = ['S','M','T','W','T','F','S']; + $.fn.calendar.defaults.months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']; +} +if ($.fn.datebox){ + $.fn.datebox.defaults.currentText = 'Днес'; + $.fn.datebox.defaults.closeText = 'Близо'; + $.fn.datebox.defaults.okText = 'Добре'; +} +if ($.fn.datetimebox && $.fn.datebox){ + $.extend($.fn.datetimebox.defaults,{ + currentText: $.fn.datebox.defaults.currentText, + closeText: $.fn.datebox.defaults.closeText, + okText: $.fn.datebox.defaults.okText + }); +} diff --git a/src/main/webapp/js/easyui/locale/easyui-lang-ca.js b/src/main/webapp/js/easyui/locale/easyui-lang-ca.js index b018e2b..872ff3d 100644 --- a/src/main/webapp/js/easyui/locale/easyui-lang-ca.js +++ b/src/main/webapp/js/easyui/locale/easyui-lang-ca.js @@ -1,44 +1,44 @@ -if ($.fn.pagination){ - $.fn.pagination.defaults.beforePageText = 'Pàgina'; - $.fn.pagination.defaults.afterPageText = 'de {pages}'; - $.fn.pagination.defaults.displayMsg = "Veient {from} a {to} de {total} d'articles"; -} -if ($.fn.datagrid){ - $.fn.datagrid.defaults.loadMsg = 'Elaboració, si us plau esperi ...'; -} -if ($.fn.treegrid && $.fn.datagrid){ - $.fn.treegrid.defaults.loadMsg = $.fn.datagrid.defaults.loadMsg; -} -if ($.messager){ - $.messager.defaults.ok = 'Ok'; - $.messager.defaults.cancel = 'Cancel'; -} -$.map(['validatebox','textbox','filebox','searchbox', - 'combo','combobox','combogrid','combotree', - 'datebox','datetimebox','numberbox', - 'spinner','numberspinner','timespinner','datetimespinner'], function(plugin){ - if ($.fn[plugin]){ - $.fn[plugin].defaults.missingMessage = 'Aquest camp és obligatori.'; - } -}); -if ($.fn.validatebox){ - $.fn.validatebox.defaults.rules.email.message = 'Introduïu una adreça de correu electrònic vàlida.'; - $.fn.validatebox.defaults.rules.url.message = 'Si us plau, introduïu un URL vàlida.'; - $.fn.validatebox.defaults.rules.length.message = 'Si us plau, introduïu un valor entre {0} i {1}.'; -} -if ($.fn.calendar){ - $.fn.calendar.defaults.weeks = ['S','M','T','W','T','F','S']; - $.fn.calendar.defaults.months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']; -} -if ($.fn.datebox){ - $.fn.datebox.defaults.currentText = 'Avui'; - $.fn.datebox.defaults.closeText = 'Tancar'; - $.fn.datebox.defaults.okText = 'Ok'; -} -if ($.fn.datetimebox && $.fn.datebox){ - $.extend($.fn.datetimebox.defaults,{ - currentText: $.fn.datebox.defaults.currentText, - closeText: $.fn.datebox.defaults.closeText, - okText: $.fn.datebox.defaults.okText - }); -} +if ($.fn.pagination){ + $.fn.pagination.defaults.beforePageText = 'Pàgina'; + $.fn.pagination.defaults.afterPageText = 'de {pages}'; + $.fn.pagination.defaults.displayMsg = "Veient {from} a {to} de {total} d'articles"; +} +if ($.fn.datagrid){ + $.fn.datagrid.defaults.loadMsg = 'Elaboració, si us plau esperi ...'; +} +if ($.fn.treegrid && $.fn.datagrid){ + $.fn.treegrid.defaults.loadMsg = $.fn.datagrid.defaults.loadMsg; +} +if ($.messager){ + $.messager.defaults.ok = 'Ok'; + $.messager.defaults.cancel = 'Cancel'; +} +$.map(['validatebox','textbox','filebox','searchbox', + 'combo','combobox','combogrid','combotree', + 'datebox','datetimebox','numberbox', + 'spinner','numberspinner','timespinner','datetimespinner'], function(plugin){ + if ($.fn[plugin]){ + $.fn[plugin].defaults.missingMessage = 'Aquest camp és obligatori.'; + } +}); +if ($.fn.validatebox){ + $.fn.validatebox.defaults.rules.email.message = 'Introduïu una adreça de correu electrònic vàlida.'; + $.fn.validatebox.defaults.rules.url.message = 'Si us plau, introduïu un URL vàlida.'; + $.fn.validatebox.defaults.rules.length.message = 'Si us plau, introduïu un valor entre {0} i {1}.'; +} +if ($.fn.calendar){ + $.fn.calendar.defaults.weeks = ['S','M','T','W','T','F','S']; + $.fn.calendar.defaults.months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']; +} +if ($.fn.datebox){ + $.fn.datebox.defaults.currentText = 'Avui'; + $.fn.datebox.defaults.closeText = 'Tancar'; + $.fn.datebox.defaults.okText = 'Ok'; +} +if ($.fn.datetimebox && $.fn.datebox){ + $.extend($.fn.datetimebox.defaults,{ + currentText: $.fn.datebox.defaults.currentText, + closeText: $.fn.datebox.defaults.closeText, + okText: $.fn.datebox.defaults.okText + }); +} diff --git a/src/main/webapp/js/easyui/locale/easyui-lang-cs.js b/src/main/webapp/js/easyui/locale/easyui-lang-cs.js index d87aafb..738ad90 100644 --- a/src/main/webapp/js/easyui/locale/easyui-lang-cs.js +++ b/src/main/webapp/js/easyui/locale/easyui-lang-cs.js @@ -1,44 +1,44 @@ -if ($.fn.pagination){ - $.fn.pagination.defaults.beforePageText = 'Strana'; - $.fn.pagination.defaults.afterPageText = 'z {pages}'; - $.fn.pagination.defaults.displayMsg = 'Zobrazuji {from} do {to} z {total} položky'; -} -if ($.fn.datagrid){ - $.fn.datagrid.defaults.loadMsg = 'Zpracování, čekejte prosím ...'; -} -if ($.fn.treegrid && $.fn.datagrid){ - $.fn.treegrid.defaults.loadMsg = $.fn.datagrid.defaults.loadMsg; -} -if ($.messager){ - $.messager.defaults.ok = 'Ok'; - $.messager.defaults.cancel = 'Zrušit'; -} -$.map(['validatebox','textbox','filebox','searchbox', - 'combo','combobox','combogrid','combotree', - 'datebox','datetimebox','numberbox', - 'spinner','numberspinner','timespinner','datetimespinner'], function(plugin){ - if ($.fn[plugin]){ - $.fn[plugin].defaults.missingMessage = 'Toto pole je vyžadováno.'; - } -}); -if ($.fn.validatebox){ - $.fn.validatebox.defaults.rules.email.message = 'Zadejte prosím platnou e-mailovou adresu.'; - $.fn.validatebox.defaults.rules.url.message = 'Zadejte prosím platnou adresu URL.'; - $.fn.validatebox.defaults.rules.length.message = 'Prosím, zadejte hodnotu mezi {0} a {1}.'; -} -if ($.fn.calendar){ - $.fn.calendar.defaults.weeks = ['S','M','T','W','T','F','S']; - $.fn.calendar.defaults.months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']; -} -if ($.fn.datebox){ - $.fn.datebox.defaults.currentText = 'Dnes'; - $.fn.datebox.defaults.closeText = 'Zavřít'; - $.fn.datebox.defaults.okText = 'Ok'; -} -if ($.fn.datetimebox && $.fn.datebox){ - $.extend($.fn.datetimebox.defaults,{ - currentText: $.fn.datebox.defaults.currentText, - closeText: $.fn.datebox.defaults.closeText, - okText: $.fn.datebox.defaults.okText - }); -} +if ($.fn.pagination){ + $.fn.pagination.defaults.beforePageText = 'Strana'; + $.fn.pagination.defaults.afterPageText = 'z {pages}'; + $.fn.pagination.defaults.displayMsg = 'Zobrazuji {from} do {to} z {total} položky'; +} +if ($.fn.datagrid){ + $.fn.datagrid.defaults.loadMsg = 'Zpracování, čekejte prosím ...'; +} +if ($.fn.treegrid && $.fn.datagrid){ + $.fn.treegrid.defaults.loadMsg = $.fn.datagrid.defaults.loadMsg; +} +if ($.messager){ + $.messager.defaults.ok = 'Ok'; + $.messager.defaults.cancel = 'Zrušit'; +} +$.map(['validatebox','textbox','filebox','searchbox', + 'combo','combobox','combogrid','combotree', + 'datebox','datetimebox','numberbox', + 'spinner','numberspinner','timespinner','datetimespinner'], function(plugin){ + if ($.fn[plugin]){ + $.fn[plugin].defaults.missingMessage = 'Toto pole je vyžadováno.'; + } +}); +if ($.fn.validatebox){ + $.fn.validatebox.defaults.rules.email.message = 'Zadejte prosím platnou e-mailovou adresu.'; + $.fn.validatebox.defaults.rules.url.message = 'Zadejte prosím platnou adresu URL.'; + $.fn.validatebox.defaults.rules.length.message = 'Prosím, zadejte hodnotu mezi {0} a {1}.'; +} +if ($.fn.calendar){ + $.fn.calendar.defaults.weeks = ['S','M','T','W','T','F','S']; + $.fn.calendar.defaults.months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']; +} +if ($.fn.datebox){ + $.fn.datebox.defaults.currentText = 'Dnes'; + $.fn.datebox.defaults.closeText = 'Zavřít'; + $.fn.datebox.defaults.okText = 'Ok'; +} +if ($.fn.datetimebox && $.fn.datebox){ + $.extend($.fn.datetimebox.defaults,{ + currentText: $.fn.datebox.defaults.currentText, + closeText: $.fn.datebox.defaults.closeText, + okText: $.fn.datebox.defaults.okText + }); +} diff --git a/src/main/webapp/js/easyui/locale/easyui-lang-cz.js b/src/main/webapp/js/easyui/locale/easyui-lang-cz.js index eea0d2b..0e370d4 100644 --- a/src/main/webapp/js/easyui/locale/easyui-lang-cz.js +++ b/src/main/webapp/js/easyui/locale/easyui-lang-cz.js @@ -1,44 +1,44 @@ -if ($.fn.pagination){ - $.fn.pagination.defaults.beforePageText = 'Strana'; - $.fn.pagination.defaults.afterPageText = 'z {pages}'; - $.fn.pagination.defaults.displayMsg = 'Zobrazuji záznam {from} až {to} z {total}.'; -} -if ($.fn.datagrid){ - $.fn.datagrid.defaults.loadMsg = 'Pracuji, čekejte prosím…'; -} -if ($.fn.treegrid && $.fn.datagrid){ - $.fn.treegrid.defaults.loadMsg = $.fn.datagrid.defaults.loadMsg; -} -if ($.messager){ - $.messager.defaults.ok = 'Ok'; - $.messager.defaults.cancel = 'Zrušit'; -} -$.map(['validatebox','textbox','filebox','searchbox', - 'combo','combobox','combogrid','combotree', - 'datebox','datetimebox','numberbox', - 'spinner','numberspinner','timespinner','datetimespinner'], function(plugin){ - if ($.fn[plugin]){ - $.fn[plugin].defaults.missingMessage = 'Toto pole je vyžadováno.'; - } -}); -if ($.fn.validatebox){ - $.fn.validatebox.defaults.rules.email.message = 'Zadejte, prosím, platnou e-mailovou adresu.'; - $.fn.validatebox.defaults.rules.url.message = 'Zadejte, prosím, platnou adresu URL.'; - $.fn.validatebox.defaults.rules.length.message = 'Zadejte, prosím, hodnotu mezi {0} a {1}.'; -} -if ($.fn.calendar){ - $.fn.calendar.defaults.weeks = ['N','P','Ú','S','Č','P','S']; //neděle pondělí úterý středa čtvrtek pátek sobota - $.fn.calendar.defaults.months = ['led', 'únr', 'bře', 'dub', 'kvě', 'čvn', 'čvc', 'srp', 'zář', 'říj', 'lis', 'pro']; //leden únor březen duben květen červen červenec srpen září říjen listopad prosinec -} -if ($.fn.datebox){ - $.fn.datebox.defaults.currentText = 'Dnes'; - $.fn.datebox.defaults.closeText = 'Zavřít'; - $.fn.datebox.defaults.okText = 'Ok'; -} -if ($.fn.datetimebox && $.fn.datebox){ - $.extend($.fn.datetimebox.defaults,{ - currentText: $.fn.datebox.defaults.currentText, - closeText: $.fn.datebox.defaults.closeText, - okText: $.fn.datebox.defaults.okText - }); -} +if ($.fn.pagination){ + $.fn.pagination.defaults.beforePageText = 'Strana'; + $.fn.pagination.defaults.afterPageText = 'z {pages}'; + $.fn.pagination.defaults.displayMsg = 'Zobrazuji záznam {from} až {to} z {total}.'; +} +if ($.fn.datagrid){ + $.fn.datagrid.defaults.loadMsg = 'Pracuji, čekejte prosím…'; +} +if ($.fn.treegrid && $.fn.datagrid){ + $.fn.treegrid.defaults.loadMsg = $.fn.datagrid.defaults.loadMsg; +} +if ($.messager){ + $.messager.defaults.ok = 'Ok'; + $.messager.defaults.cancel = 'Zrušit'; +} +$.map(['validatebox','textbox','filebox','searchbox', + 'combo','combobox','combogrid','combotree', + 'datebox','datetimebox','numberbox', + 'spinner','numberspinner','timespinner','datetimespinner'], function(plugin){ + if ($.fn[plugin]){ + $.fn[plugin].defaults.missingMessage = 'Toto pole je vyžadováno.'; + } +}); +if ($.fn.validatebox){ + $.fn.validatebox.defaults.rules.email.message = 'Zadejte, prosím, platnou e-mailovou adresu.'; + $.fn.validatebox.defaults.rules.url.message = 'Zadejte, prosím, platnou adresu URL.'; + $.fn.validatebox.defaults.rules.length.message = 'Zadejte, prosím, hodnotu mezi {0} a {1}.'; +} +if ($.fn.calendar){ + $.fn.calendar.defaults.weeks = ['N','P','Ú','S','Č','P','S']; //neděle pondělí úterý středa čtvrtek pátek sobota + $.fn.calendar.defaults.months = ['led', 'únr', 'bře', 'dub', 'kvě', 'čvn', 'čvc', 'srp', 'zář', 'říj', 'lis', 'pro']; //leden únor březen duben květen červen červenec srpen září říjen listopad prosinec +} +if ($.fn.datebox){ + $.fn.datebox.defaults.currentText = 'Dnes'; + $.fn.datebox.defaults.closeText = 'Zavřít'; + $.fn.datebox.defaults.okText = 'Ok'; +} +if ($.fn.datetimebox && $.fn.datebox){ + $.extend($.fn.datetimebox.defaults,{ + currentText: $.fn.datebox.defaults.currentText, + closeText: $.fn.datebox.defaults.closeText, + okText: $.fn.datebox.defaults.okText + }); +} diff --git a/src/main/webapp/js/easyui/locale/easyui-lang-da.js b/src/main/webapp/js/easyui/locale/easyui-lang-da.js index f3f6e3b..4a3841e 100644 --- a/src/main/webapp/js/easyui/locale/easyui-lang-da.js +++ b/src/main/webapp/js/easyui/locale/easyui-lang-da.js @@ -1,44 +1,44 @@ -if ($.fn.pagination){ - $.fn.pagination.defaults.beforePageText = 'Page'; - $.fn.pagination.defaults.afterPageText = 'af {pages}'; - $.fn.pagination.defaults.displayMsg = 'Viser {from} til {to} af {total} poster'; -} -if ($.fn.datagrid){ - $.fn.datagrid.defaults.loadMsg = 'Behandling, vent venligst ...'; -} -if ($.fn.treegrid && $.fn.datagrid){ - $.fn.treegrid.defaults.loadMsg = $.fn.datagrid.defaults.loadMsg; -} -if ($.messager){ - $.messager.defaults.ok = 'Ok'; - $.messager.defaults.cancel = 'Annuller'; -} -$.map(['validatebox','textbox','filebox','searchbox', - 'combo','combobox','combogrid','combotree', - 'datebox','datetimebox','numberbox', - 'spinner','numberspinner','timespinner','datetimespinner'], function(plugin){ - if ($.fn[plugin]){ - $.fn[plugin].defaults.missingMessage = 'Dette felt er påkrævet.'; - } -}); -if ($.fn.validatebox){ - $.fn.validatebox.defaults.rules.email.message = 'Angiv en gyldig e-mail-adresse.'; - $.fn.validatebox.defaults.rules.url.message = 'Angiv en gyldig webadresse.'; - $.fn.validatebox.defaults.rules.length.message = 'Angiv en værdi mellem {0} og {1}.'; -} -if ($.fn.calendar){ - $.fn.calendar.defaults.weeks = ['S','M','T','W','T','F','S']; - $.fn.calendar.defaults.months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']; -} -if ($.fn.datebox){ - $.fn.datebox.defaults.currentText = 'I dag'; - $.fn.datebox.defaults.closeText = 'Luk'; - $.fn.datebox.defaults.okText = 'Ok'; -} -if ($.fn.datetimebox && $.fn.datebox){ - $.extend($.fn.datetimebox.defaults,{ - currentText: $.fn.datebox.defaults.currentText, - closeText: $.fn.datebox.defaults.closeText, - okText: $.fn.datebox.defaults.okText - }); -} +if ($.fn.pagination){ + $.fn.pagination.defaults.beforePageText = 'Page'; + $.fn.pagination.defaults.afterPageText = 'af {pages}'; + $.fn.pagination.defaults.displayMsg = 'Viser {from} til {to} af {total} poster'; +} +if ($.fn.datagrid){ + $.fn.datagrid.defaults.loadMsg = 'Behandling, vent venligst ...'; +} +if ($.fn.treegrid && $.fn.datagrid){ + $.fn.treegrid.defaults.loadMsg = $.fn.datagrid.defaults.loadMsg; +} +if ($.messager){ + $.messager.defaults.ok = 'Ok'; + $.messager.defaults.cancel = 'Annuller'; +} +$.map(['validatebox','textbox','filebox','searchbox', + 'combo','combobox','combogrid','combotree', + 'datebox','datetimebox','numberbox', + 'spinner','numberspinner','timespinner','datetimespinner'], function(plugin){ + if ($.fn[plugin]){ + $.fn[plugin].defaults.missingMessage = 'Dette felt er påkrævet.'; + } +}); +if ($.fn.validatebox){ + $.fn.validatebox.defaults.rules.email.message = 'Angiv en gyldig e-mail-adresse.'; + $.fn.validatebox.defaults.rules.url.message = 'Angiv en gyldig webadresse.'; + $.fn.validatebox.defaults.rules.length.message = 'Angiv en værdi mellem {0} og {1}.'; +} +if ($.fn.calendar){ + $.fn.calendar.defaults.weeks = ['S','M','T','W','T','F','S']; + $.fn.calendar.defaults.months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']; +} +if ($.fn.datebox){ + $.fn.datebox.defaults.currentText = 'I dag'; + $.fn.datebox.defaults.closeText = 'Luk'; + $.fn.datebox.defaults.okText = 'Ok'; +} +if ($.fn.datetimebox && $.fn.datebox){ + $.extend($.fn.datetimebox.defaults,{ + currentText: $.fn.datebox.defaults.currentText, + closeText: $.fn.datebox.defaults.closeText, + okText: $.fn.datebox.defaults.okText + }); +} diff --git a/src/main/webapp/js/easyui/locale/easyui-lang-de.js b/src/main/webapp/js/easyui/locale/easyui-lang-de.js index ffcba29..659cfe7 100644 --- a/src/main/webapp/js/easyui/locale/easyui-lang-de.js +++ b/src/main/webapp/js/easyui/locale/easyui-lang-de.js @@ -1,63 +1,63 @@ -if ($.fn.pagination){ - $.fn.pagination.defaults.beforePageText = 'Seite'; - $.fn.pagination.defaults.afterPageText = 'von {pages}'; - $.fn.pagination.defaults.displayMsg = '{from} bis {to} von {total} Datensätzen'; -} -if ($.fn.datagrid){ - $.fn.datagrid.defaults.loadMsg = 'Verarbeitung läuft, bitte warten ...'; -} -if ($.fn.treegrid && $.fn.datagrid){ - $.fn.treegrid.defaults.loadMsg = $.fn.datagrid.defaults.loadMsg; -} -if ($.messager){ - $.messager.defaults.ok = 'OK'; - $.messager.defaults.cancel = 'Abbruch'; -} -$.map(['validatebox','textbox','filebox','searchbox', - 'combo','combobox','combogrid','combotree', - 'datebox','datetimebox','numberbox', - 'spinner','numberspinner','timespinner','datetimespinner'], function(plugin){ - if ($.fn[plugin]){ - $.fn[plugin].defaults.missingMessage = 'Dieses Feld wird benötigt.'; - } -}); -if ($.fn.validatebox){ - $.fn.validatebox.defaults.rules.email.message = 'Bitte geben Sie eine gültige E-Mail-Adresse ein.'; - $.fn.validatebox.defaults.rules.url.message = 'Bitte geben Sie eine gültige URL ein.'; - $.fn.validatebox.defaults.rules.length.message = 'Bitte geben Sie einen Wert zwischen {0} und {1} ein.'; -} -if ($.fn.calendar){ - $.fn.calendar.defaults.firstDay = 1; - $.fn.calendar.defaults.weeks = ['S','M','D','M','D','F','S']; - $.fn.calendar.defaults.months = ['Jan', 'Feb', 'Mär', 'Apr', 'Mai', 'Jun', 'Jul', 'Aug', 'Sep', 'Okt', 'Nov', 'Dez']; -} -if ($.fn.datebox){ - $.fn.datebox.defaults.currentText = 'Heute'; - $.fn.datebox.defaults.closeText = 'Schließen'; - $.fn.datebox.defaults.okText = 'OK'; - $.fn.datebox.defaults.formatter = function(date){ - var y = date.getFullYear(); - var m = date.getMonth()+1; - var d = date.getDate(); - return (d<10?('0'+d):d)+'.'+(m<10?('0'+m):m)+'.'+y; - }; - $.fn.datebox.defaults.parser = function(s){ - if (!s) return new Date(); - var ss = s.split('.'); - var m = parseInt(ss[1],10); - var d = parseInt(ss[0],10); - var y = parseInt(ss[2],10); - if (!isNaN(y) && !isNaN(m) && !isNaN(d)){ - return new Date(y,m-1,d); - } else { - return new Date(); - } - }; -} -if ($.fn.datetimebox && $.fn.datebox){ - $.extend($.fn.datetimebox.defaults,{ - currentText: $.fn.datebox.defaults.currentText, - closeText: $.fn.datebox.defaults.closeText, - okText: $.fn.datebox.defaults.okText - }); -} +if ($.fn.pagination){ + $.fn.pagination.defaults.beforePageText = 'Seite'; + $.fn.pagination.defaults.afterPageText = 'von {pages}'; + $.fn.pagination.defaults.displayMsg = '{from} bis {to} von {total} Datensätzen'; +} +if ($.fn.datagrid){ + $.fn.datagrid.defaults.loadMsg = 'Verarbeitung läuft, bitte warten ...'; +} +if ($.fn.treegrid && $.fn.datagrid){ + $.fn.treegrid.defaults.loadMsg = $.fn.datagrid.defaults.loadMsg; +} +if ($.messager){ + $.messager.defaults.ok = 'OK'; + $.messager.defaults.cancel = 'Abbruch'; +} +$.map(['validatebox','textbox','filebox','searchbox', + 'combo','combobox','combogrid','combotree', + 'datebox','datetimebox','numberbox', + 'spinner','numberspinner','timespinner','datetimespinner'], function(plugin){ + if ($.fn[plugin]){ + $.fn[plugin].defaults.missingMessage = 'Dieses Feld wird benötigt.'; + } +}); +if ($.fn.validatebox){ + $.fn.validatebox.defaults.rules.email.message = 'Bitte geben Sie eine gültige E-Mail-Adresse ein.'; + $.fn.validatebox.defaults.rules.url.message = 'Bitte geben Sie eine gültige URL ein.'; + $.fn.validatebox.defaults.rules.length.message = 'Bitte geben Sie einen Wert zwischen {0} und {1} ein.'; +} +if ($.fn.calendar){ + $.fn.calendar.defaults.firstDay = 1; + $.fn.calendar.defaults.weeks = ['S','M','D','M','D','F','S']; + $.fn.calendar.defaults.months = ['Jan', 'Feb', 'Mär', 'Apr', 'Mai', 'Jun', 'Jul', 'Aug', 'Sep', 'Okt', 'Nov', 'Dez']; +} +if ($.fn.datebox){ + $.fn.datebox.defaults.currentText = 'Heute'; + $.fn.datebox.defaults.closeText = 'Schließen'; + $.fn.datebox.defaults.okText = 'OK'; + $.fn.datebox.defaults.formatter = function(date){ + var y = date.getFullYear(); + var m = date.getMonth()+1; + var d = date.getDate(); + return (d<10?('0'+d):d)+'.'+(m<10?('0'+m):m)+'.'+y; + }; + $.fn.datebox.defaults.parser = function(s){ + if (!s) return new Date(); + var ss = s.split('.'); + var m = parseInt(ss[1],10); + var d = parseInt(ss[0],10); + var y = parseInt(ss[2],10); + if (!isNaN(y) && !isNaN(m) && !isNaN(d)){ + return new Date(y,m-1,d); + } else { + return new Date(); + } + }; +} +if ($.fn.datetimebox && $.fn.datebox){ + $.extend($.fn.datetimebox.defaults,{ + currentText: $.fn.datebox.defaults.currentText, + closeText: $.fn.datebox.defaults.closeText, + okText: $.fn.datebox.defaults.okText + }); +} diff --git a/src/main/webapp/js/easyui/locale/easyui-lang-el.js b/src/main/webapp/js/easyui/locale/easyui-lang-el.js index 78d9de5..8224282 100644 --- a/src/main/webapp/js/easyui/locale/easyui-lang-el.js +++ b/src/main/webapp/js/easyui/locale/easyui-lang-el.js @@ -1,45 +1,45 @@ -if ($.fn.pagination){ - $.fn.pagination.defaults.beforePageText = 'Σελίδα'; - $.fn.pagination.defaults.afterPageText = 'από {pages}'; - $.fn.pagination.defaults.displayMsg = 'Εμφάνιση {from} εώς {to} από {total} αντικείμενα'; -} -if ($.fn.datagrid){ - $.fn.datagrid.defaults.loadMsg = 'Γίνεται Επεξεργασία, Παρακαλώ Περιμένετε ...'; -} -if ($.fn.treegrid && $.fn.datagrid){ - $.fn.treegrid.defaults.loadMsg = $.fn.datagrid.defaults.loadMsg; -} -if ($.messager){ - $.messager.defaults.ok = 'Εντάξει'; - $.messager.defaults.cancel = 'Άκυρο'; -} -$.map(['validatebox','textbox','filebox','searchbox', - 'combo','combobox','combogrid','combotree', - 'datebox','datetimebox','numberbox', - 'spinner','numberspinner','timespinner','datetimespinner'], function(plugin){ - if ($.fn[plugin]){ - $.fn[plugin].defaults.missingMessage = 'Το πεδίο είναι υποχρεωτικό.'; - } -}); -if ($.fn.validatebox){ - $.fn.validatebox.defaults.rules.email.message = 'Παρακαλώ εισάγετε σωστή Ηλ.Διεύθυνση.'; - $.fn.validatebox.defaults.rules.url.message = 'Παρακαλώ εισάγετε σωστό σύνδεσμο.'; - $.fn.validatebox.defaults.rules.length.message = 'Παρακαλώ εισάγετε τιμή μεταξύ {0} και {1}.'; - $.fn.validatebox.defaults.rules.remote.message = 'Παρακαλώ διορθώστε αυτό το πεδίο.'; -} -if ($.fn.calendar){ - $.fn.calendar.defaults.weeks = ['Κυρ','Δευ','Τρι','Τετ','Πεμ','Παρ','Σαβ']; - $.fn.calendar.defaults.months = ['Ιαν', 'Φεβ', 'Μαρ', 'Απρ', 'Μαϊ', 'Ιου', 'Ιου', 'Αυγ', 'Σεπ', 'Οκτ', 'Νοε', 'Δεκ']; -} -if ($.fn.datebox){ - $.fn.datebox.defaults.currentText = 'Σήμερα'; - $.fn.datebox.defaults.closeText = 'Κλείσιμο'; - $.fn.datebox.defaults.okText = 'Εντάξει'; -} -if ($.fn.datetimebox && $.fn.datebox){ - $.extend($.fn.datetimebox.defaults,{ - currentText: $.fn.datebox.defaults.currentText, - closeText: $.fn.datebox.defaults.closeText, - okText: $.fn.datebox.defaults.okText - }); -} +if ($.fn.pagination){ + $.fn.pagination.defaults.beforePageText = 'Σελίδα'; + $.fn.pagination.defaults.afterPageText = 'από {pages}'; + $.fn.pagination.defaults.displayMsg = 'Εμφάνιση {from} εώς {to} από {total} αντικείμενα'; +} +if ($.fn.datagrid){ + $.fn.datagrid.defaults.loadMsg = 'Γίνεται Επεξεργασία, Παρακαλώ Περιμένετε ...'; +} +if ($.fn.treegrid && $.fn.datagrid){ + $.fn.treegrid.defaults.loadMsg = $.fn.datagrid.defaults.loadMsg; +} +if ($.messager){ + $.messager.defaults.ok = 'Εντάξει'; + $.messager.defaults.cancel = 'Άκυρο'; +} +$.map(['validatebox','textbox','filebox','searchbox', + 'combo','combobox','combogrid','combotree', + 'datebox','datetimebox','numberbox', + 'spinner','numberspinner','timespinner','datetimespinner'], function(plugin){ + if ($.fn[plugin]){ + $.fn[plugin].defaults.missingMessage = 'Το πεδίο είναι υποχρεωτικό.'; + } +}); +if ($.fn.validatebox){ + $.fn.validatebox.defaults.rules.email.message = 'Παρακαλώ εισάγετε σωστή Ηλ.Διεύθυνση.'; + $.fn.validatebox.defaults.rules.url.message = 'Παρακαλώ εισάγετε σωστό σύνδεσμο.'; + $.fn.validatebox.defaults.rules.length.message = 'Παρακαλώ εισάγετε τιμή μεταξύ {0} και {1}.'; + $.fn.validatebox.defaults.rules.remote.message = 'Παρακαλώ διορθώστε αυτό το πεδίο.'; +} +if ($.fn.calendar){ + $.fn.calendar.defaults.weeks = ['Κυρ','Δευ','Τρι','Τετ','Πεμ','Παρ','Σαβ']; + $.fn.calendar.defaults.months = ['Ιαν', 'Φεβ', 'Μαρ', 'Απρ', 'Μαϊ', 'Ιου', 'Ιου', 'Αυγ', 'Σεπ', 'Οκτ', 'Νοε', 'Δεκ']; +} +if ($.fn.datebox){ + $.fn.datebox.defaults.currentText = 'Σήμερα'; + $.fn.datebox.defaults.closeText = 'Κλείσιμο'; + $.fn.datebox.defaults.okText = 'Εντάξει'; +} +if ($.fn.datetimebox && $.fn.datebox){ + $.extend($.fn.datetimebox.defaults,{ + currentText: $.fn.datebox.defaults.currentText, + closeText: $.fn.datebox.defaults.closeText, + okText: $.fn.datebox.defaults.okText + }); +} diff --git a/src/main/webapp/js/easyui/locale/easyui-lang-en.js b/src/main/webapp/js/easyui/locale/easyui-lang-en.js index ce9a245..bdbeb8e 100644 --- a/src/main/webapp/js/easyui/locale/easyui-lang-en.js +++ b/src/main/webapp/js/easyui/locale/easyui-lang-en.js @@ -1,45 +1,45 @@ -if ($.fn.pagination){ - $.fn.pagination.defaults.beforePageText = 'Page'; - $.fn.pagination.defaults.afterPageText = 'of {pages}'; - $.fn.pagination.defaults.displayMsg = 'Displaying {from} to {to} of {total} items'; -} -if ($.fn.datagrid){ - $.fn.datagrid.defaults.loadMsg = 'Processing, please wait ...'; -} -if ($.fn.treegrid && $.fn.datagrid){ - $.fn.treegrid.defaults.loadMsg = $.fn.datagrid.defaults.loadMsg; -} -if ($.messager){ - $.messager.defaults.ok = 'Ok'; - $.messager.defaults.cancel = 'Cancel'; -} -$.map(['validatebox','textbox','filebox','searchbox', - 'combo','combobox','combogrid','combotree', - 'datebox','datetimebox','numberbox', - 'spinner','numberspinner','timespinner','datetimespinner'], function(plugin){ - if ($.fn[plugin]){ - $.fn[plugin].defaults.missingMessage = 'This field is required.'; - } -}); -if ($.fn.validatebox){ - $.fn.validatebox.defaults.rules.email.message = 'Please enter a valid email address.'; - $.fn.validatebox.defaults.rules.url.message = 'Please enter a valid URL.'; - $.fn.validatebox.defaults.rules.length.message = 'Please enter a value between {0} and {1}.'; - $.fn.validatebox.defaults.rules.remote.message = 'Please fix this field.'; -} -if ($.fn.calendar){ - $.fn.calendar.defaults.weeks = ['S','M','T','W','T','F','S']; - $.fn.calendar.defaults.months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']; -} -if ($.fn.datebox){ - $.fn.datebox.defaults.currentText = 'Today'; - $.fn.datebox.defaults.closeText = 'Close'; - $.fn.datebox.defaults.okText = 'Ok'; -} -if ($.fn.datetimebox && $.fn.datebox){ - $.extend($.fn.datetimebox.defaults,{ - currentText: $.fn.datebox.defaults.currentText, - closeText: $.fn.datebox.defaults.closeText, - okText: $.fn.datebox.defaults.okText - }); -} +if ($.fn.pagination){ + $.fn.pagination.defaults.beforePageText = 'Page'; + $.fn.pagination.defaults.afterPageText = 'of {pages}'; + $.fn.pagination.defaults.displayMsg = 'Displaying {from} to {to} of {total} items'; +} +if ($.fn.datagrid){ + $.fn.datagrid.defaults.loadMsg = 'Processing, please wait ...'; +} +if ($.fn.treegrid && $.fn.datagrid){ + $.fn.treegrid.defaults.loadMsg = $.fn.datagrid.defaults.loadMsg; +} +if ($.messager){ + $.messager.defaults.ok = 'Ok'; + $.messager.defaults.cancel = 'Cancel'; +} +$.map(['validatebox','textbox','filebox','searchbox', + 'combo','combobox','combogrid','combotree', + 'datebox','datetimebox','numberbox', + 'spinner','numberspinner','timespinner','datetimespinner'], function(plugin){ + if ($.fn[plugin]){ + $.fn[plugin].defaults.missingMessage = 'This field is required.'; + } +}); +if ($.fn.validatebox){ + $.fn.validatebox.defaults.rules.email.message = 'Please enter a valid email address.'; + $.fn.validatebox.defaults.rules.url.message = 'Please enter a valid URL.'; + $.fn.validatebox.defaults.rules.length.message = 'Please enter a value between {0} and {1}.'; + $.fn.validatebox.defaults.rules.remote.message = 'Please fix this field.'; +} +if ($.fn.calendar){ + $.fn.calendar.defaults.weeks = ['S','M','T','W','T','F','S']; + $.fn.calendar.defaults.months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']; +} +if ($.fn.datebox){ + $.fn.datebox.defaults.currentText = 'Today'; + $.fn.datebox.defaults.closeText = 'Close'; + $.fn.datebox.defaults.okText = 'Ok'; +} +if ($.fn.datetimebox && $.fn.datebox){ + $.extend($.fn.datetimebox.defaults,{ + currentText: $.fn.datebox.defaults.currentText, + closeText: $.fn.datebox.defaults.closeText, + okText: $.fn.datebox.defaults.okText + }); +} diff --git a/src/main/webapp/js/easyui/locale/easyui-lang-es.js b/src/main/webapp/js/easyui/locale/easyui-lang-es.js index 981f691..7083397 100644 --- a/src/main/webapp/js/easyui/locale/easyui-lang-es.js +++ b/src/main/webapp/js/easyui/locale/easyui-lang-es.js @@ -1,45 +1,45 @@ -if ($.fn.pagination){ - $.fn.pagination.defaults.beforePageText = 'Página'; - $.fn.pagination.defaults.afterPageText = 'de {pages}'; - $.fn.pagination.defaults.displayMsg = 'Mostrando {from} a {to} de {total} elementos'; -} -if ($.fn.datagrid){ - $.fn.datagrid.defaults.loadMsg = 'Procesando, por favor espere ...'; -} -if ($.fn.treegrid && $.fn.datagrid){ - $.fn.treegrid.defaults.loadMsg = $.fn.datagrid.defaults.loadMsg; -} -if ($.messager){ - $.messager.defaults.ok = 'Aceptar'; - $.messager.defaults.cancel = 'Cancelar'; -} -$.map(['validatebox','textbox','filebox','searchbox', - 'combo','combobox','combogrid','combotree', - 'datebox','datetimebox','numberbox', - 'spinner','numberspinner','timespinner','datetimespinner'], function(plugin){ - if ($.fn[plugin]){ - $.fn[plugin].defaults.missingMessage = 'Este campo es obligatorio.'; - } -}); -if ($.fn.validatebox){ - $.fn.validatebox.defaults.rules.email.message = 'Por favor ingrese una dirección de correo válida.'; - $.fn.validatebox.defaults.rules.url.message = 'Por favor ingrese una URL válida.'; - $.fn.validatebox.defaults.rules.length.message = 'Por favor ingrese un valor entre {0} y {1}.'; - $.fn.validatebox.defaults.rules.remote.message = 'Por favor corrija este campo.'; -} -if ($.fn.calendar){ - $.fn.calendar.defaults.weeks = ['Do','Lu','Ma','Mi','Ju','Vi','Sá']; - $.fn.calendar.defaults.months = ['Ene', 'Feb', 'Mar', 'Abr', 'May', 'Jun', 'Jul', 'Ago', 'Sep', 'Oct', 'Nov', 'Dic']; -} -if ($.fn.datebox){ - $.fn.datebox.defaults.currentText = 'Hoy'; - $.fn.datebox.defaults.closeText = 'Cerrar'; - $.fn.datebox.defaults.okText = 'Aceptar'; -} -if ($.fn.datetimebox && $.fn.datebox){ - $.extend($.fn.datetimebox.defaults,{ - currentText: $.fn.datebox.defaults.currentText, - closeText: $.fn.datebox.defaults.closeText, - okText: $.fn.datebox.defaults.okText - }); -} +if ($.fn.pagination){ + $.fn.pagination.defaults.beforePageText = 'Página'; + $.fn.pagination.defaults.afterPageText = 'de {pages}'; + $.fn.pagination.defaults.displayMsg = 'Mostrando {from} a {to} de {total} elementos'; +} +if ($.fn.datagrid){ + $.fn.datagrid.defaults.loadMsg = 'Procesando, por favor espere ...'; +} +if ($.fn.treegrid && $.fn.datagrid){ + $.fn.treegrid.defaults.loadMsg = $.fn.datagrid.defaults.loadMsg; +} +if ($.messager){ + $.messager.defaults.ok = 'Aceptar'; + $.messager.defaults.cancel = 'Cancelar'; +} +$.map(['validatebox','textbox','filebox','searchbox', + 'combo','combobox','combogrid','combotree', + 'datebox','datetimebox','numberbox', + 'spinner','numberspinner','timespinner','datetimespinner'], function(plugin){ + if ($.fn[plugin]){ + $.fn[plugin].defaults.missingMessage = 'Este campo es obligatorio.'; + } +}); +if ($.fn.validatebox){ + $.fn.validatebox.defaults.rules.email.message = 'Por favor ingrese una dirección de correo válida.'; + $.fn.validatebox.defaults.rules.url.message = 'Por favor ingrese una URL válida.'; + $.fn.validatebox.defaults.rules.length.message = 'Por favor ingrese un valor entre {0} y {1}.'; + $.fn.validatebox.defaults.rules.remote.message = 'Por favor corrija este campo.'; +} +if ($.fn.calendar){ + $.fn.calendar.defaults.weeks = ['Do','Lu','Ma','Mi','Ju','Vi','Sá']; + $.fn.calendar.defaults.months = ['Ene', 'Feb', 'Mar', 'Abr', 'May', 'Jun', 'Jul', 'Ago', 'Sep', 'Oct', 'Nov', 'Dic']; +} +if ($.fn.datebox){ + $.fn.datebox.defaults.currentText = 'Hoy'; + $.fn.datebox.defaults.closeText = 'Cerrar'; + $.fn.datebox.defaults.okText = 'Aceptar'; +} +if ($.fn.datetimebox && $.fn.datebox){ + $.extend($.fn.datetimebox.defaults,{ + currentText: $.fn.datebox.defaults.currentText, + closeText: $.fn.datebox.defaults.closeText, + okText: $.fn.datebox.defaults.okText + }); +} diff --git a/src/main/webapp/js/easyui/locale/easyui-lang-fr.js b/src/main/webapp/js/easyui/locale/easyui-lang-fr.js index 4d94a58..acdb1ad 100644 --- a/src/main/webapp/js/easyui/locale/easyui-lang-fr.js +++ b/src/main/webapp/js/easyui/locale/easyui-lang-fr.js @@ -1,44 +1,44 @@ -if ($.fn.pagination){ - $.fn.pagination.defaults.beforePageText = 'Page'; - $.fn.pagination.defaults.afterPageText = 'de {pages}'; - $.fn.pagination.defaults.displayMsg = 'Affichage de {from} et {to} au {total} des articles'; -} -if ($.fn.datagrid){ - $.fn.datagrid.defaults.loadMsg = "Traitement, s'il vous plaît patienter ..."; -} -if ($.fn.treegrid && $.fn.datagrid){ - $.fn.treegrid.defaults.loadMsg = $.fn.datagrid.defaults.loadMsg; -} -if ($.messager){ - $.messager.defaults.ok = 'Ok'; - $.messager.defaults.cancel = 'Annuler'; -} -$.map(['validatebox','textbox','filebox','searchbox', - 'combo','combobox','combogrid','combotree', - 'datebox','datetimebox','numberbox', - 'spinner','numberspinner','timespinner','datetimespinner'], function(plugin){ - if ($.fn[plugin]){ - $.fn[plugin].defaults.missingMessage = 'Ce champ est obligatoire.'; - } -}); -if ($.fn.validatebox){ - $.fn.validatebox.defaults.rules.email.message = "S'il vous plaît entrer une adresse email valide."; - $.fn.validatebox.defaults.rules.url.message = "S'il vous plaît entrer une URL valide."; - $.fn.validatebox.defaults.rules.length.message = "S'il vous plaît entrez une valeur comprise entre {0} et {1}."; -} -if ($.fn.calendar){ - $.fn.calendar.defaults.weeks = ['S','M','T','W','T','F','S']; - $.fn.calendar.defaults.months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']; -} -if ($.fn.datebox){ - $.fn.datebox.defaults.currentText = "Aujourd'hui"; - $.fn.datebox.defaults.closeText = 'Fermer'; - $.fn.datebox.defaults.okText = 'Ok'; -} -if ($.fn.datetimebox && $.fn.datebox){ - $.extend($.fn.datetimebox.defaults,{ - currentText: $.fn.datebox.defaults.currentText, - closeText: $.fn.datebox.defaults.closeText, - okText: $.fn.datebox.defaults.okText - }); -} +if ($.fn.pagination){ + $.fn.pagination.defaults.beforePageText = 'Page'; + $.fn.pagination.defaults.afterPageText = 'de {pages}'; + $.fn.pagination.defaults.displayMsg = 'Affichage de {from} et {to} au {total} des articles'; +} +if ($.fn.datagrid){ + $.fn.datagrid.defaults.loadMsg = "Traitement, s'il vous plaît patienter ..."; +} +if ($.fn.treegrid && $.fn.datagrid){ + $.fn.treegrid.defaults.loadMsg = $.fn.datagrid.defaults.loadMsg; +} +if ($.messager){ + $.messager.defaults.ok = 'Ok'; + $.messager.defaults.cancel = 'Annuler'; +} +$.map(['validatebox','textbox','filebox','searchbox', + 'combo','combobox','combogrid','combotree', + 'datebox','datetimebox','numberbox', + 'spinner','numberspinner','timespinner','datetimespinner'], function(plugin){ + if ($.fn[plugin]){ + $.fn[plugin].defaults.missingMessage = 'Ce champ est obligatoire.'; + } +}); +if ($.fn.validatebox){ + $.fn.validatebox.defaults.rules.email.message = "S'il vous plaît entrer une adresse email valide."; + $.fn.validatebox.defaults.rules.url.message = "S'il vous plaît entrer une URL valide."; + $.fn.validatebox.defaults.rules.length.message = "S'il vous plaît entrez une valeur comprise entre {0} et {1}."; +} +if ($.fn.calendar){ + $.fn.calendar.defaults.weeks = ['S','M','T','W','T','F','S']; + $.fn.calendar.defaults.months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']; +} +if ($.fn.datebox){ + $.fn.datebox.defaults.currentText = "Aujourd'hui"; + $.fn.datebox.defaults.closeText = 'Fermer'; + $.fn.datebox.defaults.okText = 'Ok'; +} +if ($.fn.datetimebox && $.fn.datebox){ + $.extend($.fn.datetimebox.defaults,{ + currentText: $.fn.datebox.defaults.currentText, + closeText: $.fn.datebox.defaults.closeText, + okText: $.fn.datebox.defaults.okText + }); +} diff --git a/src/main/webapp/js/easyui/locale/easyui-lang-jp.js b/src/main/webapp/js/easyui/locale/easyui-lang-jp.js index 481083f..0f16964 100644 --- a/src/main/webapp/js/easyui/locale/easyui-lang-jp.js +++ b/src/main/webapp/js/easyui/locale/easyui-lang-jp.js @@ -1,45 +1,45 @@ -if ($.fn.pagination){ - $.fn.pagination.defaults.beforePageText = 'ページ'; - $.fn.pagination.defaults.afterPageText = '{pages} 中'; - $.fn.pagination.defaults.displayMsg = '全 {total} アイテム中 {from} から {to} を表示中'; -} -if ($.fn.datagrid){ - $.fn.datagrid.defaults.loadMsg = '処理中です。少々お待ちください...'; -} -if ($.fn.treegrid && $.fn.datagrid){ - $.fn.treegrid.defaults.loadMsg = $.fn.datagrid.defaults.loadMsg; -} -if ($.messager){ - $.messager.defaults.ok = 'OK'; - $.messager.defaults.cancel = 'キャンセル'; -} -$.map(['validatebox','textbox','filebox','searchbox', - 'combo','combobox','combogrid','combotree', - 'datebox','datetimebox','numberbox', - 'spinner','numberspinner','timespinner','datetimespinner'], function(plugin){ - if ($.fn[plugin]){ - $.fn[plugin].defaults.missingMessage = '入力は必須です。'; - } -}); -if ($.fn.validatebox){ - $.fn.validatebox.defaults.rules.email.message = '正しいメールアドレスを入力してください。'; - $.fn.validatebox.defaults.rules.url.message = '正しいURLを入力してください。'; - $.fn.validatebox.defaults.rules.length.message = '{0} から {1} の範囲の正しい値を入力してください。'; - $.fn.validatebox.defaults.rules.remote.message = 'このフィールドを修正してください。'; -} -if ($.fn.calendar){ - $.fn.calendar.defaults.weeks = ['日','月','火','水','木','金','土']; - $.fn.calendar.defaults.months = ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月']; -} -if ($.fn.datebox){ - $.fn.datebox.defaults.currentText = '今日'; - $.fn.datebox.defaults.closeText = '閉じる'; - $.fn.datebox.defaults.okText = 'OK'; -} -if ($.fn.datetimebox && $.fn.datebox){ - $.extend($.fn.datetimebox.defaults,{ - currentText: $.fn.datebox.defaults.currentText, - closeText: $.fn.datebox.defaults.closeText, - okText: $.fn.datebox.defaults.okText - }); -} +if ($.fn.pagination){ + $.fn.pagination.defaults.beforePageText = 'ページ'; + $.fn.pagination.defaults.afterPageText = '{pages} 中'; + $.fn.pagination.defaults.displayMsg = '全 {total} アイテム中 {from} から {to} を表示中'; +} +if ($.fn.datagrid){ + $.fn.datagrid.defaults.loadMsg = '処理中です。少々お待ちください...'; +} +if ($.fn.treegrid && $.fn.datagrid){ + $.fn.treegrid.defaults.loadMsg = $.fn.datagrid.defaults.loadMsg; +} +if ($.messager){ + $.messager.defaults.ok = 'OK'; + $.messager.defaults.cancel = 'キャンセル'; +} +$.map(['validatebox','textbox','filebox','searchbox', + 'combo','combobox','combogrid','combotree', + 'datebox','datetimebox','numberbox', + 'spinner','numberspinner','timespinner','datetimespinner'], function(plugin){ + if ($.fn[plugin]){ + $.fn[plugin].defaults.missingMessage = '入力は必須です。'; + } +}); +if ($.fn.validatebox){ + $.fn.validatebox.defaults.rules.email.message = '正しいメールアドレスを入力してください。'; + $.fn.validatebox.defaults.rules.url.message = '正しいURLを入力してください。'; + $.fn.validatebox.defaults.rules.length.message = '{0} から {1} の範囲の正しい値を入力してください。'; + $.fn.validatebox.defaults.rules.remote.message = 'このフィールドを修正してください。'; +} +if ($.fn.calendar){ + $.fn.calendar.defaults.weeks = ['日','月','火','水','木','金','土']; + $.fn.calendar.defaults.months = ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月']; +} +if ($.fn.datebox){ + $.fn.datebox.defaults.currentText = '今日'; + $.fn.datebox.defaults.closeText = '閉じる'; + $.fn.datebox.defaults.okText = 'OK'; +} +if ($.fn.datetimebox && $.fn.datebox){ + $.extend($.fn.datetimebox.defaults,{ + currentText: $.fn.datebox.defaults.currentText, + closeText: $.fn.datebox.defaults.closeText, + okText: $.fn.datebox.defaults.okText + }); +} diff --git a/src/main/webapp/js/easyui/locale/easyui-lang-nl.js b/src/main/webapp/js/easyui/locale/easyui-lang-nl.js index d67f416..01a9115 100644 --- a/src/main/webapp/js/easyui/locale/easyui-lang-nl.js +++ b/src/main/webapp/js/easyui/locale/easyui-lang-nl.js @@ -1,44 +1,44 @@ -if ($.fn.pagination){ - $.fn.pagination.defaults.beforePageText = 'Pagina'; - $.fn.pagination.defaults.afterPageText = 'van {pages}'; - $.fn.pagination.defaults.displayMsg = 'Tonen van {from} tot {to} van de {total} items'; -} -if ($.fn.datagrid){ - $.fn.datagrid.defaults.loadMsg = 'Verwerking, even geduld ...'; -} -if ($.fn.treegrid && $.fn.datagrid){ - $.fn.treegrid.defaults.loadMsg = $.fn.datagrid.defaults.loadMsg; -} -if ($.messager){ - $.messager.defaults.ok = 'Ok'; - $.messager.defaults.cancel = 'Annuleren'; -} -$.map(['validatebox','textbox','filebox','searchbox', - 'combo','combobox','combogrid','combotree', - 'datebox','datetimebox','numberbox', - 'spinner','numberspinner','timespinner','datetimespinner'], function(plugin){ - if ($.fn[plugin]){ - $.fn[plugin].defaults.missingMessage = 'Dit veld is verplicht.'; - } -}); -if ($.fn.validatebox){ - $.fn.validatebox.defaults.rules.email.message = 'Geef een geldig e-mailadres.'; - $.fn.validatebox.defaults.rules.url.message = 'Vul een geldige URL.'; - $.fn.validatebox.defaults.rules.length.message = 'Voer een waarde tussen {0} en {1}.'; -} -if ($.fn.calendar){ - $.fn.calendar.defaults.weeks = ['S','M','T','W','T','F','S']; - $.fn.calendar.defaults.months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']; -} -if ($.fn.datebox){ - $.fn.datebox.defaults.currentText = 'Vandaag'; - $.fn.datebox.defaults.closeText = 'Dicht'; - $.fn.datebox.defaults.okText = 'Ok'; -} -if ($.fn.datetimebox && $.fn.datebox){ - $.extend($.fn.datetimebox.defaults,{ - currentText: $.fn.datebox.defaults.currentText, - closeText: $.fn.datebox.defaults.closeText, - okText: $.fn.datebox.defaults.okText - }); -} +if ($.fn.pagination){ + $.fn.pagination.defaults.beforePageText = 'Pagina'; + $.fn.pagination.defaults.afterPageText = 'van {pages}'; + $.fn.pagination.defaults.displayMsg = 'Tonen van {from} tot {to} van de {total} items'; +} +if ($.fn.datagrid){ + $.fn.datagrid.defaults.loadMsg = 'Verwerking, even geduld ...'; +} +if ($.fn.treegrid && $.fn.datagrid){ + $.fn.treegrid.defaults.loadMsg = $.fn.datagrid.defaults.loadMsg; +} +if ($.messager){ + $.messager.defaults.ok = 'Ok'; + $.messager.defaults.cancel = 'Annuleren'; +} +$.map(['validatebox','textbox','filebox','searchbox', + 'combo','combobox','combogrid','combotree', + 'datebox','datetimebox','numberbox', + 'spinner','numberspinner','timespinner','datetimespinner'], function(plugin){ + if ($.fn[plugin]){ + $.fn[plugin].defaults.missingMessage = 'Dit veld is verplicht.'; + } +}); +if ($.fn.validatebox){ + $.fn.validatebox.defaults.rules.email.message = 'Geef een geldig e-mailadres.'; + $.fn.validatebox.defaults.rules.url.message = 'Vul een geldige URL.'; + $.fn.validatebox.defaults.rules.length.message = 'Voer een waarde tussen {0} en {1}.'; +} +if ($.fn.calendar){ + $.fn.calendar.defaults.weeks = ['S','M','T','W','T','F','S']; + $.fn.calendar.defaults.months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']; +} +if ($.fn.datebox){ + $.fn.datebox.defaults.currentText = 'Vandaag'; + $.fn.datebox.defaults.closeText = 'Dicht'; + $.fn.datebox.defaults.okText = 'Ok'; +} +if ($.fn.datetimebox && $.fn.datebox){ + $.extend($.fn.datetimebox.defaults,{ + currentText: $.fn.datebox.defaults.currentText, + closeText: $.fn.datebox.defaults.closeText, + okText: $.fn.datebox.defaults.okText + }); +} diff --git a/src/main/webapp/js/easyui/locale/easyui-lang-pl.js b/src/main/webapp/js/easyui/locale/easyui-lang-pl.js index 6256ded..960f96c 100644 --- a/src/main/webapp/js/easyui/locale/easyui-lang-pl.js +++ b/src/main/webapp/js/easyui/locale/easyui-lang-pl.js @@ -1,45 +1,45 @@ -if ($.fn.pagination){ - $.fn.pagination.defaults.beforePageText = 'Strona'; - $.fn.pagination.defaults.afterPageText = 'z {pages}'; - $.fn.pagination.defaults.displayMsg = 'Wyświetlono elementy od {from} do {to} z {total}'; -} -if ($.fn.datagrid){ - $.fn.datagrid.defaults.loadMsg = 'Przetwarzanie, proszę czekać ...'; -} -if ($.fn.treegrid && $.fn.datagrid){ - $.fn.treegrid.defaults.loadMsg = $.fn.datagrid.defaults.loadMsg; -} -if ($.messager){ - $.messager.defaults.ok = 'Ok'; - $.messager.defaults.cancel = 'Cancel'; -} -$.map(['validatebox','textbox','filebox','searchbox', - 'combo','combobox','combogrid','combotree', - 'datebox','datetimebox','numberbox', - 'spinner','numberspinner','timespinner','datetimespinner'], function(plugin){ - if ($.fn[plugin]){ - $.fn[plugin].defaults.missingMessage = 'To pole jest wymagane.'; - } -}); -if ($.fn.validatebox){ - $.fn.validatebox.defaults.rules.email.message = 'Wprowadź poprawny adres email.'; - $.fn.validatebox.defaults.rules.url.message = 'Wprowadź poprawny adres URL.'; - $.fn.validatebox.defaults.rules.length.message = 'Wprowadź wartość z zakresu od {0} do {1}.'; - $.fn.validatebox.defaults.rules.remote.message = 'Proszę poprawić to pole.'; -} -if ($.fn.calendar){ - $.fn.calendar.defaults.weeks = ['N','P','W','Ś','C','P','S']; - $.fn.calendar.defaults.months = ['Sty', 'Lut', 'Mar', 'Kwi', 'Maj', 'Cze', 'Lip', 'Sie', 'Wrz', 'Paź', 'Lis', 'Gru']; -} -if ($.fn.datebox){ - $.fn.datebox.defaults.currentText = 'Dzisiaj'; - $.fn.datebox.defaults.closeText = 'Zamknij'; - $.fn.datebox.defaults.okText = 'Ok'; -} -if ($.fn.datetimebox && $.fn.datebox){ - $.extend($.fn.datetimebox.defaults,{ - currentText: $.fn.datebox.defaults.currentText, - closeText: $.fn.datebox.defaults.closeText, - okText: $.fn.datebox.defaults.okText - }); -} +if ($.fn.pagination){ + $.fn.pagination.defaults.beforePageText = 'Strona'; + $.fn.pagination.defaults.afterPageText = 'z {pages}'; + $.fn.pagination.defaults.displayMsg = 'Wyświetlono elementy od {from} do {to} z {total}'; +} +if ($.fn.datagrid){ + $.fn.datagrid.defaults.loadMsg = 'Przetwarzanie, proszę czekać ...'; +} +if ($.fn.treegrid && $.fn.datagrid){ + $.fn.treegrid.defaults.loadMsg = $.fn.datagrid.defaults.loadMsg; +} +if ($.messager){ + $.messager.defaults.ok = 'Ok'; + $.messager.defaults.cancel = 'Cancel'; +} +$.map(['validatebox','textbox','filebox','searchbox', + 'combo','combobox','combogrid','combotree', + 'datebox','datetimebox','numberbox', + 'spinner','numberspinner','timespinner','datetimespinner'], function(plugin){ + if ($.fn[plugin]){ + $.fn[plugin].defaults.missingMessage = 'To pole jest wymagane.'; + } +}); +if ($.fn.validatebox){ + $.fn.validatebox.defaults.rules.email.message = 'Wprowadź poprawny adres email.'; + $.fn.validatebox.defaults.rules.url.message = 'Wprowadź poprawny adres URL.'; + $.fn.validatebox.defaults.rules.length.message = 'Wprowadź wartość z zakresu od {0} do {1}.'; + $.fn.validatebox.defaults.rules.remote.message = 'Proszę poprawić to pole.'; +} +if ($.fn.calendar){ + $.fn.calendar.defaults.weeks = ['N','P','W','Ś','C','P','S']; + $.fn.calendar.defaults.months = ['Sty', 'Lut', 'Mar', 'Kwi', 'Maj', 'Cze', 'Lip', 'Sie', 'Wrz', 'Paź', 'Lis', 'Gru']; +} +if ($.fn.datebox){ + $.fn.datebox.defaults.currentText = 'Dzisiaj'; + $.fn.datebox.defaults.closeText = 'Zamknij'; + $.fn.datebox.defaults.okText = 'Ok'; +} +if ($.fn.datetimebox && $.fn.datebox){ + $.extend($.fn.datetimebox.defaults,{ + currentText: $.fn.datebox.defaults.currentText, + closeText: $.fn.datebox.defaults.closeText, + okText: $.fn.datebox.defaults.okText + }); +} diff --git a/src/main/webapp/js/easyui/locale/easyui-lang-pt_BR.js b/src/main/webapp/js/easyui/locale/easyui-lang-pt_BR.js index 8ad9d04..1234bc9 100644 --- a/src/main/webapp/js/easyui/locale/easyui-lang-pt_BR.js +++ b/src/main/webapp/js/easyui/locale/easyui-lang-pt_BR.js @@ -1,45 +1,45 @@ -if ($.fn.pagination){ - $.fn.pagination.defaults.beforePageText = 'Página'; - $.fn.pagination.defaults.afterPageText = 'de {pages}'; - $.fn.pagination.defaults.displayMsg = 'Mostrando {from} a {to} de {total} itens'; -} -if ($.fn.datagrid){ - $.fn.datagrid.defaults.loadMsg = 'Processando, aguarde ...'; -} -if ($.fn.treegrid && $.fn.datagrid){ - $.fn.treegrid.defaults.loadMsg = $.fn.datagrid.defaults.loadMsg; -} -if ($.messager){ - $.messager.defaults.ok = 'Ok'; - $.messager.defaults.cancel = 'Cancelar'; -} -$.map(['validatebox','textbox','filebox','searchbox', - 'combo','combobox','combogrid','combotree', - 'datebox','datetimebox','numberbox', - 'spinner','numberspinner','timespinner','datetimespinner'], function(plugin){ - if ($.fn[plugin]){ - $.fn[plugin].defaults.missingMessage = 'Esse campo é requerido.'; - } -}); -if ($.fn.validatebox){ - $.fn.validatebox.defaults.rules.email.message = 'Insira um endereço de email válido.'; - $.fn.validatebox.defaults.rules.url.message = 'Insira uma URL válida.'; - $.fn.validatebox.defaults.rules.length.message = 'Insira uma valor entre {0} e {1}.'; - $.fn.validatebox.defaults.rules.remote.message = 'Corrija esse campo.'; -} -if ($.fn.calendar){ - $.fn.calendar.defaults.weeks = ['D','S','T','Q','Q','S','S']; - $.fn.calendar.defaults.months = ['Jan', 'Fev', 'Mar', 'Abr', 'Mai', 'Jun', 'Jul', 'Ago', 'Set', 'Out', 'Nov', 'Dez']; -} -if ($.fn.datebox){ - $.fn.datebox.defaults.currentText = 'Hoje'; - $.fn.datebox.defaults.closeText = 'Fechar'; - $.fn.datebox.defaults.okText = 'Ok'; -} -if ($.fn.datetimebox && $.fn.datebox){ - $.extend($.fn.datetimebox.defaults,{ - currentText: $.fn.datebox.defaults.currentText, - closeText: $.fn.datebox.defaults.closeText, - okText: $.fn.datebox.defaults.okText - }); -} +if ($.fn.pagination){ + $.fn.pagination.defaults.beforePageText = 'Página'; + $.fn.pagination.defaults.afterPageText = 'de {pages}'; + $.fn.pagination.defaults.displayMsg = 'Mostrando {from} a {to} de {total} itens'; +} +if ($.fn.datagrid){ + $.fn.datagrid.defaults.loadMsg = 'Processando, aguarde ...'; +} +if ($.fn.treegrid && $.fn.datagrid){ + $.fn.treegrid.defaults.loadMsg = $.fn.datagrid.defaults.loadMsg; +} +if ($.messager){ + $.messager.defaults.ok = 'Ok'; + $.messager.defaults.cancel = 'Cancelar'; +} +$.map(['validatebox','textbox','filebox','searchbox', + 'combo','combobox','combogrid','combotree', + 'datebox','datetimebox','numberbox', + 'spinner','numberspinner','timespinner','datetimespinner'], function(plugin){ + if ($.fn[plugin]){ + $.fn[plugin].defaults.missingMessage = 'Esse campo é requerido.'; + } +}); +if ($.fn.validatebox){ + $.fn.validatebox.defaults.rules.email.message = 'Insira um endereço de email válido.'; + $.fn.validatebox.defaults.rules.url.message = 'Insira uma URL válida.'; + $.fn.validatebox.defaults.rules.length.message = 'Insira uma valor entre {0} e {1}.'; + $.fn.validatebox.defaults.rules.remote.message = 'Corrija esse campo.'; +} +if ($.fn.calendar){ + $.fn.calendar.defaults.weeks = ['D','S','T','Q','Q','S','S']; + $.fn.calendar.defaults.months = ['Jan', 'Fev', 'Mar', 'Abr', 'Mai', 'Jun', 'Jul', 'Ago', 'Set', 'Out', 'Nov', 'Dez']; +} +if ($.fn.datebox){ + $.fn.datebox.defaults.currentText = 'Hoje'; + $.fn.datebox.defaults.closeText = 'Fechar'; + $.fn.datebox.defaults.okText = 'Ok'; +} +if ($.fn.datetimebox && $.fn.datebox){ + $.extend($.fn.datetimebox.defaults,{ + currentText: $.fn.datebox.defaults.currentText, + closeText: $.fn.datebox.defaults.closeText, + okText: $.fn.datebox.defaults.okText + }); +} diff --git a/src/main/webapp/js/easyui/locale/easyui-lang-ru.js b/src/main/webapp/js/easyui/locale/easyui-lang-ru.js index 68a009d..3257c0a 100644 --- a/src/main/webapp/js/easyui/locale/easyui-lang-ru.js +++ b/src/main/webapp/js/easyui/locale/easyui-lang-ru.js @@ -1,46 +1,46 @@ -if ($.fn.pagination){ - $.fn.pagination.defaults.beforePageText = 'Страница'; - $.fn.pagination.defaults.afterPageText = 'из {pages}'; - $.fn.pagination.defaults.displayMsg = 'Просмотр {from} до {to} из {total} записей'; -} -if ($.fn.datagrid){ - $.fn.datagrid.defaults.loadMsg = 'Обрабатывается, пожалуйста ждите ...'; -} -if ($.fn.treegrid && $.fn.datagrid){ - $.fn.treegrid.defaults.loadMsg = $.fn.datagrid.defaults.loadMsg; -} -if ($.messager){ - $.messager.defaults.ok = 'Ок'; - $.messager.defaults.cancel = 'Закрыть'; -} -$.map(['validatebox','textbox','filebox','searchbox', - 'combo','combobox','combogrid','combotree', - 'datebox','datetimebox','numberbox', - 'spinner','numberspinner','timespinner','datetimespinner'], function(plugin){ - if ($.fn[plugin]){ - $.fn[plugin].defaults.missingMessage = 'Это поле необходимо.'; - } -}); -if ($.fn.validatebox){ - $.fn.validatebox.defaults.rules.email.message = 'Пожалуйста введите корректный e-mail адрес.'; - $.fn.validatebox.defaults.rules.url.message = 'Пожалуйста введите корректный URL.'; - $.fn.validatebox.defaults.rules.length.message = 'Пожалуйста введите зачение между {0} и {1}.'; - $.fn.validatebox.defaults.rules.remote.message = 'Пожалуйста исправте это поле.'; -} -if ($.fn.calendar){ - $.fn.calendar.defaults.firstDay = 1; - $.fn.calendar.defaults.weeks = ['В','П','В','С','Ч','П','С']; - $.fn.calendar.defaults.months = ['Янв', 'Фев', 'Мар', 'Апр', 'Май', 'Июн', 'Июл', 'Авг', 'Сен', 'Окт', 'Ноя', 'Дек']; -} -if ($.fn.datebox){ - $.fn.datebox.defaults.currentText = 'Сегодня'; - $.fn.datebox.defaults.closeText = 'Закрыть'; - $.fn.datebox.defaults.okText = 'Ок'; -} -if ($.fn.datetimebox && $.fn.datebox){ - $.extend($.fn.datetimebox.defaults,{ - currentText: $.fn.datebox.defaults.currentText, - closeText: $.fn.datebox.defaults.closeText, - okText: $.fn.datebox.defaults.okText - }); -} +if ($.fn.pagination){ + $.fn.pagination.defaults.beforePageText = 'Страница'; + $.fn.pagination.defaults.afterPageText = 'из {pages}'; + $.fn.pagination.defaults.displayMsg = 'Просмотр {from} до {to} из {total} записей'; +} +if ($.fn.datagrid){ + $.fn.datagrid.defaults.loadMsg = 'Обрабатывается, пожалуйста ждите ...'; +} +if ($.fn.treegrid && $.fn.datagrid){ + $.fn.treegrid.defaults.loadMsg = $.fn.datagrid.defaults.loadMsg; +} +if ($.messager){ + $.messager.defaults.ok = 'Ок'; + $.messager.defaults.cancel = 'Закрыть'; +} +$.map(['validatebox','textbox','filebox','searchbox', + 'combo','combobox','combogrid','combotree', + 'datebox','datetimebox','numberbox', + 'spinner','numberspinner','timespinner','datetimespinner'], function(plugin){ + if ($.fn[plugin]){ + $.fn[plugin].defaults.missingMessage = 'Это поле необходимо.'; + } +}); +if ($.fn.validatebox){ + $.fn.validatebox.defaults.rules.email.message = 'Пожалуйста введите корректный e-mail адрес.'; + $.fn.validatebox.defaults.rules.url.message = 'Пожалуйста введите корректный URL.'; + $.fn.validatebox.defaults.rules.length.message = 'Пожалуйста введите зачение между {0} и {1}.'; + $.fn.validatebox.defaults.rules.remote.message = 'Пожалуйста исправте это поле.'; +} +if ($.fn.calendar){ + $.fn.calendar.defaults.firstDay = 1; + $.fn.calendar.defaults.weeks = ['В','П','В','С','Ч','П','С']; + $.fn.calendar.defaults.months = ['Янв', 'Фев', 'Мар', 'Апр', 'Май', 'Июн', 'Июл', 'Авг', 'Сен', 'Окт', 'Ноя', 'Дек']; +} +if ($.fn.datebox){ + $.fn.datebox.defaults.currentText = 'Сегодня'; + $.fn.datebox.defaults.closeText = 'Закрыть'; + $.fn.datebox.defaults.okText = 'Ок'; +} +if ($.fn.datetimebox && $.fn.datebox){ + $.extend($.fn.datetimebox.defaults,{ + currentText: $.fn.datebox.defaults.currentText, + closeText: $.fn.datebox.defaults.closeText, + okText: $.fn.datebox.defaults.okText + }); +} diff --git a/src/main/webapp/js/easyui/locale/easyui-lang-sv_SE.js b/src/main/webapp/js/easyui/locale/easyui-lang-sv_SE.js index 0626ccf..9eba280 100644 --- a/src/main/webapp/js/easyui/locale/easyui-lang-sv_SE.js +++ b/src/main/webapp/js/easyui/locale/easyui-lang-sv_SE.js @@ -1,45 +1,45 @@ -if ($.fn.pagination) { - $.fn.pagination.defaults.beforePageText = 'Sida'; - $.fn.pagination.defaults.afterPageText = 'av {pages}'; - $.fn.pagination.defaults.displayMsg = 'Visar {from} till {to} av {total} poster'; -} -if ($.fn.datagrid) { - $.fn.datagrid.defaults.loadMsg = 'Bearbetar, vänligen vänta ...'; -} -if ($.fn.treegrid && $.fn.datagrid) { - $.fn.treegrid.defaults.loadMsg = $.fn.datagrid.defaults.loadMsg; -} -if ($.messager) { - $.messager.defaults.ok = 'Ok'; - $.messager.defaults.cancel = 'Avbryt'; -} -$.map(['validatebox','textbox','filebox','searchbox', - 'combo','combobox','combogrid','combotree', - 'datebox','datetimebox','numberbox', - 'spinner','numberspinner','timespinner','datetimespinner'], function(plugin){ - if ($.fn[plugin]){ - $.fn[plugin].defaults.missingMessage = 'Detta fält är obligatoriskt.'; - } -}); -if ($.fn.validatebox) { - $.fn.validatebox.defaults.rules.email.message = 'Vänligen ange en korrekt e-post adress.'; - $.fn.validatebox.defaults.rules.url.message = 'Vänligen ange en korrekt URL.'; - $.fn.validatebox.defaults.rules.length.message = 'Vänligen ange ett nummer mellan {0} och {1}.'; - $.fn.validatebox.defaults.rules.remote.message = 'Vänligen åtgärda detta fält.'; -} -if ($.fn.calendar) { - $.fn.calendar.defaults.weeks = ['Sön', 'Mån', 'Tis', 'Ons', 'Tors', 'Fre', 'Lör']; - $.fn.calendar.defaults.months = ['Jan', 'Feb', 'Mar', 'Apr', 'Maj', 'Jun', 'Jul', 'Aug', 'Sep', 'Okt', 'Nov', 'Dec']; -} -if ($.fn.datebox) { - $.fn.datebox.defaults.currentText = 'I dag'; - $.fn.datebox.defaults.closeText = 'Stäng'; - $.fn.datebox.defaults.okText = 'Ok'; -} -if ($.fn.datetimebox && $.fn.datebox) { - $.extend($.fn.datetimebox.defaults, { - currentText: $.fn.datebox.defaults.currentText, - closeText: $.fn.datebox.defaults.closeText, - okText: $.fn.datebox.defaults.okText - }); -} +if ($.fn.pagination) { + $.fn.pagination.defaults.beforePageText = 'Sida'; + $.fn.pagination.defaults.afterPageText = 'av {pages}'; + $.fn.pagination.defaults.displayMsg = 'Visar {from} till {to} av {total} poster'; +} +if ($.fn.datagrid) { + $.fn.datagrid.defaults.loadMsg = 'Bearbetar, vänligen vänta ...'; +} +if ($.fn.treegrid && $.fn.datagrid) { + $.fn.treegrid.defaults.loadMsg = $.fn.datagrid.defaults.loadMsg; +} +if ($.messager) { + $.messager.defaults.ok = 'Ok'; + $.messager.defaults.cancel = 'Avbryt'; +} +$.map(['validatebox','textbox','filebox','searchbox', + 'combo','combobox','combogrid','combotree', + 'datebox','datetimebox','numberbox', + 'spinner','numberspinner','timespinner','datetimespinner'], function(plugin){ + if ($.fn[plugin]){ + $.fn[plugin].defaults.missingMessage = 'Detta fält är obligatoriskt.'; + } +}); +if ($.fn.validatebox) { + $.fn.validatebox.defaults.rules.email.message = 'Vänligen ange en korrekt e-post adress.'; + $.fn.validatebox.defaults.rules.url.message = 'Vänligen ange en korrekt URL.'; + $.fn.validatebox.defaults.rules.length.message = 'Vänligen ange ett nummer mellan {0} och {1}.'; + $.fn.validatebox.defaults.rules.remote.message = 'Vänligen åtgärda detta fält.'; +} +if ($.fn.calendar) { + $.fn.calendar.defaults.weeks = ['Sön', 'Mån', 'Tis', 'Ons', 'Tors', 'Fre', 'Lör']; + $.fn.calendar.defaults.months = ['Jan', 'Feb', 'Mar', 'Apr', 'Maj', 'Jun', 'Jul', 'Aug', 'Sep', 'Okt', 'Nov', 'Dec']; +} +if ($.fn.datebox) { + $.fn.datebox.defaults.currentText = 'I dag'; + $.fn.datebox.defaults.closeText = 'Stäng'; + $.fn.datebox.defaults.okText = 'Ok'; +} +if ($.fn.datetimebox && $.fn.datebox) { + $.extend($.fn.datetimebox.defaults, { + currentText: $.fn.datebox.defaults.currentText, + closeText: $.fn.datebox.defaults.closeText, + okText: $.fn.datebox.defaults.okText + }); +} diff --git a/src/main/webapp/js/easyui/locale/easyui-lang-zh_CN.js b/src/main/webapp/js/easyui/locale/easyui-lang-zh_CN.js index c24578a..7cf6044 100644 --- a/src/main/webapp/js/easyui/locale/easyui-lang-zh_CN.js +++ b/src/main/webapp/js/easyui/locale/easyui-lang-zh_CN.js @@ -1,66 +1,66 @@ -if ($.fn.pagination){ - $.fn.pagination.defaults.beforePageText = '第'; - $.fn.pagination.defaults.afterPageText = '共{pages}页'; - $.fn.pagination.defaults.displayMsg = '显示{from}到{to},共{total}记录'; -} -if ($.fn.datagrid){ - $.fn.datagrid.defaults.loadMsg = '正在处理,请稍待。。。'; -} -if ($.fn.treegrid && $.fn.datagrid){ - $.fn.treegrid.defaults.loadMsg = $.fn.datagrid.defaults.loadMsg; -} -if ($.messager){ - $.messager.defaults.ok = '确定'; - $.messager.defaults.cancel = '取消'; -} -$.map(['validatebox','textbox','filebox','searchbox', - 'combo','combobox','combogrid','combotree', - 'datebox','datetimebox','numberbox', - 'spinner','numberspinner','timespinner','datetimespinner'], function(plugin){ - if ($.fn[plugin]){ - $.fn[plugin].defaults.missingMessage = '该输入项为必输项'; - } -}); -if ($.fn.validatebox){ - $.fn.validatebox.defaults.rules.email.message = '请输入有效的电子邮件地址'; - $.fn.validatebox.defaults.rules.url.message = '请输入有效的URL地址'; - $.fn.validatebox.defaults.rules.length.message = '输入内容长度必须介于{0}和{1}之间'; - $.fn.validatebox.defaults.rules.remote.message = '请修正该字段'; -} -if ($.fn.calendar){ - $.fn.calendar.defaults.weeks = ['日','一','二','三','四','五','六']; - $.fn.calendar.defaults.months = ['一月','二月','三月','四月','五月','六月','七月','八月','九月','十月','十一月','十二月']; -} -if ($.fn.datebox){ - $.fn.datebox.defaults.currentText = '今天'; - $.fn.datebox.defaults.closeText = '关闭'; - $.fn.datebox.defaults.okText = '确定'; - $.fn.datebox.defaults.formatter = function(date){ - var y = date.getFullYear(); - var m = date.getMonth()+1; - var d = date.getDate(); - return y+'-'+(m<10?('0'+m):m)+'-'+(d<10?('0'+d):d); - }; - $.fn.datebox.defaults.parser = function(s){ - if (!s) return new Date(); - var ss = s.split('-'); - var y = parseInt(ss[0],10); - var m = parseInt(ss[1],10); - var d = parseInt(ss[2],10); - if (!isNaN(y) && !isNaN(m) && !isNaN(d)){ - return new Date(y,m-1,d); - } else { - return new Date(); - } - }; -} -if ($.fn.datetimebox && $.fn.datebox){ - $.extend($.fn.datetimebox.defaults,{ - currentText: $.fn.datebox.defaults.currentText, - closeText: $.fn.datebox.defaults.closeText, - okText: $.fn.datebox.defaults.okText - }); -} -if ($.fn.datetimespinner){ - $.fn.datetimespinner.defaults.selections = [[0,4],[5,7],[8,10],[11,13],[14,16],[17,19]] -} +if ($.fn.pagination){ + $.fn.pagination.defaults.beforePageText = '第'; + $.fn.pagination.defaults.afterPageText = '共{pages}页'; + $.fn.pagination.defaults.displayMsg = '显示{from}到{to},共{total}记录'; +} +if ($.fn.datagrid){ + $.fn.datagrid.defaults.loadMsg = '正在处理,请稍待。。。'; +} +if ($.fn.treegrid && $.fn.datagrid){ + $.fn.treegrid.defaults.loadMsg = $.fn.datagrid.defaults.loadMsg; +} +if ($.messager){ + $.messager.defaults.ok = '确定'; + $.messager.defaults.cancel = '取消'; +} +$.map(['validatebox','textbox','filebox','searchbox', + 'combo','combobox','combogrid','combotree', + 'datebox','datetimebox','numberbox', + 'spinner','numberspinner','timespinner','datetimespinner'], function(plugin){ + if ($.fn[plugin]){ + $.fn[plugin].defaults.missingMessage = '该输入项为必输项'; + } +}); +if ($.fn.validatebox){ + $.fn.validatebox.defaults.rules.email.message = '请输入有效的电子邮件地址'; + $.fn.validatebox.defaults.rules.url.message = '请输入有效的URL地址'; + $.fn.validatebox.defaults.rules.length.message = '输入内容长度必须介于{0}和{1}之间'; + $.fn.validatebox.defaults.rules.remote.message = '请修正该字段'; +} +if ($.fn.calendar){ + $.fn.calendar.defaults.weeks = ['日','一','二','三','四','五','六']; + $.fn.calendar.defaults.months = ['一月','二月','三月','四月','五月','六月','七月','八月','九月','十月','十一月','十二月']; +} +if ($.fn.datebox){ + $.fn.datebox.defaults.currentText = '今天'; + $.fn.datebox.defaults.closeText = '关闭'; + $.fn.datebox.defaults.okText = '确定'; + $.fn.datebox.defaults.formatter = function(date){ + var y = date.getFullYear(); + var m = date.getMonth()+1; + var d = date.getDate(); + return y+'-'+(m<10?('0'+m):m)+'-'+(d<10?('0'+d):d); + }; + $.fn.datebox.defaults.parser = function(s){ + if (!s) return new Date(); + var ss = s.split('-'); + var y = parseInt(ss[0],10); + var m = parseInt(ss[1],10); + var d = parseInt(ss[2],10); + if (!isNaN(y) && !isNaN(m) && !isNaN(d)){ + return new Date(y,m-1,d); + } else { + return new Date(); + } + }; +} +if ($.fn.datetimebox && $.fn.datebox){ + $.extend($.fn.datetimebox.defaults,{ + currentText: $.fn.datebox.defaults.currentText, + closeText: $.fn.datebox.defaults.closeText, + okText: $.fn.datebox.defaults.okText + }); +} +if ($.fn.datetimespinner){ + $.fn.datetimespinner.defaults.selections = [[0,4],[5,7],[8,10],[11,13],[14,16],[17,19]] +} diff --git a/src/main/webapp/js/easyui/locale/easyui-lang-zh_TW.js b/src/main/webapp/js/easyui/locale/easyui-lang-zh_TW.js index a909a76..5aab376 100644 --- a/src/main/webapp/js/easyui/locale/easyui-lang-zh_TW.js +++ b/src/main/webapp/js/easyui/locale/easyui-lang-zh_TW.js @@ -1,48 +1,48 @@ -if ($.fn.pagination){ - $.fn.pagination.defaults.beforePageText = '第'; - $.fn.pagination.defaults.afterPageText = '共{pages}頁'; - $.fn.pagination.defaults.displayMsg = '顯示{from}到{to},共{total}記錄'; -} -if ($.fn.datagrid){ - $.fn.datagrid.defaults.loadMsg = '正在處理,請稍待。。。'; -} -if ($.fn.treegrid && $.fn.datagrid){ - $.fn.treegrid.defaults.loadMsg = $.fn.datagrid.defaults.loadMsg; -} -if ($.messager){ - $.messager.defaults.ok = '確定'; - $.messager.defaults.cancel = '取消'; -} -$.map(['validatebox','textbox','filebox','searchbox', - 'combo','combobox','combogrid','combotree', - 'datebox','datetimebox','numberbox', - 'spinner','numberspinner','timespinner','datetimespinner'], function(plugin){ - if ($.fn[plugin]){ - $.fn[plugin].defaults.missingMessage = '該輸入項為必輸項'; - } -}); -if ($.fn.validatebox){ - $.fn.validatebox.defaults.rules.email.message = '請輸入有效的電子郵件地址'; - $.fn.validatebox.defaults.rules.url.message = '請輸入有效的URL地址'; - $.fn.validatebox.defaults.rules.length.message = '輸入內容長度必須介於{0}和{1}之間'; - $.fn.validatebox.defaults.rules.remote.message = '請修正此欄位'; -} -if ($.fn.calendar){ - $.fn.calendar.defaults.weeks = ['日','一','二','三','四','五','六']; - $.fn.calendar.defaults.months = ['一月','二月','三月','四月','五月','六月','七月','八月','九月','十月','十一月','十二月']; -} -if ($.fn.datebox){ - $.fn.datebox.defaults.currentText = '今天'; - $.fn.datebox.defaults.closeText = '關閉'; - $.fn.datebox.defaults.okText = '確定'; -} -if ($.fn.datetimebox && $.fn.datebox){ - $.extend($.fn.datetimebox.defaults,{ - currentText: $.fn.datebox.defaults.currentText, - closeText: $.fn.datebox.defaults.closeText, - okText: $.fn.datebox.defaults.okText - }); -} -if ($.fn.datetimespinner){ - $.fn.datetimespinner.defaults.selections = [[0,4],[5,7],[8,10],[11,13],[14,16],[17,19]] -} +if ($.fn.pagination){ + $.fn.pagination.defaults.beforePageText = '第'; + $.fn.pagination.defaults.afterPageText = '共{pages}頁'; + $.fn.pagination.defaults.displayMsg = '顯示{from}到{to},共{total}記錄'; +} +if ($.fn.datagrid){ + $.fn.datagrid.defaults.loadMsg = '正在處理,請稍待。。。'; +} +if ($.fn.treegrid && $.fn.datagrid){ + $.fn.treegrid.defaults.loadMsg = $.fn.datagrid.defaults.loadMsg; +} +if ($.messager){ + $.messager.defaults.ok = '確定'; + $.messager.defaults.cancel = '取消'; +} +$.map(['validatebox','textbox','filebox','searchbox', + 'combo','combobox','combogrid','combotree', + 'datebox','datetimebox','numberbox', + 'spinner','numberspinner','timespinner','datetimespinner'], function(plugin){ + if ($.fn[plugin]){ + $.fn[plugin].defaults.missingMessage = '該輸入項為必輸項'; + } +}); +if ($.fn.validatebox){ + $.fn.validatebox.defaults.rules.email.message = '請輸入有效的電子郵件地址'; + $.fn.validatebox.defaults.rules.url.message = '請輸入有效的URL地址'; + $.fn.validatebox.defaults.rules.length.message = '輸入內容長度必須介於{0}和{1}之間'; + $.fn.validatebox.defaults.rules.remote.message = '請修正此欄位'; +} +if ($.fn.calendar){ + $.fn.calendar.defaults.weeks = ['日','一','二','三','四','五','六']; + $.fn.calendar.defaults.months = ['一月','二月','三月','四月','五月','六月','七月','八月','九月','十月','十一月','十二月']; +} +if ($.fn.datebox){ + $.fn.datebox.defaults.currentText = '今天'; + $.fn.datebox.defaults.closeText = '關閉'; + $.fn.datebox.defaults.okText = '確定'; +} +if ($.fn.datetimebox && $.fn.datebox){ + $.extend($.fn.datetimebox.defaults,{ + currentText: $.fn.datebox.defaults.currentText, + closeText: $.fn.datebox.defaults.closeText, + okText: $.fn.datebox.defaults.okText + }); +} +if ($.fn.datetimespinner){ + $.fn.datetimespinner.defaults.selections = [[0,4],[5,7],[8,10],[11,13],[14,16],[17,19]] +} diff --git a/src/main/webapp/js/easyui/plugins/jquery.accordion.js b/src/main/webapp/js/easyui/plugins/jquery.accordion.js index 047915c..523c145 100644 --- a/src/main/webapp/js/easyui/plugins/jquery.accordion.js +++ b/src/main/webapp/js/easyui/plugins/jquery.accordion.js @@ -1,12 +1,12 @@ -/** - * jQuery EasyUI 1.4.2 - * - * Copyright (c) 2009-2015 www.jeasyui.com. All rights reserved. - * - * Licensed under the GPL license: http://www.gnu.org/licenses/gpl.txt - * To use it on other terms please contact us at info@jeasyui.com - * - */ +/** + * jQuery EasyUI 1.4.2 + * + * Copyright (c) 2009-2015 www.jeasyui.com. All rights reserved. + * + * Licensed under the GPL license: http://www.gnu.org/licenses/gpl.txt + * To use it on other terms please contact us at info@jeasyui.com + * + */ (function($){ function _1(_2,_3){ var _4=$.data(_2,"accordion"); diff --git a/src/main/webapp/js/easyui/plugins/jquery.calendar.js b/src/main/webapp/js/easyui/plugins/jquery.calendar.js index 5847eb2..12481ef 100644 --- a/src/main/webapp/js/easyui/plugins/jquery.calendar.js +++ b/src/main/webapp/js/easyui/plugins/jquery.calendar.js @@ -1,12 +1,12 @@ -/** - * jQuery EasyUI 1.4.2 - * - * Copyright (c) 2009-2015 www.jeasyui.com. All rights reserved. - * - * Licensed under the GPL license: http://www.gnu.org/licenses/gpl.txt - * To use it on other terms please contact us at info@jeasyui.com - * - */ +/** + * jQuery EasyUI 1.4.2 + * + * Copyright (c) 2009-2015 www.jeasyui.com. All rights reserved. + * + * Licensed under the GPL license: http://www.gnu.org/licenses/gpl.txt + * To use it on other terms please contact us at info@jeasyui.com + * + */ (function($){ function _1(_2,_3){ var _4=$.data(_2,"calendar").options; diff --git a/src/main/webapp/js/easyui/plugins/jquery.combo.js b/src/main/webapp/js/easyui/plugins/jquery.combo.js index b1effba..1ee0e84 100644 --- a/src/main/webapp/js/easyui/plugins/jquery.combo.js +++ b/src/main/webapp/js/easyui/plugins/jquery.combo.js @@ -1,12 +1,12 @@ -/** - * jQuery EasyUI 1.4.2 - * - * Copyright (c) 2009-2015 www.jeasyui.com. All rights reserved. - * - * Licensed under the GPL license: http://www.gnu.org/licenses/gpl.txt - * To use it on other terms please contact us at info@jeasyui.com - * - */ +/** + * jQuery EasyUI 1.4.2 + * + * Copyright (c) 2009-2015 www.jeasyui.com. All rights reserved. + * + * Licensed under the GPL license: http://www.gnu.org/licenses/gpl.txt + * To use it on other terms please contact us at info@jeasyui.com + * + */ (function($){ $(function(){ $(document).unbind(".combo").bind("mousedown.combo mousewheel.combo",function(e){ diff --git a/src/main/webapp/js/easyui/plugins/jquery.combobox.js b/src/main/webapp/js/easyui/plugins/jquery.combobox.js index 5ef5e76..2a2020e 100644 --- a/src/main/webapp/js/easyui/plugins/jquery.combobox.js +++ b/src/main/webapp/js/easyui/plugins/jquery.combobox.js @@ -1,12 +1,12 @@ -/** - * jQuery EasyUI 1.4.2 - * - * Copyright (c) 2009-2015 www.jeasyui.com. All rights reserved. - * - * Licensed under the GPL license: http://www.gnu.org/licenses/gpl.txt - * To use it on other terms please contact us at info@jeasyui.com - * - */ +/** + * jQuery EasyUI 1.4.2 + * + * Copyright (c) 2009-2015 www.jeasyui.com. All rights reserved. + * + * Licensed under the GPL license: http://www.gnu.org/licenses/gpl.txt + * To use it on other terms please contact us at info@jeasyui.com + * + */ (function($){ var _1=0; function _2(_3,_4){ diff --git a/src/main/webapp/js/easyui/plugins/jquery.combogrid.js b/src/main/webapp/js/easyui/plugins/jquery.combogrid.js index cfa5bfb..1ab579c 100644 --- a/src/main/webapp/js/easyui/plugins/jquery.combogrid.js +++ b/src/main/webapp/js/easyui/plugins/jquery.combogrid.js @@ -1,12 +1,12 @@ -/** - * jQuery EasyUI 1.4.2 - * - * Copyright (c) 2009-2015 www.jeasyui.com. All rights reserved. - * - * Licensed under the GPL license: http://www.gnu.org/licenses/gpl.txt - * To use it on other terms please contact us at info@jeasyui.com - * - */ +/** + * jQuery EasyUI 1.4.2 + * + * Copyright (c) 2009-2015 www.jeasyui.com. All rights reserved. + * + * Licensed under the GPL license: http://www.gnu.org/licenses/gpl.txt + * To use it on other terms please contact us at info@jeasyui.com + * + */ (function($){ function _1(_2){ var _3=$.data(_2,"combogrid"); diff --git a/src/main/webapp/js/easyui/plugins/jquery.combotree.js b/src/main/webapp/js/easyui/plugins/jquery.combotree.js index 825fef3..892df5c 100644 --- a/src/main/webapp/js/easyui/plugins/jquery.combotree.js +++ b/src/main/webapp/js/easyui/plugins/jquery.combotree.js @@ -1,12 +1,12 @@ -/** - * jQuery EasyUI 1.4.2 - * - * Copyright (c) 2009-2015 www.jeasyui.com. All rights reserved. - * - * Licensed under the GPL license: http://www.gnu.org/licenses/gpl.txt - * To use it on other terms please contact us at info@jeasyui.com - * - */ +/** + * jQuery EasyUI 1.4.2 + * + * Copyright (c) 2009-2015 www.jeasyui.com. All rights reserved. + * + * Licensed under the GPL license: http://www.gnu.org/licenses/gpl.txt + * To use it on other terms please contact us at info@jeasyui.com + * + */ (function($){ function _1(_2){ var _3=$.data(_2,"combotree"); diff --git a/src/main/webapp/js/easyui/plugins/jquery.datagrid.js b/src/main/webapp/js/easyui/plugins/jquery.datagrid.js index cf15662..4c01388 100644 --- a/src/main/webapp/js/easyui/plugins/jquery.datagrid.js +++ b/src/main/webapp/js/easyui/plugins/jquery.datagrid.js @@ -1,12 +1,12 @@ -/** - * jQuery EasyUI 1.4.2 - * - * Copyright (c) 2009-2015 www.jeasyui.com. All rights reserved. - * - * Licensed under the GPL license: http://www.gnu.org/licenses/gpl.txt - * To use it on other terms please contact us at info@jeasyui.com - * - */ +/** + * jQuery EasyUI 1.4.2 + * + * Copyright (c) 2009-2015 www.jeasyui.com. All rights reserved. + * + * Licensed under the GPL license: http://www.gnu.org/licenses/gpl.txt + * To use it on other terms please contact us at info@jeasyui.com + * + */ (function($){ var _1=0; function _2(a,o){ diff --git a/src/main/webapp/js/easyui/plugins/jquery.datalist.js b/src/main/webapp/js/easyui/plugins/jquery.datalist.js index 9df4c28..c016bfe 100644 --- a/src/main/webapp/js/easyui/plugins/jquery.datalist.js +++ b/src/main/webapp/js/easyui/plugins/jquery.datalist.js @@ -1,12 +1,12 @@ -/** - * jQuery EasyUI 1.4.2 - * - * Copyright (c) 2009-2015 www.jeasyui.com. All rights reserved. - * - * Licensed under the GPL license: http://www.gnu.org/licenses/gpl.txt - * To use it on other terms please contact us at info@jeasyui.com - * - */ +/** + * jQuery EasyUI 1.4.2 + * + * Copyright (c) 2009-2015 www.jeasyui.com. All rights reserved. + * + * Licensed under the GPL license: http://www.gnu.org/licenses/gpl.txt + * To use it on other terms please contact us at info@jeasyui.com + * + */ (function($){ function _1(_2){ var _3=$.data(_2,"datalist").options; diff --git a/src/main/webapp/js/easyui/plugins/jquery.datebox.js b/src/main/webapp/js/easyui/plugins/jquery.datebox.js index 7a53aca..2fe3489 100644 --- a/src/main/webapp/js/easyui/plugins/jquery.datebox.js +++ b/src/main/webapp/js/easyui/plugins/jquery.datebox.js @@ -1,12 +1,12 @@ -/** - * jQuery EasyUI 1.4.2 - * - * Copyright (c) 2009-2015 www.jeasyui.com. All rights reserved. - * - * Licensed under the GPL license: http://www.gnu.org/licenses/gpl.txt - * To use it on other terms please contact us at info@jeasyui.com - * - */ +/** + * jQuery EasyUI 1.4.2 + * + * Copyright (c) 2009-2015 www.jeasyui.com. All rights reserved. + * + * Licensed under the GPL license: http://www.gnu.org/licenses/gpl.txt + * To use it on other terms please contact us at info@jeasyui.com + * + */ (function($){ function _1(_2){ var _3=$.data(_2,"datebox"); diff --git a/src/main/webapp/js/easyui/plugins/jquery.datetimebox.js b/src/main/webapp/js/easyui/plugins/jquery.datetimebox.js index d8ac380..84bdfd4 100644 --- a/src/main/webapp/js/easyui/plugins/jquery.datetimebox.js +++ b/src/main/webapp/js/easyui/plugins/jquery.datetimebox.js @@ -1,12 +1,12 @@ -/** - * jQuery EasyUI 1.4.2 - * - * Copyright (c) 2009-2015 www.jeasyui.com. All rights reserved. - * - * Licensed under the GPL license: http://www.gnu.org/licenses/gpl.txt - * To use it on other terms please contact us at info@jeasyui.com - * - */ +/** + * jQuery EasyUI 1.4.2 + * + * Copyright (c) 2009-2015 www.jeasyui.com. All rights reserved. + * + * Licensed under the GPL license: http://www.gnu.org/licenses/gpl.txt + * To use it on other terms please contact us at info@jeasyui.com + * + */ (function($){ function _1(_2){ var _3=$.data(_2,"datetimebox"); diff --git a/src/main/webapp/js/easyui/plugins/jquery.datetimespinner.js b/src/main/webapp/js/easyui/plugins/jquery.datetimespinner.js index 7caee8d..17fbac4 100644 --- a/src/main/webapp/js/easyui/plugins/jquery.datetimespinner.js +++ b/src/main/webapp/js/easyui/plugins/jquery.datetimespinner.js @@ -1,12 +1,12 @@ -/** - * jQuery EasyUI 1.4.2 - * - * Copyright (c) 2009-2015 www.jeasyui.com. All rights reserved. - * - * Licensed under the GPL license: http://www.gnu.org/licenses/gpl.txt - * To use it on other terms please contact us at info@jeasyui.com - * - */ +/** + * jQuery EasyUI 1.4.2 + * + * Copyright (c) 2009-2015 www.jeasyui.com. All rights reserved. + * + * Licensed under the GPL license: http://www.gnu.org/licenses/gpl.txt + * To use it on other terms please contact us at info@jeasyui.com + * + */ (function($){ function _1(_2){ var _3=$.data(_2,"datetimespinner").options; diff --git a/src/main/webapp/js/easyui/plugins/jquery.dialog.js b/src/main/webapp/js/easyui/plugins/jquery.dialog.js index efb16f0..aa8874b 100644 --- a/src/main/webapp/js/easyui/plugins/jquery.dialog.js +++ b/src/main/webapp/js/easyui/plugins/jquery.dialog.js @@ -1,12 +1,12 @@ -/** - * jQuery EasyUI 1.4.2 - * - * Copyright (c) 2009-2015 www.jeasyui.com. All rights reserved. - * - * Licensed under the GPL license: http://www.gnu.org/licenses/gpl.txt - * To use it on other terms please contact us at info@jeasyui.com - * - */ +/** + * jQuery EasyUI 1.4.2 + * + * Copyright (c) 2009-2015 www.jeasyui.com. All rights reserved. + * + * Licensed under the GPL license: http://www.gnu.org/licenses/gpl.txt + * To use it on other terms please contact us at info@jeasyui.com + * + */ (function($){ function _1(_2){ var _3=$.data(_2,"dialog").options; diff --git a/src/main/webapp/js/easyui/plugins/jquery.draggable.js b/src/main/webapp/js/easyui/plugins/jquery.draggable.js index 1b21139..61dc3f3 100644 --- a/src/main/webapp/js/easyui/plugins/jquery.draggable.js +++ b/src/main/webapp/js/easyui/plugins/jquery.draggable.js @@ -1,12 +1,12 @@ -/** - * jQuery EasyUI 1.4.2 - * - * Copyright (c) 2009-2015 www.jeasyui.com. All rights reserved. - * - * Licensed under the GPL license: http://www.gnu.org/licenses/gpl.txt - * To use it on other terms please contact us at info@jeasyui.com - * - */ +/** + * jQuery EasyUI 1.4.2 + * + * Copyright (c) 2009-2015 www.jeasyui.com. All rights reserved. + * + * Licensed under the GPL license: http://www.gnu.org/licenses/gpl.txt + * To use it on other terms please contact us at info@jeasyui.com + * + */ (function($){ function _1(e){ var _2=$.data(e.data.target,"draggable"); diff --git a/src/main/webapp/js/easyui/plugins/jquery.droppable.js b/src/main/webapp/js/easyui/plugins/jquery.droppable.js index 370a8d9..fb3f136 100644 --- a/src/main/webapp/js/easyui/plugins/jquery.droppable.js +++ b/src/main/webapp/js/easyui/plugins/jquery.droppable.js @@ -1,12 +1,12 @@ -/** - * jQuery EasyUI 1.4.2 - * - * Copyright (c) 2009-2015 www.jeasyui.com. All rights reserved. - * - * Licensed under the GPL license: http://www.gnu.org/licenses/gpl.txt - * To use it on other terms please contact us at info@jeasyui.com - * - */ +/** + * jQuery EasyUI 1.4.2 + * + * Copyright (c) 2009-2015 www.jeasyui.com. All rights reserved. + * + * Licensed under the GPL license: http://www.gnu.org/licenses/gpl.txt + * To use it on other terms please contact us at info@jeasyui.com + * + */ (function($){ function _1(_2){ $(_2).addClass("droppable"); diff --git a/src/main/webapp/js/easyui/plugins/jquery.filebox.js b/src/main/webapp/js/easyui/plugins/jquery.filebox.js index d4967d7..3fd3ac9 100644 --- a/src/main/webapp/js/easyui/plugins/jquery.filebox.js +++ b/src/main/webapp/js/easyui/plugins/jquery.filebox.js @@ -1,12 +1,12 @@ -/** - * jQuery EasyUI 1.4.2 - * - * Copyright (c) 2009-2015 www.jeasyui.com. All rights reserved. - * - * Licensed under the GPL license: http://www.gnu.org/licenses/gpl.txt - * To use it on other terms please contact us at info@jeasyui.com - * - */ +/** + * jQuery EasyUI 1.4.2 + * + * Copyright (c) 2009-2015 www.jeasyui.com. All rights reserved. + * + * Licensed under the GPL license: http://www.gnu.org/licenses/gpl.txt + * To use it on other terms please contact us at info@jeasyui.com + * + */ (function($){ var _1=0; function _2(_3){ diff --git a/src/main/webapp/js/easyui/plugins/jquery.form.js b/src/main/webapp/js/easyui/plugins/jquery.form.js index d2ecc70..bbcd161 100644 --- a/src/main/webapp/js/easyui/plugins/jquery.form.js +++ b/src/main/webapp/js/easyui/plugins/jquery.form.js @@ -1,12 +1,12 @@ -/** - * jQuery EasyUI 1.4.2 - * - * Copyright (c) 2009-2015 www.jeasyui.com. All rights reserved. - * - * Licensed under the GPL license: http://www.gnu.org/licenses/gpl.txt - * To use it on other terms please contact us at info@jeasyui.com - * - */ +/** + * jQuery EasyUI 1.4.2 + * + * Copyright (c) 2009-2015 www.jeasyui.com. All rights reserved. + * + * Licensed under the GPL license: http://www.gnu.org/licenses/gpl.txt + * To use it on other terms please contact us at info@jeasyui.com + * + */ (function($){ function _1(_2,_3){ var _4=$.data(_2,"form").options; diff --git a/src/main/webapp/js/easyui/plugins/jquery.layout.js b/src/main/webapp/js/easyui/plugins/jquery.layout.js index 4b58533..7037b08 100644 --- a/src/main/webapp/js/easyui/plugins/jquery.layout.js +++ b/src/main/webapp/js/easyui/plugins/jquery.layout.js @@ -1,12 +1,12 @@ -/** - * jQuery EasyUI 1.4.2 - * - * Copyright (c) 2009-2015 www.jeasyui.com. All rights reserved. - * - * Licensed under the GPL license: http://www.gnu.org/licenses/gpl.txt - * To use it on other terms please contact us at info@jeasyui.com - * - */ +/** + * jQuery EasyUI 1.4.2 + * + * Copyright (c) 2009-2015 www.jeasyui.com. All rights reserved. + * + * Licensed under the GPL license: http://www.gnu.org/licenses/gpl.txt + * To use it on other terms please contact us at info@jeasyui.com + * + */ (function($){ var _1=false; function _2(_3,_4){ diff --git a/src/main/webapp/js/easyui/plugins/jquery.linkbutton.js b/src/main/webapp/js/easyui/plugins/jquery.linkbutton.js index 8680315..3477063 100644 --- a/src/main/webapp/js/easyui/plugins/jquery.linkbutton.js +++ b/src/main/webapp/js/easyui/plugins/jquery.linkbutton.js @@ -1,12 +1,12 @@ -/** - * jQuery EasyUI 1.4.2 - * - * Copyright (c) 2009-2015 www.jeasyui.com. All rights reserved. - * - * Licensed under the GPL license: http://www.gnu.org/licenses/gpl.txt - * To use it on other terms please contact us at info@jeasyui.com - * - */ +/** + * jQuery EasyUI 1.4.2 + * + * Copyright (c) 2009-2015 www.jeasyui.com. All rights reserved. + * + * Licensed under the GPL license: http://www.gnu.org/licenses/gpl.txt + * To use it on other terms please contact us at info@jeasyui.com + * + */ (function($){ function _1(_2,_3){ var _4=$.data(_2,"linkbutton").options; diff --git a/src/main/webapp/js/easyui/plugins/jquery.menu.js b/src/main/webapp/js/easyui/plugins/jquery.menu.js index 17382df..44edf39 100644 --- a/src/main/webapp/js/easyui/plugins/jquery.menu.js +++ b/src/main/webapp/js/easyui/plugins/jquery.menu.js @@ -1,12 +1,12 @@ -/** - * jQuery EasyUI 1.4.2 - * - * Copyright (c) 2009-2015 www.jeasyui.com. All rights reserved. - * - * Licensed under the GPL license: http://www.gnu.org/licenses/gpl.txt - * To use it on other terms please contact us at info@jeasyui.com - * - */ +/** + * jQuery EasyUI 1.4.2 + * + * Copyright (c) 2009-2015 www.jeasyui.com. All rights reserved. + * + * Licensed under the GPL license: http://www.gnu.org/licenses/gpl.txt + * To use it on other terms please contact us at info@jeasyui.com + * + */ (function($){ $(function(){ $(document).unbind(".menu").bind("mousedown.menu",function(e){ diff --git a/src/main/webapp/js/easyui/plugins/jquery.menubutton.js b/src/main/webapp/js/easyui/plugins/jquery.menubutton.js index ae9022c..ae34d04 100644 --- a/src/main/webapp/js/easyui/plugins/jquery.menubutton.js +++ b/src/main/webapp/js/easyui/plugins/jquery.menubutton.js @@ -1,12 +1,12 @@ -/** - * jQuery EasyUI 1.4.2 - * - * Copyright (c) 2009-2015 www.jeasyui.com. All rights reserved. - * - * Licensed under the GPL license: http://www.gnu.org/licenses/gpl.txt - * To use it on other terms please contact us at info@jeasyui.com - * - */ +/** + * jQuery EasyUI 1.4.2 + * + * Copyright (c) 2009-2015 www.jeasyui.com. All rights reserved. + * + * Licensed under the GPL license: http://www.gnu.org/licenses/gpl.txt + * To use it on other terms please contact us at info@jeasyui.com + * + */ (function($){ function _1(_2){ var _3=$.data(_2,"menubutton").options; diff --git a/src/main/webapp/js/easyui/plugins/jquery.messager.js b/src/main/webapp/js/easyui/plugins/jquery.messager.js index 5445365..a32491c 100644 --- a/src/main/webapp/js/easyui/plugins/jquery.messager.js +++ b/src/main/webapp/js/easyui/plugins/jquery.messager.js @@ -1,12 +1,12 @@ -/** - * jQuery EasyUI 1.4.2 - * - * Copyright (c) 2009-2015 www.jeasyui.com. All rights reserved. - * - * Licensed under the GPL license: http://www.gnu.org/licenses/gpl.txt - * To use it on other terms please contact us at info@jeasyui.com - * - */ +/** + * jQuery EasyUI 1.4.2 + * + * Copyright (c) 2009-2015 www.jeasyui.com. All rights reserved. + * + * Licensed under the GPL license: http://www.gnu.org/licenses/gpl.txt + * To use it on other terms please contact us at info@jeasyui.com + * + */ (function($){ function _1(){ $(document).unbind(".messager").bind("keydown.messager",function(e){ diff --git a/src/main/webapp/js/easyui/plugins/jquery.mobile.js b/src/main/webapp/js/easyui/plugins/jquery.mobile.js index 3daf209..b7fed1d 100644 --- a/src/main/webapp/js/easyui/plugins/jquery.mobile.js +++ b/src/main/webapp/js/easyui/plugins/jquery.mobile.js @@ -1,12 +1,12 @@ -/** - * jQuery EasyUI 1.4.2 - * - * Copyright (c) 2009-2015 www.jeasyui.com. All rights reserved. - * - * Licensed under the GPL license: http://www.gnu.org/licenses/gpl.txt - * To use it on other terms please contact us at info@jeasyui.com - * - */ +/** + * jQuery EasyUI 1.4.2 + * + * Copyright (c) 2009-2015 www.jeasyui.com. All rights reserved. + * + * Licensed under the GPL license: http://www.gnu.org/licenses/gpl.txt + * To use it on other terms please contact us at info@jeasyui.com + * + */ (function($){ $.fn.navpanel=function(_1,_2){ if(typeof _1=="string"){ diff --git a/src/main/webapp/js/easyui/plugins/jquery.numberbox.js b/src/main/webapp/js/easyui/plugins/jquery.numberbox.js index 4874099..2f93cad 100644 --- a/src/main/webapp/js/easyui/plugins/jquery.numberbox.js +++ b/src/main/webapp/js/easyui/plugins/jquery.numberbox.js @@ -1,12 +1,12 @@ -/** - * jQuery EasyUI 1.4.2 - * - * Copyright (c) 2009-2015 www.jeasyui.com. All rights reserved. - * - * Licensed under the GPL license: http://www.gnu.org/licenses/gpl.txt - * To use it on other terms please contact us at info@jeasyui.com - * - */ +/** + * jQuery EasyUI 1.4.2 + * + * Copyright (c) 2009-2015 www.jeasyui.com. All rights reserved. + * + * Licensed under the GPL license: http://www.gnu.org/licenses/gpl.txt + * To use it on other terms please contact us at info@jeasyui.com + * + */ (function($){ function _1(_2){ var _3=$.data(_2,"numberbox"); diff --git a/src/main/webapp/js/easyui/plugins/jquery.numberspinner.js b/src/main/webapp/js/easyui/plugins/jquery.numberspinner.js index d3c3efb..1d082b8 100644 --- a/src/main/webapp/js/easyui/plugins/jquery.numberspinner.js +++ b/src/main/webapp/js/easyui/plugins/jquery.numberspinner.js @@ -1,12 +1,12 @@ -/** - * jQuery EasyUI 1.4.2 - * - * Copyright (c) 2009-2015 www.jeasyui.com. All rights reserved. - * - * Licensed under the GPL license: http://www.gnu.org/licenses/gpl.txt - * To use it on other terms please contact us at info@jeasyui.com - * - */ +/** + * jQuery EasyUI 1.4.2 + * + * Copyright (c) 2009-2015 www.jeasyui.com. All rights reserved. + * + * Licensed under the GPL license: http://www.gnu.org/licenses/gpl.txt + * To use it on other terms please contact us at info@jeasyui.com + * + */ (function($){ function _1(_2){ $(_2).addClass("numberspinner-f"); diff --git a/src/main/webapp/js/easyui/plugins/jquery.pagination.js b/src/main/webapp/js/easyui/plugins/jquery.pagination.js index a9f0819..d86f6d1 100644 --- a/src/main/webapp/js/easyui/plugins/jquery.pagination.js +++ b/src/main/webapp/js/easyui/plugins/jquery.pagination.js @@ -1,12 +1,12 @@ -/** - * jQuery EasyUI 1.4.2 - * - * Copyright (c) 2009-2015 www.jeasyui.com. All rights reserved. - * - * Licensed under the GPL license: http://www.gnu.org/licenses/gpl.txt - * To use it on other terms please contact us at info@jeasyui.com - * - */ +/** + * jQuery EasyUI 1.4.2 + * + * Copyright (c) 2009-2015 www.jeasyui.com. All rights reserved. + * + * Licensed under the GPL license: http://www.gnu.org/licenses/gpl.txt + * To use it on other terms please contact us at info@jeasyui.com + * + */ (function($){ function _1(_2){ var _3=$.data(_2,"pagination"); diff --git a/src/main/webapp/js/easyui/plugins/jquery.panel.js b/src/main/webapp/js/easyui/plugins/jquery.panel.js index 3181d2c..c9ce9ff 100644 --- a/src/main/webapp/js/easyui/plugins/jquery.panel.js +++ b/src/main/webapp/js/easyui/plugins/jquery.panel.js @@ -1,12 +1,12 @@ -/** - * jQuery EasyUI 1.4.2 - * - * Copyright (c) 2009-2015 www.jeasyui.com. All rights reserved. - * - * Licensed under the GPL license: http://www.gnu.org/licenses/gpl.txt - * To use it on other terms please contact us at info@jeasyui.com - * - */ +/** + * jQuery EasyUI 1.4.2 + * + * Copyright (c) 2009-2015 www.jeasyui.com. All rights reserved. + * + * Licensed under the GPL license: http://www.gnu.org/licenses/gpl.txt + * To use it on other terms please contact us at info@jeasyui.com + * + */ (function($){ $.fn._remove=function(){ return this.each(function(){ diff --git a/src/main/webapp/js/easyui/plugins/jquery.parser.js b/src/main/webapp/js/easyui/plugins/jquery.parser.js index f92870b..08e928b 100644 --- a/src/main/webapp/js/easyui/plugins/jquery.parser.js +++ b/src/main/webapp/js/easyui/plugins/jquery.parser.js @@ -1,12 +1,12 @@ -/** - * jQuery EasyUI 1.4.2 - * - * Copyright (c) 2009-2015 www.jeasyui.com. All rights reserved. - * - * Licensed under the GPL license: http://www.gnu.org/licenses/gpl.txt - * To use it on other terms please contact us at info@jeasyui.com - * - */ +/** + * jQuery EasyUI 1.4.2 + * + * Copyright (c) 2009-2015 www.jeasyui.com. All rights reserved. + * + * Licensed under the GPL license: http://www.gnu.org/licenses/gpl.txt + * To use it on other terms please contact us at info@jeasyui.com + * + */ (function($){ $.parser={auto:true,onComplete:function(_1){ },plugins:["draggable","droppable","resizable","pagination","tooltip","linkbutton","menu","menubutton","splitbutton","progressbar","tree","textbox","filebox","combo","combobox","combotree","combogrid","numberbox","validatebox","searchbox","spinner","numberspinner","timespinner","datetimespinner","calendar","datebox","datetimebox","slider","layout","panel","datagrid","propertygrid","treegrid","datalist","tabs","accordion","window","dialog","form"],parse:function(_2){ diff --git a/src/main/webapp/js/easyui/plugins/jquery.progressbar.js b/src/main/webapp/js/easyui/plugins/jquery.progressbar.js index 784b1af..8ba3bb8 100644 --- a/src/main/webapp/js/easyui/plugins/jquery.progressbar.js +++ b/src/main/webapp/js/easyui/plugins/jquery.progressbar.js @@ -1,12 +1,12 @@ -/** - * jQuery EasyUI 1.4.2 - * - * Copyright (c) 2009-2015 www.jeasyui.com. All rights reserved. - * - * Licensed under the GPL license: http://www.gnu.org/licenses/gpl.txt - * To use it on other terms please contact us at info@jeasyui.com - * - */ +/** + * jQuery EasyUI 1.4.2 + * + * Copyright (c) 2009-2015 www.jeasyui.com. All rights reserved. + * + * Licensed under the GPL license: http://www.gnu.org/licenses/gpl.txt + * To use it on other terms please contact us at info@jeasyui.com + * + */ (function($){ function _1(_2){ $(_2).addClass("progressbar"); diff --git a/src/main/webapp/js/easyui/plugins/jquery.propertygrid.js b/src/main/webapp/js/easyui/plugins/jquery.propertygrid.js index 4167954..ad77c6f 100644 --- a/src/main/webapp/js/easyui/plugins/jquery.propertygrid.js +++ b/src/main/webapp/js/easyui/plugins/jquery.propertygrid.js @@ -1,12 +1,12 @@ -/** - * jQuery EasyUI 1.4.2 - * - * Copyright (c) 2009-2015 www.jeasyui.com. All rights reserved. - * - * Licensed under the GPL license: http://www.gnu.org/licenses/gpl.txt - * To use it on other terms please contact us at info@jeasyui.com - * - */ +/** + * jQuery EasyUI 1.4.2 + * + * Copyright (c) 2009-2015 www.jeasyui.com. All rights reserved. + * + * Licensed under the GPL license: http://www.gnu.org/licenses/gpl.txt + * To use it on other terms please contact us at info@jeasyui.com + * + */ (function($){ var _1; $(document).unbind(".propertygrid").bind("mousedown.propertygrid",function(e){ diff --git a/src/main/webapp/js/easyui/plugins/jquery.resizable.js b/src/main/webapp/js/easyui/plugins/jquery.resizable.js index 141333c..34c0c0f 100644 --- a/src/main/webapp/js/easyui/plugins/jquery.resizable.js +++ b/src/main/webapp/js/easyui/plugins/jquery.resizable.js @@ -1,12 +1,12 @@ -/** - * jQuery EasyUI 1.4.2 - * - * Copyright (c) 2009-2015 www.jeasyui.com. All rights reserved. - * - * Licensed under the GPL license: http://www.gnu.org/licenses/gpl.txt - * To use it on other terms please contact us at info@jeasyui.com - * - */ +/** + * jQuery EasyUI 1.4.2 + * + * Copyright (c) 2009-2015 www.jeasyui.com. All rights reserved. + * + * Licensed under the GPL license: http://www.gnu.org/licenses/gpl.txt + * To use it on other terms please contact us at info@jeasyui.com + * + */ (function($){ $.fn.resizable=function(_1,_2){ if(typeof _1=="string"){ diff --git a/src/main/webapp/js/easyui/plugins/jquery.searchbox.js b/src/main/webapp/js/easyui/plugins/jquery.searchbox.js index 9a0a3ea..a2b21d1 100644 --- a/src/main/webapp/js/easyui/plugins/jquery.searchbox.js +++ b/src/main/webapp/js/easyui/plugins/jquery.searchbox.js @@ -1,12 +1,12 @@ -/** - * jQuery EasyUI 1.4.2 - * - * Copyright (c) 2009-2015 www.jeasyui.com. All rights reserved. - * - * Licensed under the GPL license: http://www.gnu.org/licenses/gpl.txt - * To use it on other terms please contact us at info@jeasyui.com - * - */ +/** + * jQuery EasyUI 1.4.2 + * + * Copyright (c) 2009-2015 www.jeasyui.com. All rights reserved. + * + * Licensed under the GPL license: http://www.gnu.org/licenses/gpl.txt + * To use it on other terms please contact us at info@jeasyui.com + * + */ (function($){ function _1(_2){ var _3=$.data(_2,"searchbox"); diff --git a/src/main/webapp/js/easyui/plugins/jquery.slider.js b/src/main/webapp/js/easyui/plugins/jquery.slider.js index 320eb94..2677896 100644 --- a/src/main/webapp/js/easyui/plugins/jquery.slider.js +++ b/src/main/webapp/js/easyui/plugins/jquery.slider.js @@ -1,12 +1,12 @@ -/** - * jQuery EasyUI 1.4.2 - * - * Copyright (c) 2009-2015 www.jeasyui.com. All rights reserved. - * - * Licensed under the GPL license: http://www.gnu.org/licenses/gpl.txt - * To use it on other terms please contact us at info@jeasyui.com - * - */ +/** + * jQuery EasyUI 1.4.2 + * + * Copyright (c) 2009-2015 www.jeasyui.com. All rights reserved. + * + * Licensed under the GPL license: http://www.gnu.org/licenses/gpl.txt + * To use it on other terms please contact us at info@jeasyui.com + * + */ (function($){ function _1(_2){ var _3=$("
                                                                  "+"
                                                                  "+""+""+"
                                                                  "+"
                                                                  "+"
                                                                  "+"
                                                                  "+""+"
                                                                  ").insertAfter(_2); diff --git a/src/main/webapp/js/easyui/plugins/jquery.spinner.js b/src/main/webapp/js/easyui/plugins/jquery.spinner.js index a6a07a7..f436b46 100644 --- a/src/main/webapp/js/easyui/plugins/jquery.spinner.js +++ b/src/main/webapp/js/easyui/plugins/jquery.spinner.js @@ -1,12 +1,12 @@ -/** - * jQuery EasyUI 1.4.2 - * - * Copyright (c) 2009-2015 www.jeasyui.com. All rights reserved. - * - * Licensed under the GPL license: http://www.gnu.org/licenses/gpl.txt - * To use it on other terms please contact us at info@jeasyui.com - * - */ +/** + * jQuery EasyUI 1.4.2 + * + * Copyright (c) 2009-2015 www.jeasyui.com. All rights reserved. + * + * Licensed under the GPL license: http://www.gnu.org/licenses/gpl.txt + * To use it on other terms please contact us at info@jeasyui.com + * + */ (function($){ function _1(_2){ var _3=$.data(_2,"spinner"); diff --git a/src/main/webapp/js/easyui/plugins/jquery.splitbutton.js b/src/main/webapp/js/easyui/plugins/jquery.splitbutton.js index 936a06a..ceda038 100644 --- a/src/main/webapp/js/easyui/plugins/jquery.splitbutton.js +++ b/src/main/webapp/js/easyui/plugins/jquery.splitbutton.js @@ -1,12 +1,12 @@ -/** - * jQuery EasyUI 1.4.2 - * - * Copyright (c) 2009-2015 www.jeasyui.com. All rights reserved. - * - * Licensed under the GPL license: http://www.gnu.org/licenses/gpl.txt - * To use it on other terms please contact us at info@jeasyui.com - * - */ +/** + * jQuery EasyUI 1.4.2 + * + * Copyright (c) 2009-2015 www.jeasyui.com. All rights reserved. + * + * Licensed under the GPL license: http://www.gnu.org/licenses/gpl.txt + * To use it on other terms please contact us at info@jeasyui.com + * + */ (function($){ function _1(_2){ var _3=$.data(_2,"splitbutton").options; diff --git a/src/main/webapp/js/easyui/plugins/jquery.tabs.js b/src/main/webapp/js/easyui/plugins/jquery.tabs.js index 502bcbc..ed67ef4 100644 --- a/src/main/webapp/js/easyui/plugins/jquery.tabs.js +++ b/src/main/webapp/js/easyui/plugins/jquery.tabs.js @@ -1,12 +1,12 @@ -/** - * jQuery EasyUI 1.4.2 - * - * Copyright (c) 2009-2015 www.jeasyui.com. All rights reserved. - * - * Licensed under the GPL license: http://www.gnu.org/licenses/gpl.txt - * To use it on other terms please contact us at info@jeasyui.com - * - */ +/** + * jQuery EasyUI 1.4.2 + * + * Copyright (c) 2009-2015 www.jeasyui.com. All rights reserved. + * + * Licensed under the GPL license: http://www.gnu.org/licenses/gpl.txt + * To use it on other terms please contact us at info@jeasyui.com + * + */ (function($){ function _1(c){ var w=0; diff --git a/src/main/webapp/js/easyui/plugins/jquery.textbox.js b/src/main/webapp/js/easyui/plugins/jquery.textbox.js index f9d0d01..ee8a4ed 100644 --- a/src/main/webapp/js/easyui/plugins/jquery.textbox.js +++ b/src/main/webapp/js/easyui/plugins/jquery.textbox.js @@ -1,12 +1,12 @@ -/** - * jQuery EasyUI 1.4.2 - * - * Copyright (c) 2009-2015 www.jeasyui.com. All rights reserved. - * - * Licensed under the GPL license: http://www.gnu.org/licenses/gpl.txt - * To use it on other terms please contact us at info@jeasyui.com - * - */ +/** + * jQuery EasyUI 1.4.2 + * + * Copyright (c) 2009-2015 www.jeasyui.com. All rights reserved. + * + * Licensed under the GPL license: http://www.gnu.org/licenses/gpl.txt + * To use it on other terms please contact us at info@jeasyui.com + * + */ (function($){ function _1(_2){ $(_2).addClass("textbox-f").hide(); diff --git a/src/main/webapp/js/easyui/plugins/jquery.timespinner.js b/src/main/webapp/js/easyui/plugins/jquery.timespinner.js index 69af0cf..adccdaf 100644 --- a/src/main/webapp/js/easyui/plugins/jquery.timespinner.js +++ b/src/main/webapp/js/easyui/plugins/jquery.timespinner.js @@ -1,12 +1,12 @@ -/** - * jQuery EasyUI 1.4.2 - * - * Copyright (c) 2009-2015 www.jeasyui.com. All rights reserved. - * - * Licensed under the GPL license: http://www.gnu.org/licenses/gpl.txt - * To use it on other terms please contact us at info@jeasyui.com - * - */ +/** + * jQuery EasyUI 1.4.2 + * + * Copyright (c) 2009-2015 www.jeasyui.com. All rights reserved. + * + * Licensed under the GPL license: http://www.gnu.org/licenses/gpl.txt + * To use it on other terms please contact us at info@jeasyui.com + * + */ (function($){ function _1(_2){ var _3=0; diff --git a/src/main/webapp/js/easyui/plugins/jquery.tooltip.js b/src/main/webapp/js/easyui/plugins/jquery.tooltip.js index 651f1d2..d44c4e5 100644 --- a/src/main/webapp/js/easyui/plugins/jquery.tooltip.js +++ b/src/main/webapp/js/easyui/plugins/jquery.tooltip.js @@ -1,12 +1,12 @@ -/** - * jQuery EasyUI 1.4.2 - * - * Copyright (c) 2009-2015 www.jeasyui.com. All rights reserved. - * - * Licensed under the GPL license: http://www.gnu.org/licenses/gpl.txt - * To use it on other terms please contact us at info@jeasyui.com - * - */ +/** + * jQuery EasyUI 1.4.2 + * + * Copyright (c) 2009-2015 www.jeasyui.com. All rights reserved. + * + * Licensed under the GPL license: http://www.gnu.org/licenses/gpl.txt + * To use it on other terms please contact us at info@jeasyui.com + * + */ (function($){ function _1(_2){ $(_2).addClass("tooltip-f"); diff --git a/src/main/webapp/js/easyui/plugins/jquery.tree.js b/src/main/webapp/js/easyui/plugins/jquery.tree.js index 587c615..d39cf5f 100644 --- a/src/main/webapp/js/easyui/plugins/jquery.tree.js +++ b/src/main/webapp/js/easyui/plugins/jquery.tree.js @@ -1,12 +1,12 @@ -/** - * jQuery EasyUI 1.4.2 - * - * Copyright (c) 2009-2015 www.jeasyui.com. All rights reserved. - * - * Licensed under the GPL license: http://www.gnu.org/licenses/gpl.txt - * To use it on other terms please contact us at info@jeasyui.com - * - */ +/** + * jQuery EasyUI 1.4.2 + * + * Copyright (c) 2009-2015 www.jeasyui.com. All rights reserved. + * + * Licensed under the GPL license: http://www.gnu.org/licenses/gpl.txt + * To use it on other terms please contact us at info@jeasyui.com + * + */ (function($){ function _1(_2){ var _3=$(_2); diff --git a/src/main/webapp/js/easyui/plugins/jquery.treegrid.js b/src/main/webapp/js/easyui/plugins/jquery.treegrid.js index 871c7be..962525f 100644 --- a/src/main/webapp/js/easyui/plugins/jquery.treegrid.js +++ b/src/main/webapp/js/easyui/plugins/jquery.treegrid.js @@ -1,12 +1,12 @@ -/** - * jQuery EasyUI 1.4.2 - * - * Copyright (c) 2009-2015 www.jeasyui.com. All rights reserved. - * - * Licensed under the GPL license: http://www.gnu.org/licenses/gpl.txt - * To use it on other terms please contact us at info@jeasyui.com - * - */ +/** + * jQuery EasyUI 1.4.2 + * + * Copyright (c) 2009-2015 www.jeasyui.com. All rights reserved. + * + * Licensed under the GPL license: http://www.gnu.org/licenses/gpl.txt + * To use it on other terms please contact us at info@jeasyui.com + * + */ (function($){ function _1(_2){ var _3=$.data(_2,"treegrid"); diff --git a/src/main/webapp/js/easyui/plugins/jquery.validatebox.js b/src/main/webapp/js/easyui/plugins/jquery.validatebox.js index 3eead1a..f212324 100644 --- a/src/main/webapp/js/easyui/plugins/jquery.validatebox.js +++ b/src/main/webapp/js/easyui/plugins/jquery.validatebox.js @@ -1,12 +1,12 @@ -/** - * jQuery EasyUI 1.4.2 - * - * Copyright (c) 2009-2015 www.jeasyui.com. All rights reserved. - * - * Licensed under the GPL license: http://www.gnu.org/licenses/gpl.txt - * To use it on other terms please contact us at info@jeasyui.com - * - */ +/** + * jQuery EasyUI 1.4.2 + * + * Copyright (c) 2009-2015 www.jeasyui.com. All rights reserved. + * + * Licensed under the GPL license: http://www.gnu.org/licenses/gpl.txt + * To use it on other terms please contact us at info@jeasyui.com + * + */ (function($){ function _1(_2){ $(_2).addClass("validatebox-text"); diff --git a/src/main/webapp/js/easyui/plugins/jquery.window.js b/src/main/webapp/js/easyui/plugins/jquery.window.js index f0d4dd4..f1f83e4 100644 --- a/src/main/webapp/js/easyui/plugins/jquery.window.js +++ b/src/main/webapp/js/easyui/plugins/jquery.window.js @@ -1,12 +1,12 @@ -/** - * jQuery EasyUI 1.4.2 - * - * Copyright (c) 2009-2015 www.jeasyui.com. All rights reserved. - * - * Licensed under the GPL license: http://www.gnu.org/licenses/gpl.txt - * To use it on other terms please contact us at info@jeasyui.com - * - */ +/** + * jQuery EasyUI 1.4.2 + * + * Copyright (c) 2009-2015 www.jeasyui.com. All rights reserved. + * + * Licensed under the GPL license: http://www.gnu.org/licenses/gpl.txt + * To use it on other terms please contact us at info@jeasyui.com + * + */ (function($){ function _1(_2,_3){ var _4=$.data(_2,"window"); diff --git a/src/main/webapp/js/easyui/readme.txt b/src/main/webapp/js/easyui/readme.txt index eb594fd..4e57b5d 100644 --- a/src/main/webapp/js/easyui/readme.txt +++ b/src/main/webapp/js/easyui/readme.txt @@ -1,4 +1,4 @@ -Current Version: 1.4.2 -====================== -This software is allowed to use under GPL or you need to buy commercial license for better support or other purpose. -Please contact us at info@jeasyui.com +Current Version: 1.4.2 +====================== +This software is allowed to use under GPL or you need to buy commercial license for better support or other purpose. +Please contact us at info@jeasyui.com diff --git a/src/main/webapp/js/easyui/src/easyloader.js b/src/main/webapp/js/easyui/src/easyloader.js index 700acf2..689bd4e 100644 --- a/src/main/webapp/js/easyui/src/easyloader.js +++ b/src/main/webapp/js/easyui/src/easyloader.js @@ -1,425 +1,425 @@ -/** - * jQuery EasyUI 1.4.2 - * - * Copyright (c) 2009-2015 www.jeasyui.com. All rights reserved. - * - * Licensed under the GPL license: http://www.gnu.org/licenses/gpl.txt - * To use it on other terms please contact us at info@jeasyui.com - * - */ -/** - * easyloader - jQuery EasyUI - * - */ -(function(){ - var modules = { - draggable:{ - js:'jquery.draggable.js' - }, - droppable:{ - js:'jquery.droppable.js' - }, - resizable:{ - js:'jquery.resizable.js' - }, - linkbutton:{ - js:'jquery.linkbutton.js', - css:'linkbutton.css' - }, - progressbar:{ - js:'jquery.progressbar.js', - css:'progressbar.css' - }, - tooltip:{ - js:'jquery.tooltip.js', - css:'tooltip.css' - }, - pagination:{ - js:'jquery.pagination.js', - css:'pagination.css', - dependencies:['linkbutton'] - }, - datagrid:{ - js:'jquery.datagrid.js', - css:'datagrid.css', - dependencies:['panel','resizable','linkbutton','pagination'] - }, - treegrid:{ - js:'jquery.treegrid.js', - css:'tree.css', - dependencies:['datagrid'] - }, - propertygrid:{ - js:'jquery.propertygrid.js', - css:'propertygrid.css', - dependencies:['datagrid'] - }, - datalist:{ - js:'jquery.datalist.js', - css:'datalist.css', - dependencies:['datagrid'] - }, - panel: { - js:'jquery.panel.js', - css:'panel.css' - }, - window:{ - js:'jquery.window.js', - css:'window.css', - dependencies:['resizable','draggable','panel'] - }, - dialog:{ - js:'jquery.dialog.js', - css:'dialog.css', - dependencies:['linkbutton','window'] - }, - messager:{ - js:'jquery.messager.js', - css:'messager.css', - dependencies:['linkbutton','window','progressbar'] - }, - layout:{ - js:'jquery.layout.js', - css:'layout.css', - dependencies:['resizable','panel'] - }, - form:{ - js:'jquery.form.js' - }, - menu:{ - js:'jquery.menu.js', - css:'menu.css' - }, - tabs:{ - js:'jquery.tabs.js', - css:'tabs.css', - dependencies:['panel','linkbutton'] - }, - menubutton:{ - js:'jquery.menubutton.js', - css:'menubutton.css', - dependencies:['linkbutton','menu'] - }, - splitbutton:{ - js:'jquery.splitbutton.js', - css:'splitbutton.css', - dependencies:['menubutton'] - }, - accordion:{ - js:'jquery.accordion.js', - css:'accordion.css', - dependencies:['panel'] - }, - calendar:{ - js:'jquery.calendar.js', - css:'calendar.css' - }, - textbox:{ - js:'jquery.textbox.js', - css:'textbox.css', - dependencies:['validatebox','linkbutton'] - }, - filebox:{ - js:'jquery.filebox.js', - css:'filebox.css', - dependencies:['textbox'] - }, - combo:{ - js:'jquery.combo.js', - css:'combo.css', - dependencies:['panel','textbox'] - }, - combobox:{ - js:'jquery.combobox.js', - css:'combobox.css', - dependencies:['combo'] - }, - combotree:{ - js:'jquery.combotree.js', - dependencies:['combo','tree'] - }, - combogrid:{ - js:'jquery.combogrid.js', - dependencies:['combo','datagrid'] - }, - validatebox:{ - js:'jquery.validatebox.js', - css:'validatebox.css', - dependencies:['tooltip'] - }, - numberbox:{ - js:'jquery.numberbox.js', - dependencies:['textbox'] - }, - searchbox:{ - js:'jquery.searchbox.js', - css:'searchbox.css', - dependencies:['menubutton','textbox'] - }, - spinner:{ - js:'jquery.spinner.js', - css:'spinner.css', - dependencies:['textbox'] - }, - numberspinner:{ - js:'jquery.numberspinner.js', - dependencies:['spinner','numberbox'] - }, - timespinner:{ - js:'jquery.timespinner.js', - dependencies:['spinner'] - }, - tree:{ - js:'jquery.tree.js', - css:'tree.css', - dependencies:['draggable','droppable'] - }, - datebox:{ - js:'jquery.datebox.js', - css:'datebox.css', - dependencies:['calendar','combo'] - }, - datetimebox:{ - js:'jquery.datetimebox.js', - dependencies:['datebox','timespinner'] - }, - slider:{ - js:'jquery.slider.js', - dependencies:['draggable'] - }, - tooltip:{ - js:'jquery.tooltip.js' - }, - parser:{ - js:'jquery.parser.js' - }, - mobile:{ - js:'jquery.mobile.js' - } - }; - - var locales = { - 'af':'easyui-lang-af.js', - 'ar':'easyui-lang-ar.js', - 'bg':'easyui-lang-bg.js', - 'ca':'easyui-lang-ca.js', - 'cs':'easyui-lang-cs.js', - 'cz':'easyui-lang-cz.js', - 'da':'easyui-lang-da.js', - 'de':'easyui-lang-de.js', - 'el':'easyui-lang-el.js', - 'en':'easyui-lang-en.js', - 'es':'easyui-lang-es.js', - 'fr':'easyui-lang-fr.js', - 'it':'easyui-lang-it.js', - 'jp':'easyui-lang-jp.js', - 'nl':'easyui-lang-nl.js', - 'pl':'easyui-lang-pl.js', - 'pt_BR':'easyui-lang-pt_BR.js', - 'ru':'easyui-lang-ru.js', - 'sv_SE':'easyui-lang-sv_SE.js', - 'tr':'easyui-lang-tr.js', - 'zh_CN':'easyui-lang-zh_CN.js', - 'zh_TW':'easyui-lang-zh_TW.js' - }; - - var queues = {}; - - function loadJs(url, callback){ - var done = false; - var script = document.createElement('script'); - script.type = 'text/javascript'; - script.language = 'javascript'; - script.src = url; - script.onload = script.onreadystatechange = function(){ - if (!done && (!script.readyState || script.readyState == 'loaded' || script.readyState == 'complete')){ - done = true; - script.onload = script.onreadystatechange = null; - if (callback){ - callback.call(script); - } - } - } - document.getElementsByTagName("head")[0].appendChild(script); - } - - function runJs(url, callback){ - loadJs(url, function(){ - document.getElementsByTagName("head")[0].removeChild(this); - if (callback){ - callback(); - } - }); - } - - function loadCss(url, callback){ - var link = document.createElement('link'); - link.rel = 'stylesheet'; - link.type = 'text/css'; - link.media = 'screen'; - link.href = url; - document.getElementsByTagName('head')[0].appendChild(link); - if (callback){ - callback.call(link); - } - } - - function loadSingle(name, callback){ - queues[name] = 'loading'; - - var module = modules[name]; - var jsStatus = 'loading'; - var cssStatus = (easyloader.css && module['css']) ? 'loading' : 'loaded'; - - if (easyloader.css && module['css']){ - if (/^http/i.test(module['css'])){ - var url = module['css']; - } else { - var url = easyloader.base + 'themes/' + easyloader.theme + '/' + module['css']; - } - loadCss(url, function(){ - cssStatus = 'loaded'; - if (jsStatus == 'loaded' && cssStatus == 'loaded'){ - finish(); - } - }); - } - - if (/^http/i.test(module['js'])){ - var url = module['js']; - } else { - var url = easyloader.base + 'plugins/' + module['js']; - } - loadJs(url, function(){ - jsStatus = 'loaded'; - if (jsStatus == 'loaded' && cssStatus == 'loaded'){ - finish(); - } - }); - - function finish(){ - queues[name] = 'loaded'; - easyloader.onProgress(name); - if (callback){ - callback(); - } - } - } - - function loadModule(name, callback){ - var mm = []; - var doLoad = false; - - if (typeof name == 'string'){ - add(name); - } else { - for(var i=0; i.panel>.accordion-header'); - if (headers.length){ - headerHeight = $(headers[0]).css('height', '')._outerHeight(); - } - if (!isNaN(parseInt(opts.height))){ - bodyHeight = cc.height() - headerHeight*headers.length; - } - - _resize(true, bodyHeight - _resize(false) + 1); - - function _resize(collapsible, height){ - var totalHeight = 0; - for(var i=0; i= panels.length){ - return null; - } else { - return panels[which]; - } - } - return findBy(container, 'title', which); - } - - function setProperties(container){ - var opts = $.data(container, 'accordion').options; - var cc = $(container); - if (opts.border){ - cc.removeClass('accordion-noborder'); - } else { - cc.addClass('accordion-noborder'); - } - } - - function init(container){ - var state = $.data(container, 'accordion'); - var cc = $(container); - cc.addClass('accordion'); - - state.panels = []; - cc.children('div').each(function(){ - var opts = $.extend({}, $.parser.parseOptions(this), { - selected: ($(this).attr('selected') ? true : undefined) - }); - var pp = $(this); - state.panels.push(pp); - createPanel(container, pp, opts); - }); - - cc.bind('_resize', function(e,force){ - if ($(this).hasClass('easyui-fluid') || force){ - setSize(container); - } - return false; - }); - } - - function createPanel(container, pp, options){ - var opts = $.data(container, 'accordion').options; - pp.panel($.extend({}, { - collapsible: true, - minimizable: false, - maximizable: false, - closable: false, - doSize: false, - collapsed: true, - headerCls: 'accordion-header', - bodyCls: 'accordion-body' - }, options, { - onBeforeExpand: function(){ - if (options.onBeforeExpand){ - if (options.onBeforeExpand.call(this) == false){return false} - } - if (!opts.multiple){ - // get all selected panel - var all = $.grep(getSelections(container), function(p){ - return p.panel('options').collapsible; - }); - for(var i=0; i').addClass('accordion-collapse accordion-expand').appendTo(tool); - t.bind('click', function(){ - togglePanel(pp); - return false; - }); - pp.panel('options').collapsible ? t.show() : t.hide(); - - header.click(function(){ - togglePanel(pp); - return false; - }); - - function togglePanel(p){ - var popts = p.panel('options'); - if (popts.collapsible){ - var index = getPanelIndex(container, p); - if (popts.collapsed){ - select(container, index); - } else { - unselect(container, index); - } - } - } - } - - /** - * select and set the specified panel active - */ - function select(container, which){ - var p = getPanel(container, which); - if (!p){return} - stopAnimate(container); - var opts = $.data(container, 'accordion').options; - p.panel('expand', opts.animate); - } - - function unselect(container, which){ - var p = getPanel(container, which); - if (!p){return} - stopAnimate(container); - var opts = $.data(container, 'accordion').options; - p.panel('collapse', opts.animate); - } - - function doFirstSelect(container){ - var opts = $.data(container, 'accordion').options; - var p = findBy(container, 'selected', true); - if (p){ - _select(getPanelIndex(container, p)); - } else { - _select(opts.selected); - } - - function _select(index){ - var animate = opts.animate; - opts.animate = false; - select(container, index); - opts.animate = animate; - } - } - - /** - * stop the animation of all panels - */ - function stopAnimate(container){ - var panels = $.data(container, 'accordion').panels; - for(var i=0; i').appendTo(container); - panels.push(pp); - createPanel(container, pp, options); - setSize(container); - - opts.onAdd.call(container, options.title, panels.length-1); - - if (options.selected){ - select(container, panels.length-1); - } - } - - function remove(container, which){ - var state = $.data(container, 'accordion'); - var opts = state.options; - var panels = state.panels; - - stopAnimate(container); - - var panel = getPanel(container, which); - var title = panel.panel('options').title; - var index = getPanelIndex(container, panel); - - if (!panel){return} - if (opts.onBeforeRemove.call(container, title, index) == false){return} - - panels.splice(index, 1); - panel.panel('destroy'); - if (panels.length){ - setSize(container); - var curr = getSelected(container); - if (!curr){ - select(container, 0); - } - } - - opts.onRemove.call(container, title, index); - } - - $.fn.accordion = function(options, param){ - if (typeof options == 'string'){ - return $.fn.accordion.methods[options](this, param); - } - - options = options || {}; - return this.each(function(){ - var state = $.data(this, 'accordion'); - if (state){ - $.extend(state.options, options); - } else { - $.data(this, 'accordion', { - options: $.extend({}, $.fn.accordion.defaults, $.fn.accordion.parseOptions(this), options), - accordion: $(this).addClass('accordion'), - panels: [] - }); - init(this); - } - - setProperties(this); - setSize(this); - doFirstSelect(this); - }); - }; - - $.fn.accordion.methods = { - options: function(jq){ - return $.data(jq[0], 'accordion').options; - }, - panels: function(jq){ - return $.data(jq[0], 'accordion').panels; - }, - resize: function(jq, param){ - return jq.each(function(){ - setSize(this, param); - }); - }, - getSelections: function(jq){ - return getSelections(jq[0]); - }, - getSelected: function(jq){ - return getSelected(jq[0]); - }, - getPanel: function(jq, which){ - return getPanel(jq[0], which); - }, - getPanelIndex: function(jq, panel){ - return getPanelIndex(jq[0], panel); - }, - select: function(jq, which){ - return jq.each(function(){ - select(this, which); - }); - }, - unselect: function(jq, which){ - return jq.each(function(){ - unselect(this, which); - }); - }, - add: function(jq, options){ - return jq.each(function(){ - add(this, options); - }); - }, - remove: function(jq, which){ - return jq.each(function(){ - remove(this, which); - }); - } - }; - - $.fn.accordion.parseOptions = function(target){ - var t = $(target); - return $.extend({}, $.parser.parseOptions(target, [ - 'width','height', - {fit:'boolean',border:'boolean',animate:'boolean',multiple:'boolean',selected:'number'} - ])); - }; - - $.fn.accordion.defaults = { - width: 'auto', - height: 'auto', - fit: false, - border: true, - animate: true, - multiple: false, - selected: 0, - - onSelect: function(title, index){}, - onUnselect: function(title, index){}, - onAdd: function(title, index){}, - onBeforeRemove: function(title, index){}, - onRemove: function(title, index){} - }; -})(jQuery); +/** + * jQuery EasyUI 1.4.2 + * + * Copyright (c) 2009-2015 www.jeasyui.com. All rights reserved. + * + * Licensed under the GPL license: http://www.gnu.org/licenses/gpl.txt + * To use it on other terms please contact us at info@jeasyui.com + * + */ +/** + * accordion - jQuery EasyUI + * + * Dependencies: + * panel + * + */ +(function($){ + + function setSize(container, param){ + var state = $.data(container, 'accordion'); + var opts = state.options; + var panels = state.panels; + var cc = $(container); + + if (param){ + $.extend(opts, { + width: param.width, + height: param.height + }); + } + cc._size(opts); + var headerHeight = 0; + var bodyHeight = 'auto'; + var headers = cc.find('>.panel>.accordion-header'); + if (headers.length){ + headerHeight = $(headers[0]).css('height', '')._outerHeight(); + } + if (!isNaN(parseInt(opts.height))){ + bodyHeight = cc.height() - headerHeight*headers.length; + } + + _resize(true, bodyHeight - _resize(false) + 1); + + function _resize(collapsible, height){ + var totalHeight = 0; + for(var i=0; i= panels.length){ + return null; + } else { + return panels[which]; + } + } + return findBy(container, 'title', which); + } + + function setProperties(container){ + var opts = $.data(container, 'accordion').options; + var cc = $(container); + if (opts.border){ + cc.removeClass('accordion-noborder'); + } else { + cc.addClass('accordion-noborder'); + } + } + + function init(container){ + var state = $.data(container, 'accordion'); + var cc = $(container); + cc.addClass('accordion'); + + state.panels = []; + cc.children('div').each(function(){ + var opts = $.extend({}, $.parser.parseOptions(this), { + selected: ($(this).attr('selected') ? true : undefined) + }); + var pp = $(this); + state.panels.push(pp); + createPanel(container, pp, opts); + }); + + cc.bind('_resize', function(e,force){ + if ($(this).hasClass('easyui-fluid') || force){ + setSize(container); + } + return false; + }); + } + + function createPanel(container, pp, options){ + var opts = $.data(container, 'accordion').options; + pp.panel($.extend({}, { + collapsible: true, + minimizable: false, + maximizable: false, + closable: false, + doSize: false, + collapsed: true, + headerCls: 'accordion-header', + bodyCls: 'accordion-body' + }, options, { + onBeforeExpand: function(){ + if (options.onBeforeExpand){ + if (options.onBeforeExpand.call(this) == false){return false} + } + if (!opts.multiple){ + // get all selected panel + var all = $.grep(getSelections(container), function(p){ + return p.panel('options').collapsible; + }); + for(var i=0; i').addClass('accordion-collapse accordion-expand').appendTo(tool); + t.bind('click', function(){ + togglePanel(pp); + return false; + }); + pp.panel('options').collapsible ? t.show() : t.hide(); + + header.click(function(){ + togglePanel(pp); + return false; + }); + + function togglePanel(p){ + var popts = p.panel('options'); + if (popts.collapsible){ + var index = getPanelIndex(container, p); + if (popts.collapsed){ + select(container, index); + } else { + unselect(container, index); + } + } + } + } + + /** + * select and set the specified panel active + */ + function select(container, which){ + var p = getPanel(container, which); + if (!p){return} + stopAnimate(container); + var opts = $.data(container, 'accordion').options; + p.panel('expand', opts.animate); + } + + function unselect(container, which){ + var p = getPanel(container, which); + if (!p){return} + stopAnimate(container); + var opts = $.data(container, 'accordion').options; + p.panel('collapse', opts.animate); + } + + function doFirstSelect(container){ + var opts = $.data(container, 'accordion').options; + var p = findBy(container, 'selected', true); + if (p){ + _select(getPanelIndex(container, p)); + } else { + _select(opts.selected); + } + + function _select(index){ + var animate = opts.animate; + opts.animate = false; + select(container, index); + opts.animate = animate; + } + } + + /** + * stop the animation of all panels + */ + function stopAnimate(container){ + var panels = $.data(container, 'accordion').panels; + for(var i=0; i').appendTo(container); + panels.push(pp); + createPanel(container, pp, options); + setSize(container); + + opts.onAdd.call(container, options.title, panels.length-1); + + if (options.selected){ + select(container, panels.length-1); + } + } + + function remove(container, which){ + var state = $.data(container, 'accordion'); + var opts = state.options; + var panels = state.panels; + + stopAnimate(container); + + var panel = getPanel(container, which); + var title = panel.panel('options').title; + var index = getPanelIndex(container, panel); + + if (!panel){return} + if (opts.onBeforeRemove.call(container, title, index) == false){return} + + panels.splice(index, 1); + panel.panel('destroy'); + if (panels.length){ + setSize(container); + var curr = getSelected(container); + if (!curr){ + select(container, 0); + } + } + + opts.onRemove.call(container, title, index); + } + + $.fn.accordion = function(options, param){ + if (typeof options == 'string'){ + return $.fn.accordion.methods[options](this, param); + } + + options = options || {}; + return this.each(function(){ + var state = $.data(this, 'accordion'); + if (state){ + $.extend(state.options, options); + } else { + $.data(this, 'accordion', { + options: $.extend({}, $.fn.accordion.defaults, $.fn.accordion.parseOptions(this), options), + accordion: $(this).addClass('accordion'), + panels: [] + }); + init(this); + } + + setProperties(this); + setSize(this); + doFirstSelect(this); + }); + }; + + $.fn.accordion.methods = { + options: function(jq){ + return $.data(jq[0], 'accordion').options; + }, + panels: function(jq){ + return $.data(jq[0], 'accordion').panels; + }, + resize: function(jq, param){ + return jq.each(function(){ + setSize(this, param); + }); + }, + getSelections: function(jq){ + return getSelections(jq[0]); + }, + getSelected: function(jq){ + return getSelected(jq[0]); + }, + getPanel: function(jq, which){ + return getPanel(jq[0], which); + }, + getPanelIndex: function(jq, panel){ + return getPanelIndex(jq[0], panel); + }, + select: function(jq, which){ + return jq.each(function(){ + select(this, which); + }); + }, + unselect: function(jq, which){ + return jq.each(function(){ + unselect(this, which); + }); + }, + add: function(jq, options){ + return jq.each(function(){ + add(this, options); + }); + }, + remove: function(jq, which){ + return jq.each(function(){ + remove(this, which); + }); + } + }; + + $.fn.accordion.parseOptions = function(target){ + var t = $(target); + return $.extend({}, $.parser.parseOptions(target, [ + 'width','height', + {fit:'boolean',border:'boolean',animate:'boolean',multiple:'boolean',selected:'number'} + ])); + }; + + $.fn.accordion.defaults = { + width: 'auto', + height: 'auto', + fit: false, + border: true, + animate: true, + multiple: false, + selected: 0, + + onSelect: function(title, index){}, + onUnselect: function(title, index){}, + onAdd: function(title, index){}, + onBeforeRemove: function(title, index){}, + onRemove: function(title, index){} + }; +})(jQuery); diff --git a/src/main/webapp/js/easyui/src/jquery.calendar.js b/src/main/webapp/js/easyui/src/jquery.calendar.js index 0756ba2..44da11c 100644 --- a/src/main/webapp/js/easyui/src/jquery.calendar.js +++ b/src/main/webapp/js/easyui/src/jquery.calendar.js @@ -1,438 +1,438 @@ -/** - * jQuery EasyUI 1.4.2 - * - * Copyright (c) 2009-2015 www.jeasyui.com. All rights reserved. - * - * Licensed under the GPL license: http://www.gnu.org/licenses/gpl.txt - * To use it on other terms please contact us at info@jeasyui.com - * - */ -/** - * calendar - jQuery EasyUI - * - */ -(function($){ - - function setSize(target, param){ - var opts = $.data(target, 'calendar').options; - var t = $(target); - if (param){ - $.extend(opts, { - width: param.width, - height: param.height - }); - } - t._size(opts, t.parent()); - t.find('.calendar-body')._outerHeight(t.height() - t.find('.calendar-header')._outerHeight()); - if (t.find('.calendar-menu').is(':visible')){ - showSelectMenus(target); - } - } - - function init(target){ - $(target).addClass('calendar').html( - '
                                                                  ' + - '
                                                                  ' + - '
                                                                  ' + - '
                                                                  ' + - '
                                                                  ' + - '
                                                                  ' + - '' + - '
                                                                  ' + - '
                                                                  ' + - '
                                                                  ' + - '
                                                                  ' + - '
                                                                  ' + - '' + - '' + - '' + - '
                                                                  ' + - '
                                                                  ' + - '
                                                                  ' + - '
                                                                  ' + - '
                                                                  ' - ); - - - $(target).bind('_resize', function(e,force){ - if ($(this).hasClass('easyui-fluid') || force){ - setSize(target); - } - return false; - }); - } - - function bindEvents(target){ - var opts = $.data(target, 'calendar').options; - var menu = $(target).find('.calendar-menu'); - menu.find('.calendar-menu-year').unbind('.calendar').bind('keypress.calendar', function(e){ - if (e.keyCode == 13){ - setDate(true); - } - }); - $(target).unbind('.calendar').bind('mouseover.calendar', function(e){ - var t = toTarget(e.target); - if (t.hasClass('calendar-nav') || t.hasClass('calendar-text') || (t.hasClass('calendar-day') && !t.hasClass('calendar-disabled'))){ - t.addClass('calendar-nav-hover'); - } - }).bind('mouseout.calendar', function(e){ - var t = toTarget(e.target); - if (t.hasClass('calendar-nav') || t.hasClass('calendar-text') || (t.hasClass('calendar-day') && !t.hasClass('calendar-disabled'))){ - t.removeClass('calendar-nav-hover'); - } - }).bind('click.calendar', function(e){ - var t = toTarget(e.target); - if (t.hasClass('calendar-menu-next') || t.hasClass('calendar-nextyear')){ - showYear(1); - } else if (t.hasClass('calendar-menu-prev') || t.hasClass('calendar-prevyear')){ - showYear(-1); - } else if (t.hasClass('calendar-menu-month')){ - menu.find('.calendar-selected').removeClass('calendar-selected'); - t.addClass('calendar-selected'); - setDate(true); - } else if (t.hasClass('calendar-prevmonth')){ - showMonth(-1); - } else if (t.hasClass('calendar-nextmonth')){ - showMonth(1); - } else if (t.hasClass('calendar-text')){ - if (menu.is(':visible')){ - menu.hide(); - } else { - showSelectMenus(target); - } - } else if (t.hasClass('calendar-day')){ - if (t.hasClass('calendar-disabled')){return} - var oldValue = opts.current; - t.closest('div.calendar-body').find('.calendar-selected').removeClass('calendar-selected'); - t.addClass('calendar-selected'); - var parts = t.attr('abbr').split(','); - var y = parseInt(parts[0]); - var m = parseInt(parts[1]); - var d = parseInt(parts[2]); - opts.current = new Date(y, m-1, d); - opts.onSelect.call(target, opts.current); - if (!oldValue || oldValue.getTime() != opts.current.getTime()){ - opts.onChange.call(target, opts.current, oldValue); - } - if (opts.year != y || opts.month != m){ - opts.year = y; - opts.month = m; - show(target); - } - } - }); - function toTarget(t){ - var day = $(t).closest('.calendar-day'); - if (day.length){ - return day; - } else { - return $(t); - } - } - function setDate(hideMenu){ - var menu = $(target).find('.calendar-menu'); - var year = menu.find('.calendar-menu-year').val(); - var month = menu.find('.calendar-selected').attr('abbr'); - if (!isNaN(year)){ - opts.year = parseInt(year); - opts.month = parseInt(month); - show(target); - } - if (hideMenu){menu.hide()} - } - function showYear(delta){ - opts.year += delta; - show(target); - menu.find('.calendar-menu-year').val(opts.year); - } - function showMonth(delta){ - opts.month += delta; - if (opts.month > 12){ - opts.year++; - opts.month = 1; - } else if (opts.month < 1){ - opts.year--; - opts.month = 12; - } - show(target); - - menu.find('td.calendar-selected').removeClass('calendar-selected'); - menu.find('td:eq(' + (opts.month-1) + ')').addClass('calendar-selected'); - } - } - - /** - * show the select menu that can change year or month, if the menu is not be created then create it. - */ - function showSelectMenus(target){ - var opts = $.data(target, 'calendar').options; - $(target).find('.calendar-menu').show(); - - if ($(target).find('.calendar-menu-month-inner').is(':empty')){ - $(target).find('.calendar-menu-month-inner').empty(); - var t = $('
                                                                  ').appendTo($(target).find('.calendar-menu-month-inner')); - var idx = 0; - for(var i=0; i<3; i++){ - var tr = $('').appendTo(t); - for(var j=0; j<4; j++){ - $('').html(opts.months[idx++]).attr('abbr',idx).appendTo(tr); - } - } - } - - var body = $(target).find('.calendar-body'); - var sele = $(target).find('.calendar-menu'); - var seleYear = sele.find('.calendar-menu-year-inner'); - var seleMonth = sele.find('.calendar-menu-month-inner'); - - seleYear.find('input').val(opts.year).focus(); - seleMonth.find('td.calendar-selected').removeClass('calendar-selected'); - seleMonth.find('td:eq('+(opts.month-1)+')').addClass('calendar-selected'); - - sele._outerWidth(body._outerWidth()); - sele._outerHeight(body._outerHeight()); - seleMonth._outerHeight(sele.height() - seleYear._outerHeight()); - } - - /** - * get weeks data. - */ - function getWeeks(target, year, month){ - var opts = $.data(target, 'calendar').options; - var dates = []; - var lastDay = new Date(year, month, 0).getDate(); - for(var i=1; i<=lastDay; i++) dates.push([year,month,i]); - - // group date by week - var weeks = [], week = []; - var memoDay = -1; - while(dates.length > 0){ - var date = dates.shift(); - week.push(date); - var day = new Date(date[0],date[1]-1,date[2]).getDay(); - if (memoDay == day){ - day = 0; - } else if (day == (opts.firstDay==0 ? 7 : opts.firstDay) - 1){ - weeks.push(week); - week = []; - } - memoDay = day; - } - if (week.length){ - weeks.push(week); - } - - var firstWeek = weeks[0]; - if (firstWeek.length < 7){ - while(firstWeek.length < 7){ - var firstDate = firstWeek[0]; - var date = new Date(firstDate[0],firstDate[1]-1,firstDate[2]-1) - firstWeek.unshift([date.getFullYear(), date.getMonth()+1, date.getDate()]); - } - } else { - var firstDate = firstWeek[0]; - var week = []; - for(var i=1; i<=7; i++){ - var date = new Date(firstDate[0], firstDate[1]-1, firstDate[2]-i); - week.unshift([date.getFullYear(), date.getMonth()+1, date.getDate()]); - } - weeks.unshift(week); - } - - var lastWeek = weeks[weeks.length-1]; - while(lastWeek.length < 7){ - var lastDate = lastWeek[lastWeek.length-1]; - var date = new Date(lastDate[0], lastDate[1]-1, lastDate[2]+1); - lastWeek.push([date.getFullYear(), date.getMonth()+1, date.getDate()]); - } - if (weeks.length < 6){ - var lastDate = lastWeek[lastWeek.length-1]; - var week = []; - for(var i=1; i<=7; i++){ - var date = new Date(lastDate[0], lastDate[1]-1, lastDate[2]+i); - week.push([date.getFullYear(), date.getMonth()+1, date.getDate()]); - } - weeks.push(week); - } - - return weeks; - } - - /** - * show the calendar day. - */ - function show(target){ - var opts = $.data(target, 'calendar').options; - if (opts.current && !opts.validator.call(target, opts.current)){ - opts.current = null; - } - - var now = new Date(); - var todayInfo = now.getFullYear()+','+(now.getMonth()+1)+','+now.getDate(); - var currentInfo = opts.current ? (opts.current.getFullYear()+','+(opts.current.getMonth()+1)+','+opts.current.getDate()) : ''; - // calulate the saturday and sunday index - var saIndex = 6 - opts.firstDay; - var suIndex = saIndex + 1; - if (saIndex >= 7) saIndex -= 7; - if (suIndex >= 7) suIndex -= 7; - - $(target).find('.calendar-title span').html(opts.months[opts.month-1] + ' ' + opts.year); - - var body = $(target).find('div.calendar-body'); - body.children('table').remove(); - - var data = ['']; - data.push(''); - for(var i=opts.firstDay; i'+opts.weeks[i]+''); - } - for(var i=0; i'+opts.weeks[i]+''); - } - data.push(''); - - data.push(''); - var weeks = getWeeks(target, opts.year, opts.month); - for(var i=0; i'); - for(var j=0; j' + d + ''); - } - data.push(''); - } - data.push(''); - data.push('
                                                                  '); - - body.append(data.join('')); - body.children('table.calendar-dtable').prependTo(body); - - opts.onNavigate.call(target, opts.year, opts.month); - } - - $.fn.calendar = function(options, param){ - if (typeof options == 'string'){ - return $.fn.calendar.methods[options](this, param); - } - - options = options || {}; - return this.each(function(){ - var state = $.data(this, 'calendar'); - if (state){ - $.extend(state.options, options); - } else { - state = $.data(this, 'calendar', { - options:$.extend({}, $.fn.calendar.defaults, $.fn.calendar.parseOptions(this), options) - }); - init(this); - } - if (state.options.border == false){ - $(this).addClass('calendar-noborder'); - } - setSize(this); - bindEvents(this); - show(this); - $(this).find('div.calendar-menu').hide(); // hide the calendar menu - }); - }; - - $.fn.calendar.methods = { - options: function(jq){ - return $.data(jq[0], 'calendar').options; - }, - resize: function(jq, param){ - return jq.each(function(){ - setSize(this, param); - }); - }, - moveTo: function(jq, date){ - return jq.each(function(){ - if (!date){ - var now = new Date(); - $(this).calendar({ - year: now.getFullYear(), - month: now.getMonth()+1, - current: date - }); - return; - } - var opts = $(this).calendar('options'); - if (opts.validator.call(this, date)){ - var oldValue = opts.current; - $(this).calendar({ - year: date.getFullYear(), - month: date.getMonth()+1, - current: date - }); - if (!oldValue || oldValue.getTime() != date.getTime()){ - opts.onChange.call(this, opts.current, oldValue); - } - } - }); - } - }; - - $.fn.calendar.parseOptions = function(target){ - var t = $(target); - return $.extend({}, $.parser.parseOptions(target, [ - {firstDay:'number',fit:'boolean',border:'boolean'} - ])); - }; - - $.fn.calendar.defaults = { - width:180, - height:180, - fit:false, - border:true, - firstDay:0, - weeks:['S','M','T','W','T','F','S'], - months:['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'], - year:new Date().getFullYear(), - month:new Date().getMonth()+1, - current:(function(){ - var d = new Date(); - return new Date(d.getFullYear(), d.getMonth(), d.getDate()); - })(), - - formatter:function(date){return date.getDate()}, - styler:function(date){return ''}, - validator:function(date){return true}, - - onSelect: function(date){}, - onChange: function(newDate, oldDate){}, - onNavigate: function(year, month){} - }; -})(jQuery); +/** + * jQuery EasyUI 1.4.2 + * + * Copyright (c) 2009-2015 www.jeasyui.com. All rights reserved. + * + * Licensed under the GPL license: http://www.gnu.org/licenses/gpl.txt + * To use it on other terms please contact us at info@jeasyui.com + * + */ +/** + * calendar - jQuery EasyUI + * + */ +(function($){ + + function setSize(target, param){ + var opts = $.data(target, 'calendar').options; + var t = $(target); + if (param){ + $.extend(opts, { + width: param.width, + height: param.height + }); + } + t._size(opts, t.parent()); + t.find('.calendar-body')._outerHeight(t.height() - t.find('.calendar-header')._outerHeight()); + if (t.find('.calendar-menu').is(':visible')){ + showSelectMenus(target); + } + } + + function init(target){ + $(target).addClass('calendar').html( + '
                                                                  ' + + '
                                                                  ' + + '
                                                                  ' + + '
                                                                  ' + + '
                                                                  ' + + '
                                                                  ' + + '' + + '
                                                                  ' + + '
                                                                  ' + + '
                                                                  ' + + '
                                                                  ' + + '
                                                                  ' + + '' + + '' + + '' + + '
                                                                  ' + + '
                                                                  ' + + '
                                                                  ' + + '
                                                                  ' + + '
                                                                  ' + ); + + + $(target).bind('_resize', function(e,force){ + if ($(this).hasClass('easyui-fluid') || force){ + setSize(target); + } + return false; + }); + } + + function bindEvents(target){ + var opts = $.data(target, 'calendar').options; + var menu = $(target).find('.calendar-menu'); + menu.find('.calendar-menu-year').unbind('.calendar').bind('keypress.calendar', function(e){ + if (e.keyCode == 13){ + setDate(true); + } + }); + $(target).unbind('.calendar').bind('mouseover.calendar', function(e){ + var t = toTarget(e.target); + if (t.hasClass('calendar-nav') || t.hasClass('calendar-text') || (t.hasClass('calendar-day') && !t.hasClass('calendar-disabled'))){ + t.addClass('calendar-nav-hover'); + } + }).bind('mouseout.calendar', function(e){ + var t = toTarget(e.target); + if (t.hasClass('calendar-nav') || t.hasClass('calendar-text') || (t.hasClass('calendar-day') && !t.hasClass('calendar-disabled'))){ + t.removeClass('calendar-nav-hover'); + } + }).bind('click.calendar', function(e){ + var t = toTarget(e.target); + if (t.hasClass('calendar-menu-next') || t.hasClass('calendar-nextyear')){ + showYear(1); + } else if (t.hasClass('calendar-menu-prev') || t.hasClass('calendar-prevyear')){ + showYear(-1); + } else if (t.hasClass('calendar-menu-month')){ + menu.find('.calendar-selected').removeClass('calendar-selected'); + t.addClass('calendar-selected'); + setDate(true); + } else if (t.hasClass('calendar-prevmonth')){ + showMonth(-1); + } else if (t.hasClass('calendar-nextmonth')){ + showMonth(1); + } else if (t.hasClass('calendar-text')){ + if (menu.is(':visible')){ + menu.hide(); + } else { + showSelectMenus(target); + } + } else if (t.hasClass('calendar-day')){ + if (t.hasClass('calendar-disabled')){return} + var oldValue = opts.current; + t.closest('div.calendar-body').find('.calendar-selected').removeClass('calendar-selected'); + t.addClass('calendar-selected'); + var parts = t.attr('abbr').split(','); + var y = parseInt(parts[0]); + var m = parseInt(parts[1]); + var d = parseInt(parts[2]); + opts.current = new Date(y, m-1, d); + opts.onSelect.call(target, opts.current); + if (!oldValue || oldValue.getTime() != opts.current.getTime()){ + opts.onChange.call(target, opts.current, oldValue); + } + if (opts.year != y || opts.month != m){ + opts.year = y; + opts.month = m; + show(target); + } + } + }); + function toTarget(t){ + var day = $(t).closest('.calendar-day'); + if (day.length){ + return day; + } else { + return $(t); + } + } + function setDate(hideMenu){ + var menu = $(target).find('.calendar-menu'); + var year = menu.find('.calendar-menu-year').val(); + var month = menu.find('.calendar-selected').attr('abbr'); + if (!isNaN(year)){ + opts.year = parseInt(year); + opts.month = parseInt(month); + show(target); + } + if (hideMenu){menu.hide()} + } + function showYear(delta){ + opts.year += delta; + show(target); + menu.find('.calendar-menu-year').val(opts.year); + } + function showMonth(delta){ + opts.month += delta; + if (opts.month > 12){ + opts.year++; + opts.month = 1; + } else if (opts.month < 1){ + opts.year--; + opts.month = 12; + } + show(target); + + menu.find('td.calendar-selected').removeClass('calendar-selected'); + menu.find('td:eq(' + (opts.month-1) + ')').addClass('calendar-selected'); + } + } + + /** + * show the select menu that can change year or month, if the menu is not be created then create it. + */ + function showSelectMenus(target){ + var opts = $.data(target, 'calendar').options; + $(target).find('.calendar-menu').show(); + + if ($(target).find('.calendar-menu-month-inner').is(':empty')){ + $(target).find('.calendar-menu-month-inner').empty(); + var t = $('
                                                                  ').appendTo($(target).find('.calendar-menu-month-inner')); + var idx = 0; + for(var i=0; i<3; i++){ + var tr = $('').appendTo(t); + for(var j=0; j<4; j++){ + $('').html(opts.months[idx++]).attr('abbr',idx).appendTo(tr); + } + } + } + + var body = $(target).find('.calendar-body'); + var sele = $(target).find('.calendar-menu'); + var seleYear = sele.find('.calendar-menu-year-inner'); + var seleMonth = sele.find('.calendar-menu-month-inner'); + + seleYear.find('input').val(opts.year).focus(); + seleMonth.find('td.calendar-selected').removeClass('calendar-selected'); + seleMonth.find('td:eq('+(opts.month-1)+')').addClass('calendar-selected'); + + sele._outerWidth(body._outerWidth()); + sele._outerHeight(body._outerHeight()); + seleMonth._outerHeight(sele.height() - seleYear._outerHeight()); + } + + /** + * get weeks data. + */ + function getWeeks(target, year, month){ + var opts = $.data(target, 'calendar').options; + var dates = []; + var lastDay = new Date(year, month, 0).getDate(); + for(var i=1; i<=lastDay; i++) dates.push([year,month,i]); + + // group date by week + var weeks = [], week = []; + var memoDay = -1; + while(dates.length > 0){ + var date = dates.shift(); + week.push(date); + var day = new Date(date[0],date[1]-1,date[2]).getDay(); + if (memoDay == day){ + day = 0; + } else if (day == (opts.firstDay==0 ? 7 : opts.firstDay) - 1){ + weeks.push(week); + week = []; + } + memoDay = day; + } + if (week.length){ + weeks.push(week); + } + + var firstWeek = weeks[0]; + if (firstWeek.length < 7){ + while(firstWeek.length < 7){ + var firstDate = firstWeek[0]; + var date = new Date(firstDate[0],firstDate[1]-1,firstDate[2]-1) + firstWeek.unshift([date.getFullYear(), date.getMonth()+1, date.getDate()]); + } + } else { + var firstDate = firstWeek[0]; + var week = []; + for(var i=1; i<=7; i++){ + var date = new Date(firstDate[0], firstDate[1]-1, firstDate[2]-i); + week.unshift([date.getFullYear(), date.getMonth()+1, date.getDate()]); + } + weeks.unshift(week); + } + + var lastWeek = weeks[weeks.length-1]; + while(lastWeek.length < 7){ + var lastDate = lastWeek[lastWeek.length-1]; + var date = new Date(lastDate[0], lastDate[1]-1, lastDate[2]+1); + lastWeek.push([date.getFullYear(), date.getMonth()+1, date.getDate()]); + } + if (weeks.length < 6){ + var lastDate = lastWeek[lastWeek.length-1]; + var week = []; + for(var i=1; i<=7; i++){ + var date = new Date(lastDate[0], lastDate[1]-1, lastDate[2]+i); + week.push([date.getFullYear(), date.getMonth()+1, date.getDate()]); + } + weeks.push(week); + } + + return weeks; + } + + /** + * show the calendar day. + */ + function show(target){ + var opts = $.data(target, 'calendar').options; + if (opts.current && !opts.validator.call(target, opts.current)){ + opts.current = null; + } + + var now = new Date(); + var todayInfo = now.getFullYear()+','+(now.getMonth()+1)+','+now.getDate(); + var currentInfo = opts.current ? (opts.current.getFullYear()+','+(opts.current.getMonth()+1)+','+opts.current.getDate()) : ''; + // calulate the saturday and sunday index + var saIndex = 6 - opts.firstDay; + var suIndex = saIndex + 1; + if (saIndex >= 7) saIndex -= 7; + if (suIndex >= 7) suIndex -= 7; + + $(target).find('.calendar-title span').html(opts.months[opts.month-1] + ' ' + opts.year); + + var body = $(target).find('div.calendar-body'); + body.children('table').remove(); + + var data = ['']; + data.push(''); + for(var i=opts.firstDay; i'+opts.weeks[i]+''); + } + for(var i=0; i'+opts.weeks[i]+''); + } + data.push(''); + + data.push(''); + var weeks = getWeeks(target, opts.year, opts.month); + for(var i=0; i'); + for(var j=0; j' + d + ''); + } + data.push(''); + } + data.push(''); + data.push('
                                                                  '); + + body.append(data.join('')); + body.children('table.calendar-dtable').prependTo(body); + + opts.onNavigate.call(target, opts.year, opts.month); + } + + $.fn.calendar = function(options, param){ + if (typeof options == 'string'){ + return $.fn.calendar.methods[options](this, param); + } + + options = options || {}; + return this.each(function(){ + var state = $.data(this, 'calendar'); + if (state){ + $.extend(state.options, options); + } else { + state = $.data(this, 'calendar', { + options:$.extend({}, $.fn.calendar.defaults, $.fn.calendar.parseOptions(this), options) + }); + init(this); + } + if (state.options.border == false){ + $(this).addClass('calendar-noborder'); + } + setSize(this); + bindEvents(this); + show(this); + $(this).find('div.calendar-menu').hide(); // hide the calendar menu + }); + }; + + $.fn.calendar.methods = { + options: function(jq){ + return $.data(jq[0], 'calendar').options; + }, + resize: function(jq, param){ + return jq.each(function(){ + setSize(this, param); + }); + }, + moveTo: function(jq, date){ + return jq.each(function(){ + if (!date){ + var now = new Date(); + $(this).calendar({ + year: now.getFullYear(), + month: now.getMonth()+1, + current: date + }); + return; + } + var opts = $(this).calendar('options'); + if (opts.validator.call(this, date)){ + var oldValue = opts.current; + $(this).calendar({ + year: date.getFullYear(), + month: date.getMonth()+1, + current: date + }); + if (!oldValue || oldValue.getTime() != date.getTime()){ + opts.onChange.call(this, opts.current, oldValue); + } + } + }); + } + }; + + $.fn.calendar.parseOptions = function(target){ + var t = $(target); + return $.extend({}, $.parser.parseOptions(target, [ + {firstDay:'number',fit:'boolean',border:'boolean'} + ])); + }; + + $.fn.calendar.defaults = { + width:180, + height:180, + fit:false, + border:true, + firstDay:0, + weeks:['S','M','T','W','T','F','S'], + months:['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'], + year:new Date().getFullYear(), + month:new Date().getMonth()+1, + current:(function(){ + var d = new Date(); + return new Date(d.getFullYear(), d.getMonth(), d.getDate()); + })(), + + formatter:function(date){return date.getDate()}, + styler:function(date){return ''}, + validator:function(date){return true}, + + onSelect: function(date){}, + onChange: function(newDate, oldDate){}, + onNavigate: function(year, month){} + }; +})(jQuery); diff --git a/src/main/webapp/js/easyui/src/jquery.combobox.js b/src/main/webapp/js/easyui/src/jquery.combobox.js index bba8058..0f29c7b 100644 --- a/src/main/webapp/js/easyui/src/jquery.combobox.js +++ b/src/main/webapp/js/easyui/src/jquery.combobox.js @@ -1,565 +1,565 @@ -/** - * jQuery EasyUI 1.4.2 - * - * Copyright (c) 2009-2015 www.jeasyui.com. All rights reserved. - * - * Licensed under the GPL license: http://www.gnu.org/licenses/gpl.txt - * To use it on other terms please contact us at info@jeasyui.com - * - */ -/** - * combobox - jQuery EasyUI - * - * Dependencies: - * combo - * - */ -(function($){ - var COMBOBOX_SERNO = 0; - - function getRowIndex(target, value){ - var state = $.data(target, 'combobox'); - var opts = state.options; - var data = state.data; - for(var i=0; i panel.height()){ - var h = panel.scrollTop() + item.position().top + item.outerHeight() - panel.height(); - panel.scrollTop(h); - } - } - } - - function nav(target, dir){ - var opts = $.data(target, 'combobox').options; - var panel = $(target).combobox('panel'); - var item = panel.children('div.combobox-item-hover'); - if (!item.length){ - item = panel.children('div.combobox-item-selected'); - } - item.removeClass('combobox-item-hover'); - var firstSelector = 'div.combobox-item:visible:not(.combobox-item-disabled):first'; - var lastSelector = 'div.combobox-item:visible:not(.combobox-item-disabled):last'; - if (!item.length){ - item = panel.children(dir=='next' ? firstSelector : lastSelector); -// item = panel.children('div.combobox-item:visible:' + (dir=='next'?'first':'last')); - } else { - if (dir == 'next'){ - item = item.nextAll(firstSelector); -// item = item.nextAll('div.combobox-item:visible:first'); - if (!item.length){ - item = panel.children(firstSelector); -// item = panel.children('div.combobox-item:visible:first'); - } - } else { - item = item.prevAll(firstSelector); -// item = item.prevAll('div.combobox-item:visible:first'); - if (!item.length){ - item = panel.children(lastSelector); -// item = panel.children('div.combobox-item:visible:last'); - } - } - } - if (item.length){ - item.addClass('combobox-item-hover'); - var row = opts.finder.getRow(target, item); - if (row){ - scrollTo(target, row[opts.valueField]); - if (opts.selectOnNavigation){ - select(target, row[opts.valueField]); - } - } - } - } - - /** - * select the specified value - */ - function select(target, value){ - var opts = $.data(target, 'combobox').options; - var values = $(target).combo('getValues'); - if ($.inArray(value+'', values) == -1){ - if (opts.multiple){ - values.push(value); - } else { - values = [value]; - } - setValues(target, values); - opts.onSelect.call(target, opts.finder.getRow(target, value)); - } - } - - /** - * unselect the specified value - */ - function unselect(target, value){ - var opts = $.data(target, 'combobox').options; - var values = $(target).combo('getValues'); - var index = $.inArray(value+'', values); - if (index >= 0){ - values.splice(index, 1); - setValues(target, values); - opts.onUnselect.call(target, opts.finder.getRow(target, value)); - } - } - - /** - * set values - */ - function setValues(target, values, remainText){ - var opts = $.data(target, 'combobox').options; - var panel = $(target).combo('panel'); - - if (!$.isArray(values)){values = values.split(opts.separator)} - panel.find('div.combobox-item-selected').removeClass('combobox-item-selected'); - var vv = [], ss = []; - for(var i=0; i'); - dd.push(opts.groupFormatter ? opts.groupFormatter.call(target, g) : g); - dd.push(''); - } - } else { - group = undefined; - } - - var cls = 'combobox-item' + (row.disabled ? ' combobox-item-disabled' : '') + (g ? ' combobox-gitem' : ''); - dd.push('
                                                                  '); - dd.push(opts.formatter ? opts.formatter.call(target, row) : s); - dd.push('
                                                                  '); - -// if (item['selected']){ -// (function(){ -// for(var i=0; i= 0){ - vv.push(v); - } - }); - t.combobox('setValues', vv); - if (!opts.multiple){ - t.combobox('hidePanel'); - } - } - - /** - * create the component - */ - function create(target){ - var state = $.data(target, 'combobox'); - var opts = state.options; - - COMBOBOX_SERNO++; - state.itemIdPrefix = '_easyui_combobox_i' + COMBOBOX_SERNO; - state.groupIdPrefix = '_easyui_combobox_g' + COMBOBOX_SERNO; - - $(target).addClass('combobox-f'); - $(target).combo($.extend({}, opts, { - onShowPanel: function(){ - $(target).combo('panel').find('div.combobox-item,div.combobox-group').show(); - scrollTo(target, $(target).combobox('getValue')); - opts.onShowPanel.call(target); - } - })); - - $(target).combo('panel').unbind().bind('mouseover', function(e){ - $(this).children('div.combobox-item-hover').removeClass('combobox-item-hover'); - var item = $(e.target).closest('div.combobox-item'); - if (!item.hasClass('combobox-item-disabled')){ - item.addClass('combobox-item-hover'); - } - e.stopPropagation(); - }).bind('mouseout', function(e){ - $(e.target).closest('div.combobox-item').removeClass('combobox-item-hover'); - e.stopPropagation(); - }).bind('click', function(e){ - var item = $(e.target).closest('div.combobox-item'); - if (!item.length || item.hasClass('combobox-item-disabled')){return} - var row = opts.finder.getRow(target, item); - if (!row){return} - var value = row[opts.valueField]; - if (opts.multiple){ - if (item.hasClass('combobox-item-selected')){ - unselect(target, value); - } else { - select(target, value); - } - } else { - select(target, value); - $(target).combo('hidePanel'); - } - e.stopPropagation(); - }); - } - - $.fn.combobox = function(options, param){ - if (typeof options == 'string'){ - var method = $.fn.combobox.methods[options]; - if (method){ - return method(this, param); - } else { - return this.combo(options, param); - } - } - - options = options || {}; - return this.each(function(){ - var state = $.data(this, 'combobox'); - if (state){ - $.extend(state.options, options); - create(this); - } else { - state = $.data(this, 'combobox', { - options: $.extend({}, $.fn.combobox.defaults, $.fn.combobox.parseOptions(this), options), - data: [] - }); - create(this); - var data = $.fn.combobox.parseData(this); - if (data.length){ - loadData(this, data); - } - } - if (state.options.data){ - loadData(this, state.options.data); - } - request(this); - }); - }; - - - $.fn.combobox.methods = { - options: function(jq){ - var copts = jq.combo('options'); - return $.extend($.data(jq[0], 'combobox').options, { - width: copts.width, - height: copts.height, - originalValue: copts.originalValue, - disabled: copts.disabled, - readonly: copts.readonly - }); - }, - getData: function(jq){ - return $.data(jq[0], 'combobox').data; - }, - setValues: function(jq, values){ - return jq.each(function(){ - setValues(this, values); - }); - }, - setValue: function(jq, value){ - return jq.each(function(){ - setValues(this, [value]); - }); - }, - clear: function(jq){ - return jq.each(function(){ - $(this).combo('clear'); - var panel = $(this).combo('panel'); - panel.find('div.combobox-item-selected').removeClass('combobox-item-selected'); - }); - }, - reset: function(jq){ - return jq.each(function(){ - var opts = $(this).combobox('options'); - if (opts.multiple){ - $(this).combobox('setValues', opts.originalValue); - } else { - $(this).combobox('setValue', opts.originalValue); - } - }); - }, - loadData: function(jq, data){ - return jq.each(function(){ - loadData(this, data); - }); - }, - reload: function(jq, url){ - return jq.each(function(){ - if (typeof url == 'string'){ - request(this, url); - } else { - if (url){ - var opts = $(this).combobox('options'); - opts.queryParams = url; - } - request(this); - } - }); - }, - select: function(jq, value){ - return jq.each(function(){ - select(this, value); - }); - }, - unselect: function(jq, value){ - return jq.each(function(){ - unselect(this, value); - }); - } - }; - - $.fn.combobox.parseOptions = function(target){ - var t = $(target); - return $.extend({}, $.fn.combo.parseOptions(target), $.parser.parseOptions(target,[ - 'valueField','textField','groupField','mode','method','url' - ])); - }; - - $.fn.combobox.parseData = function(target){ - var data = []; - var opts = $(target).combobox('options'); - $(target).children().each(function(){ - if (this.tagName.toLowerCase() == 'optgroup'){ - var group = $(this).attr('label'); - $(this).children().each(function(){ - _parseItem(this, group); - }); - } else { - _parseItem(this); - } - }); - return data; - - function _parseItem(el, group){ - var t = $(el); - var row = {}; - row[opts.valueField] = t.attr('value')!=undefined ? t.attr('value') : t.text(); - row[opts.textField] = t.text(); - row['selected'] = t.is(':selected'); - row['disabled'] = t.is(':disabled'); - if (group){ - opts.groupField = opts.groupField || 'group'; - row[opts.groupField] = group; - } - data.push(row); - } - }; - - $.fn.combobox.defaults = $.extend({}, $.fn.combo.defaults, { - valueField: 'value', - textField: 'text', - groupField: null, - groupFormatter: function(group){return group;}, - mode: 'local', // or 'remote' - method: 'post', - url: null, - data: null, - queryParams: {}, - - keyHandler: { - up: function(e){nav(this,'prev');e.preventDefault()}, - down: function(e){nav(this,'next');e.preventDefault()}, - left: function(e){}, - right: function(e){}, - enter: function(e){doEnter(this)}, - query: function(q,e){doQuery(this, q)} - }, - filter: function(q, row){ - var opts = $(this).combobox('options'); - return row[opts.textField].toLowerCase().indexOf(q.toLowerCase()) == 0; - }, - formatter: function(row){ - var opts = $(this).combobox('options'); - return row[opts.textField]; - }, - loader: function(param, success, error){ - var opts = $(this).combobox('options'); - if (!opts.url) return false; - $.ajax({ - type: opts.method, - url: opts.url, - data: param, - dataType: 'json', - success: function(data){ - success(data); - }, - error: function(){ - error.apply(this, arguments); - } - }); - }, - loadFilter: function(data){ - return data; - }, - finder:{ - getEl:function(target, value){ - var index = getRowIndex(target, value); - var id = $.data(target, 'combobox').itemIdPrefix + '_' + index; - return $('#'+id); - }, - getRow:function(target, p){ - var state = $.data(target, 'combobox'); - var index = (p instanceof jQuery) ? p.attr('id').substr(state.itemIdPrefix.length+1) : getRowIndex(target, p); - return state.data[parseInt(index)]; - } - }, - - onBeforeLoad: function(param){}, - onLoadSuccess: function(){}, - onLoadError: function(){}, - onSelect: function(record){}, - onUnselect: function(record){} - }); -})(jQuery); +/** + * jQuery EasyUI 1.4.2 + * + * Copyright (c) 2009-2015 www.jeasyui.com. All rights reserved. + * + * Licensed under the GPL license: http://www.gnu.org/licenses/gpl.txt + * To use it on other terms please contact us at info@jeasyui.com + * + */ +/** + * combobox - jQuery EasyUI + * + * Dependencies: + * combo + * + */ +(function($){ + var COMBOBOX_SERNO = 0; + + function getRowIndex(target, value){ + var state = $.data(target, 'combobox'); + var opts = state.options; + var data = state.data; + for(var i=0; i panel.height()){ + var h = panel.scrollTop() + item.position().top + item.outerHeight() - panel.height(); + panel.scrollTop(h); + } + } + } + + function nav(target, dir){ + var opts = $.data(target, 'combobox').options; + var panel = $(target).combobox('panel'); + var item = panel.children('div.combobox-item-hover'); + if (!item.length){ + item = panel.children('div.combobox-item-selected'); + } + item.removeClass('combobox-item-hover'); + var firstSelector = 'div.combobox-item:visible:not(.combobox-item-disabled):first'; + var lastSelector = 'div.combobox-item:visible:not(.combobox-item-disabled):last'; + if (!item.length){ + item = panel.children(dir=='next' ? firstSelector : lastSelector); +// item = panel.children('div.combobox-item:visible:' + (dir=='next'?'first':'last')); + } else { + if (dir == 'next'){ + item = item.nextAll(firstSelector); +// item = item.nextAll('div.combobox-item:visible:first'); + if (!item.length){ + item = panel.children(firstSelector); +// item = panel.children('div.combobox-item:visible:first'); + } + } else { + item = item.prevAll(firstSelector); +// item = item.prevAll('div.combobox-item:visible:first'); + if (!item.length){ + item = panel.children(lastSelector); +// item = panel.children('div.combobox-item:visible:last'); + } + } + } + if (item.length){ + item.addClass('combobox-item-hover'); + var row = opts.finder.getRow(target, item); + if (row){ + scrollTo(target, row[opts.valueField]); + if (opts.selectOnNavigation){ + select(target, row[opts.valueField]); + } + } + } + } + + /** + * select the specified value + */ + function select(target, value){ + var opts = $.data(target, 'combobox').options; + var values = $(target).combo('getValues'); + if ($.inArray(value+'', values) == -1){ + if (opts.multiple){ + values.push(value); + } else { + values = [value]; + } + setValues(target, values); + opts.onSelect.call(target, opts.finder.getRow(target, value)); + } + } + + /** + * unselect the specified value + */ + function unselect(target, value){ + var opts = $.data(target, 'combobox').options; + var values = $(target).combo('getValues'); + var index = $.inArray(value+'', values); + if (index >= 0){ + values.splice(index, 1); + setValues(target, values); + opts.onUnselect.call(target, opts.finder.getRow(target, value)); + } + } + + /** + * set values + */ + function setValues(target, values, remainText){ + var opts = $.data(target, 'combobox').options; + var panel = $(target).combo('panel'); + + if (!$.isArray(values)){values = values.split(opts.separator)} + panel.find('div.combobox-item-selected').removeClass('combobox-item-selected'); + var vv = [], ss = []; + for(var i=0; i'); + dd.push(opts.groupFormatter ? opts.groupFormatter.call(target, g) : g); + dd.push(''); + } + } else { + group = undefined; + } + + var cls = 'combobox-item' + (row.disabled ? ' combobox-item-disabled' : '') + (g ? ' combobox-gitem' : ''); + dd.push('
                                                                  '); + dd.push(opts.formatter ? opts.formatter.call(target, row) : s); + dd.push('
                                                                  '); + +// if (item['selected']){ +// (function(){ +// for(var i=0; i= 0){ + vv.push(v); + } + }); + t.combobox('setValues', vv); + if (!opts.multiple){ + t.combobox('hidePanel'); + } + } + + /** + * create the component + */ + function create(target){ + var state = $.data(target, 'combobox'); + var opts = state.options; + + COMBOBOX_SERNO++; + state.itemIdPrefix = '_easyui_combobox_i' + COMBOBOX_SERNO; + state.groupIdPrefix = '_easyui_combobox_g' + COMBOBOX_SERNO; + + $(target).addClass('combobox-f'); + $(target).combo($.extend({}, opts, { + onShowPanel: function(){ + $(target).combo('panel').find('div.combobox-item,div.combobox-group').show(); + scrollTo(target, $(target).combobox('getValue')); + opts.onShowPanel.call(target); + } + })); + + $(target).combo('panel').unbind().bind('mouseover', function(e){ + $(this).children('div.combobox-item-hover').removeClass('combobox-item-hover'); + var item = $(e.target).closest('div.combobox-item'); + if (!item.hasClass('combobox-item-disabled')){ + item.addClass('combobox-item-hover'); + } + e.stopPropagation(); + }).bind('mouseout', function(e){ + $(e.target).closest('div.combobox-item').removeClass('combobox-item-hover'); + e.stopPropagation(); + }).bind('click', function(e){ + var item = $(e.target).closest('div.combobox-item'); + if (!item.length || item.hasClass('combobox-item-disabled')){return} + var row = opts.finder.getRow(target, item); + if (!row){return} + var value = row[opts.valueField]; + if (opts.multiple){ + if (item.hasClass('combobox-item-selected')){ + unselect(target, value); + } else { + select(target, value); + } + } else { + select(target, value); + $(target).combo('hidePanel'); + } + e.stopPropagation(); + }); + } + + $.fn.combobox = function(options, param){ + if (typeof options == 'string'){ + var method = $.fn.combobox.methods[options]; + if (method){ + return method(this, param); + } else { + return this.combo(options, param); + } + } + + options = options || {}; + return this.each(function(){ + var state = $.data(this, 'combobox'); + if (state){ + $.extend(state.options, options); + create(this); + } else { + state = $.data(this, 'combobox', { + options: $.extend({}, $.fn.combobox.defaults, $.fn.combobox.parseOptions(this), options), + data: [] + }); + create(this); + var data = $.fn.combobox.parseData(this); + if (data.length){ + loadData(this, data); + } + } + if (state.options.data){ + loadData(this, state.options.data); + } + request(this); + }); + }; + + + $.fn.combobox.methods = { + options: function(jq){ + var copts = jq.combo('options'); + return $.extend($.data(jq[0], 'combobox').options, { + width: copts.width, + height: copts.height, + originalValue: copts.originalValue, + disabled: copts.disabled, + readonly: copts.readonly + }); + }, + getData: function(jq){ + return $.data(jq[0], 'combobox').data; + }, + setValues: function(jq, values){ + return jq.each(function(){ + setValues(this, values); + }); + }, + setValue: function(jq, value){ + return jq.each(function(){ + setValues(this, [value]); + }); + }, + clear: function(jq){ + return jq.each(function(){ + $(this).combo('clear'); + var panel = $(this).combo('panel'); + panel.find('div.combobox-item-selected').removeClass('combobox-item-selected'); + }); + }, + reset: function(jq){ + return jq.each(function(){ + var opts = $(this).combobox('options'); + if (opts.multiple){ + $(this).combobox('setValues', opts.originalValue); + } else { + $(this).combobox('setValue', opts.originalValue); + } + }); + }, + loadData: function(jq, data){ + return jq.each(function(){ + loadData(this, data); + }); + }, + reload: function(jq, url){ + return jq.each(function(){ + if (typeof url == 'string'){ + request(this, url); + } else { + if (url){ + var opts = $(this).combobox('options'); + opts.queryParams = url; + } + request(this); + } + }); + }, + select: function(jq, value){ + return jq.each(function(){ + select(this, value); + }); + }, + unselect: function(jq, value){ + return jq.each(function(){ + unselect(this, value); + }); + } + }; + + $.fn.combobox.parseOptions = function(target){ + var t = $(target); + return $.extend({}, $.fn.combo.parseOptions(target), $.parser.parseOptions(target,[ + 'valueField','textField','groupField','mode','method','url' + ])); + }; + + $.fn.combobox.parseData = function(target){ + var data = []; + var opts = $(target).combobox('options'); + $(target).children().each(function(){ + if (this.tagName.toLowerCase() == 'optgroup'){ + var group = $(this).attr('label'); + $(this).children().each(function(){ + _parseItem(this, group); + }); + } else { + _parseItem(this); + } + }); + return data; + + function _parseItem(el, group){ + var t = $(el); + var row = {}; + row[opts.valueField] = t.attr('value')!=undefined ? t.attr('value') : t.text(); + row[opts.textField] = t.text(); + row['selected'] = t.is(':selected'); + row['disabled'] = t.is(':disabled'); + if (group){ + opts.groupField = opts.groupField || 'group'; + row[opts.groupField] = group; + } + data.push(row); + } + }; + + $.fn.combobox.defaults = $.extend({}, $.fn.combo.defaults, { + valueField: 'value', + textField: 'text', + groupField: null, + groupFormatter: function(group){return group;}, + mode: 'local', // or 'remote' + method: 'post', + url: null, + data: null, + queryParams: {}, + + keyHandler: { + up: function(e){nav(this,'prev');e.preventDefault()}, + down: function(e){nav(this,'next');e.preventDefault()}, + left: function(e){}, + right: function(e){}, + enter: function(e){doEnter(this)}, + query: function(q,e){doQuery(this, q)} + }, + filter: function(q, row){ + var opts = $(this).combobox('options'); + return row[opts.textField].toLowerCase().indexOf(q.toLowerCase()) == 0; + }, + formatter: function(row){ + var opts = $(this).combobox('options'); + return row[opts.textField]; + }, + loader: function(param, success, error){ + var opts = $(this).combobox('options'); + if (!opts.url) return false; + $.ajax({ + type: opts.method, + url: opts.url, + data: param, + dataType: 'json', + success: function(data){ + success(data); + }, + error: function(){ + error.apply(this, arguments); + } + }); + }, + loadFilter: function(data){ + return data; + }, + finder:{ + getEl:function(target, value){ + var index = getRowIndex(target, value); + var id = $.data(target, 'combobox').itemIdPrefix + '_' + index; + return $('#'+id); + }, + getRow:function(target, p){ + var state = $.data(target, 'combobox'); + var index = (p instanceof jQuery) ? p.attr('id').substr(state.itemIdPrefix.length+1) : getRowIndex(target, p); + return state.data[parseInt(index)]; + } + }, + + onBeforeLoad: function(param){}, + onLoadSuccess: function(){}, + onLoadError: function(){}, + onSelect: function(record){}, + onUnselect: function(record){} + }); +})(jQuery); diff --git a/src/main/webapp/js/easyui/src/jquery.datebox.js b/src/main/webapp/js/easyui/src/jquery.datebox.js index 4a2ae7e..8df6159 100644 --- a/src/main/webapp/js/easyui/src/jquery.datebox.js +++ b/src/main/webapp/js/easyui/src/jquery.datebox.js @@ -1,285 +1,285 @@ -/** - * jQuery EasyUI 1.4.2 - * - * Copyright (c) 2009-2015 www.jeasyui.com. All rights reserved. - * - * Licensed under the GPL license: http://www.gnu.org/licenses/gpl.txt - * To use it on other terms please contact us at info@jeasyui.com - * - */ -/** - * datebox - jQuery EasyUI - * - * Dependencies: - * calendar - * combo - * - */ -(function($){ - /** - * create date box - */ - function createBox(target){ - var state = $.data(target, 'datebox'); - var opts = state.options; - - $(target).addClass('datebox-f').combo($.extend({}, opts, { - onShowPanel:function(){ - bindEvents(this); - setButtons(this); - setCalendar(this); - setValue(this, $(this).datebox('getText'), true); - opts.onShowPanel.call(this); - } - })); - - /** - * if the calendar isn't created, create it. - */ - if (!state.calendar){ - var panel = $(target).combo('panel').css('overflow','hidden'); - panel.panel('options').onBeforeDestroy = function(){ - var c = $(this).find('.calendar-shared'); - if (c.length){ - c.insertBefore(c[0].pholder); - } - }; - var cc = $('
                                                                  ').prependTo(panel); - if (opts.sharedCalendar){ - var c = $(opts.sharedCalendar); - if (!c[0].pholder){ - c[0].pholder = $('').insertAfter(c); - } - c.addClass('calendar-shared').appendTo(cc); - if (!c.hasClass('calendar')){ - c.calendar(); - } - state.calendar = c; - } else { - state.calendar = $('
                                                                  ').appendTo(cc).calendar(); - } - - $.extend(state.calendar.calendar('options'), { - fit:true, - border:false, - onSelect:function(date){ - var target = this.target; - var opts = $(target).datebox('options'); - setValue(target, opts.formatter.call(target, date)); - $(target).combo('hidePanel'); - opts.onSelect.call(target, date); - } - }); - } - - $(target).combo('textbox').parent().addClass('datebox'); - $(target).datebox('initValue', opts.value); - - function bindEvents(target){ - var opts = $(target).datebox('options'); - var panel = $(target).combo('panel'); - panel.unbind('.datebox').bind('click.datebox', function(e){ - if ($(e.target).hasClass('datebox-button-a')){ - var index = parseInt($(e.target).attr('datebox-button-index')); - opts.buttons[index].handler.call(e.target, target); - } - }); - } - function setButtons(target){ - var panel = $(target).combo('panel'); - if (panel.children('div.datebox-button').length){return} - var button = $('
                                                                  ').appendTo(panel); - var tr = button.find('tr'); - for(var i=0; i').appendTo(tr); - var btn = opts.buttons[i]; - var t = $('').html($.isFunction(btn.text) ? btn.text(target) : btn.text).appendTo(td); - t.attr('datebox-button-index', i); - } - tr.find('td').css('width', (100/opts.buttons.length)+'%'); - } - function setCalendar(target){ - var panel = $(target).combo('panel'); - var cc = panel.children('div.datebox-calendar-inner'); - panel.children()._outerWidth(panel.width()); - state.calendar.appendTo(cc); - state.calendar[0].target = target; - if (opts.panelHeight != 'auto'){ - var height = panel.height(); - panel.children().not(cc).each(function(){ - height -= $(this).outerHeight(); - }); - cc._outerHeight(height); - } - state.calendar.calendar('resize'); - } - } - - /** - * called when user inputs some value in text box - */ - function doQuery(target, q){ - setValue(target, q, true); - } - - /** - * called when user press enter key - */ - function doEnter(target){ - var state = $.data(target, 'datebox'); - var opts = state.options; - var current = state.calendar.calendar('options').current; - if (current){ - setValue(target, opts.formatter.call(target, current)); - $(target).combo('hidePanel'); - } - } - - function setValue(target, value, remainText){ - var state = $.data(target, 'datebox'); - var opts = state.options; - var calendar = state.calendar; - calendar.calendar('moveTo', opts.parser.call(target, value)); - if (remainText){ - $(target).combo('setValue', value); - } else { - if (value){ - value = opts.formatter.call(target, calendar.calendar('options').current); - } - $(target).combo('setText', value).combo('setValue', value); - } - } - - $.fn.datebox = function(options, param){ - if (typeof options == 'string'){ - var method = $.fn.datebox.methods[options]; - if (method){ - return method(this, param); - } else { - return this.combo(options, param); - } - } - - options = options || {}; - return this.each(function(){ - var state = $.data(this, 'datebox'); - if (state){ - $.extend(state.options, options); - } else { - $.data(this, 'datebox', { - options: $.extend({}, $.fn.datebox.defaults, $.fn.datebox.parseOptions(this), options) - }); - } - createBox(this); - }); - }; - - $.fn.datebox.methods = { - options: function(jq){ - var copts = jq.combo('options'); - return $.extend($.data(jq[0], 'datebox').options, { - width: copts.width, - height: copts.height, - originalValue: copts.originalValue, - disabled: copts.disabled, - readonly: copts.readonly - }); - }, - cloneFrom: function(jq, from){ - return jq.each(function(){ - $(this).combo('cloneFrom', from); - $.data(this, 'datebox', { - options: $.extend(true, {}, $(from).datebox('options')), - calendar: $(from).datebox('calendar') - }); - $(this).addClass('datebox-f'); - }); - }, - calendar: function(jq){ // get the calendar object - return $.data(jq[0], 'datebox').calendar; - }, - initValue: function(jq, value){ - return jq.each(function(){ - var opts = $(this).datebox('options'); - var value = opts.value; - if (value){ - value = opts.formatter.call(this, opts.parser.call(this, value)); - } - $(this).combo('initValue', value).combo('setText', value); - }); - }, - setValue: function(jq, value){ - return jq.each(function(){ - setValue(this, value); - }); - }, - reset: function(jq){ - return jq.each(function(){ - var opts = $(this).datebox('options'); - $(this).datebox('setValue', opts.originalValue); - }); - } - }; - - $.fn.datebox.parseOptions = function(target){ - return $.extend({}, $.fn.combo.parseOptions(target), $.parser.parseOptions(target, ['sharedCalendar'])); - }; - - $.fn.datebox.defaults = $.extend({}, $.fn.combo.defaults, { - panelWidth:180, - panelHeight:'auto', - sharedCalendar:null, - - keyHandler: { - up:function(e){}, - down:function(e){}, - left: function(e){}, - right: function(e){}, - enter:function(e){doEnter(this)}, - query:function(q,e){doQuery(this, q)} - }, - - currentText:'Today', - closeText:'Close', - okText:'Ok', - - buttons:[{ - text: function(target){return $(target).datebox('options').currentText;}, - handler: function(target){ - var now = new Date(); - $(target).datebox('calendar').calendar({ - year:now.getFullYear(), - month:now.getMonth()+1, - current:new Date(now.getFullYear(), now.getMonth(), now.getDate()) - }); - doEnter(target); - } - },{ - text: function(target){return $(target).datebox('options').closeText;}, - handler: function(target){ - $(this).closest('div.combo-panel').panel('close'); - } - }], - - formatter:function(date){ - var y = date.getFullYear(); - var m = date.getMonth()+1; - var d = date.getDate(); - return (m<10?('0'+m):m)+'/'+(d<10?('0'+d):d)+'/'+y; - }, - parser:function(s){ - if (!s) return new Date(); - var ss = s.split('/'); - var m = parseInt(ss[0],10); - var d = parseInt(ss[1],10); - var y = parseInt(ss[2],10); - if (!isNaN(y) && !isNaN(m) && !isNaN(d)){ - return new Date(y,m-1,d); - } else { - return new Date(); - } - }, - - onSelect:function(date){} - }); -})(jQuery); +/** + * jQuery EasyUI 1.4.2 + * + * Copyright (c) 2009-2015 www.jeasyui.com. All rights reserved. + * + * Licensed under the GPL license: http://www.gnu.org/licenses/gpl.txt + * To use it on other terms please contact us at info@jeasyui.com + * + */ +/** + * datebox - jQuery EasyUI + * + * Dependencies: + * calendar + * combo + * + */ +(function($){ + /** + * create date box + */ + function createBox(target){ + var state = $.data(target, 'datebox'); + var opts = state.options; + + $(target).addClass('datebox-f').combo($.extend({}, opts, { + onShowPanel:function(){ + bindEvents(this); + setButtons(this); + setCalendar(this); + setValue(this, $(this).datebox('getText'), true); + opts.onShowPanel.call(this); + } + })); + + /** + * if the calendar isn't created, create it. + */ + if (!state.calendar){ + var panel = $(target).combo('panel').css('overflow','hidden'); + panel.panel('options').onBeforeDestroy = function(){ + var c = $(this).find('.calendar-shared'); + if (c.length){ + c.insertBefore(c[0].pholder); + } + }; + var cc = $('
                                                                  ').prependTo(panel); + if (opts.sharedCalendar){ + var c = $(opts.sharedCalendar); + if (!c[0].pholder){ + c[0].pholder = $('').insertAfter(c); + } + c.addClass('calendar-shared').appendTo(cc); + if (!c.hasClass('calendar')){ + c.calendar(); + } + state.calendar = c; + } else { + state.calendar = $('
                                                                  ').appendTo(cc).calendar(); + } + + $.extend(state.calendar.calendar('options'), { + fit:true, + border:false, + onSelect:function(date){ + var target = this.target; + var opts = $(target).datebox('options'); + setValue(target, opts.formatter.call(target, date)); + $(target).combo('hidePanel'); + opts.onSelect.call(target, date); + } + }); + } + + $(target).combo('textbox').parent().addClass('datebox'); + $(target).datebox('initValue', opts.value); + + function bindEvents(target){ + var opts = $(target).datebox('options'); + var panel = $(target).combo('panel'); + panel.unbind('.datebox').bind('click.datebox', function(e){ + if ($(e.target).hasClass('datebox-button-a')){ + var index = parseInt($(e.target).attr('datebox-button-index')); + opts.buttons[index].handler.call(e.target, target); + } + }); + } + function setButtons(target){ + var panel = $(target).combo('panel'); + if (panel.children('div.datebox-button').length){return} + var button = $('
                                                                  ').appendTo(panel); + var tr = button.find('tr'); + for(var i=0; i').appendTo(tr); + var btn = opts.buttons[i]; + var t = $('').html($.isFunction(btn.text) ? btn.text(target) : btn.text).appendTo(td); + t.attr('datebox-button-index', i); + } + tr.find('td').css('width', (100/opts.buttons.length)+'%'); + } + function setCalendar(target){ + var panel = $(target).combo('panel'); + var cc = panel.children('div.datebox-calendar-inner'); + panel.children()._outerWidth(panel.width()); + state.calendar.appendTo(cc); + state.calendar[0].target = target; + if (opts.panelHeight != 'auto'){ + var height = panel.height(); + panel.children().not(cc).each(function(){ + height -= $(this).outerHeight(); + }); + cc._outerHeight(height); + } + state.calendar.calendar('resize'); + } + } + + /** + * called when user inputs some value in text box + */ + function doQuery(target, q){ + setValue(target, q, true); + } + + /** + * called when user press enter key + */ + function doEnter(target){ + var state = $.data(target, 'datebox'); + var opts = state.options; + var current = state.calendar.calendar('options').current; + if (current){ + setValue(target, opts.formatter.call(target, current)); + $(target).combo('hidePanel'); + } + } + + function setValue(target, value, remainText){ + var state = $.data(target, 'datebox'); + var opts = state.options; + var calendar = state.calendar; + calendar.calendar('moveTo', opts.parser.call(target, value)); + if (remainText){ + $(target).combo('setValue', value); + } else { + if (value){ + value = opts.formatter.call(target, calendar.calendar('options').current); + } + $(target).combo('setText', value).combo('setValue', value); + } + } + + $.fn.datebox = function(options, param){ + if (typeof options == 'string'){ + var method = $.fn.datebox.methods[options]; + if (method){ + return method(this, param); + } else { + return this.combo(options, param); + } + } + + options = options || {}; + return this.each(function(){ + var state = $.data(this, 'datebox'); + if (state){ + $.extend(state.options, options); + } else { + $.data(this, 'datebox', { + options: $.extend({}, $.fn.datebox.defaults, $.fn.datebox.parseOptions(this), options) + }); + } + createBox(this); + }); + }; + + $.fn.datebox.methods = { + options: function(jq){ + var copts = jq.combo('options'); + return $.extend($.data(jq[0], 'datebox').options, { + width: copts.width, + height: copts.height, + originalValue: copts.originalValue, + disabled: copts.disabled, + readonly: copts.readonly + }); + }, + cloneFrom: function(jq, from){ + return jq.each(function(){ + $(this).combo('cloneFrom', from); + $.data(this, 'datebox', { + options: $.extend(true, {}, $(from).datebox('options')), + calendar: $(from).datebox('calendar') + }); + $(this).addClass('datebox-f'); + }); + }, + calendar: function(jq){ // get the calendar object + return $.data(jq[0], 'datebox').calendar; + }, + initValue: function(jq, value){ + return jq.each(function(){ + var opts = $(this).datebox('options'); + var value = opts.value; + if (value){ + value = opts.formatter.call(this, opts.parser.call(this, value)); + } + $(this).combo('initValue', value).combo('setText', value); + }); + }, + setValue: function(jq, value){ + return jq.each(function(){ + setValue(this, value); + }); + }, + reset: function(jq){ + return jq.each(function(){ + var opts = $(this).datebox('options'); + $(this).datebox('setValue', opts.originalValue); + }); + } + }; + + $.fn.datebox.parseOptions = function(target){ + return $.extend({}, $.fn.combo.parseOptions(target), $.parser.parseOptions(target, ['sharedCalendar'])); + }; + + $.fn.datebox.defaults = $.extend({}, $.fn.combo.defaults, { + panelWidth:180, + panelHeight:'auto', + sharedCalendar:null, + + keyHandler: { + up:function(e){}, + down:function(e){}, + left: function(e){}, + right: function(e){}, + enter:function(e){doEnter(this)}, + query:function(q,e){doQuery(this, q)} + }, + + currentText:'Today', + closeText:'Close', + okText:'Ok', + + buttons:[{ + text: function(target){return $(target).datebox('options').currentText;}, + handler: function(target){ + var now = new Date(); + $(target).datebox('calendar').calendar({ + year:now.getFullYear(), + month:now.getMonth()+1, + current:new Date(now.getFullYear(), now.getMonth(), now.getDate()) + }); + doEnter(target); + } + },{ + text: function(target){return $(target).datebox('options').closeText;}, + handler: function(target){ + $(this).closest('div.combo-panel').panel('close'); + } + }], + + formatter:function(date){ + var y = date.getFullYear(); + var m = date.getMonth()+1; + var d = date.getDate(); + return (m<10?('0'+m):m)+'/'+(d<10?('0'+d):d)+'/'+y; + }, + parser:function(s){ + if (!s) return new Date(); + var ss = s.split('/'); + var m = parseInt(ss[0],10); + var d = parseInt(ss[1],10); + var y = parseInt(ss[2],10); + if (!isNaN(y) && !isNaN(m) && !isNaN(d)){ + return new Date(y,m-1,d); + } else { + return new Date(); + } + }, + + onSelect:function(date){} + }); +})(jQuery); diff --git a/src/main/webapp/js/easyui/src/jquery.draggable.js b/src/main/webapp/js/easyui/src/jquery.draggable.js index 7ead5cb..d92aaba 100644 --- a/src/main/webapp/js/easyui/src/jquery.draggable.js +++ b/src/main/webapp/js/easyui/src/jquery.draggable.js @@ -1,395 +1,395 @@ -/** - * jQuery EasyUI 1.4.2 - * - * Copyright (c) 2009-2015 www.jeasyui.com. All rights reserved. - * - * Licensed under the GPL license: http://www.gnu.org/licenses/gpl.txt - * To use it on other terms please contact us at info@jeasyui.com - * - */ -/** - * draggable - jQuery EasyUI - * - */ -(function($){ - function drag(e){ - var state = $.data(e.data.target, 'draggable'); - var opts = state.options; - var proxy = state.proxy; - - var dragData = e.data; - var left = dragData.startLeft + e.pageX - dragData.startX; - var top = dragData.startTop + e.pageY - dragData.startY; - - if (proxy){ - if (proxy.parent()[0] == document.body){ - if (opts.deltaX != null && opts.deltaX != undefined){ - left = e.pageX + opts.deltaX; - } else { - left = e.pageX - e.data.offsetWidth; - } - if (opts.deltaY != null && opts.deltaY != undefined){ - top = e.pageY + opts.deltaY; - } else { - top = e.pageY - e.data.offsetHeight; - } - } else { - if (opts.deltaX != null && opts.deltaX != undefined){ - left += e.data.offsetWidth + opts.deltaX; - } - if (opts.deltaY != null && opts.deltaY != undefined){ - top += e.data.offsetHeight + opts.deltaY; - } - } - } - - if (e.data.parent != document.body) { - left += $(e.data.parent).scrollLeft(); - top += $(e.data.parent).scrollTop(); - } - - if (opts.axis == 'h') { - dragData.left = left; - } else if (opts.axis == 'v') { - dragData.top = top; - } else { - dragData.left = left; - dragData.top = top; - } - } - - function applyDrag(e){ - var state = $.data(e.data.target, 'draggable'); - var opts = state.options; - var proxy = state.proxy; - if (!proxy){ - proxy = $(e.data.target); - } - proxy.css({ - left:e.data.left, - top:e.data.top - }); - $('body').css('cursor', opts.cursor); - } - - function doDown(e){ - if (!$.fn.draggable.isDragging){return false;} - - var state = $.data(e.data.target, 'draggable'); - var opts = state.options; - - var droppables = $('.droppable').filter(function(){ - return e.data.target != this; - }).filter(function(){ - var accept = $.data(this, 'droppable').options.accept; - if (accept){ - return $(accept).filter(function(){ - return this == e.data.target; - }).length > 0; - } else { - return true; - } - }); - state.droppables = droppables; - - var proxy = state.proxy; - if (!proxy){ - if (opts.proxy){ - if (opts.proxy == 'clone'){ - proxy = $(e.data.target).clone().insertAfter(e.data.target); - } else { - proxy = opts.proxy.call(e.data.target, e.data.target); - } - state.proxy = proxy; - } else { - proxy = $(e.data.target); - } - } - - proxy.css('position', 'absolute'); - drag(e); - applyDrag(e); - - opts.onStartDrag.call(e.data.target, e); - return false; - } - - function doMove(e){ - if (!$.fn.draggable.isDragging){return false;} - - var state = $.data(e.data.target, 'draggable'); - drag(e); - if (state.options.onDrag.call(e.data.target, e) != false){ - applyDrag(e); - } - - var source = e.data.target; - state.droppables.each(function(){ - var dropObj = $(this); - if (dropObj.droppable('options').disabled){return;} - - var p2 = dropObj.offset(); - if (e.pageX > p2.left && e.pageX < p2.left + dropObj.outerWidth() - && e.pageY > p2.top && e.pageY < p2.top + dropObj.outerHeight()){ - if (!this.entered){ - $(this).trigger('_dragenter', [source]); - this.entered = true; - } - $(this).trigger('_dragover', [source]); - } else { - if (this.entered){ - $(this).trigger('_dragleave', [source]); - this.entered = false; - } - } - }); - - return false; - } - - function doUp(e){ - if (!$.fn.draggable.isDragging){ - clearDragging(); - return false; - } - - doMove(e); - - var state = $.data(e.data.target, 'draggable'); - var proxy = state.proxy; - var opts = state.options; - if (opts.revert){ - if (checkDrop() == true){ - $(e.data.target).css({ - position:e.data.startPosition, - left:e.data.startLeft, - top:e.data.startTop - }); - } else { - if (proxy){ - var left, top; - if (proxy.parent()[0] == document.body){ - left = e.data.startX - e.data.offsetWidth; - top = e.data.startY - e.data.offsetHeight; - } else { - left = e.data.startLeft; - top = e.data.startTop; - } - proxy.animate({ - left: left, - top: top - }, function(){ - removeProxy(); - }); - } else { - $(e.data.target).animate({ - left:e.data.startLeft, - top:e.data.startTop - }, function(){ - $(e.data.target).css('position', e.data.startPosition); - }); - } - } - } else { - $(e.data.target).css({ - position:'absolute', - left:e.data.left, - top:e.data.top - }); - checkDrop(); - } - - opts.onStopDrag.call(e.data.target, e); - - clearDragging(); - - function removeProxy(){ - if (proxy){ - proxy.remove(); - } - state.proxy = null; - } - - function checkDrop(){ - var dropped = false; - state.droppables.each(function(){ - var dropObj = $(this); - if (dropObj.droppable('options').disabled){return;} - - var p2 = dropObj.offset(); - if (e.pageX > p2.left && e.pageX < p2.left + dropObj.outerWidth() - && e.pageY > p2.top && e.pageY < p2.top + dropObj.outerHeight()){ - if (opts.revert){ - $(e.data.target).css({ - position:e.data.startPosition, - left:e.data.startLeft, - top:e.data.startTop - }); - } - $(this).trigger('_drop', [e.data.target]); - removeProxy(); - dropped = true; - this.entered = false; - return false; - } - }); - if (!dropped && !opts.revert){ - removeProxy(); - } - return dropped; - } - - return false; - } - - function clearDragging(){ - if ($.fn.draggable.timer){ - clearTimeout($.fn.draggable.timer); - $.fn.draggable.timer = undefined; - } - $(document).unbind('.draggable'); - $.fn.draggable.isDragging = false; - setTimeout(function(){ - $('body').css('cursor',''); - },100); - } - - $.fn.draggable = function(options, param){ - if (typeof options == 'string'){ - return $.fn.draggable.methods[options](this, param); - } - - return this.each(function(){ - var opts; - var state = $.data(this, 'draggable'); - if (state) { - state.handle.unbind('.draggable'); - opts = $.extend(state.options, options); - } else { - opts = $.extend({}, $.fn.draggable.defaults, $.fn.draggable.parseOptions(this), options || {}); - } - var handle = opts.handle ? (typeof opts.handle=='string' ? $(opts.handle, this) : opts.handle) : $(this); - - $.data(this, 'draggable', { - options: opts, - handle: handle - }); - - if (opts.disabled) { - $(this).css('cursor', ''); - return; - } - - handle.unbind('.draggable').bind('mousemove.draggable', {target:this}, function(e){ - if ($.fn.draggable.isDragging){return} - var opts = $.data(e.data.target, 'draggable').options; - if (checkArea(e)){ - $(this).css('cursor', opts.cursor); - } else { - $(this).css('cursor', ''); - } - }).bind('mouseleave.draggable', {target:this}, function(e){ - $(this).css('cursor', ''); - }).bind('mousedown.draggable', {target:this}, function(e){ - if (checkArea(e) == false) return; - $(this).css('cursor', ''); - - var position = $(e.data.target).position(); - var offset = $(e.data.target).offset(); - var data = { - startPosition: $(e.data.target).css('position'), - startLeft: position.left, - startTop: position.top, - left: position.left, - top: position.top, - startX: e.pageX, - startY: e.pageY, - offsetWidth: (e.pageX - offset.left), - offsetHeight: (e.pageY - offset.top), - target: e.data.target, - parent: $(e.data.target).parent()[0] - }; - - $.extend(e.data, data); - var opts = $.data(e.data.target, 'draggable').options; - if (opts.onBeforeDrag.call(e.data.target, e) == false) return; - - $(document).bind('mousedown.draggable', e.data, doDown); - $(document).bind('mousemove.draggable', e.data, doMove); - $(document).bind('mouseup.draggable', e.data, doUp); - - $.fn.draggable.timer = setTimeout(function(){ - $.fn.draggable.isDragging = true; - doDown(e); - }, opts.delay); - return false; - }); - - // check if the handle can be dragged - function checkArea(e) { - var state = $.data(e.data.target, 'draggable'); - var handle = state.handle; - var offset = $(handle).offset(); - var width = $(handle).outerWidth(); - var height = $(handle).outerHeight(); - var t = e.pageY - offset.top; - var r = offset.left + width - e.pageX; - var b = offset.top + height - e.pageY; - var l = e.pageX - offset.left; - - return Math.min(t,r,b,l) > state.options.edge; - } - - }); - }; - - $.fn.draggable.methods = { - options: function(jq){ - return $.data(jq[0], 'draggable').options; - }, - proxy: function(jq){ - return $.data(jq[0], 'draggable').proxy; - }, - enable: function(jq){ - return jq.each(function(){ - $(this).draggable({disabled:false}); - }); - }, - disable: function(jq){ - return jq.each(function(){ - $(this).draggable({disabled:true}); - }); - } - }; - - $.fn.draggable.parseOptions = function(target){ - var t = $(target); - return $.extend({}, - $.parser.parseOptions(target, ['cursor','handle','axis', - {'revert':'boolean','deltaX':'number','deltaY':'number','edge':'number','delay':'number'}]), { - disabled: (t.attr('disabled') ? true : undefined) - }); - }; - - $.fn.draggable.defaults = { - proxy:null, // 'clone' or a function that will create the proxy object, - // the function has the source parameter that indicate the source object dragged. - revert:false, - cursor:'move', - deltaX:null, - deltaY:null, - handle: null, - disabled: false, - edge:0, - axis:null, // v or h - delay:100, - - onBeforeDrag: function(e){}, - onStartDrag: function(e){}, - onDrag: function(e){}, - onStopDrag: function(e){} - }; - - $.fn.draggable.isDragging = false; - -})(jQuery); +/** + * jQuery EasyUI 1.4.2 + * + * Copyright (c) 2009-2015 www.jeasyui.com. All rights reserved. + * + * Licensed under the GPL license: http://www.gnu.org/licenses/gpl.txt + * To use it on other terms please contact us at info@jeasyui.com + * + */ +/** + * draggable - jQuery EasyUI + * + */ +(function($){ + function drag(e){ + var state = $.data(e.data.target, 'draggable'); + var opts = state.options; + var proxy = state.proxy; + + var dragData = e.data; + var left = dragData.startLeft + e.pageX - dragData.startX; + var top = dragData.startTop + e.pageY - dragData.startY; + + if (proxy){ + if (proxy.parent()[0] == document.body){ + if (opts.deltaX != null && opts.deltaX != undefined){ + left = e.pageX + opts.deltaX; + } else { + left = e.pageX - e.data.offsetWidth; + } + if (opts.deltaY != null && opts.deltaY != undefined){ + top = e.pageY + opts.deltaY; + } else { + top = e.pageY - e.data.offsetHeight; + } + } else { + if (opts.deltaX != null && opts.deltaX != undefined){ + left += e.data.offsetWidth + opts.deltaX; + } + if (opts.deltaY != null && opts.deltaY != undefined){ + top += e.data.offsetHeight + opts.deltaY; + } + } + } + + if (e.data.parent != document.body) { + left += $(e.data.parent).scrollLeft(); + top += $(e.data.parent).scrollTop(); + } + + if (opts.axis == 'h') { + dragData.left = left; + } else if (opts.axis == 'v') { + dragData.top = top; + } else { + dragData.left = left; + dragData.top = top; + } + } + + function applyDrag(e){ + var state = $.data(e.data.target, 'draggable'); + var opts = state.options; + var proxy = state.proxy; + if (!proxy){ + proxy = $(e.data.target); + } + proxy.css({ + left:e.data.left, + top:e.data.top + }); + $('body').css('cursor', opts.cursor); + } + + function doDown(e){ + if (!$.fn.draggable.isDragging){return false;} + + var state = $.data(e.data.target, 'draggable'); + var opts = state.options; + + var droppables = $('.droppable').filter(function(){ + return e.data.target != this; + }).filter(function(){ + var accept = $.data(this, 'droppable').options.accept; + if (accept){ + return $(accept).filter(function(){ + return this == e.data.target; + }).length > 0; + } else { + return true; + } + }); + state.droppables = droppables; + + var proxy = state.proxy; + if (!proxy){ + if (opts.proxy){ + if (opts.proxy == 'clone'){ + proxy = $(e.data.target).clone().insertAfter(e.data.target); + } else { + proxy = opts.proxy.call(e.data.target, e.data.target); + } + state.proxy = proxy; + } else { + proxy = $(e.data.target); + } + } + + proxy.css('position', 'absolute'); + drag(e); + applyDrag(e); + + opts.onStartDrag.call(e.data.target, e); + return false; + } + + function doMove(e){ + if (!$.fn.draggable.isDragging){return false;} + + var state = $.data(e.data.target, 'draggable'); + drag(e); + if (state.options.onDrag.call(e.data.target, e) != false){ + applyDrag(e); + } + + var source = e.data.target; + state.droppables.each(function(){ + var dropObj = $(this); + if (dropObj.droppable('options').disabled){return;} + + var p2 = dropObj.offset(); + if (e.pageX > p2.left && e.pageX < p2.left + dropObj.outerWidth() + && e.pageY > p2.top && e.pageY < p2.top + dropObj.outerHeight()){ + if (!this.entered){ + $(this).trigger('_dragenter', [source]); + this.entered = true; + } + $(this).trigger('_dragover', [source]); + } else { + if (this.entered){ + $(this).trigger('_dragleave', [source]); + this.entered = false; + } + } + }); + + return false; + } + + function doUp(e){ + if (!$.fn.draggable.isDragging){ + clearDragging(); + return false; + } + + doMove(e); + + var state = $.data(e.data.target, 'draggable'); + var proxy = state.proxy; + var opts = state.options; + if (opts.revert){ + if (checkDrop() == true){ + $(e.data.target).css({ + position:e.data.startPosition, + left:e.data.startLeft, + top:e.data.startTop + }); + } else { + if (proxy){ + var left, top; + if (proxy.parent()[0] == document.body){ + left = e.data.startX - e.data.offsetWidth; + top = e.data.startY - e.data.offsetHeight; + } else { + left = e.data.startLeft; + top = e.data.startTop; + } + proxy.animate({ + left: left, + top: top + }, function(){ + removeProxy(); + }); + } else { + $(e.data.target).animate({ + left:e.data.startLeft, + top:e.data.startTop + }, function(){ + $(e.data.target).css('position', e.data.startPosition); + }); + } + } + } else { + $(e.data.target).css({ + position:'absolute', + left:e.data.left, + top:e.data.top + }); + checkDrop(); + } + + opts.onStopDrag.call(e.data.target, e); + + clearDragging(); + + function removeProxy(){ + if (proxy){ + proxy.remove(); + } + state.proxy = null; + } + + function checkDrop(){ + var dropped = false; + state.droppables.each(function(){ + var dropObj = $(this); + if (dropObj.droppable('options').disabled){return;} + + var p2 = dropObj.offset(); + if (e.pageX > p2.left && e.pageX < p2.left + dropObj.outerWidth() + && e.pageY > p2.top && e.pageY < p2.top + dropObj.outerHeight()){ + if (opts.revert){ + $(e.data.target).css({ + position:e.data.startPosition, + left:e.data.startLeft, + top:e.data.startTop + }); + } + $(this).trigger('_drop', [e.data.target]); + removeProxy(); + dropped = true; + this.entered = false; + return false; + } + }); + if (!dropped && !opts.revert){ + removeProxy(); + } + return dropped; + } + + return false; + } + + function clearDragging(){ + if ($.fn.draggable.timer){ + clearTimeout($.fn.draggable.timer); + $.fn.draggable.timer = undefined; + } + $(document).unbind('.draggable'); + $.fn.draggable.isDragging = false; + setTimeout(function(){ + $('body').css('cursor',''); + },100); + } + + $.fn.draggable = function(options, param){ + if (typeof options == 'string'){ + return $.fn.draggable.methods[options](this, param); + } + + return this.each(function(){ + var opts; + var state = $.data(this, 'draggable'); + if (state) { + state.handle.unbind('.draggable'); + opts = $.extend(state.options, options); + } else { + opts = $.extend({}, $.fn.draggable.defaults, $.fn.draggable.parseOptions(this), options || {}); + } + var handle = opts.handle ? (typeof opts.handle=='string' ? $(opts.handle, this) : opts.handle) : $(this); + + $.data(this, 'draggable', { + options: opts, + handle: handle + }); + + if (opts.disabled) { + $(this).css('cursor', ''); + return; + } + + handle.unbind('.draggable').bind('mousemove.draggable', {target:this}, function(e){ + if ($.fn.draggable.isDragging){return} + var opts = $.data(e.data.target, 'draggable').options; + if (checkArea(e)){ + $(this).css('cursor', opts.cursor); + } else { + $(this).css('cursor', ''); + } + }).bind('mouseleave.draggable', {target:this}, function(e){ + $(this).css('cursor', ''); + }).bind('mousedown.draggable', {target:this}, function(e){ + if (checkArea(e) == false) return; + $(this).css('cursor', ''); + + var position = $(e.data.target).position(); + var offset = $(e.data.target).offset(); + var data = { + startPosition: $(e.data.target).css('position'), + startLeft: position.left, + startTop: position.top, + left: position.left, + top: position.top, + startX: e.pageX, + startY: e.pageY, + offsetWidth: (e.pageX - offset.left), + offsetHeight: (e.pageY - offset.top), + target: e.data.target, + parent: $(e.data.target).parent()[0] + }; + + $.extend(e.data, data); + var opts = $.data(e.data.target, 'draggable').options; + if (opts.onBeforeDrag.call(e.data.target, e) == false) return; + + $(document).bind('mousedown.draggable', e.data, doDown); + $(document).bind('mousemove.draggable', e.data, doMove); + $(document).bind('mouseup.draggable', e.data, doUp); + + $.fn.draggable.timer = setTimeout(function(){ + $.fn.draggable.isDragging = true; + doDown(e); + }, opts.delay); + return false; + }); + + // check if the handle can be dragged + function checkArea(e) { + var state = $.data(e.data.target, 'draggable'); + var handle = state.handle; + var offset = $(handle).offset(); + var width = $(handle).outerWidth(); + var height = $(handle).outerHeight(); + var t = e.pageY - offset.top; + var r = offset.left + width - e.pageX; + var b = offset.top + height - e.pageY; + var l = e.pageX - offset.left; + + return Math.min(t,r,b,l) > state.options.edge; + } + + }); + }; + + $.fn.draggable.methods = { + options: function(jq){ + return $.data(jq[0], 'draggable').options; + }, + proxy: function(jq){ + return $.data(jq[0], 'draggable').proxy; + }, + enable: function(jq){ + return jq.each(function(){ + $(this).draggable({disabled:false}); + }); + }, + disable: function(jq){ + return jq.each(function(){ + $(this).draggable({disabled:true}); + }); + } + }; + + $.fn.draggable.parseOptions = function(target){ + var t = $(target); + return $.extend({}, + $.parser.parseOptions(target, ['cursor','handle','axis', + {'revert':'boolean','deltaX':'number','deltaY':'number','edge':'number','delay':'number'}]), { + disabled: (t.attr('disabled') ? true : undefined) + }); + }; + + $.fn.draggable.defaults = { + proxy:null, // 'clone' or a function that will create the proxy object, + // the function has the source parameter that indicate the source object dragged. + revert:false, + cursor:'move', + deltaX:null, + deltaY:null, + handle: null, + disabled: false, + edge:0, + axis:null, // v or h + delay:100, + + onBeforeDrag: function(e){}, + onStartDrag: function(e){}, + onDrag: function(e){}, + onStopDrag: function(e){} + }; + + $.fn.draggable.isDragging = false; + +})(jQuery); diff --git a/src/main/webapp/js/easyui/src/jquery.droppable.js b/src/main/webapp/js/easyui/src/jquery.droppable.js index 41e27d8..49f31c6 100644 --- a/src/main/webapp/js/easyui/src/jquery.droppable.js +++ b/src/main/webapp/js/easyui/src/jquery.droppable.js @@ -1,81 +1,81 @@ -/** - * jQuery EasyUI 1.4.2 - * - * Copyright (c) 2009-2015 www.jeasyui.com. All rights reserved. - * - * Licensed under the GPL license: http://www.gnu.org/licenses/gpl.txt - * To use it on other terms please contact us at info@jeasyui.com - * - */ -/** - * droppable - jQuery EasyUI - * - */ -(function($){ - function init(target){ - $(target).addClass('droppable'); - $(target).bind('_dragenter', function(e, source){ - $.data(target, 'droppable').options.onDragEnter.apply(target, [e, source]); - }); - $(target).bind('_dragleave', function(e, source){ - $.data(target, 'droppable').options.onDragLeave.apply(target, [e, source]); - }); - $(target).bind('_dragover', function(e, source){ - $.data(target, 'droppable').options.onDragOver.apply(target, [e, source]); - }); - $(target).bind('_drop', function(e, source){ - $.data(target, 'droppable').options.onDrop.apply(target, [e, source]); - }); - } - - $.fn.droppable = function(options, param){ - if (typeof options == 'string'){ - return $.fn.droppable.methods[options](this, param); - } - - options = options || {}; - return this.each(function(){ - var state = $.data(this, 'droppable'); - if (state){ - $.extend(state.options, options); - } else { - init(this); - $.data(this, 'droppable', { - options: $.extend({}, $.fn.droppable.defaults, $.fn.droppable.parseOptions(this), options) - }); - } - }); - }; - - $.fn.droppable.methods = { - options: function(jq){ - return $.data(jq[0], 'droppable').options; - }, - enable: function(jq){ - return jq.each(function(){ - $(this).droppable({disabled:false}); - }); - }, - disable: function(jq){ - return jq.each(function(){ - $(this).droppable({disabled:true}); - }); - } - }; - - $.fn.droppable.parseOptions = function(target){ - var t = $(target); - return $.extend({}, $.parser.parseOptions(target, ['accept']), { - disabled: (t.attr('disabled') ? true : undefined) - }); - }; - - $.fn.droppable.defaults = { - accept:null, - disabled:false, - onDragEnter:function(e, source){}, - onDragOver:function(e, source){}, - onDragLeave:function(e, source){}, - onDrop:function(e, source){} - }; -})(jQuery); +/** + * jQuery EasyUI 1.4.2 + * + * Copyright (c) 2009-2015 www.jeasyui.com. All rights reserved. + * + * Licensed under the GPL license: http://www.gnu.org/licenses/gpl.txt + * To use it on other terms please contact us at info@jeasyui.com + * + */ +/** + * droppable - jQuery EasyUI + * + */ +(function($){ + function init(target){ + $(target).addClass('droppable'); + $(target).bind('_dragenter', function(e, source){ + $.data(target, 'droppable').options.onDragEnter.apply(target, [e, source]); + }); + $(target).bind('_dragleave', function(e, source){ + $.data(target, 'droppable').options.onDragLeave.apply(target, [e, source]); + }); + $(target).bind('_dragover', function(e, source){ + $.data(target, 'droppable').options.onDragOver.apply(target, [e, source]); + }); + $(target).bind('_drop', function(e, source){ + $.data(target, 'droppable').options.onDrop.apply(target, [e, source]); + }); + } + + $.fn.droppable = function(options, param){ + if (typeof options == 'string'){ + return $.fn.droppable.methods[options](this, param); + } + + options = options || {}; + return this.each(function(){ + var state = $.data(this, 'droppable'); + if (state){ + $.extend(state.options, options); + } else { + init(this); + $.data(this, 'droppable', { + options: $.extend({}, $.fn.droppable.defaults, $.fn.droppable.parseOptions(this), options) + }); + } + }); + }; + + $.fn.droppable.methods = { + options: function(jq){ + return $.data(jq[0], 'droppable').options; + }, + enable: function(jq){ + return jq.each(function(){ + $(this).droppable({disabled:false}); + }); + }, + disable: function(jq){ + return jq.each(function(){ + $(this).droppable({disabled:true}); + }); + } + }; + + $.fn.droppable.parseOptions = function(target){ + var t = $(target); + return $.extend({}, $.parser.parseOptions(target, ['accept']), { + disabled: (t.attr('disabled') ? true : undefined) + }); + }; + + $.fn.droppable.defaults = { + accept:null, + disabled:false, + onDragEnter:function(e, source){}, + onDragOver:function(e, source){}, + onDragLeave:function(e, source){}, + onDrop:function(e, source){} + }; +})(jQuery); diff --git a/src/main/webapp/js/easyui/src/jquery.form.js b/src/main/webapp/js/easyui/src/jquery.form.js index 47e3a7d..0e17103 100644 --- a/src/main/webapp/js/easyui/src/jquery.form.js +++ b/src/main/webapp/js/easyui/src/jquery.form.js @@ -1,371 +1,371 @@ -/** - * jQuery EasyUI 1.4.2 - * - * Copyright (c) 2009-2015 www.jeasyui.com. All rights reserved. - * - * Licensed under the GPL license: http://www.gnu.org/licenses/gpl.txt - * To use it on other terms please contact us at info@jeasyui.com - * - */ -/** - * form - jQuery EasyUI - * - */ -(function($){ - /** - * submit the form - */ - function ajaxSubmit(target, options){ - var opts = $.data(target, 'form').options; - $.extend(opts, options||{}); - - var param = $.extend({}, opts.queryParams); - if (opts.onSubmit.call(target, param) == false){return;} - $(target).find('.textbox-text:focus').blur(); - - var frameId = 'easyui_frame_' + (new Date().getTime()); - var frame = $('').appendTo('body') - frame.attr('src', window.ActiveXObject ? 'javascript:false' : 'about:blank'); - frame.css({ - position:'absolute', - top:-1000, - left:-1000 - }); - frame.bind('load', cb); - - submit(param); - - function submit(param){ - var form = $(target); - if (opts.url){ - form.attr('action', opts.url); - } - var t = form.attr('target'), a = form.attr('action'); - form.attr('target', frameId); - var paramFields = $(); - try { - for(var n in param){ - var field = $('').val(param[n]).appendTo(form); - paramFields = paramFields.add(field); - } - checkState(); - form[0].submit(); - } finally { - form.attr('action', a); - t ? form.attr('target', t) : form.removeAttr('target'); - paramFields.remove(); - } - } - - function checkState(){ - var f = $('#'+frameId); - if (!f.length){return} - try{ - var s = f.contents()[0].readyState; - if (s && s.toLowerCase() == 'uninitialized'){ - setTimeout(checkState, 100); - } - } catch(e){ - cb(); - } - } - - var checkCount = 10; - function cb(){ - var f = $('#'+frameId); - if (!f.length){return} - f.unbind(); - var data = ''; - try{ - var body = f.contents().find('body'); - data = body.html(); - if (data == ''){ - if (--checkCount){ - setTimeout(cb, 100); - return; - } - } - var ta = body.find('>textarea'); - if (ta.length){ - data = ta.val(); - } else { - var pre = body.find('>pre'); - if (pre.length){ - data = pre.html(); - } - } - } catch(e){ - } - opts.success(data); - setTimeout(function(){ - f.unbind(); - f.remove(); - }, 100); - } - } - - /** - * load form data - * if data is a URL string type load from remote site, - * otherwise load from local data object. - */ - function load(target, data){ - var opts = $.data(target, 'form').options; - - if (typeof data == 'string'){ - var param = {}; - if (opts.onBeforeLoad.call(target, param) == false) return; - - $.ajax({ - url: data, - data: param, - dataType: 'json', - success: function(data){ - _load(data); - }, - error: function(){ - opts.onLoadError.apply(target, arguments); - } - }); - } else { - _load(data); - } - - function _load(data){ - var form = $(target); - for(var name in data){ - var val = data[name]; - if (!_checkField(name, val)){ - if (!_loadBox(name, val)){ - form.find('input[name="'+name+'"]').val(val); - form.find('textarea[name="'+name+'"]').val(val); - form.find('select[name="'+name+'"]').val(val); - } - } - } - opts.onLoadSuccess.call(target, data); - form.form('validate'); - } - - /** - * check the checkbox and radio fields - */ - function _checkField(name, val){ - var cc = $(target).find('input[name="'+name+'"][type=radio], input[name="'+name+'"][type=checkbox]'); - if (cc.length){ - cc._propAttr('checked', false); - cc.each(function(){ - var f = $(this); - if (f.val() == String(val) || $.inArray(f.val(), $.isArray(val)?val:[val]) >= 0){ - f._propAttr('checked', true); - } - }); - return true; - } - return false; - } - - function _loadBox(name, val){ - var field = $(target).find('[textboxName="'+name+'"],[sliderName="'+name+'"]'); - if (field.length){ - for(var i=0; i=0; i--){ - var type = opts.fieldTypes[i]; - var field = form.find('.'+type+'-f'); - if (field.length && field[type]){ - field[type]('clear'); - } - } - form.form('validate'); - } - - function reset(target){ - target.reset(); - var form = $(target); - var opts = $.data(target, 'form').options; - for(var i=opts.fieldTypes.length-1; i>=0; i--){ - var type = opts.fieldTypes[i]; - var field = form.find('.'+type+'-f'); - if (field.length && field[type]){ - field[type]('reset'); - } - } - form.form('validate'); - } - - /** - * set the form to make it can submit with ajax. - */ - function setForm(target){ - var options = $.data(target, 'form').options; - $(target).unbind('.form'); - if (options.ajax){ - $(target).bind('submit.form', function(){ - setTimeout(function(){ - ajaxSubmit(target, options); - }, 0); - return false; - }); - } - $(target).bind('_change.form', function(e, t){ - options.onChange.call(this, t); - }).bind('change.form', function(e){ - var t = e.target; - if (!$(t).hasClass('textbox-text')){ - options.onChange.call(this, t); - } - }); - setValidation(target, options.novalidate); - } - - function initForm(target, options){ - options = options || {}; - var state = $.data(target, 'form'); - if (state){ - $.extend(state.options, options); - } else { - $.data(target, 'form', { - options: $.extend({}, $.fn.form.defaults, $.fn.form.parseOptions(target), options) - }); - } - } - - function validate(target){ - if ($.fn.validatebox){ - var t = $(target); - t.find('.validatebox-text:not(:disabled)').validatebox('validate'); - var invalidbox = t.find('.validatebox-invalid'); - invalidbox.filter(':not(:disabled):first').focus(); - return invalidbox.length == 0; - } - return true; - } - - function setValidation(target, novalidate){ - var opts = $.data(target, 'form').options; - opts.novalidate = novalidate; - $(target).find('.validatebox-text:not(:disabled)').validatebox(novalidate ? 'disableValidation' : 'enableValidation'); - } - - $.fn.form = function(options, param){ - if (typeof options == 'string'){ - this.each(function(){ - initForm(this); - }); - return $.fn.form.methods[options](this, param); - } - - return this.each(function(){ - initForm(this, options); - setForm(this); - }); - }; - - $.fn.form.methods = { - options: function(jq){ - return $.data(jq[0], 'form').options; - }, - submit: function(jq, options){ - return jq.each(function(){ - ajaxSubmit(this, options); - }); - }, - load: function(jq, data){ - return jq.each(function(){ - load(this, data); - }); - }, - clear: function(jq){ - return jq.each(function(){ - clear(this); - }); - }, - reset: function(jq){ - return jq.each(function(){ - reset(this); - }); - }, - validate: function(jq){ - return validate(jq[0]); - }, - disableValidation: function(jq){ - return jq.each(function(){ - setValidation(this, true); - }); - }, - enableValidation: function(jq){ - return jq.each(function(){ - setValidation(this, false); - }); - } - }; - - $.fn.form.parseOptions = function(target){ - var t = $(target); - return $.extend({}, $.parser.parseOptions(target, [{ajax:'boolean'}]), { - url: (t.attr('action') ? t.attr('action') : undefined) - }); - }; - - $.fn.form.defaults = { - fieldTypes: ['combobox','combotree','combogrid','datetimebox','datebox','combo', - 'datetimespinner','timespinner','numberspinner','spinner', - 'slider','searchbox','numberbox','textbox'], - novalidate: false, - ajax: true, - url: null, - queryParams: {}, - onSubmit: function(param){return $(this).form('validate');}, - success: function(data){}, - onBeforeLoad: function(param){}, - onLoadSuccess: function(data){}, - onLoadError: function(){}, - onChange: function(target){} - }; -})(jQuery); +/** + * jQuery EasyUI 1.4.2 + * + * Copyright (c) 2009-2015 www.jeasyui.com. All rights reserved. + * + * Licensed under the GPL license: http://www.gnu.org/licenses/gpl.txt + * To use it on other terms please contact us at info@jeasyui.com + * + */ +/** + * form - jQuery EasyUI + * + */ +(function($){ + /** + * submit the form + */ + function ajaxSubmit(target, options){ + var opts = $.data(target, 'form').options; + $.extend(opts, options||{}); + + var param = $.extend({}, opts.queryParams); + if (opts.onSubmit.call(target, param) == false){return;} + $(target).find('.textbox-text:focus').blur(); + + var frameId = 'easyui_frame_' + (new Date().getTime()); + var frame = $('').appendTo('body') + frame.attr('src', window.ActiveXObject ? 'javascript:false' : 'about:blank'); + frame.css({ + position:'absolute', + top:-1000, + left:-1000 + }); + frame.bind('load', cb); + + submit(param); + + function submit(param){ + var form = $(target); + if (opts.url){ + form.attr('action', opts.url); + } + var t = form.attr('target'), a = form.attr('action'); + form.attr('target', frameId); + var paramFields = $(); + try { + for(var n in param){ + var field = $('').val(param[n]).appendTo(form); + paramFields = paramFields.add(field); + } + checkState(); + form[0].submit(); + } finally { + form.attr('action', a); + t ? form.attr('target', t) : form.removeAttr('target'); + paramFields.remove(); + } + } + + function checkState(){ + var f = $('#'+frameId); + if (!f.length){return} + try{ + var s = f.contents()[0].readyState; + if (s && s.toLowerCase() == 'uninitialized'){ + setTimeout(checkState, 100); + } + } catch(e){ + cb(); + } + } + + var checkCount = 10; + function cb(){ + var f = $('#'+frameId); + if (!f.length){return} + f.unbind(); + var data = ''; + try{ + var body = f.contents().find('body'); + data = body.html(); + if (data == ''){ + if (--checkCount){ + setTimeout(cb, 100); + return; + } + } + var ta = body.find('>textarea'); + if (ta.length){ + data = ta.val(); + } else { + var pre = body.find('>pre'); + if (pre.length){ + data = pre.html(); + } + } + } catch(e){ + } + opts.success(data); + setTimeout(function(){ + f.unbind(); + f.remove(); + }, 100); + } + } + + /** + * load form data + * if data is a URL string type load from remote site, + * otherwise load from local data object. + */ + function load(target, data){ + var opts = $.data(target, 'form').options; + + if (typeof data == 'string'){ + var param = {}; + if (opts.onBeforeLoad.call(target, param) == false) return; + + $.ajax({ + url: data, + data: param, + dataType: 'json', + success: function(data){ + _load(data); + }, + error: function(){ + opts.onLoadError.apply(target, arguments); + } + }); + } else { + _load(data); + } + + function _load(data){ + var form = $(target); + for(var name in data){ + var val = data[name]; + if (!_checkField(name, val)){ + if (!_loadBox(name, val)){ + form.find('input[name="'+name+'"]').val(val); + form.find('textarea[name="'+name+'"]').val(val); + form.find('select[name="'+name+'"]').val(val); + } + } + } + opts.onLoadSuccess.call(target, data); + form.form('validate'); + } + + /** + * check the checkbox and radio fields + */ + function _checkField(name, val){ + var cc = $(target).find('input[name="'+name+'"][type=radio], input[name="'+name+'"][type=checkbox]'); + if (cc.length){ + cc._propAttr('checked', false); + cc.each(function(){ + var f = $(this); + if (f.val() == String(val) || $.inArray(f.val(), $.isArray(val)?val:[val]) >= 0){ + f._propAttr('checked', true); + } + }); + return true; + } + return false; + } + + function _loadBox(name, val){ + var field = $(target).find('[textboxName="'+name+'"],[sliderName="'+name+'"]'); + if (field.length){ + for(var i=0; i=0; i--){ + var type = opts.fieldTypes[i]; + var field = form.find('.'+type+'-f'); + if (field.length && field[type]){ + field[type]('clear'); + } + } + form.form('validate'); + } + + function reset(target){ + target.reset(); + var form = $(target); + var opts = $.data(target, 'form').options; + for(var i=opts.fieldTypes.length-1; i>=0; i--){ + var type = opts.fieldTypes[i]; + var field = form.find('.'+type+'-f'); + if (field.length && field[type]){ + field[type]('reset'); + } + } + form.form('validate'); + } + + /** + * set the form to make it can submit with ajax. + */ + function setForm(target){ + var options = $.data(target, 'form').options; + $(target).unbind('.form'); + if (options.ajax){ + $(target).bind('submit.form', function(){ + setTimeout(function(){ + ajaxSubmit(target, options); + }, 0); + return false; + }); + } + $(target).bind('_change.form', function(e, t){ + options.onChange.call(this, t); + }).bind('change.form', function(e){ + var t = e.target; + if (!$(t).hasClass('textbox-text')){ + options.onChange.call(this, t); + } + }); + setValidation(target, options.novalidate); + } + + function initForm(target, options){ + options = options || {}; + var state = $.data(target, 'form'); + if (state){ + $.extend(state.options, options); + } else { + $.data(target, 'form', { + options: $.extend({}, $.fn.form.defaults, $.fn.form.parseOptions(target), options) + }); + } + } + + function validate(target){ + if ($.fn.validatebox){ + var t = $(target); + t.find('.validatebox-text:not(:disabled)').validatebox('validate'); + var invalidbox = t.find('.validatebox-invalid'); + invalidbox.filter(':not(:disabled):first').focus(); + return invalidbox.length == 0; + } + return true; + } + + function setValidation(target, novalidate){ + var opts = $.data(target, 'form').options; + opts.novalidate = novalidate; + $(target).find('.validatebox-text:not(:disabled)').validatebox(novalidate ? 'disableValidation' : 'enableValidation'); + } + + $.fn.form = function(options, param){ + if (typeof options == 'string'){ + this.each(function(){ + initForm(this); + }); + return $.fn.form.methods[options](this, param); + } + + return this.each(function(){ + initForm(this, options); + setForm(this); + }); + }; + + $.fn.form.methods = { + options: function(jq){ + return $.data(jq[0], 'form').options; + }, + submit: function(jq, options){ + return jq.each(function(){ + ajaxSubmit(this, options); + }); + }, + load: function(jq, data){ + return jq.each(function(){ + load(this, data); + }); + }, + clear: function(jq){ + return jq.each(function(){ + clear(this); + }); + }, + reset: function(jq){ + return jq.each(function(){ + reset(this); + }); + }, + validate: function(jq){ + return validate(jq[0]); + }, + disableValidation: function(jq){ + return jq.each(function(){ + setValidation(this, true); + }); + }, + enableValidation: function(jq){ + return jq.each(function(){ + setValidation(this, false); + }); + } + }; + + $.fn.form.parseOptions = function(target){ + var t = $(target); + return $.extend({}, $.parser.parseOptions(target, [{ajax:'boolean'}]), { + url: (t.attr('action') ? t.attr('action') : undefined) + }); + }; + + $.fn.form.defaults = { + fieldTypes: ['combobox','combotree','combogrid','datetimebox','datebox','combo', + 'datetimespinner','timespinner','numberspinner','spinner', + 'slider','searchbox','numberbox','textbox'], + novalidate: false, + ajax: true, + url: null, + queryParams: {}, + onSubmit: function(param){return $(this).form('validate');}, + success: function(data){}, + onBeforeLoad: function(param){}, + onLoadSuccess: function(data){}, + onLoadError: function(){}, + onChange: function(target){} + }; +})(jQuery); diff --git a/src/main/webapp/js/easyui/src/jquery.linkbutton.js b/src/main/webapp/js/easyui/src/jquery.linkbutton.js index 47a59ca..2b7c3c9 100644 --- a/src/main/webapp/js/easyui/src/jquery.linkbutton.js +++ b/src/main/webapp/js/easyui/src/jquery.linkbutton.js @@ -1,242 +1,242 @@ -/** - * jQuery EasyUI 1.4.2 - * - * Copyright (c) 2009-2015 www.jeasyui.com. All rights reserved. - * - * Licensed under the GPL license: http://www.gnu.org/licenses/gpl.txt - * To use it on other terms please contact us at info@jeasyui.com - * - */ -/** - * linkbutton - jQuery EasyUI - * - */ -(function($){ - function setSize(target, param){ - var opts = $.data(target, 'linkbutton').options; - if (param){ - $.extend(opts, param); - } - if (opts.width || opts.height || opts.fit){ - var btn = $(target); - var parent = btn.parent(); - var isVisible = btn.is(':visible'); - if (!isVisible){ - var spacer = $('
                                                                  ').insertBefore(target); - var style = { - position: btn.css('position'), - display: btn.css('display'), - left: btn.css('left') - }; - btn.appendTo('body'); - btn.css({ - position: 'absolute', - display: 'inline-block', - left: -20000 - }); - } - btn._size(opts, parent); - var left = btn.find('.l-btn-left'); - left.css('margin-top', 0); - left.css('margin-top', parseInt((btn.height()-left.height())/2)+'px'); - if (!isVisible){ - btn.insertAfter(spacer); - btn.css(style); - spacer.remove(); - } - } - } - - function createButton(target) { - var opts = $.data(target, 'linkbutton').options; - var t = $(target).empty(); - - t.addClass('l-btn').removeClass('l-btn-plain l-btn-selected l-btn-plain-selected l-btn-outline'); - t.removeClass('l-btn-small l-btn-medium l-btn-large').addClass('l-btn-'+opts.size); - if (opts.plain){t.addClass('l-btn-plain')} - if (opts.outline){t.addClass('l-btn-outline')} - if (opts.selected){ - t.addClass(opts.plain ? 'l-btn-selected l-btn-plain-selected' : 'l-btn-selected'); - } - t.attr('group', opts.group || ''); - t.attr('id', opts.id || ''); - - var inner = $('').appendTo(t); - if (opts.text){ - $('').html(opts.text).appendTo(inner); - } else { - $(' ').appendTo(inner); - } - if (opts.iconCls){ - $(' ').addClass(opts.iconCls).appendTo(inner); - inner.addClass('l-btn-icon-'+opts.iconAlign); - } - - t.unbind('.linkbutton').bind('focus.linkbutton',function(){ - if (!opts.disabled){ - $(this).addClass('l-btn-focus'); - } - }).bind('blur.linkbutton',function(){ - $(this).removeClass('l-btn-focus'); - }).bind('click.linkbutton',function(){ - if (!opts.disabled){ - if (opts.toggle){ - if (opts.selected){ - $(this).linkbutton('unselect'); - } else { - $(this).linkbutton('select'); - } - } - opts.onClick.call(this); - } -// return false; - }); -// if (opts.toggle && !opts.disabled){ -// t.bind('click.linkbutton', function(){ -// if (opts.selected){ -// $(this).linkbutton('unselect'); -// } else { -// $(this).linkbutton('select'); -// } -// }); -// } - - setSelected(target, opts.selected) - setDisabled(target, opts.disabled); - } - - function setSelected(target, selected){ - var opts = $.data(target, 'linkbutton').options; - if (selected){ - if (opts.group){ - $('a.l-btn[group="'+opts.group+'"]').each(function(){ - var o = $(this).linkbutton('options'); - if (o.toggle){ - $(this).removeClass('l-btn-selected l-btn-plain-selected'); - o.selected = false; - } - }); - } - $(target).addClass(opts.plain ? 'l-btn-selected l-btn-plain-selected' : 'l-btn-selected'); - opts.selected = true; - } else { - if (!opts.group){ - $(target).removeClass('l-btn-selected l-btn-plain-selected'); - opts.selected = false; - } - } - } - - function setDisabled(target, disabled){ - var state = $.data(target, 'linkbutton'); - var opts = state.options; - $(target).removeClass('l-btn-disabled l-btn-plain-disabled'); - if (disabled){ - opts.disabled = true; - var href = $(target).attr('href'); - if (href){ - state.href = href; - $(target).attr('href', 'javascript:void(0)'); - } - if (target.onclick){ - state.onclick = target.onclick; - target.onclick = null; - } - opts.plain ? $(target).addClass('l-btn-disabled l-btn-plain-disabled') : $(target).addClass('l-btn-disabled'); - } else { - opts.disabled = false; - if (state.href) { - $(target).attr('href', state.href); - } - if (state.onclick) { - target.onclick = state.onclick; - } - } - } - - $.fn.linkbutton = function(options, param){ - if (typeof options == 'string'){ - return $.fn.linkbutton.methods[options](this, param); - } - - options = options || {}; - return this.each(function(){ - var state = $.data(this, 'linkbutton'); - if (state){ - $.extend(state.options, options); - } else { - $.data(this, 'linkbutton', { - options: $.extend({}, $.fn.linkbutton.defaults, $.fn.linkbutton.parseOptions(this), options) - }); - $(this).removeAttr('disabled'); - $(this).bind('_resize', function(e, force){ - if ($(this).hasClass('easyui-fluid') || force){ - setSize(this); - } - return false; - }); - } - - createButton(this); - setSize(this); - }); - }; - - $.fn.linkbutton.methods = { - options: function(jq){ - return $.data(jq[0], 'linkbutton').options; - }, - resize: function(jq, param){ - return jq.each(function(){ - setSize(this, param); - }); - }, - enable: function(jq){ - return jq.each(function(){ - setDisabled(this, false); - }); - }, - disable: function(jq){ - return jq.each(function(){ - setDisabled(this, true); - }); - }, - select: function(jq){ - return jq.each(function(){ - setSelected(this, true); - }); - }, - unselect: function(jq){ - return jq.each(function(){ - setSelected(this, false); - }); - } - }; - - $.fn.linkbutton.parseOptions = function(target){ - var t = $(target); - return $.extend({}, $.parser.parseOptions(target, - ['id','iconCls','iconAlign','group','size',{plain:'boolean',toggle:'boolean',selected:'boolean',outline:'boolean'}] - ), { - disabled: (t.attr('disabled') ? true : undefined), - text: $.trim(t.html()), - iconCls: (t.attr('icon') || t.attr('iconCls')) - }); - }; - - $.fn.linkbutton.defaults = { - id: null, - disabled: false, - toggle: false, - selected: false, - outline: false, - group: null, - plain: false, - text: '', - iconCls: null, - iconAlign: 'left', - size: 'small', // small,large - onClick: function(){} - }; - -})(jQuery); +/** + * jQuery EasyUI 1.4.2 + * + * Copyright (c) 2009-2015 www.jeasyui.com. All rights reserved. + * + * Licensed under the GPL license: http://www.gnu.org/licenses/gpl.txt + * To use it on other terms please contact us at info@jeasyui.com + * + */ +/** + * linkbutton - jQuery EasyUI + * + */ +(function($){ + function setSize(target, param){ + var opts = $.data(target, 'linkbutton').options; + if (param){ + $.extend(opts, param); + } + if (opts.width || opts.height || opts.fit){ + var btn = $(target); + var parent = btn.parent(); + var isVisible = btn.is(':visible'); + if (!isVisible){ + var spacer = $('
                                                                  ').insertBefore(target); + var style = { + position: btn.css('position'), + display: btn.css('display'), + left: btn.css('left') + }; + btn.appendTo('body'); + btn.css({ + position: 'absolute', + display: 'inline-block', + left: -20000 + }); + } + btn._size(opts, parent); + var left = btn.find('.l-btn-left'); + left.css('margin-top', 0); + left.css('margin-top', parseInt((btn.height()-left.height())/2)+'px'); + if (!isVisible){ + btn.insertAfter(spacer); + btn.css(style); + spacer.remove(); + } + } + } + + function createButton(target) { + var opts = $.data(target, 'linkbutton').options; + var t = $(target).empty(); + + t.addClass('l-btn').removeClass('l-btn-plain l-btn-selected l-btn-plain-selected l-btn-outline'); + t.removeClass('l-btn-small l-btn-medium l-btn-large').addClass('l-btn-'+opts.size); + if (opts.plain){t.addClass('l-btn-plain')} + if (opts.outline){t.addClass('l-btn-outline')} + if (opts.selected){ + t.addClass(opts.plain ? 'l-btn-selected l-btn-plain-selected' : 'l-btn-selected'); + } + t.attr('group', opts.group || ''); + t.attr('id', opts.id || ''); + + var inner = $('').appendTo(t); + if (opts.text){ + $('').html(opts.text).appendTo(inner); + } else { + $(' ').appendTo(inner); + } + if (opts.iconCls){ + $(' ').addClass(opts.iconCls).appendTo(inner); + inner.addClass('l-btn-icon-'+opts.iconAlign); + } + + t.unbind('.linkbutton').bind('focus.linkbutton',function(){ + if (!opts.disabled){ + $(this).addClass('l-btn-focus'); + } + }).bind('blur.linkbutton',function(){ + $(this).removeClass('l-btn-focus'); + }).bind('click.linkbutton',function(){ + if (!opts.disabled){ + if (opts.toggle){ + if (opts.selected){ + $(this).linkbutton('unselect'); + } else { + $(this).linkbutton('select'); + } + } + opts.onClick.call(this); + } +// return false; + }); +// if (opts.toggle && !opts.disabled){ +// t.bind('click.linkbutton', function(){ +// if (opts.selected){ +// $(this).linkbutton('unselect'); +// } else { +// $(this).linkbutton('select'); +// } +// }); +// } + + setSelected(target, opts.selected) + setDisabled(target, opts.disabled); + } + + function setSelected(target, selected){ + var opts = $.data(target, 'linkbutton').options; + if (selected){ + if (opts.group){ + $('a.l-btn[group="'+opts.group+'"]').each(function(){ + var o = $(this).linkbutton('options'); + if (o.toggle){ + $(this).removeClass('l-btn-selected l-btn-plain-selected'); + o.selected = false; + } + }); + } + $(target).addClass(opts.plain ? 'l-btn-selected l-btn-plain-selected' : 'l-btn-selected'); + opts.selected = true; + } else { + if (!opts.group){ + $(target).removeClass('l-btn-selected l-btn-plain-selected'); + opts.selected = false; + } + } + } + + function setDisabled(target, disabled){ + var state = $.data(target, 'linkbutton'); + var opts = state.options; + $(target).removeClass('l-btn-disabled l-btn-plain-disabled'); + if (disabled){ + opts.disabled = true; + var href = $(target).attr('href'); + if (href){ + state.href = href; + $(target).attr('href', 'javascript:void(0)'); + } + if (target.onclick){ + state.onclick = target.onclick; + target.onclick = null; + } + opts.plain ? $(target).addClass('l-btn-disabled l-btn-plain-disabled') : $(target).addClass('l-btn-disabled'); + } else { + opts.disabled = false; + if (state.href) { + $(target).attr('href', state.href); + } + if (state.onclick) { + target.onclick = state.onclick; + } + } + } + + $.fn.linkbutton = function(options, param){ + if (typeof options == 'string'){ + return $.fn.linkbutton.methods[options](this, param); + } + + options = options || {}; + return this.each(function(){ + var state = $.data(this, 'linkbutton'); + if (state){ + $.extend(state.options, options); + } else { + $.data(this, 'linkbutton', { + options: $.extend({}, $.fn.linkbutton.defaults, $.fn.linkbutton.parseOptions(this), options) + }); + $(this).removeAttr('disabled'); + $(this).bind('_resize', function(e, force){ + if ($(this).hasClass('easyui-fluid') || force){ + setSize(this); + } + return false; + }); + } + + createButton(this); + setSize(this); + }); + }; + + $.fn.linkbutton.methods = { + options: function(jq){ + return $.data(jq[0], 'linkbutton').options; + }, + resize: function(jq, param){ + return jq.each(function(){ + setSize(this, param); + }); + }, + enable: function(jq){ + return jq.each(function(){ + setDisabled(this, false); + }); + }, + disable: function(jq){ + return jq.each(function(){ + setDisabled(this, true); + }); + }, + select: function(jq){ + return jq.each(function(){ + setSelected(this, true); + }); + }, + unselect: function(jq){ + return jq.each(function(){ + setSelected(this, false); + }); + } + }; + + $.fn.linkbutton.parseOptions = function(target){ + var t = $(target); + return $.extend({}, $.parser.parseOptions(target, + ['id','iconCls','iconAlign','group','size',{plain:'boolean',toggle:'boolean',selected:'boolean',outline:'boolean'}] + ), { + disabled: (t.attr('disabled') ? true : undefined), + text: $.trim(t.html()), + iconCls: (t.attr('icon') || t.attr('iconCls')) + }); + }; + + $.fn.linkbutton.defaults = { + id: null, + disabled: false, + toggle: false, + selected: false, + outline: false, + group: null, + plain: false, + text: '', + iconCls: null, + iconAlign: 'left', + size: 'small', // small,large + onClick: function(){} + }; + +})(jQuery); diff --git a/src/main/webapp/js/easyui/src/jquery.menu.js b/src/main/webapp/js/easyui/src/jquery.menu.js index e0fadc9..3cd5e00 100644 --- a/src/main/webapp/js/easyui/src/jquery.menu.js +++ b/src/main/webapp/js/easyui/src/jquery.menu.js @@ -1,637 +1,637 @@ -/** - * jQuery EasyUI 1.4.2 - * - * Copyright (c) 2009-2015 www.jeasyui.com. All rights reserved. - * - * Licensed under the GPL license: http://www.gnu.org/licenses/gpl.txt - * To use it on other terms please contact us at info@jeasyui.com - * - */ -/** - * menu - jQuery EasyUI - * - */ -(function($){ - $(function(){ - $(document).unbind('.menu').bind('mousedown.menu', function(e){ - var m = $(e.target).closest('div.menu,div.combo-p'); - if (m.length){return} - $('body>div.menu-top:visible').not('.menu-inline').menu('hide'); - hideMenu($('body>div.menu:visible').not('.menu-inline')); - }); - }); - - /** - * initialize the target menu, the function can be invoked only once - */ - function init(target){ - var opts = $.data(target, 'menu').options; - $(target).addClass('menu-top'); // the top menu - opts.inline ? $(target).addClass('menu-inline') : $(target).appendTo('body'); - $(target).bind('_resize', function(e, force){ - if ($(this).hasClass('easyui-fluid') || force){ - $(target).menu('resize', target); - } - return false; - }); - - var menus = splitMenu($(target)); - for(var i=0; i').html(text)); - if (itemOpts.iconCls){ - $('').addClass(itemOpts.iconCls).appendTo(item); - } - if (itemOpts.disabled){ - setDisabled(target, item[0], true); - } - if (item[0].submenu){ - $('').appendTo(item); // has sub menu - } - - bindMenuItemEvent(target, item); - } - }); - $('').prependTo(menu); - } - setMenuSize(target, menu); - if (!menu.hasClass('menu-inline')){ - menu.hide(); - } - - bindMenuEvent(target, menu); - } - } - - function setMenuSize(target, menu){ - var opts = $.data(target, 'menu').options; - var style = menu.attr('style') || ''; - menu.css({ - display: 'block', - left:-10000, - height: 'auto', - overflow: 'hidden' - }); - menu.find('.menu-item').each(function(){ - $(this)._outerHeight(opts.itemHeight); - $(this).find('.menu-text').css({ - height: (opts.itemHeight-2)+'px', - lineHeight: (opts.itemHeight-2)+'px' - }); - }); - menu.removeClass('menu-noline').addClass(opts.noline?'menu-noline':''); - - var width = menu[0].originalWidth || 'auto'; - if (isNaN(parseInt(width))){ - width = 0; - menu.find('div.menu-text').each(function(){ - if (width < $(this)._outerWidth()){ - width = $(this)._outerWidth(); - } - }); - width += 40; - } - - var autoHeight = menu.outerHeight(); - var height = menu[0].originalHeight || 'auto'; - if (isNaN(parseInt(height))){ - height = autoHeight; - - if (menu.hasClass('menu-top') && opts.alignTo){ - var at = $(opts.alignTo); - var h1 = at.offset().top - $(document).scrollTop(); - var h2 = $(window)._outerHeight() + $(document).scrollTop() - at.offset().top - at._outerHeight(); - height = Math.min(height, Math.max(h1, h2)); - } else if (height > $(window)._outerHeight()){ - height = $(window).height(); - } - } - - menu.attr('style', style); // restore the original style - menu._size({ - fit: (menu[0]==target?opts.fit:false), - width: width, - minWidth: opts.minWidth, - height: height - }); - menu.css('overflow', menu.outerHeight() < autoHeight ? 'auto' : 'hidden'); - menu.children('div.menu-line')._outerHeight(autoHeight-2); - } - - /** - * bind menu event - */ - function bindMenuEvent(target, menu){ - if (menu.hasClass('menu-inline')){return} - var state = $.data(target, 'menu'); - menu.unbind('.menu').bind('mouseenter.menu', function(){ - if (state.timer){ - clearTimeout(state.timer); - state.timer = null; - } - }).bind('mouseleave.menu', function(){ - if (state.options.hideOnUnhover){ - state.timer = setTimeout(function(){ - hideAll(target, $(target).hasClass('menu-inline')); - }, state.options.duration); - } - }); - } - - /** - * bind menu item event - */ - function bindMenuItemEvent(target, item){ - if (!item.hasClass('menu-item')){return} - item.unbind('.menu'); - item.bind('click.menu', function(){ - if ($(this).hasClass('menu-item-disabled')){ - return; - } - // only the sub menu clicked can hide all menus - if (!this.submenu){ - hideAll(target, $(target).hasClass('menu-inline')); - var href = this.itemHref; - if (href){ - location.href = href; - } - } - $(this).trigger('mouseenter'); - var item = $(target).menu('getItem', this); - $.data(target, 'menu').options.onClick.call(target, item); - }).bind('mouseenter.menu', function(e){ - // hide other menu - item.siblings().each(function(){ - if (this.submenu){ - hideMenu(this.submenu); - } - $(this).removeClass('menu-active'); - }); - // show this menu - item.addClass('menu-active'); - - if ($(this).hasClass('menu-item-disabled')){ - item.addClass('menu-active-disabled'); - return; - } - - var submenu = item[0].submenu; - if (submenu){ - $(target).menu('show', { - menu: submenu, - parent: item - }); - } - }).bind('mouseleave.menu', function(e){ - item.removeClass('menu-active menu-active-disabled'); - var submenu = item[0].submenu; - if (submenu){ - if (e.pageX>=parseInt(submenu.css('left'))){ - item.addClass('menu-active'); - } else { - hideMenu(submenu); - } - - } else { - item.removeClass('menu-active'); - } - }); - } - - /** - * hide top menu and it's all sub menus - */ - function hideAll(target, inline){ - var state = $.data(target, 'menu'); - if (state){ - if ($(target).is(':visible')){ - hideMenu($(target)); - if (inline){ - $(target).show(); - } else { - state.options.onHide.call(target); - } - } - } - return false; - } - - /** - * show the menu, the 'param' object has one or more properties: - * left: the left position to display - * top: the top position to display - * menu: the menu to display, if not defined, the 'target menu' is used - * parent: the parent menu item to align to - * alignTo: the element object to align to - */ - function showMenu(target, param){ - var left,top; - param = param || {}; - var menu = $(param.menu || target); - $(target).menu('resize', menu[0]); - if (menu.hasClass('menu-top')){ - var opts = $.data(target, 'menu').options; - $.extend(opts, param); - left = opts.left; - top = opts.top; - if (opts.alignTo){ - var at = $(opts.alignTo); - left = at.offset().left; - top = at.offset().top + at._outerHeight(); - if (opts.align == 'right'){ - left += at.outerWidth() - menu.outerWidth(); - } - } - if (left + menu.outerWidth() > $(window)._outerWidth() + $(document)._scrollLeft()){ - left = $(window)._outerWidth() + $(document).scrollLeft() - menu.outerWidth() - 5; - } - if (left < 0){left = 0;} - top = _fixTop(top, opts.alignTo); - } else { - var parent = param.parent; // the parent menu item - left = parent.offset().left + parent.outerWidth() - 2; - if (left + menu.outerWidth() + 5 > $(window)._outerWidth() + $(document).scrollLeft()){ - left = parent.offset().left - menu.outerWidth() + 2; - } - top = _fixTop(parent.offset().top - 3); - } - - function _fixTop(top, alignTo){ - if (top + menu.outerHeight() > $(window)._outerHeight() + $(document).scrollTop()){ - if (alignTo){ - top = $(alignTo).offset().top - menu._outerHeight(); - } else { - top = $(window)._outerHeight() + $(document).scrollTop() - menu.outerHeight(); - } - } - if (top < 0){top = 0;} - return top; - } - - menu.css({left:left,top:top}); - menu.show(0, function(){ - if (!menu[0].shadow){ - menu[0].shadow = $('').insertAfter(menu); - } - menu[0].shadow.css({ - display:(menu.hasClass('menu-inline')?'none':'block'), - zIndex:$.fn.menu.defaults.zIndex++, - left:menu.css('left'), - top:menu.css('top'), - width:menu.outerWidth(), - height:menu.outerHeight() - }); - menu.css('z-index', $.fn.menu.defaults.zIndex++); - if (menu.hasClass('menu-top')){ - $.data(menu[0], 'menu').options.onShow.call(menu[0]); - } - }); - } - - function hideMenu(menu){ - if (menu && menu.length){ - hideit(menu); - menu.find('div.menu-item').each(function(){ - if (this.submenu){ - hideMenu(this.submenu); - } - $(this).removeClass('menu-active'); - }); - } - - function hideit(m){ - m.stop(true,true); - if (m[0].shadow){ - m[0].shadow.hide(); - } - m.hide(); - } - } - - function findItem(target, text){ - var result = null; - var tmp = $('
                                                                  '); - function find(menu){ - menu.children('div.menu-item').each(function(){ - var item = $(target).menu('getItem', this); - var s = tmp.empty().html(item.text).text(); - if (text == $.trim(s)) { - result = item; - } else if (this.submenu && !result){ - find(this.submenu); - } - }); - } - find($(target)); - tmp.remove(); - return result; - } - - function setDisabled(target, itemEl, disabled){ - var t = $(itemEl); - if (!t.hasClass('menu-item')){return} - - if (disabled){ - t.addClass('menu-item-disabled'); - if (itemEl.onclick){ - itemEl.onclick1 = itemEl.onclick; - itemEl.onclick = null; - } - } else { - t.removeClass('menu-item-disabled'); - if (itemEl.onclick1){ - itemEl.onclick = itemEl.onclick1; - itemEl.onclick1 = null; - } - } - } - - function appendItem(target, param){ - var opts = $.data(target, 'menu').options; - var menu = $(target); - if (param.parent){ - if (!param.parent.submenu){ - var submenu = $('').appendTo('body'); - submenu.hide(); - param.parent.submenu = submenu; - $('').appendTo(param.parent); - } - menu = param.parent.submenu; - } - if (param.separator){ - var item = $('').appendTo(menu); - } else { - var item = $('').appendTo(menu); - $('').html(param.text).appendTo(item); - } - if (param.iconCls) $('').addClass(param.iconCls).appendTo(item); - if (param.id) item.attr('id', param.id); - if (param.name){item[0].itemName = param.name} - if (param.href){item[0].itemHref = param.href} - if (param.onclick){ - if (typeof param.onclick == 'string'){ - item.attr('onclick', param.onclick); - } else { - item[0].onclick = eval(param.onclick); - } - } - if (param.handler){item[0].onclick = eval(param.handler)} - if (param.disabled){setDisabled(target, item[0], true)} - - bindMenuItemEvent(target, item); - bindMenuEvent(target, menu); - setMenuSize(target, menu); - } - - function removeItem(target, itemEl){ - function removeit(el){ - if (el.submenu){ - el.submenu.children('div.menu-item').each(function(){ - removeit(this); - }); - var shadow = el.submenu[0].shadow; - if (shadow) shadow.remove(); - el.submenu.remove(); - } - $(el).remove(); - } - var menu = $(itemEl).parent(); - removeit(itemEl); - setMenuSize(target, menu); - } - - function setVisible(target, itemEl, visible){ - var menu = $(itemEl).parent(); - if (visible){ - $(itemEl).show(); - } else { - $(itemEl).hide(); - } - setMenuSize(target, menu); - } - - function destroyMenu(target){ - $(target).children('div.menu-item').each(function(){ - removeItem(target, this); - }); - if (target.shadow) target.shadow.remove(); - $(target).remove(); - } - - $.fn.menu = function(options, param){ - if (typeof options == 'string'){ - return $.fn.menu.methods[options](this, param); - } - - options = options || {}; - return this.each(function(){ - var state = $.data(this, 'menu'); - if (state){ - $.extend(state.options, options); - } else { - state = $.data(this, 'menu', { - options: $.extend({}, $.fn.menu.defaults, $.fn.menu.parseOptions(this), options) - }); - init(this); - } - $(this).css({ - left: state.options.left, - top: state.options.top - }); - }); - }; - - $.fn.menu.methods = { - options: function(jq){ - return $.data(jq[0], 'menu').options; - }, - show: function(jq, pos){ - return jq.each(function(){ - showMenu(this, pos); - }); - }, - hide: function(jq){ - return jq.each(function(){ - hideAll(this); - }); - }, - destroy: function(jq){ - return jq.each(function(){ - destroyMenu(this); - }); - }, - /** - * set the menu item text - * param: { - * target: DOM object, indicate the menu item - * text: string, the new text - * } - */ - setText: function(jq, param){ - return jq.each(function(){ - $(param.target).children('div.menu-text').html(param.text); - }); - }, - /** - * set the menu icon class - * param: { - * target: DOM object, indicate the menu item - * iconCls: the menu item icon class - * } - */ - setIcon: function(jq, param){ - return jq.each(function(){ - $(param.target).children('div.menu-icon').remove(); - if (param.iconCls){ - $('').addClass(param.iconCls).appendTo(param.target); - } - }); - }, - /** - * get the menu item data that contains the following property: - * { - * target: DOM object, the menu item - * id: the menu id - * text: the menu item text - * iconCls: the icon class - * href: a remote address to redirect to - * onclick: a function to be called when the item is clicked - * } - */ - getItem: function(jq, itemEl){ - var t = $(itemEl); - var item = { - target: itemEl, - id: t.attr('id'), - text: $.trim(t.children('div.menu-text').html()), - disabled: t.hasClass('menu-item-disabled'), -// href: t.attr('href'), -// name: t.attr('name'), - name: itemEl.itemName, - href: itemEl.itemHref, - onclick: itemEl.onclick - } - var icon = t.children('div.menu-icon'); - if (icon.length){ - var cc = []; - var aa = icon.attr('class').split(' '); - for(var i=0; idiv.menu-top:visible').not('.menu-inline').menu('hide'); + hideMenu($('body>div.menu:visible').not('.menu-inline')); + }); + }); + + /** + * initialize the target menu, the function can be invoked only once + */ + function init(target){ + var opts = $.data(target, 'menu').options; + $(target).addClass('menu-top'); // the top menu + opts.inline ? $(target).addClass('menu-inline') : $(target).appendTo('body'); + $(target).bind('_resize', function(e, force){ + if ($(this).hasClass('easyui-fluid') || force){ + $(target).menu('resize', target); + } + return false; + }); + + var menus = splitMenu($(target)); + for(var i=0; i').html(text)); + if (itemOpts.iconCls){ + $('').addClass(itemOpts.iconCls).appendTo(item); + } + if (itemOpts.disabled){ + setDisabled(target, item[0], true); + } + if (item[0].submenu){ + $('').appendTo(item); // has sub menu + } + + bindMenuItemEvent(target, item); + } + }); + $('').prependTo(menu); + } + setMenuSize(target, menu); + if (!menu.hasClass('menu-inline')){ + menu.hide(); + } + + bindMenuEvent(target, menu); + } + } + + function setMenuSize(target, menu){ + var opts = $.data(target, 'menu').options; + var style = menu.attr('style') || ''; + menu.css({ + display: 'block', + left:-10000, + height: 'auto', + overflow: 'hidden' + }); + menu.find('.menu-item').each(function(){ + $(this)._outerHeight(opts.itemHeight); + $(this).find('.menu-text').css({ + height: (opts.itemHeight-2)+'px', + lineHeight: (opts.itemHeight-2)+'px' + }); + }); + menu.removeClass('menu-noline').addClass(opts.noline?'menu-noline':''); + + var width = menu[0].originalWidth || 'auto'; + if (isNaN(parseInt(width))){ + width = 0; + menu.find('div.menu-text').each(function(){ + if (width < $(this)._outerWidth()){ + width = $(this)._outerWidth(); + } + }); + width += 40; + } + + var autoHeight = menu.outerHeight(); + var height = menu[0].originalHeight || 'auto'; + if (isNaN(parseInt(height))){ + height = autoHeight; + + if (menu.hasClass('menu-top') && opts.alignTo){ + var at = $(opts.alignTo); + var h1 = at.offset().top - $(document).scrollTop(); + var h2 = $(window)._outerHeight() + $(document).scrollTop() - at.offset().top - at._outerHeight(); + height = Math.min(height, Math.max(h1, h2)); + } else if (height > $(window)._outerHeight()){ + height = $(window).height(); + } + } + + menu.attr('style', style); // restore the original style + menu._size({ + fit: (menu[0]==target?opts.fit:false), + width: width, + minWidth: opts.minWidth, + height: height + }); + menu.css('overflow', menu.outerHeight() < autoHeight ? 'auto' : 'hidden'); + menu.children('div.menu-line')._outerHeight(autoHeight-2); + } + + /** + * bind menu event + */ + function bindMenuEvent(target, menu){ + if (menu.hasClass('menu-inline')){return} + var state = $.data(target, 'menu'); + menu.unbind('.menu').bind('mouseenter.menu', function(){ + if (state.timer){ + clearTimeout(state.timer); + state.timer = null; + } + }).bind('mouseleave.menu', function(){ + if (state.options.hideOnUnhover){ + state.timer = setTimeout(function(){ + hideAll(target, $(target).hasClass('menu-inline')); + }, state.options.duration); + } + }); + } + + /** + * bind menu item event + */ + function bindMenuItemEvent(target, item){ + if (!item.hasClass('menu-item')){return} + item.unbind('.menu'); + item.bind('click.menu', function(){ + if ($(this).hasClass('menu-item-disabled')){ + return; + } + // only the sub menu clicked can hide all menus + if (!this.submenu){ + hideAll(target, $(target).hasClass('menu-inline')); + var href = this.itemHref; + if (href){ + location.href = href; + } + } + $(this).trigger('mouseenter'); + var item = $(target).menu('getItem', this); + $.data(target, 'menu').options.onClick.call(target, item); + }).bind('mouseenter.menu', function(e){ + // hide other menu + item.siblings().each(function(){ + if (this.submenu){ + hideMenu(this.submenu); + } + $(this).removeClass('menu-active'); + }); + // show this menu + item.addClass('menu-active'); + + if ($(this).hasClass('menu-item-disabled')){ + item.addClass('menu-active-disabled'); + return; + } + + var submenu = item[0].submenu; + if (submenu){ + $(target).menu('show', { + menu: submenu, + parent: item + }); + } + }).bind('mouseleave.menu', function(e){ + item.removeClass('menu-active menu-active-disabled'); + var submenu = item[0].submenu; + if (submenu){ + if (e.pageX>=parseInt(submenu.css('left'))){ + item.addClass('menu-active'); + } else { + hideMenu(submenu); + } + + } else { + item.removeClass('menu-active'); + } + }); + } + + /** + * hide top menu and it's all sub menus + */ + function hideAll(target, inline){ + var state = $.data(target, 'menu'); + if (state){ + if ($(target).is(':visible')){ + hideMenu($(target)); + if (inline){ + $(target).show(); + } else { + state.options.onHide.call(target); + } + } + } + return false; + } + + /** + * show the menu, the 'param' object has one or more properties: + * left: the left position to display + * top: the top position to display + * menu: the menu to display, if not defined, the 'target menu' is used + * parent: the parent menu item to align to + * alignTo: the element object to align to + */ + function showMenu(target, param){ + var left,top; + param = param || {}; + var menu = $(param.menu || target); + $(target).menu('resize', menu[0]); + if (menu.hasClass('menu-top')){ + var opts = $.data(target, 'menu').options; + $.extend(opts, param); + left = opts.left; + top = opts.top; + if (opts.alignTo){ + var at = $(opts.alignTo); + left = at.offset().left; + top = at.offset().top + at._outerHeight(); + if (opts.align == 'right'){ + left += at.outerWidth() - menu.outerWidth(); + } + } + if (left + menu.outerWidth() > $(window)._outerWidth() + $(document)._scrollLeft()){ + left = $(window)._outerWidth() + $(document).scrollLeft() - menu.outerWidth() - 5; + } + if (left < 0){left = 0;} + top = _fixTop(top, opts.alignTo); + } else { + var parent = param.parent; // the parent menu item + left = parent.offset().left + parent.outerWidth() - 2; + if (left + menu.outerWidth() + 5 > $(window)._outerWidth() + $(document).scrollLeft()){ + left = parent.offset().left - menu.outerWidth() + 2; + } + top = _fixTop(parent.offset().top - 3); + } + + function _fixTop(top, alignTo){ + if (top + menu.outerHeight() > $(window)._outerHeight() + $(document).scrollTop()){ + if (alignTo){ + top = $(alignTo).offset().top - menu._outerHeight(); + } else { + top = $(window)._outerHeight() + $(document).scrollTop() - menu.outerHeight(); + } + } + if (top < 0){top = 0;} + return top; + } + + menu.css({left:left,top:top}); + menu.show(0, function(){ + if (!menu[0].shadow){ + menu[0].shadow = $('').insertAfter(menu); + } + menu[0].shadow.css({ + display:(menu.hasClass('menu-inline')?'none':'block'), + zIndex:$.fn.menu.defaults.zIndex++, + left:menu.css('left'), + top:menu.css('top'), + width:menu.outerWidth(), + height:menu.outerHeight() + }); + menu.css('z-index', $.fn.menu.defaults.zIndex++); + if (menu.hasClass('menu-top')){ + $.data(menu[0], 'menu').options.onShow.call(menu[0]); + } + }); + } + + function hideMenu(menu){ + if (menu && menu.length){ + hideit(menu); + menu.find('div.menu-item').each(function(){ + if (this.submenu){ + hideMenu(this.submenu); + } + $(this).removeClass('menu-active'); + }); + } + + function hideit(m){ + m.stop(true,true); + if (m[0].shadow){ + m[0].shadow.hide(); + } + m.hide(); + } + } + + function findItem(target, text){ + var result = null; + var tmp = $('
                                                                  '); + function find(menu){ + menu.children('div.menu-item').each(function(){ + var item = $(target).menu('getItem', this); + var s = tmp.empty().html(item.text).text(); + if (text == $.trim(s)) { + result = item; + } else if (this.submenu && !result){ + find(this.submenu); + } + }); + } + find($(target)); + tmp.remove(); + return result; + } + + function setDisabled(target, itemEl, disabled){ + var t = $(itemEl); + if (!t.hasClass('menu-item')){return} + + if (disabled){ + t.addClass('menu-item-disabled'); + if (itemEl.onclick){ + itemEl.onclick1 = itemEl.onclick; + itemEl.onclick = null; + } + } else { + t.removeClass('menu-item-disabled'); + if (itemEl.onclick1){ + itemEl.onclick = itemEl.onclick1; + itemEl.onclick1 = null; + } + } + } + + function appendItem(target, param){ + var opts = $.data(target, 'menu').options; + var menu = $(target); + if (param.parent){ + if (!param.parent.submenu){ + var submenu = $('').appendTo('body'); + submenu.hide(); + param.parent.submenu = submenu; + $('').appendTo(param.parent); + } + menu = param.parent.submenu; + } + if (param.separator){ + var item = $('').appendTo(menu); + } else { + var item = $('').appendTo(menu); + $('').html(param.text).appendTo(item); + } + if (param.iconCls) $('').addClass(param.iconCls).appendTo(item); + if (param.id) item.attr('id', param.id); + if (param.name){item[0].itemName = param.name} + if (param.href){item[0].itemHref = param.href} + if (param.onclick){ + if (typeof param.onclick == 'string'){ + item.attr('onclick', param.onclick); + } else { + item[0].onclick = eval(param.onclick); + } + } + if (param.handler){item[0].onclick = eval(param.handler)} + if (param.disabled){setDisabled(target, item[0], true)} + + bindMenuItemEvent(target, item); + bindMenuEvent(target, menu); + setMenuSize(target, menu); + } + + function removeItem(target, itemEl){ + function removeit(el){ + if (el.submenu){ + el.submenu.children('div.menu-item').each(function(){ + removeit(this); + }); + var shadow = el.submenu[0].shadow; + if (shadow) shadow.remove(); + el.submenu.remove(); + } + $(el).remove(); + } + var menu = $(itemEl).parent(); + removeit(itemEl); + setMenuSize(target, menu); + } + + function setVisible(target, itemEl, visible){ + var menu = $(itemEl).parent(); + if (visible){ + $(itemEl).show(); + } else { + $(itemEl).hide(); + } + setMenuSize(target, menu); + } + + function destroyMenu(target){ + $(target).children('div.menu-item').each(function(){ + removeItem(target, this); + }); + if (target.shadow) target.shadow.remove(); + $(target).remove(); + } + + $.fn.menu = function(options, param){ + if (typeof options == 'string'){ + return $.fn.menu.methods[options](this, param); + } + + options = options || {}; + return this.each(function(){ + var state = $.data(this, 'menu'); + if (state){ + $.extend(state.options, options); + } else { + state = $.data(this, 'menu', { + options: $.extend({}, $.fn.menu.defaults, $.fn.menu.parseOptions(this), options) + }); + init(this); + } + $(this).css({ + left: state.options.left, + top: state.options.top + }); + }); + }; + + $.fn.menu.methods = { + options: function(jq){ + return $.data(jq[0], 'menu').options; + }, + show: function(jq, pos){ + return jq.each(function(){ + showMenu(this, pos); + }); + }, + hide: function(jq){ + return jq.each(function(){ + hideAll(this); + }); + }, + destroy: function(jq){ + return jq.each(function(){ + destroyMenu(this); + }); + }, + /** + * set the menu item text + * param: { + * target: DOM object, indicate the menu item + * text: string, the new text + * } + */ + setText: function(jq, param){ + return jq.each(function(){ + $(param.target).children('div.menu-text').html(param.text); + }); + }, + /** + * set the menu icon class + * param: { + * target: DOM object, indicate the menu item + * iconCls: the menu item icon class + * } + */ + setIcon: function(jq, param){ + return jq.each(function(){ + $(param.target).children('div.menu-icon').remove(); + if (param.iconCls){ + $('').addClass(param.iconCls).appendTo(param.target); + } + }); + }, + /** + * get the menu item data that contains the following property: + * { + * target: DOM object, the menu item + * id: the menu id + * text: the menu item text + * iconCls: the icon class + * href: a remote address to redirect to + * onclick: a function to be called when the item is clicked + * } + */ + getItem: function(jq, itemEl){ + var t = $(itemEl); + var item = { + target: itemEl, + id: t.attr('id'), + text: $.trim(t.children('div.menu-text').html()), + disabled: t.hasClass('menu-item-disabled'), +// href: t.attr('href'), +// name: t.attr('name'), + name: itemEl.itemName, + href: itemEl.itemHref, + onclick: itemEl.onclick + } + var icon = t.children('div.menu-icon'); + if (icon.length){ + var cc = []; + var aa = icon.attr('class').split(' '); + for(var i=0; i= 0){ - v = Math.floor((parent.width()-delta) * v / 100.0); - } else { - v = Math.floor((parent.height()-delta) * v / 100.0); - } - } else { - v = parseInt(v) || undefined; - } - return v; - }, - - /** - * parse options, including standard 'data-options' attribute. - * - * calling examples: - * $.parser.parseOptions(target); - * $.parser.parseOptions(target, ['id','title','width',{fit:'boolean',border:'boolean'},{min:'number'}]); - */ - parseOptions: function(target, properties){ - var t = $(target); - var options = {}; - - var s = $.trim(t.attr('data-options')); - if (s){ - if (s.substring(0, 1) != '{'){ - s = '{' + s + '}'; - } - options = (new Function('return ' + s))(); - } - $.map(['width','height','left','top','minWidth','maxWidth','minHeight','maxHeight'], function(p){ - var pv = $.trim(target.style[p] || ''); - if (pv){ - if (pv.indexOf('%') == -1){ - pv = parseInt(pv) || undefined; - } - options[p] = pv; - } - }); - - if (properties){ - var opts = {}; - for(var i=0; i').appendTo('body'); - $._boxModel = d.outerWidth()!=100; - d.remove(); - - if (!window.easyloader && $.parser.auto){ - $.parser.parse(); - } - }); - - /** - * extend plugin to set box model width - */ - $.fn._outerWidth = function(width){ - if (width == undefined){ - if (this[0] == window){ - return this.width() || document.body.clientWidth; - } - return this.outerWidth()||0; - } - return this._size('width', width); - }; - - /** - * extend plugin to set box model height - */ - $.fn._outerHeight = function(height){ - if (height == undefined){ - if (this[0] == window){ - return this.height() || document.body.clientHeight; - } - return this.outerHeight()||0; - } - return this._size('height', height); - }; - - $.fn._scrollLeft = function(left){ - if (left == undefined){ - return this.scrollLeft(); - } else { - return this.each(function(){$(this).scrollLeft(left)}); - } - }; - - $.fn._propAttr = $.fn.prop || $.fn.attr; - - $.fn._size = function(options, parent){ - if (typeof options == 'string'){ - if (options == 'clear'){ - return this.each(function(){ - $(this).css({width:'',minWidth:'',maxWidth:'',height:'',minHeight:'',maxHeight:''}); - }); - } else if (options == 'fit'){ - return this.each(function(){ - _fit(this, this.tagName=='BODY' ? $('body') : $(this).parent(), true); - }); - } else if (options == 'unfit'){ - return this.each(function(){ - _fit(this, $(this).parent(), false); - }); - } else { - if (parent == undefined){ - return _css(this[0], options); - } else { - return this.each(function(){ - _css(this, options, parent); - }); - } - } - } else { - return this.each(function(){ - parent = parent || $(this).parent(); - $.extend(options, _fit(this, parent, options.fit)||{}); - var r1 = _setSize(this, 'width', parent, options); - var r2 = _setSize(this, 'height', parent, options); - if (r1 || r2){ - $(this).addClass('easyui-fluid'); - } else { - $(this).removeClass('easyui-fluid'); - } - }); - } - - function _fit(target, parent, fit){ - if (!parent.length){return false;} - var t = $(target)[0]; - var p = parent[0]; - var fcount = p.fcount || 0; - if (fit){ - if (!t.fitted){ - t.fitted = true; - p.fcount = fcount + 1; - $(p).addClass('panel-noscroll'); - if (p.tagName == 'BODY'){ - $('html').addClass('panel-fit'); - } - } - return { - width: ($(p).width()||1), - height: ($(p).height()||1) - }; - } else { - if (t.fitted){ - t.fitted = false; - p.fcount = fcount - 1; - if (p.fcount == 0){ - $(p).removeClass('panel-noscroll'); - if (p.tagName == 'BODY'){ - $('html').removeClass('panel-fit'); - } - } - } - return false; - } - } - function _setSize(target, property, parent, options){ - var t = $(target); - var p = property; - var p1 = p.substr(0,1).toUpperCase() + p.substr(1); - var min = $.parser.parseValue('min'+p1, options['min'+p1], parent);// || 0; - var max = $.parser.parseValue('max'+p1, options['max'+p1], parent);// || 99999; - var val = $.parser.parseValue(p, options[p], parent); - var fluid = (String(options[p]||'').indexOf('%') >= 0 ? true : false); - - if (!isNaN(val)){ - var v = Math.min(Math.max(val, min||0), max||99999); - if (!fluid){ - options[p] = v; - } - t._size('min'+p1, ''); - t._size('max'+p1, ''); - t._size(p, v); - } else { - t._size(p, ''); - t._size('min'+p1, min); - t._size('max'+p1, max); - } - return fluid || options.fit; - } - function _css(target, property, value){ - var t = $(target); - if (value == undefined){ - value = parseInt(target.style[property]); - if (isNaN(value)){return undefined;} - if ($._boxModel){ - value += getDeltaSize(); - } - return value; - } else if (value === ''){ - t.css(property, ''); - } else { - if ($._boxModel){ - value -= getDeltaSize(); - if (value < 0){value = 0;} - } - t.css(property, value+'px'); - } - function getDeltaSize(){ - if (property.toLowerCase().indexOf('width') >= 0){ - return t.outerWidth() - t.width(); - } else { - return t.outerHeight() - t.height(); - } - } - } - }; - -})(jQuery); - -/** - * support for mobile devices - */ -(function($){ - var longTouchTimer = null; - var dblTouchTimer = null; - var isDblClick = false; - - function onTouchStart(e){ - if (e.touches.length != 1){return} - if (!isDblClick){ - isDblClick = true; - dblClickTimer = setTimeout(function(){ - isDblClick = false; - }, 500); - } else { - clearTimeout(dblClickTimer); - isDblClick = false; - fire(e, 'dblclick'); -// e.preventDefault(); - } - longTouchTimer = setTimeout(function(){ - fire(e, 'contextmenu', 3); - }, 1000); - fire(e, 'mousedown'); - if ($.fn.draggable.isDragging || $.fn.resizable.isResizing){ - e.preventDefault(); - } - } - function onTouchMove(e){ - if (e.touches.length != 1){return} - if (longTouchTimer){ - clearTimeout(longTouchTimer); - } - fire(e, 'mousemove'); - if ($.fn.draggable.isDragging || $.fn.resizable.isResizing){ - e.preventDefault(); - } - } - function onTouchEnd(e){ -// if (e.touches.length > 0){return} - if (longTouchTimer){ - clearTimeout(longTouchTimer); - } - fire(e, 'mouseup'); - if ($.fn.draggable.isDragging || $.fn.resizable.isResizing){ - e.preventDefault(); - } - } - - function fire(e, name, which){ - var event = new $.Event(name); - event.pageX = e.changedTouches[0].pageX; - event.pageY = e.changedTouches[0].pageY; - event.which = which || 1; - $(e.target).trigger(event); - } - - if (document.addEventListener){ - document.addEventListener("touchstart", onTouchStart, true); - document.addEventListener("touchmove", onTouchMove, true); - document.addEventListener("touchend", onTouchEnd, true); - } -})(jQuery); - +/** + * jQuery EasyUI 1.4.2 + * + * Copyright (c) 2009-2015 www.jeasyui.com. All rights reserved. + * + * Licensed under the GPL license: http://www.gnu.org/licenses/gpl.txt + * To use it on other terms please contact us at info@jeasyui.com + * + */ +/** + * parser - jQuery EasyUI + * + */ + +(function($){ + $.parser = { + auto: true, + onComplete: function(context){}, + plugins:['draggable','droppable','resizable','pagination','tooltip', + 'linkbutton','menu','menubutton','splitbutton','progressbar', + 'tree','textbox','filebox','combo','combobox','combotree','combogrid','numberbox','validatebox','searchbox', + 'spinner','numberspinner','timespinner','datetimespinner','calendar','datebox','datetimebox','slider', + 'layout','panel','datagrid','propertygrid','treegrid','datalist','tabs','accordion','window','dialog','form' + ], + parse: function(context){ + var aa = []; + for(var i=0; i<$.parser.plugins.length; i++){ + var name = $.parser.plugins[i]; + var r = $('.easyui-' + name, context); + if (r.length){ + if (r[name]){ + r[name](); + } else { + aa.push({name:name,jq:r}); + } + } + } + if (aa.length && window.easyloader){ + var names = []; + for(var i=0; i= 0){ + v = Math.floor((parent.width()-delta) * v / 100.0); + } else { + v = Math.floor((parent.height()-delta) * v / 100.0); + } + } else { + v = parseInt(v) || undefined; + } + return v; + }, + + /** + * parse options, including standard 'data-options' attribute. + * + * calling examples: + * $.parser.parseOptions(target); + * $.parser.parseOptions(target, ['id','title','width',{fit:'boolean',border:'boolean'},{min:'number'}]); + */ + parseOptions: function(target, properties){ + var t = $(target); + var options = {}; + + var s = $.trim(t.attr('data-options')); + if (s){ + if (s.substring(0, 1) != '{'){ + s = '{' + s + '}'; + } + options = (new Function('return ' + s))(); + } + $.map(['width','height','left','top','minWidth','maxWidth','minHeight','maxHeight'], function(p){ + var pv = $.trim(target.style[p] || ''); + if (pv){ + if (pv.indexOf('%') == -1){ + pv = parseInt(pv) || undefined; + } + options[p] = pv; + } + }); + + if (properties){ + var opts = {}; + for(var i=0; i').appendTo('body'); + $._boxModel = d.outerWidth()!=100; + d.remove(); + + if (!window.easyloader && $.parser.auto){ + $.parser.parse(); + } + }); + + /** + * extend plugin to set box model width + */ + $.fn._outerWidth = function(width){ + if (width == undefined){ + if (this[0] == window){ + return this.width() || document.body.clientWidth; + } + return this.outerWidth()||0; + } + return this._size('width', width); + }; + + /** + * extend plugin to set box model height + */ + $.fn._outerHeight = function(height){ + if (height == undefined){ + if (this[0] == window){ + return this.height() || document.body.clientHeight; + } + return this.outerHeight()||0; + } + return this._size('height', height); + }; + + $.fn._scrollLeft = function(left){ + if (left == undefined){ + return this.scrollLeft(); + } else { + return this.each(function(){$(this).scrollLeft(left)}); + } + }; + + $.fn._propAttr = $.fn.prop || $.fn.attr; + + $.fn._size = function(options, parent){ + if (typeof options == 'string'){ + if (options == 'clear'){ + return this.each(function(){ + $(this).css({width:'',minWidth:'',maxWidth:'',height:'',minHeight:'',maxHeight:''}); + }); + } else if (options == 'fit'){ + return this.each(function(){ + _fit(this, this.tagName=='BODY' ? $('body') : $(this).parent(), true); + }); + } else if (options == 'unfit'){ + return this.each(function(){ + _fit(this, $(this).parent(), false); + }); + } else { + if (parent == undefined){ + return _css(this[0], options); + } else { + return this.each(function(){ + _css(this, options, parent); + }); + } + } + } else { + return this.each(function(){ + parent = parent || $(this).parent(); + $.extend(options, _fit(this, parent, options.fit)||{}); + var r1 = _setSize(this, 'width', parent, options); + var r2 = _setSize(this, 'height', parent, options); + if (r1 || r2){ + $(this).addClass('easyui-fluid'); + } else { + $(this).removeClass('easyui-fluid'); + } + }); + } + + function _fit(target, parent, fit){ + if (!parent.length){return false;} + var t = $(target)[0]; + var p = parent[0]; + var fcount = p.fcount || 0; + if (fit){ + if (!t.fitted){ + t.fitted = true; + p.fcount = fcount + 1; + $(p).addClass('panel-noscroll'); + if (p.tagName == 'BODY'){ + $('html').addClass('panel-fit'); + } + } + return { + width: ($(p).width()||1), + height: ($(p).height()||1) + }; + } else { + if (t.fitted){ + t.fitted = false; + p.fcount = fcount - 1; + if (p.fcount == 0){ + $(p).removeClass('panel-noscroll'); + if (p.tagName == 'BODY'){ + $('html').removeClass('panel-fit'); + } + } + } + return false; + } + } + function _setSize(target, property, parent, options){ + var t = $(target); + var p = property; + var p1 = p.substr(0,1).toUpperCase() + p.substr(1); + var min = $.parser.parseValue('min'+p1, options['min'+p1], parent);// || 0; + var max = $.parser.parseValue('max'+p1, options['max'+p1], parent);// || 99999; + var val = $.parser.parseValue(p, options[p], parent); + var fluid = (String(options[p]||'').indexOf('%') >= 0 ? true : false); + + if (!isNaN(val)){ + var v = Math.min(Math.max(val, min||0), max||99999); + if (!fluid){ + options[p] = v; + } + t._size('min'+p1, ''); + t._size('max'+p1, ''); + t._size(p, v); + } else { + t._size(p, ''); + t._size('min'+p1, min); + t._size('max'+p1, max); + } + return fluid || options.fit; + } + function _css(target, property, value){ + var t = $(target); + if (value == undefined){ + value = parseInt(target.style[property]); + if (isNaN(value)){return undefined;} + if ($._boxModel){ + value += getDeltaSize(); + } + return value; + } else if (value === ''){ + t.css(property, ''); + } else { + if ($._boxModel){ + value -= getDeltaSize(); + if (value < 0){value = 0;} + } + t.css(property, value+'px'); + } + function getDeltaSize(){ + if (property.toLowerCase().indexOf('width') >= 0){ + return t.outerWidth() - t.width(); + } else { + return t.outerHeight() - t.height(); + } + } + } + }; + +})(jQuery); + +/** + * support for mobile devices + */ +(function($){ + var longTouchTimer = null; + var dblTouchTimer = null; + var isDblClick = false; + + function onTouchStart(e){ + if (e.touches.length != 1){return} + if (!isDblClick){ + isDblClick = true; + dblClickTimer = setTimeout(function(){ + isDblClick = false; + }, 500); + } else { + clearTimeout(dblClickTimer); + isDblClick = false; + fire(e, 'dblclick'); +// e.preventDefault(); + } + longTouchTimer = setTimeout(function(){ + fire(e, 'contextmenu', 3); + }, 1000); + fire(e, 'mousedown'); + if ($.fn.draggable.isDragging || $.fn.resizable.isResizing){ + e.preventDefault(); + } + } + function onTouchMove(e){ + if (e.touches.length != 1){return} + if (longTouchTimer){ + clearTimeout(longTouchTimer); + } + fire(e, 'mousemove'); + if ($.fn.draggable.isDragging || $.fn.resizable.isResizing){ + e.preventDefault(); + } + } + function onTouchEnd(e){ +// if (e.touches.length > 0){return} + if (longTouchTimer){ + clearTimeout(longTouchTimer); + } + fire(e, 'mouseup'); + if ($.fn.draggable.isDragging || $.fn.resizable.isResizing){ + e.preventDefault(); + } + } + + function fire(e, name, which){ + var event = new $.Event(name); + event.pageX = e.changedTouches[0].pageX; + event.pageY = e.changedTouches[0].pageY; + event.which = which || 1; + $(e.target).trigger(event); + } + + if (document.addEventListener){ + document.addEventListener("touchstart", onTouchStart, true); + document.addEventListener("touchmove", onTouchMove, true); + document.addEventListener("touchend", onTouchEnd, true); + } +})(jQuery); + diff --git a/src/main/webapp/js/easyui/src/jquery.progressbar.js b/src/main/webapp/js/easyui/src/jquery.progressbar.js index 6a3a080..65cb9bd 100644 --- a/src/main/webapp/js/easyui/src/jquery.progressbar.js +++ b/src/main/webapp/js/easyui/src/jquery.progressbar.js @@ -1,107 +1,107 @@ -/** - * jQuery EasyUI 1.4.2 - * - * Copyright (c) 2009-2015 www.jeasyui.com. All rights reserved. - * - * Licensed under the GPL license: http://www.gnu.org/licenses/gpl.txt - * To use it on other terms please contact us at info@jeasyui.com - * - */ -/** - * progressbar - jQuery EasyUI - * - * Dependencies: - * none - * - */ -(function($){ - function init(target){ - $(target).addClass('progressbar'); - $(target).html('
                                                                  '); - $(target).bind('_resize', function(e,force){ - if ($(this).hasClass('easyui-fluid') || force){ - setSize(target); - } - return false; - }); - return $(target); - } - - function setSize(target,width){ - var opts = $.data(target, 'progressbar').options; - var bar = $.data(target, 'progressbar').bar; - if (width) opts.width = width; - bar._size(opts); - - bar.find('div.progressbar-text').css('width', bar.width()); - bar.find('div.progressbar-text,div.progressbar-value').css({ - height: bar.height()+'px', - lineHeight: bar.height()+'px' - }); - } - - $.fn.progressbar = function(options, param){ - if (typeof options == 'string'){ - var method = $.fn.progressbar.methods[options]; - if (method){ - return method(this, param); - } - } - - options = options || {}; - return this.each(function(){ - var state = $.data(this, 'progressbar'); - if (state){ - $.extend(state.options, options); - } else { - state = $.data(this, 'progressbar', { - options: $.extend({}, $.fn.progressbar.defaults, $.fn.progressbar.parseOptions(this), options), - bar: init(this) - }); - } - $(this).progressbar('setValue', state.options.value); - setSize(this); - }); - }; - - $.fn.progressbar.methods = { - options: function(jq){ - return $.data(jq[0], 'progressbar').options; - }, - resize: function(jq, width){ - return jq.each(function(){ - setSize(this, width); - }); - }, - getValue: function(jq){ - return $.data(jq[0], 'progressbar').options.value; - }, - setValue: function(jq, value){ - if (value < 0) value = 0; - if (value > 100) value = 100; - return jq.each(function(){ - var opts = $.data(this, 'progressbar').options; - var text = opts.text.replace(/{value}/, value); - var oldValue = opts.value; - opts.value = value; - $(this).find('div.progressbar-value').width(value+'%'); - $(this).find('div.progressbar-text').html(text); - if (oldValue != value){ - opts.onChange.call(this, value, oldValue); - } - }); - } - }; - - $.fn.progressbar.parseOptions = function(target){ - return $.extend({}, $.parser.parseOptions(target, ['width','height','text',{value:'number'}])); - }; - - $.fn.progressbar.defaults = { - width: 'auto', - height: 22, - value: 0, // percentage value - text: '{value}%', - onChange:function(newValue,oldValue){} - }; -})(jQuery); +/** + * jQuery EasyUI 1.4.2 + * + * Copyright (c) 2009-2015 www.jeasyui.com. All rights reserved. + * + * Licensed under the GPL license: http://www.gnu.org/licenses/gpl.txt + * To use it on other terms please contact us at info@jeasyui.com + * + */ +/** + * progressbar - jQuery EasyUI + * + * Dependencies: + * none + * + */ +(function($){ + function init(target){ + $(target).addClass('progressbar'); + $(target).html('
                                                                  '); + $(target).bind('_resize', function(e,force){ + if ($(this).hasClass('easyui-fluid') || force){ + setSize(target); + } + return false; + }); + return $(target); + } + + function setSize(target,width){ + var opts = $.data(target, 'progressbar').options; + var bar = $.data(target, 'progressbar').bar; + if (width) opts.width = width; + bar._size(opts); + + bar.find('div.progressbar-text').css('width', bar.width()); + bar.find('div.progressbar-text,div.progressbar-value').css({ + height: bar.height()+'px', + lineHeight: bar.height()+'px' + }); + } + + $.fn.progressbar = function(options, param){ + if (typeof options == 'string'){ + var method = $.fn.progressbar.methods[options]; + if (method){ + return method(this, param); + } + } + + options = options || {}; + return this.each(function(){ + var state = $.data(this, 'progressbar'); + if (state){ + $.extend(state.options, options); + } else { + state = $.data(this, 'progressbar', { + options: $.extend({}, $.fn.progressbar.defaults, $.fn.progressbar.parseOptions(this), options), + bar: init(this) + }); + } + $(this).progressbar('setValue', state.options.value); + setSize(this); + }); + }; + + $.fn.progressbar.methods = { + options: function(jq){ + return $.data(jq[0], 'progressbar').options; + }, + resize: function(jq, width){ + return jq.each(function(){ + setSize(this, width); + }); + }, + getValue: function(jq){ + return $.data(jq[0], 'progressbar').options.value; + }, + setValue: function(jq, value){ + if (value < 0) value = 0; + if (value > 100) value = 100; + return jq.each(function(){ + var opts = $.data(this, 'progressbar').options; + var text = opts.text.replace(/{value}/, value); + var oldValue = opts.value; + opts.value = value; + $(this).find('div.progressbar-value').width(value+'%'); + $(this).find('div.progressbar-text').html(text); + if (oldValue != value){ + opts.onChange.call(this, value, oldValue); + } + }); + } + }; + + $.fn.progressbar.parseOptions = function(target){ + return $.extend({}, $.parser.parseOptions(target, ['width','height','text',{value:'number'}])); + }; + + $.fn.progressbar.defaults = { + width: 'auto', + height: 22, + value: 0, // percentage value + text: '{value}%', + onChange:function(newValue,oldValue){} + }; +})(jQuery); diff --git a/src/main/webapp/js/easyui/src/jquery.propertygrid.js b/src/main/webapp/js/easyui/src/jquery.propertygrid.js index a9ae1ff..47c20d0 100644 --- a/src/main/webapp/js/easyui/src/jquery.propertygrid.js +++ b/src/main/webapp/js/easyui/src/jquery.propertygrid.js @@ -1,410 +1,410 @@ -/** - * jQuery EasyUI 1.4.2 - * - * Copyright (c) 2009-2015 www.jeasyui.com. All rights reserved. - * - * Licensed under the GPL license: http://www.gnu.org/licenses/gpl.txt - * To use it on other terms please contact us at info@jeasyui.com - * - */ -/** - * propertygrid - jQuery EasyUI - * - * Dependencies: - * datagrid - * - */ -(function($){ - var currTarget; - $(document).unbind('.propertygrid').bind('mousedown.propertygrid', function(e){ - var p = $(e.target).closest('div.datagrid-view,div.combo-panel'); - if (p.length){return;} - stopEditing(currTarget); - currTarget = undefined; - }); - - function buildGrid(target){ - var state = $.data(target, 'propertygrid'); - var opts = $.data(target, 'propertygrid').options; - $(target).datagrid($.extend({}, opts, { - cls:'propertygrid', - view:(opts.showGroup ? opts.groupView : opts.view), - onBeforeEdit:function(index, row){ - if (opts.onBeforeEdit.call(target, index, row) == false){return false;} - var dg = $(this); - var row = dg.datagrid('getRows')[index]; - var col = dg.datagrid('getColumnOption', 'value'); - col.editor = row.editor; - }, - onClickCell:function(index, field, value){ - if (currTarget != this){ - stopEditing(currTarget); - currTarget = this; - } - if (opts.editIndex != index){ - stopEditing(currTarget); - $(this).datagrid('beginEdit', index); - var ed = $(this).datagrid('getEditor', {index:index,field:field}); - if (!ed){ - ed = $(this).datagrid('getEditor', {index:index,field:'value'}); - } - if (ed){ - var t = $(ed.target); - var input = t.data('textbox') ? t.textbox('textbox') : t; - input.focus(); - opts.editIndex = index; - } - } - opts.onClickCell.call(target, index, field, value); - }, - loadFilter:function(data){ - stopEditing(this); - return opts.loadFilter.call(this, data); - } - })); - } - - function stopEditing(target){ - var t = $(target); - if (!t.length){return} - var opts = $.data(target, 'propertygrid').options; - opts.finder.getTr(target, null, 'editing').each(function(){ - var index = parseInt($(this).attr('datagrid-row-index')); - if (t.datagrid('validateRow', index)){ - t.datagrid('endEdit', index); - } else { - t.datagrid('cancelEdit', index); - } - }); - opts.editIndex = undefined; - } - - $.fn.propertygrid = function(options, param){ - if (typeof options == 'string'){ - var method = $.fn.propertygrid.methods[options]; - if (method){ - return method(this, param); - } else { - return this.datagrid(options, param); - } - } - - options = options || {}; - return this.each(function(){ - var state = $.data(this, 'propertygrid'); - if (state){ - $.extend(state.options, options); - } else { - var opts = $.extend({}, $.fn.propertygrid.defaults, $.fn.propertygrid.parseOptions(this), options); - opts.frozenColumns = $.extend(true, [], opts.frozenColumns); - opts.columns = $.extend(true, [], opts.columns); - $.data(this, 'propertygrid', { - options: opts - }); - } - buildGrid(this); - }); - } - - $.fn.propertygrid.methods = { - options: function(jq){ - return $.data(jq[0], 'propertygrid').options; - } - }; - - $.fn.propertygrid.parseOptions = function(target){ - return $.extend({}, $.fn.datagrid.parseOptions(target), $.parser.parseOptions(target,[{showGroup:'boolean'}])); - }; - - // the group view definition - var groupview = $.extend({}, $.fn.datagrid.defaults.view, { - render: function(target, container, frozen){ - var table = []; - var groups = this.groups; - for(var i=0; i'); - table.push(''); - table.push(''); - if ((frozen && (opts.rownumbers || opts.frozenColumns.length)) || - (!frozen && !(opts.rownumbers || opts.frozenColumns.length))){ - table.push(''); - } - table.push(''); - table.push(''); - table.push('
                                                                   '); - if (!frozen){ - table.push(''); - table.push(opts.groupFormatter.call(target, group.value, group.rows)); - table.push(''); - } - table.push('
                                                                  '); - table.push(''); - - table.push(''); - var index = group.startIndex; - for(var j=0; j'); - table.push(this.renderRow.call(this, target, fields, frozen, index, group.rows[j])); - table.push(''); - index++; - } - table.push('
                                                                  '); - return table.join(''); - }, - - bindEvents: function(target){ - var state = $.data(target, 'datagrid'); - var dc = state.dc; - var body = dc.body1.add(dc.body2); - var clickHandler = ($.data(body[0],'events')||$._data(body[0],'events')).click[0].handler; - body.unbind('click').bind('click', function(e){ - var tt = $(e.target); - var expander = tt.closest('span.datagrid-row-expander'); - if (expander.length){ - var gindex = expander.closest('div.datagrid-group').attr('group-index'); - if (expander.hasClass('datagrid-row-collapse')){ - $(target).datagrid('collapseGroup', gindex); - } else { - $(target).datagrid('expandGroup', gindex); - } - } else { - clickHandler(e); - } - e.stopPropagation(); - }); - }, - - onBeforeRender: function(target, rows){ - var state = $.data(target, 'datagrid'); - var opts = state.options; - - initCss(); - - var groups = []; - for(var i=0; i' + - '.datagrid-group{height:25px;overflow:hidden;font-weight:bold;border-bottom:1px solid #ccc;}' + - '' - ); - } - } - } - }); - - $.extend($.fn.datagrid.methods, { - expandGroup:function(jq, groupIndex){ - return jq.each(function(){ - var view = $.data(this, 'datagrid').dc.view; - var group = view.find(groupIndex!=undefined ? 'div.datagrid-group[group-index="'+groupIndex+'"]' : 'div.datagrid-group'); - var expander = group.find('span.datagrid-row-expander'); - if (expander.hasClass('datagrid-row-expand')){ - expander.removeClass('datagrid-row-expand').addClass('datagrid-row-collapse'); - group.next('table').show(); - } - $(this).datagrid('fixRowHeight'); - }); - }, - collapseGroup:function(jq, groupIndex){ - return jq.each(function(){ - var view = $.data(this, 'datagrid').dc.view; - var group = view.find(groupIndex!=undefined ? 'div.datagrid-group[group-index="'+groupIndex+'"]' : 'div.datagrid-group'); - var expander = group.find('span.datagrid-row-expander'); - if (expander.hasClass('datagrid-row-collapse')){ - expander.removeClass('datagrid-row-collapse').addClass('datagrid-row-expand'); - group.next('table').hide(); - } - $(this).datagrid('fixRowHeight'); - }); - } - }); - - $.extend(groupview, { - refreshGroupTitle: function(target, groupIndex){ - var state = $.data(target, 'datagrid'); - var opts = state.options; - var dc = state.dc; - var group = this.groups[groupIndex]; - var span = dc.body2.children('div.datagrid-group[group-index=' + groupIndex + ']').find('span.datagrid-group-title'); - span.html(opts.groupFormatter.call(target, group.value, group.rows)); - }, - - insertRow: function(target, index, row){ - var state = $.data(target, 'datagrid'); - var opts = state.options; - var dc = state.dc; - var group = null; - var groupIndex; - - for(var i=0; i group.startIndex + group.rows.length){ - index = group.startIndex + group.rows.length; - } - $.fn.datagrid.defaults.view.insertRow.call(this, target, index, row); - - if (index >= group.startIndex + group.rows.length){ - _moveTr(index, true); - _moveTr(index, false); - } - group.rows.splice(index - group.startIndex, 0, row); - } else { - group = { - value: row[opts.groupField], - rows: [row], - startIndex: state.data.rows.length - } - groupIndex = this.groups.length; - dc.body1.append(this.renderGroup.call(this, target, groupIndex, group, true)); - dc.body2.append(this.renderGroup.call(this, target, groupIndex, group, false)); - this.groups.push(group); - state.data.rows.push(row); - } - - this.refreshGroupTitle(target, groupIndex); - - function _moveTr(index,frozen){ - var serno = frozen?1:2; - var prevTr = opts.finder.getTr(target, index-1, 'body', serno); - var tr = opts.finder.getTr(target, index, 'body', serno); - tr.insertAfter(prevTr); - } - }, - - updateRow: function(target, index, row){ - var opts = $.data(target, 'datagrid').options; - $.fn.datagrid.defaults.view.updateRow.call(this, target, index, row); - var tb = opts.finder.getTr(target, index, 'body', 2).closest('table.datagrid-btable'); - var groupIndex = parseInt(tb.prev().attr('group-index')); - this.refreshGroupTitle(target, groupIndex); - }, - - deleteRow: function(target, index){ - var state = $.data(target, 'datagrid'); - var opts = state.options; - var dc = state.dc; - var body = dc.body1.add(dc.body2); - - var tb = opts.finder.getTr(target, index, 'body', 2).closest('table.datagrid-btable'); - var groupIndex = parseInt(tb.prev().attr('group-index')); - - $.fn.datagrid.defaults.view.deleteRow.call(this, target, index); - - var group = this.groups[groupIndex]; - if (group.rows.length > 1){ - group.rows.splice(index-group.startIndex, 1); - this.refreshGroupTitle(target, groupIndex); - } else { - body.children('div.datagrid-group[group-index='+groupIndex+']').remove(); - for(var i=groupIndex+1; i'); + table.push(''); + table.push(''); + if ((frozen && (opts.rownumbers || opts.frozenColumns.length)) || + (!frozen && !(opts.rownumbers || opts.frozenColumns.length))){ + table.push(''); + } + table.push(''); + table.push(''); + table.push('
                                                                   '); + if (!frozen){ + table.push(''); + table.push(opts.groupFormatter.call(target, group.value, group.rows)); + table.push(''); + } + table.push('
                                                                  '); + table.push(''); + + table.push(''); + var index = group.startIndex; + for(var j=0; j'); + table.push(this.renderRow.call(this, target, fields, frozen, index, group.rows[j])); + table.push(''); + index++; + } + table.push('
                                                                  '); + return table.join(''); + }, + + bindEvents: function(target){ + var state = $.data(target, 'datagrid'); + var dc = state.dc; + var body = dc.body1.add(dc.body2); + var clickHandler = ($.data(body[0],'events')||$._data(body[0],'events')).click[0].handler; + body.unbind('click').bind('click', function(e){ + var tt = $(e.target); + var expander = tt.closest('span.datagrid-row-expander'); + if (expander.length){ + var gindex = expander.closest('div.datagrid-group').attr('group-index'); + if (expander.hasClass('datagrid-row-collapse')){ + $(target).datagrid('collapseGroup', gindex); + } else { + $(target).datagrid('expandGroup', gindex); + } + } else { + clickHandler(e); + } + e.stopPropagation(); + }); + }, + + onBeforeRender: function(target, rows){ + var state = $.data(target, 'datagrid'); + var opts = state.options; + + initCss(); + + var groups = []; + for(var i=0; i' + + '.datagrid-group{height:25px;overflow:hidden;font-weight:bold;border-bottom:1px solid #ccc;}' + + '' + ); + } + } + } + }); + + $.extend($.fn.datagrid.methods, { + expandGroup:function(jq, groupIndex){ + return jq.each(function(){ + var view = $.data(this, 'datagrid').dc.view; + var group = view.find(groupIndex!=undefined ? 'div.datagrid-group[group-index="'+groupIndex+'"]' : 'div.datagrid-group'); + var expander = group.find('span.datagrid-row-expander'); + if (expander.hasClass('datagrid-row-expand')){ + expander.removeClass('datagrid-row-expand').addClass('datagrid-row-collapse'); + group.next('table').show(); + } + $(this).datagrid('fixRowHeight'); + }); + }, + collapseGroup:function(jq, groupIndex){ + return jq.each(function(){ + var view = $.data(this, 'datagrid').dc.view; + var group = view.find(groupIndex!=undefined ? 'div.datagrid-group[group-index="'+groupIndex+'"]' : 'div.datagrid-group'); + var expander = group.find('span.datagrid-row-expander'); + if (expander.hasClass('datagrid-row-collapse')){ + expander.removeClass('datagrid-row-collapse').addClass('datagrid-row-expand'); + group.next('table').hide(); + } + $(this).datagrid('fixRowHeight'); + }); + } + }); + + $.extend(groupview, { + refreshGroupTitle: function(target, groupIndex){ + var state = $.data(target, 'datagrid'); + var opts = state.options; + var dc = state.dc; + var group = this.groups[groupIndex]; + var span = dc.body2.children('div.datagrid-group[group-index=' + groupIndex + ']').find('span.datagrid-group-title'); + span.html(opts.groupFormatter.call(target, group.value, group.rows)); + }, + + insertRow: function(target, index, row){ + var state = $.data(target, 'datagrid'); + var opts = state.options; + var dc = state.dc; + var group = null; + var groupIndex; + + for(var i=0; i group.startIndex + group.rows.length){ + index = group.startIndex + group.rows.length; + } + $.fn.datagrid.defaults.view.insertRow.call(this, target, index, row); + + if (index >= group.startIndex + group.rows.length){ + _moveTr(index, true); + _moveTr(index, false); + } + group.rows.splice(index - group.startIndex, 0, row); + } else { + group = { + value: row[opts.groupField], + rows: [row], + startIndex: state.data.rows.length + } + groupIndex = this.groups.length; + dc.body1.append(this.renderGroup.call(this, target, groupIndex, group, true)); + dc.body2.append(this.renderGroup.call(this, target, groupIndex, group, false)); + this.groups.push(group); + state.data.rows.push(row); + } + + this.refreshGroupTitle(target, groupIndex); + + function _moveTr(index,frozen){ + var serno = frozen?1:2; + var prevTr = opts.finder.getTr(target, index-1, 'body', serno); + var tr = opts.finder.getTr(target, index, 'body', serno); + tr.insertAfter(prevTr); + } + }, + + updateRow: function(target, index, row){ + var opts = $.data(target, 'datagrid').options; + $.fn.datagrid.defaults.view.updateRow.call(this, target, index, row); + var tb = opts.finder.getTr(target, index, 'body', 2).closest('table.datagrid-btable'); + var groupIndex = parseInt(tb.prev().attr('group-index')); + this.refreshGroupTitle(target, groupIndex); + }, + + deleteRow: function(target, index){ + var state = $.data(target, 'datagrid'); + var opts = state.options; + var dc = state.dc; + var body = dc.body1.add(dc.body2); + + var tb = opts.finder.getTr(target, index, 'body', 2).closest('table.datagrid-btable'); + var groupIndex = parseInt(tb.prev().attr('group-index')); + + $.fn.datagrid.defaults.view.deleteRow.call(this, target, index); + + var group = this.groups[groupIndex]; + if (group.rows.length > 1){ + group.rows.splice(index-group.startIndex, 1); + this.refreshGroupTitle(target, groupIndex); + } else { + body.children('div.datagrid-group[group-index='+groupIndex+']').remove(); + for(var i=groupIndex+1; i= options.minWidth && resizeData.width <= options.maxWidth) { -// resizeData.left = resizeData.startLeft + e.pageX - resizeData.startX; -// } - } - if (resizeData.dir.indexOf('n') != -1) { - var height = resizeData.startHeight - e.pageY + resizeData.startY; - height = Math.min( - Math.max(height, options.minHeight), - options.maxHeight - ); - resizeData.height = height; - resizeData.top = resizeData.startTop + resizeData.startHeight - resizeData.height; - -// resizeData.height = resizeData.startHeight - e.pageY + resizeData.startY; -// if (resizeData.height >= options.minHeight && resizeData.height <= options.maxHeight) { -// resizeData.top = resizeData.startTop + e.pageY - resizeData.startY; -// } - } - } - - function applySize(e){ - var resizeData = e.data; - var t = $(resizeData.target); - t.css({ - left: resizeData.left, - top: resizeData.top - }); - if (t.outerWidth() != resizeData.width){t._outerWidth(resizeData.width)} - if (t.outerHeight() != resizeData.height){t._outerHeight(resizeData.height)} -// t._outerWidth(resizeData.width)._outerHeight(resizeData.height); - } - - function doDown(e){ -// isResizing = true; - $.fn.resizable.isResizing = true; - $.data(e.data.target, 'resizable').options.onStartResize.call(e.data.target, e); - return false; - } - - function doMove(e){ - resize(e); - if ($.data(e.data.target, 'resizable').options.onResize.call(e.data.target, e) != false){ - applySize(e) - } - return false; - } - - function doUp(e){ -// isResizing = false; - $.fn.resizable.isResizing = false; - resize(e, true); - applySize(e); - $.data(e.data.target, 'resizable').options.onStopResize.call(e.data.target, e); - $(document).unbind('.resizable'); - $('body').css('cursor',''); -// $('body').css('cursor','auto'); - return false; - } - - return this.each(function(){ - var opts = null; - var state = $.data(this, 'resizable'); - if (state) { - $(this).unbind('.resizable'); - opts = $.extend(state.options, options || {}); - } else { - opts = $.extend({}, $.fn.resizable.defaults, $.fn.resizable.parseOptions(this), options || {}); - $.data(this, 'resizable', { - options:opts - }); - } - - if (opts.disabled == true) { - return; - } - - // bind mouse event using namespace resizable - $(this).bind('mousemove.resizable', {target:this}, function(e){ -// if (isResizing) return; - if ($.fn.resizable.isResizing){return} - var dir = getDirection(e); - if (dir == '') { - $(e.data.target).css('cursor', ''); - } else { - $(e.data.target).css('cursor', dir + '-resize'); - } - }).bind('mouseleave.resizable', {target:this}, function(e){ - $(e.data.target).css('cursor', ''); - }).bind('mousedown.resizable', {target:this}, function(e){ - var dir = getDirection(e); - if (dir == '') return; - - function getCssValue(css) { - var val = parseInt($(e.data.target).css(css)); - if (isNaN(val)) { - return 0; - } else { - return val; - } - } - - var data = { - target: e.data.target, - dir: dir, - startLeft: getCssValue('left'), - startTop: getCssValue('top'), - left: getCssValue('left'), - top: getCssValue('top'), - startX: e.pageX, - startY: e.pageY, - startWidth: $(e.data.target).outerWidth(), - startHeight: $(e.data.target).outerHeight(), - width: $(e.data.target).outerWidth(), - height: $(e.data.target).outerHeight(), - deltaWidth: $(e.data.target).outerWidth() - $(e.data.target).width(), - deltaHeight: $(e.data.target).outerHeight() - $(e.data.target).height() - }; - $(document).bind('mousedown.resizable', data, doDown); - $(document).bind('mousemove.resizable', data, doMove); - $(document).bind('mouseup.resizable', data, doUp); - $('body').css('cursor', dir+'-resize'); - }); - - // get the resize direction - function getDirection(e) { - var tt = $(e.data.target); - var dir = ''; - var offset = tt.offset(); - var width = tt.outerWidth(); - var height = tt.outerHeight(); - var edge = opts.edge; - if (e.pageY > offset.top && e.pageY < offset.top + edge) { - dir += 'n'; - } else if (e.pageY < offset.top + height && e.pageY > offset.top + height - edge) { - dir += 's'; - } - if (e.pageX > offset.left && e.pageX < offset.left + edge) { - dir += 'w'; - } else if (e.pageX < offset.left + width && e.pageX > offset.left + width - edge) { - dir += 'e'; - } - - var handles = opts.handles.split(','); - for(var i=0; i= options.minWidth && resizeData.width <= options.maxWidth) { +// resizeData.left = resizeData.startLeft + e.pageX - resizeData.startX; +// } + } + if (resizeData.dir.indexOf('n') != -1) { + var height = resizeData.startHeight - e.pageY + resizeData.startY; + height = Math.min( + Math.max(height, options.minHeight), + options.maxHeight + ); + resizeData.height = height; + resizeData.top = resizeData.startTop + resizeData.startHeight - resizeData.height; + +// resizeData.height = resizeData.startHeight - e.pageY + resizeData.startY; +// if (resizeData.height >= options.minHeight && resizeData.height <= options.maxHeight) { +// resizeData.top = resizeData.startTop + e.pageY - resizeData.startY; +// } + } + } + + function applySize(e){ + var resizeData = e.data; + var t = $(resizeData.target); + t.css({ + left: resizeData.left, + top: resizeData.top + }); + if (t.outerWidth() != resizeData.width){t._outerWidth(resizeData.width)} + if (t.outerHeight() != resizeData.height){t._outerHeight(resizeData.height)} +// t._outerWidth(resizeData.width)._outerHeight(resizeData.height); + } + + function doDown(e){ +// isResizing = true; + $.fn.resizable.isResizing = true; + $.data(e.data.target, 'resizable').options.onStartResize.call(e.data.target, e); + return false; + } + + function doMove(e){ + resize(e); + if ($.data(e.data.target, 'resizable').options.onResize.call(e.data.target, e) != false){ + applySize(e) + } + return false; + } + + function doUp(e){ +// isResizing = false; + $.fn.resizable.isResizing = false; + resize(e, true); + applySize(e); + $.data(e.data.target, 'resizable').options.onStopResize.call(e.data.target, e); + $(document).unbind('.resizable'); + $('body').css('cursor',''); +// $('body').css('cursor','auto'); + return false; + } + + return this.each(function(){ + var opts = null; + var state = $.data(this, 'resizable'); + if (state) { + $(this).unbind('.resizable'); + opts = $.extend(state.options, options || {}); + } else { + opts = $.extend({}, $.fn.resizable.defaults, $.fn.resizable.parseOptions(this), options || {}); + $.data(this, 'resizable', { + options:opts + }); + } + + if (opts.disabled == true) { + return; + } + + // bind mouse event using namespace resizable + $(this).bind('mousemove.resizable', {target:this}, function(e){ +// if (isResizing) return; + if ($.fn.resizable.isResizing){return} + var dir = getDirection(e); + if (dir == '') { + $(e.data.target).css('cursor', ''); + } else { + $(e.data.target).css('cursor', dir + '-resize'); + } + }).bind('mouseleave.resizable', {target:this}, function(e){ + $(e.data.target).css('cursor', ''); + }).bind('mousedown.resizable', {target:this}, function(e){ + var dir = getDirection(e); + if (dir == '') return; + + function getCssValue(css) { + var val = parseInt($(e.data.target).css(css)); + if (isNaN(val)) { + return 0; + } else { + return val; + } + } + + var data = { + target: e.data.target, + dir: dir, + startLeft: getCssValue('left'), + startTop: getCssValue('top'), + left: getCssValue('left'), + top: getCssValue('top'), + startX: e.pageX, + startY: e.pageY, + startWidth: $(e.data.target).outerWidth(), + startHeight: $(e.data.target).outerHeight(), + width: $(e.data.target).outerWidth(), + height: $(e.data.target).outerHeight(), + deltaWidth: $(e.data.target).outerWidth() - $(e.data.target).width(), + deltaHeight: $(e.data.target).outerHeight() - $(e.data.target).height() + }; + $(document).bind('mousedown.resizable', data, doDown); + $(document).bind('mousemove.resizable', data, doMove); + $(document).bind('mouseup.resizable', data, doUp); + $('body').css('cursor', dir+'-resize'); + }); + + // get the resize direction + function getDirection(e) { + var tt = $(e.data.target); + var dir = ''; + var offset = tt.offset(); + var width = tt.outerWidth(); + var height = tt.outerHeight(); + var edge = opts.edge; + if (e.pageY > offset.top && e.pageY < offset.top + edge) { + dir += 'n'; + } else if (e.pageY < offset.top + height && e.pageY > offset.top + height - edge) { + dir += 's'; + } + if (e.pageX > offset.left && e.pageX < offset.left + edge) { + dir += 'w'; + } else if (e.pageX < offset.left + width && e.pageX > offset.left + width - edge) { + dir += 'e'; + } + + var handles = opts.handles.split(','); + for(var i=0; i' + - '
                                                                  ' + - '' + - '' + - '
                                                                  ' + - '
                                                                  ' + - '
                                                                  ' + - '
                                                                  ' + - '' + - '').insertAfter(target); - var t = $(target); - t.addClass('slider-f').hide(); - var name = t.attr('name'); - if (name){ - slider.find('input.slider-value').attr('name', name); - t.removeAttr('name').attr('sliderName', name); - } - slider.bind('_resize', function(e,force){ - if ($(this).hasClass('easyui-fluid') || force){ - setSize(target); - } - return false; - }); - return slider; - } - - /** - * set the slider size, for vertical slider, the height property is required - */ - function setSize(target, param){ - var state = $.data(target, 'slider'); - var opts = state.options; - var slider = state.slider; - - if (param){ - if (param.width) opts.width = param.width; - if (param.height) opts.height = param.height; - } - slider._size(opts); - if (opts.mode == 'h'){ - slider.css('height', ''); - slider.children('div').css('height', ''); - } else { - slider.css('width', ''); - slider.children('div').css('width', ''); - slider.children('div.slider-rule,div.slider-rulelabel,div.slider-inner')._outerHeight(slider._outerHeight()); - } - initValue(target); - } - - /** - * show slider rule if needed - */ - function showRule(target){ - var state = $.data(target, 'slider'); - var opts = state.options; - var slider = state.slider; - - var aa = opts.mode == 'h' ? opts.rule : opts.rule.slice(0).reverse(); - if (opts.reversed){ - aa = aa.slice(0).reverse(); - } - _build(aa); - - function _build(aa){ - var rule = slider.find('div.slider-rule'); - var label = slider.find('div.slider-rulelabel'); - rule.empty(); - label.empty(); - for(var i=0; i').appendTo(rule); - span.css((opts.mode=='h'?'left':'top'), distance); - - // show the labels - if (aa[i] != '|'){ - span = $('').appendTo(label); - span.html(aa[i]); - if (opts.mode == 'h'){ - span.css({ - left: distance, - marginLeft: -Math.round(span.outerWidth()/2) - }); - } else { - span.css({ - top: distance, - marginTop: -Math.round(span.outerHeight()/2) - }); - } - } - } - } - } - - /** - * build the slider and set some properties - */ - function buildSlider(target){ - var state = $.data(target, 'slider'); - var opts = state.options; - var slider = state.slider; - - slider.removeClass('slider-h slider-v slider-disabled'); - slider.addClass(opts.mode == 'h' ? 'slider-h' : 'slider-v'); - slider.addClass(opts.disabled ? 'slider-disabled' : ''); - - var inner = slider.find('.slider-inner'); - inner.html( - '' + - '' - ); - if (opts.range){ - inner.append( - '' + - '' - ); - } - - slider.find('a.slider-handle').draggable({ - axis:opts.mode, - cursor:'pointer', - disabled: opts.disabled, - onDrag:function(e){ - var left = e.data.left; - var width = slider.width(); - if (opts.mode!='h'){ - left = e.data.top; - width = slider.height(); - } - if (left < 0 || left > width) { - return false; - } else { - setPos(left); - return false; - } - }, - onBeforeDrag:function(){ - state.isDragging = true; - }, - onStartDrag:function(){ - opts.onSlideStart.call(target, opts.value); - }, - onStopDrag:function(e){ - setPos(opts.mode=='h'?e.data.left:e.data.top); - opts.onSlideEnd.call(target, opts.value); - opts.onComplete.call(target, opts.value); - state.isDragging = false; - } - }); - slider.find('div.slider-inner').unbind('.slider').bind('mousedown.slider', function(e){ - if (state.isDragging || opts.disabled){return} - var pos = $(this).offset(); - setPos(opts.mode=='h'?(e.pageX-pos.left):(e.pageY-pos.top)); - opts.onComplete.call(target, opts.value); - }); - - function setPos(pos){ - var value = pos2value(target, pos); - var s = Math.abs(value % opts.step); - if (s < opts.step/2){ - value -= s; - } else { - value = value - s + opts.step; - } - if (opts.range){ - var v1 = opts.value[0]; - var v2 = opts.value[1]; - var m = parseFloat((v1+v2)/2); - if (value < v1){ - v1 = value; - } else if (value > v2){ - v2 = value; - } else { - value < m ? v1 = value : v2 = value; - } - $(target).slider('setValues', [v1,v2]); - } else { - $(target).slider('setValue', value); - } - } - } - - /** - * set a specified value to slider - */ - function setValues(target, values){ - var state = $.data(target, 'slider'); - var opts = state.options; - var slider = state.slider; - var oldValues = $.isArray(opts.value) ? opts.value : [opts.value]; - var newValues = []; - - if (!$.isArray(values)){ - values = $.map(String(values).split(opts.separator), function(v){ - return parseFloat(v); - }); - } - - slider.find('.slider-value').remove(); - var name = $(target).attr('sliderName') || ''; - for(var i=0; i opts.max) value = opts.max; - - var input = $('').appendTo(slider); - input.attr('name', name); - input.val(value); - newValues.push(value); - - var handle = slider.find('.slider-handle:eq('+i+')'); - var tip = handle.next(); - var pos = value2pos(target, value); - if (opts.showTip){ - tip.show(); - tip.html(opts.tipFormatter.call(target, value)); - } else { - tip.hide(); - } - - if (opts.mode == 'h'){ - var style = 'left:'+pos+'px;'; - handle.attr('style', style); - tip.attr('style', style + 'margin-left:' + (-Math.round(tip.outerWidth()/2)) + 'px'); - } else { - var style = 'top:' + pos + 'px;'; - handle.attr('style', style); - tip.attr('style', style + 'margin-left:' + (-Math.round(tip.outerWidth())) + 'px'); - } - } - opts.value = opts.range ? newValues : newValues[0]; - $(target).val(opts.range ? newValues.join(opts.separator) : newValues[0]); - - if (oldValues.join(',') != newValues.join(',')){ - opts.onChange.call(target, opts.value, (opts.range?oldValues:oldValues[0])); - } - } - - function initValue(target){ - var opts = $.data(target, 'slider').options; - var fn = opts.onChange; - opts.onChange = function(){}; - setValues(target, opts.value); - opts.onChange = fn; - } - - /** - * translate value to slider position - */ - function value2pos(target, value){ - var state = $.data(target, 'slider'); - var opts = state.options; - var slider = state.slider; - var size = opts.mode == 'h' ? slider.width() : slider.height(); - var pos = opts.converter.toPosition.call(target, value, size); - if (opts.mode == 'v'){ - pos = slider.height() - pos; - } - if (opts.reversed){ - pos = size - pos; - } - return pos.toFixed(0); - } - - /** - * translate slider position to value - */ - function pos2value(target, pos){ - var state = $.data(target, 'slider'); - var opts = state.options; - var slider = state.slider; - var size = opts.mode == 'h' ? slider.width() : slider.height(); - var value = opts.converter.toValue.call(target, opts.mode=='h'?(opts.reversed?(size-pos):pos):(size-pos), size); - return value.toFixed(0); - } - - $.fn.slider = function(options, param){ - if (typeof options == 'string'){ - return $.fn.slider.methods[options](this, param); - } - - options = options || {}; - return this.each(function(){ - var state = $.data(this, 'slider'); - if (state){ - $.extend(state.options, options); - } else { - state = $.data(this, 'slider', { - options: $.extend({}, $.fn.slider.defaults, $.fn.slider.parseOptions(this), options), - slider: init(this) - }); - $(this).removeAttr('disabled'); - } - - var opts = state.options; - opts.min = parseFloat(opts.min); - opts.max = parseFloat(opts.max); - if (opts.range){ - if (!$.isArray(opts.value)){ - opts.value = $.map(String(opts.value).split(opts.separator), function(v){ - return parseFloat(v); - }); - } - if (opts.value.length < 2){ - opts.value.push(opts.max); - } - } else { - opts.value = parseFloat(opts.value); - } - opts.step = parseFloat(opts.step); - opts.originalValue = opts.value; - - buildSlider(this); - showRule(this); - setSize(this); - }); - }; - - $.fn.slider.methods = { - options: function(jq){ - return $.data(jq[0], 'slider').options; - }, - destroy: function(jq){ - return jq.each(function(){ - $.data(this, 'slider').slider.remove(); - $(this).remove(); - }); - }, - resize: function(jq, param){ - return jq.each(function(){ - setSize(this, param); - }); - }, - getValue: function(jq){ - return jq.slider('options').value; - }, - getValues: function(jq){ - return jq.slider('options').value; - }, - setValue: function(jq, value){ - return jq.each(function(){ - setValues(this, [value]); - }); - }, - setValues: function(jq, values){ - return jq.each(function(){ - setValues(this, values); - }); - }, - clear: function(jq){ - return jq.each(function(){ - var opts = $(this).slider('options'); - setValues(this, opts.range?[opts.min,opts.max]:[opts.min]); - }); - }, - reset: function(jq){ - return jq.each(function(){ - var opts = $(this).slider('options'); - $(this).slider(opts.range?'setValues':'setValue', opts.originalValue); - }); - }, - enable: function(jq){ - return jq.each(function(){ - $.data(this, 'slider').options.disabled = false; - buildSlider(this); - }); - }, - disable: function(jq){ - return jq.each(function(){ - $.data(this, 'slider').options.disabled = true; - buildSlider(this); - }); - } - }; - - $.fn.slider.parseOptions = function(target){ - var t = $(target); - return $.extend({}, $.parser.parseOptions(target, [ - 'width','height','mode',{reversed:'boolean',showTip:'boolean',range:'boolean',min:'number',max:'number',step:'number'} - ]), { - value: (t.val() || undefined), - disabled: (t.attr('disabled') ? true : undefined), - rule: (t.attr('rule') ? eval(t.attr('rule')) : undefined) - }); - }; - - $.fn.slider.defaults = { - width: 'auto', - height: 'auto', - mode: 'h', // 'h'(horizontal) or 'v'(vertical) - reversed: false, - showTip: false, - disabled: false, - range: false, - value: 0, - separator: ',', - min: 0, - max: 100, - step: 1, - rule: [], // [0,'|',100] - tipFormatter: function(value){return value}, - converter:{ - toPosition:function(value, size){ - var opts = $(this).slider('options'); - return (value-opts.min)/(opts.max-opts.min)*size; - }, - toValue:function(pos, size){ - var opts = $(this).slider('options'); - return opts.min + (opts.max-opts.min)*(pos/size); - } - }, - onChange: function(value, oldValue){}, - onSlideStart: function(value){}, - onSlideEnd: function(value){}, - onComplete: function(value){} - }; -})(jQuery); +/** + * jQuery EasyUI 1.4.2 + * + * Copyright (c) 2009-2015 www.jeasyui.com. All rights reserved. + * + * Licensed under the GPL license: http://www.gnu.org/licenses/gpl.txt + * To use it on other terms please contact us at info@jeasyui.com + * + */ +/** + * slider - jQuery EasyUI + * + * Dependencies: + * draggable + * + */ +(function($){ + function init(target){ + var slider = $('
                                                                  ' + + '
                                                                  ' + + '' + + '' + + '
                                                                  ' + + '
                                                                  ' + + '
                                                                  ' + + '
                                                                  ' + + '' + + '
                                                                  ').insertAfter(target); + var t = $(target); + t.addClass('slider-f').hide(); + var name = t.attr('name'); + if (name){ + slider.find('input.slider-value').attr('name', name); + t.removeAttr('name').attr('sliderName', name); + } + slider.bind('_resize', function(e,force){ + if ($(this).hasClass('easyui-fluid') || force){ + setSize(target); + } + return false; + }); + return slider; + } + + /** + * set the slider size, for vertical slider, the height property is required + */ + function setSize(target, param){ + var state = $.data(target, 'slider'); + var opts = state.options; + var slider = state.slider; + + if (param){ + if (param.width) opts.width = param.width; + if (param.height) opts.height = param.height; + } + slider._size(opts); + if (opts.mode == 'h'){ + slider.css('height', ''); + slider.children('div').css('height', ''); + } else { + slider.css('width', ''); + slider.children('div').css('width', ''); + slider.children('div.slider-rule,div.slider-rulelabel,div.slider-inner')._outerHeight(slider._outerHeight()); + } + initValue(target); + } + + /** + * show slider rule if needed + */ + function showRule(target){ + var state = $.data(target, 'slider'); + var opts = state.options; + var slider = state.slider; + + var aa = opts.mode == 'h' ? opts.rule : opts.rule.slice(0).reverse(); + if (opts.reversed){ + aa = aa.slice(0).reverse(); + } + _build(aa); + + function _build(aa){ + var rule = slider.find('div.slider-rule'); + var label = slider.find('div.slider-rulelabel'); + rule.empty(); + label.empty(); + for(var i=0; i').appendTo(rule); + span.css((opts.mode=='h'?'left':'top'), distance); + + // show the labels + if (aa[i] != '|'){ + span = $('').appendTo(label); + span.html(aa[i]); + if (opts.mode == 'h'){ + span.css({ + left: distance, + marginLeft: -Math.round(span.outerWidth()/2) + }); + } else { + span.css({ + top: distance, + marginTop: -Math.round(span.outerHeight()/2) + }); + } + } + } + } + } + + /** + * build the slider and set some properties + */ + function buildSlider(target){ + var state = $.data(target, 'slider'); + var opts = state.options; + var slider = state.slider; + + slider.removeClass('slider-h slider-v slider-disabled'); + slider.addClass(opts.mode == 'h' ? 'slider-h' : 'slider-v'); + slider.addClass(opts.disabled ? 'slider-disabled' : ''); + + var inner = slider.find('.slider-inner'); + inner.html( + '' + + '' + ); + if (opts.range){ + inner.append( + '' + + '' + ); + } + + slider.find('a.slider-handle').draggable({ + axis:opts.mode, + cursor:'pointer', + disabled: opts.disabled, + onDrag:function(e){ + var left = e.data.left; + var width = slider.width(); + if (opts.mode!='h'){ + left = e.data.top; + width = slider.height(); + } + if (left < 0 || left > width) { + return false; + } else { + setPos(left); + return false; + } + }, + onBeforeDrag:function(){ + state.isDragging = true; + }, + onStartDrag:function(){ + opts.onSlideStart.call(target, opts.value); + }, + onStopDrag:function(e){ + setPos(opts.mode=='h'?e.data.left:e.data.top); + opts.onSlideEnd.call(target, opts.value); + opts.onComplete.call(target, opts.value); + state.isDragging = false; + } + }); + slider.find('div.slider-inner').unbind('.slider').bind('mousedown.slider', function(e){ + if (state.isDragging || opts.disabled){return} + var pos = $(this).offset(); + setPos(opts.mode=='h'?(e.pageX-pos.left):(e.pageY-pos.top)); + opts.onComplete.call(target, opts.value); + }); + + function setPos(pos){ + var value = pos2value(target, pos); + var s = Math.abs(value % opts.step); + if (s < opts.step/2){ + value -= s; + } else { + value = value - s + opts.step; + } + if (opts.range){ + var v1 = opts.value[0]; + var v2 = opts.value[1]; + var m = parseFloat((v1+v2)/2); + if (value < v1){ + v1 = value; + } else if (value > v2){ + v2 = value; + } else { + value < m ? v1 = value : v2 = value; + } + $(target).slider('setValues', [v1,v2]); + } else { + $(target).slider('setValue', value); + } + } + } + + /** + * set a specified value to slider + */ + function setValues(target, values){ + var state = $.data(target, 'slider'); + var opts = state.options; + var slider = state.slider; + var oldValues = $.isArray(opts.value) ? opts.value : [opts.value]; + var newValues = []; + + if (!$.isArray(values)){ + values = $.map(String(values).split(opts.separator), function(v){ + return parseFloat(v); + }); + } + + slider.find('.slider-value').remove(); + var name = $(target).attr('sliderName') || ''; + for(var i=0; i opts.max) value = opts.max; + + var input = $('').appendTo(slider); + input.attr('name', name); + input.val(value); + newValues.push(value); + + var handle = slider.find('.slider-handle:eq('+i+')'); + var tip = handle.next(); + var pos = value2pos(target, value); + if (opts.showTip){ + tip.show(); + tip.html(opts.tipFormatter.call(target, value)); + } else { + tip.hide(); + } + + if (opts.mode == 'h'){ + var style = 'left:'+pos+'px;'; + handle.attr('style', style); + tip.attr('style', style + 'margin-left:' + (-Math.round(tip.outerWidth()/2)) + 'px'); + } else { + var style = 'top:' + pos + 'px;'; + handle.attr('style', style); + tip.attr('style', style + 'margin-left:' + (-Math.round(tip.outerWidth())) + 'px'); + } + } + opts.value = opts.range ? newValues : newValues[0]; + $(target).val(opts.range ? newValues.join(opts.separator) : newValues[0]); + + if (oldValues.join(',') != newValues.join(',')){ + opts.onChange.call(target, opts.value, (opts.range?oldValues:oldValues[0])); + } + } + + function initValue(target){ + var opts = $.data(target, 'slider').options; + var fn = opts.onChange; + opts.onChange = function(){}; + setValues(target, opts.value); + opts.onChange = fn; + } + + /** + * translate value to slider position + */ + function value2pos(target, value){ + var state = $.data(target, 'slider'); + var opts = state.options; + var slider = state.slider; + var size = opts.mode == 'h' ? slider.width() : slider.height(); + var pos = opts.converter.toPosition.call(target, value, size); + if (opts.mode == 'v'){ + pos = slider.height() - pos; + } + if (opts.reversed){ + pos = size - pos; + } + return pos.toFixed(0); + } + + /** + * translate slider position to value + */ + function pos2value(target, pos){ + var state = $.data(target, 'slider'); + var opts = state.options; + var slider = state.slider; + var size = opts.mode == 'h' ? slider.width() : slider.height(); + var value = opts.converter.toValue.call(target, opts.mode=='h'?(opts.reversed?(size-pos):pos):(size-pos), size); + return value.toFixed(0); + } + + $.fn.slider = function(options, param){ + if (typeof options == 'string'){ + return $.fn.slider.methods[options](this, param); + } + + options = options || {}; + return this.each(function(){ + var state = $.data(this, 'slider'); + if (state){ + $.extend(state.options, options); + } else { + state = $.data(this, 'slider', { + options: $.extend({}, $.fn.slider.defaults, $.fn.slider.parseOptions(this), options), + slider: init(this) + }); + $(this).removeAttr('disabled'); + } + + var opts = state.options; + opts.min = parseFloat(opts.min); + opts.max = parseFloat(opts.max); + if (opts.range){ + if (!$.isArray(opts.value)){ + opts.value = $.map(String(opts.value).split(opts.separator), function(v){ + return parseFloat(v); + }); + } + if (opts.value.length < 2){ + opts.value.push(opts.max); + } + } else { + opts.value = parseFloat(opts.value); + } + opts.step = parseFloat(opts.step); + opts.originalValue = opts.value; + + buildSlider(this); + showRule(this); + setSize(this); + }); + }; + + $.fn.slider.methods = { + options: function(jq){ + return $.data(jq[0], 'slider').options; + }, + destroy: function(jq){ + return jq.each(function(){ + $.data(this, 'slider').slider.remove(); + $(this).remove(); + }); + }, + resize: function(jq, param){ + return jq.each(function(){ + setSize(this, param); + }); + }, + getValue: function(jq){ + return jq.slider('options').value; + }, + getValues: function(jq){ + return jq.slider('options').value; + }, + setValue: function(jq, value){ + return jq.each(function(){ + setValues(this, [value]); + }); + }, + setValues: function(jq, values){ + return jq.each(function(){ + setValues(this, values); + }); + }, + clear: function(jq){ + return jq.each(function(){ + var opts = $(this).slider('options'); + setValues(this, opts.range?[opts.min,opts.max]:[opts.min]); + }); + }, + reset: function(jq){ + return jq.each(function(){ + var opts = $(this).slider('options'); + $(this).slider(opts.range?'setValues':'setValue', opts.originalValue); + }); + }, + enable: function(jq){ + return jq.each(function(){ + $.data(this, 'slider').options.disabled = false; + buildSlider(this); + }); + }, + disable: function(jq){ + return jq.each(function(){ + $.data(this, 'slider').options.disabled = true; + buildSlider(this); + }); + } + }; + + $.fn.slider.parseOptions = function(target){ + var t = $(target); + return $.extend({}, $.parser.parseOptions(target, [ + 'width','height','mode',{reversed:'boolean',showTip:'boolean',range:'boolean',min:'number',max:'number',step:'number'} + ]), { + value: (t.val() || undefined), + disabled: (t.attr('disabled') ? true : undefined), + rule: (t.attr('rule') ? eval(t.attr('rule')) : undefined) + }); + }; + + $.fn.slider.defaults = { + width: 'auto', + height: 'auto', + mode: 'h', // 'h'(horizontal) or 'v'(vertical) + reversed: false, + showTip: false, + disabled: false, + range: false, + value: 0, + separator: ',', + min: 0, + max: 100, + step: 1, + rule: [], // [0,'|',100] + tipFormatter: function(value){return value}, + converter:{ + toPosition:function(value, size){ + var opts = $(this).slider('options'); + return (value-opts.min)/(opts.max-opts.min)*size; + }, + toValue:function(pos, size){ + var opts = $(this).slider('options'); + return opts.min + (opts.max-opts.min)*(pos/size); + } + }, + onChange: function(value, oldValue){}, + onSlideStart: function(value){}, + onSlideEnd: function(value){}, + onComplete: function(value){} + }; +})(jQuery); diff --git a/src/main/webapp/js/easyui/src/jquery.tabs.js b/src/main/webapp/js/easyui/src/jquery.tabs.js index 74d5680..c2e89a4 100644 --- a/src/main/webapp/js/easyui/src/jquery.tabs.js +++ b/src/main/webapp/js/easyui/src/jquery.tabs.js @@ -1,853 +1,853 @@ -/** - * jQuery EasyUI 1.4.2 - * - * Copyright (c) 2009-2015 www.jeasyui.com. All rights reserved. - * - * Licensed under the GPL license: http://www.gnu.org/licenses/gpl.txt - * To use it on other terms please contact us at info@jeasyui.com - * - */ -/** - * tabs - jQuery EasyUI - * - * Dependencies: - * panel - * linkbutton - * - */ -(function($){ - function getContentWidth(c){ - var w = 0; - $(c).children().each(function(){ - w += $(this).outerWidth(true); - }); - return w; - } - /** - * set the tabs scrollers to show or not, - * dependent on the tabs count and width - */ - function setScrollers(container) { - var opts = $.data(container, 'tabs').options; - if (opts.tabPosition == 'left' || opts.tabPosition == 'right' || !opts.showHeader){return} - - var header = $(container).children('div.tabs-header'); - var tool = header.children('div.tabs-tool'); - var sLeft = header.children('div.tabs-scroller-left'); - var sRight = header.children('div.tabs-scroller-right'); - var wrap = header.children('div.tabs-wrap'); - - // set the tool height - var tHeight = header.outerHeight(); - if (opts.plain){ - tHeight -= tHeight - header.height(); - } - tool._outerHeight(tHeight); - - var tabsWidth = getContentWidth(header.find('ul.tabs')); - var cWidth = header.width() - tool._outerWidth(); - - if (tabsWidth > cWidth) { - sLeft.add(sRight).show()._outerHeight(tHeight); - if (opts.toolPosition == 'left'){ - tool.css({ - left: sLeft.outerWidth(), - right: '' - }); - wrap.css({ - marginLeft: sLeft.outerWidth() + tool._outerWidth(), - marginRight: sRight._outerWidth(), - width: cWidth - sLeft.outerWidth() - sRight.outerWidth() - }); - } else { - tool.css({ - left: '', - right: sRight.outerWidth() - }); - wrap.css({ - marginLeft: sLeft.outerWidth(), - marginRight: sRight.outerWidth() + tool._outerWidth(), - width: cWidth - sLeft.outerWidth() - sRight.outerWidth() - }); - } - } else { - sLeft.add(sRight).hide(); - if (opts.toolPosition == 'left'){ - tool.css({ - left: 0, - right: '' - }); - wrap.css({ - marginLeft: tool._outerWidth(), - marginRight: 0, - width: cWidth - }); - } else { - tool.css({ - left: '', - right: 0 - }); - wrap.css({ - marginLeft: 0, - marginRight: tool._outerWidth(), - width: cWidth - }); - } - } - } - - function addTools(container){ - var opts = $.data(container, 'tabs').options; - var header = $(container).children('div.tabs-header'); - if (opts.tools) { - if (typeof opts.tools == 'string'){ - $(opts.tools).addClass('tabs-tool').appendTo(header); - $(opts.tools).show(); - } else { - header.children('div.tabs-tool').remove(); - var tools = $('
                                                                  ').appendTo(header); - var tr = tools.find('tr'); - for(var i=0; i').appendTo(tr); - var tool = $('').appendTo(td); - tool[0].onclick = eval(opts.tools[i].handler || function(){}); - tool.linkbutton($.extend({}, opts.tools[i], { - plain: true - })); - } - } - } else { - header.children('div.tabs-tool').remove(); - } - } - - function setSize(container, param) { - var state = $.data(container, 'tabs'); - var opts = state.options; - var cc = $(container); - - if (!opts.doSize){return} - if (param){ - $.extend(opts, { - width: param.width, - height: param.height - }); - } - cc._size(opts); - - var header = cc.children('div.tabs-header'); - var panels = cc.children('div.tabs-panels'); - var wrap = header.find('div.tabs-wrap'); - var ul = wrap.find('.tabs'); - ul.children('li').removeClass('tabs-first tabs-last'); - ul.children('li:first').addClass('tabs-first'); - ul.children('li:last').addClass('tabs-last'); - - if (opts.tabPosition == 'left' || opts.tabPosition == 'right'){ - header._outerWidth(opts.showHeader ? opts.headerWidth : 0); - panels._outerWidth(cc.width() - header.outerWidth()); - header.add(panels)._outerHeight(opts.height); - wrap._outerWidth(header.width()); - ul._outerWidth(wrap.width()).css('height',''); - } else { - header.children('div.tabs-scroller-left,div.tabs-scroller-right,div.tabs-tool').css('display', opts.showHeader?'block':'none'); - header._outerWidth(cc.width()).css('height',''); - if (opts.showHeader){ - header.css('background-color',''); - wrap.css('height',''); - } else { - header.css('background-color','transparent'); - header._outerHeight(0); - wrap._outerHeight(0); - } - ul._outerHeight(opts.tabHeight).css('width',''); - ul._outerHeight(ul.outerHeight()-ul.height()-1+opts.tabHeight).css('width',''); - - panels._size('height', isNaN(opts.height) ? '' : (opts.height-header.outerHeight())); - panels._size('width', isNaN(opts.width) ? '' : opts.width); - } - - if (state.tabs.length){ - var d1 = ul.outerWidth(true) - ul.width(); - var li = ul.children('li:first'); - var d2 = li.outerWidth(true) - li.width(); - var hwidth = header.width() - header.children('.tabs-tool')._outerWidth(); - var justifiedWidth = Math.floor((hwidth-d1-d2*state.tabs.length)/state.tabs.length); - - $.map(state.tabs, function(p){ - setTabSize(p, (opts.justified && $.inArray(opts.tabPosition,['top','bottom'])>=0) ? justifiedWidth : undefined); - }); - if (opts.justified && $.inArray(opts.tabPosition,['top','bottom'])>=0){ - var deltaWidth = hwidth - d1 - getContentWidth(ul); - setTabSize(state.tabs[state.tabs.length-1], justifiedWidth+deltaWidth); - } - } - setScrollers(container); - - function setTabSize(p, width){ - var p_opts = p.panel('options'); - var p_t = p_opts.tab.find('a.tabs-inner'); - var width = width ? width : (parseInt(p_opts.tabWidth||opts.tabWidth||undefined)); - if (width){ - p_t._outerWidth(width); - } else { - p_t.css('width', ''); - } - p_t._outerHeight(opts.tabHeight); - p_t.css('lineHeight', p_t.height()+'px'); - p_t.find('.easyui-fluid:visible').triggerHandler('_resize'); - } - } - - /** - * set selected tab panel size - */ - function setSelectedSize(container){ - var opts = $.data(container, 'tabs').options; - var tab = getSelectedTab(container); - if (tab){ - var panels = $(container).children('div.tabs-panels'); - var width = opts.width=='auto' ? 'auto' : panels.width(); - var height = opts.height=='auto' ? 'auto' : panels.height(); - tab.panel('resize', { - width: width, - height: height - }); - } - } - - /** - * wrap the tabs header and body - */ - function wrapTabs(container) { - var tabs = $.data(container, 'tabs').tabs; - var cc = $(container).addClass('tabs-container'); - var panels = $('
                                                                  ').insertBefore(cc); - cc.children('div').each(function(){ - panels[0].appendChild(this); - }); - cc[0].appendChild(panels[0]); - $('
                                                                  ' - + '
                                                                  ' - + '
                                                                  ' - + '
                                                                  ' - + '
                                                                    ' - + '
                                                                    ' - + '
                                                                    ').prependTo(container); - - cc.children('div.tabs-panels').children('div').each(function(i){ - var opts = $.extend({}, $.parser.parseOptions(this), { - selected: ($(this).attr('selected') ? true : undefined) - }); - createTab(container, opts, $(this)); - }); - - cc.children('div.tabs-header').find('.tabs-scroller-left, .tabs-scroller-right').hover( - function(){$(this).addClass('tabs-scroller-over');}, - function(){$(this).removeClass('tabs-scroller-over');} - ); - cc.bind('_resize', function(e,force){ - if ($(this).hasClass('easyui-fluid') || force){ - setSize(container); - setSelectedSize(container); - } - return false; - }); - } - - function bindEvents(container){ - var state = $.data(container, 'tabs') - var opts = state.options; - $(container).children('div.tabs-header').unbind().bind('click', function(e){ - if ($(e.target).hasClass('tabs-scroller-left')){ - $(container).tabs('scrollBy', -opts.scrollIncrement); - } else if ($(e.target).hasClass('tabs-scroller-right')){ - $(container).tabs('scrollBy', opts.scrollIncrement); - } else { - var li = $(e.target).closest('li'); - if (li.hasClass('tabs-disabled')){return false;} - var a = $(e.target).closest('a.tabs-close'); - if (a.length){ - closeTab(container, getLiIndex(li)); - } else if (li.length){ -// selectTab(container, getLiIndex(li)); - var index = getLiIndex(li); - var popts = state.tabs[index].panel('options'); - if (popts.collapsible){ - popts.closed ? selectTab(container, index) : unselectTab(container, index); - } else { - selectTab(container, index); - } - } - return false; - } - }).bind('contextmenu', function(e){ - var li = $(e.target).closest('li'); - if (li.hasClass('tabs-disabled')){return;} - if (li.length){ - opts.onContextMenu.call(container, e, li.find('span.tabs-title').html(), getLiIndex(li)); - } - }); - - function getLiIndex(li){ - var index = 0; - li.parent().children('li').each(function(i){ - if (li[0] == this){ - index = i; - return false; - } - }); - return index; - } - } - - function setProperties(container){ - var opts = $.data(container, 'tabs').options; - var header = $(container).children('div.tabs-header'); - var panels = $(container).children('div.tabs-panels'); - - header.removeClass('tabs-header-top tabs-header-bottom tabs-header-left tabs-header-right'); - panels.removeClass('tabs-panels-top tabs-panels-bottom tabs-panels-left tabs-panels-right'); - if (opts.tabPosition == 'top'){ - header.insertBefore(panels); - } else if (opts.tabPosition == 'bottom'){ - header.insertAfter(panels); - header.addClass('tabs-header-bottom'); - panels.addClass('tabs-panels-top'); - } else if (opts.tabPosition == 'left'){ - header.addClass('tabs-header-left'); - panels.addClass('tabs-panels-right'); - } else if (opts.tabPosition == 'right'){ - header.addClass('tabs-header-right'); - panels.addClass('tabs-panels-left'); - } - - if (opts.plain == true) { - header.addClass('tabs-header-plain'); - } else { - header.removeClass('tabs-header-plain'); - } - header.removeClass('tabs-header-narrow').addClass(opts.narrow?'tabs-header-narrow':''); - var tabs = header.find('.tabs'); - tabs.removeClass('tabs-pill').addClass(opts.pill?'tabs-pill':''); - tabs.removeClass('tabs-narrow').addClass(opts.narrow?'tabs-narrow':''); - tabs.removeClass('tabs-justified').addClass(opts.justified?'tabs-justified':''); - if (opts.border == true){ - header.removeClass('tabs-header-noborder'); - panels.removeClass('tabs-panels-noborder'); - } else { - header.addClass('tabs-header-noborder'); - panels.addClass('tabs-panels-noborder'); - } - opts.doSize = true; - } - - function createTab(container, options, pp) { - options = options || {}; - var state = $.data(container, 'tabs'); - var tabs = state.tabs; - if (options.index == undefined || options.index > tabs.length){options.index = tabs.length} - if (options.index < 0){options.index = 0} - - var ul = $(container).children('div.tabs-header').find('ul.tabs'); - var panels = $(container).children('div.tabs-panels'); - var tab = $( - '
                                                                  • ' + - '' + - '' + - '' + - '' + - '
                                                                  • '); - if (!pp){pp = $('
                                                                    ');} - if (options.index >= tabs.length){ - tab.appendTo(ul); - pp.appendTo(panels); - tabs.push(pp); - } else { - tab.insertBefore(ul.children('li:eq('+options.index+')')); - pp.insertBefore(panels.children('div.panel:eq('+options.index+')')); - tabs.splice(options.index, 0, pp); - } - - // create panel - pp.panel($.extend({}, options, { - tab: tab, - border: false, - noheader: true, - closed: true, - doSize: false, - iconCls: (options.icon ? options.icon : undefined), - onLoad: function(){ - if (options.onLoad){ - options.onLoad.call(this, arguments); - } - state.options.onLoad.call(container, $(this)); - }, - onBeforeOpen: function(){ - if (options.onBeforeOpen){ - if (options.onBeforeOpen.call(this) == false){return false;} - } - var p = $(container).tabs('getSelected'); - if (p){ - if (p[0] != this){ - $(container).tabs('unselect', getTabIndex(container, p)); - p = $(container).tabs('getSelected'); - if (p){ - return false; - } - } else { - setSelectedSize(container); - return false; - } - } - - var popts = $(this).panel('options'); - popts.tab.addClass('tabs-selected'); - // scroll the tab to center position if required. - var wrap = $(container).find('>div.tabs-header>div.tabs-wrap'); - var left = popts.tab.position().left; - var right = left + popts.tab.outerWidth(); - if (left < 0 || right > wrap.width()){ - var deltaX = left - (wrap.width()-popts.tab.width()) / 2; - $(container).tabs('scrollBy', deltaX); - } else { - $(container).tabs('scrollBy', 0); - } - - var panel = $(this).panel('panel'); - panel.css('display','block'); - setSelectedSize(container); - panel.css('display','none'); - }, - onOpen: function(){ - if (options.onOpen){ - options.onOpen.call(this); - } - var popts = $(this).panel('options'); - state.selectHis.push(popts.title); - state.options.onSelect.call(container, popts.title, getTabIndex(container, this)); - }, - onBeforeClose: function(){ - if (options.onBeforeClose){ - if (options.onBeforeClose.call(this) == false){return false;} - } - $(this).panel('options').tab.removeClass('tabs-selected'); - }, - onClose: function(){ - if (options.onClose){ - options.onClose.call(this); - } - var popts = $(this).panel('options'); - state.options.onUnselect.call(container, popts.title, getTabIndex(container, this)); - } - })); - - // only update the tab header - $(container).tabs('update', { - tab: pp, - options: pp.panel('options'), - type: 'header' - }); - } - - function addTab(container, options) { - var state = $.data(container, 'tabs'); - var opts = state.options; - if (options.selected == undefined) options.selected = true; - - createTab(container, options); - opts.onAdd.call(container, options.title, options.index); - if (options.selected){ - selectTab(container, options.index); // select the added tab panel - } - } - - /** - * update tab panel, param has following properties: - * tab: the tab panel to be updated - * options: the tab panel options - * type: the update type, possible values are: 'header','body','all' - */ - function updateTab(container, param){ - param.type = param.type || 'all'; - var selectHis = $.data(container, 'tabs').selectHis; - var pp = param.tab; // the tab panel - var oldTitle = pp.panel('options').title; - - if (param.type == 'all' || param == 'body'){ - pp.panel($.extend({}, param.options, { - iconCls: (param.options.icon ? param.options.icon : undefined) - })); - } - if (param.type == 'all' || param.type == 'header'){ - var opts = pp.panel('options'); // get the tab panel options - var tab = opts.tab; - - if (opts.header){ - tab.find('.tabs-inner').html($(opts.header)); - } else { - var s_title = tab.find('span.tabs-title'); - var s_icon = tab.find('span.tabs-icon'); - s_title.html(opts.title); - s_icon.attr('class', 'tabs-icon'); - - tab.find('a.tabs-close').remove(); - if (opts.closable){ - s_title.addClass('tabs-closable'); - $('').appendTo(tab); - } else{ - s_title.removeClass('tabs-closable'); - } - if (opts.iconCls){ - s_title.addClass('tabs-with-icon'); - s_icon.addClass(opts.iconCls); - } else { - s_title.removeClass('tabs-with-icon'); - } - if (opts.tools){ - var p_tool = tab.find('span.tabs-p-tool'); - if (!p_tool.length){ - var p_tool = $('').insertAfter(tab.find('a.tabs-inner')); - } - if ($.isArray(opts.tools)){ - for(var i=0; i').appendTo(p_tool); - t.addClass(opts.tools[i].iconCls); - if (opts.tools[i].handler){ - t.bind('click', {handler:opts.tools[i].handler}, function(e){ - if ($(this).parents('li').hasClass('tabs-disabled')){return;} - e.data.handler.call(this); - }); - } - } - } else { - $(opts.tools).children().appendTo(p_tool); - } - var pr = p_tool.children().length * 12; - if (opts.closable) { - pr += 8; - } else { - pr -= 3; - p_tool.css('right','5px'); - } - s_title.css('padding-right', pr+'px'); - } else { - tab.find('span.tabs-p-tool').remove(); - s_title.css('padding-right', ''); - } - } - if (oldTitle != opts.title){ - for(var i=0; i= tabs.length){ - return null; - } else { - var tab = tabs[which]; - if (removeit) { - tabs.splice(which, 1); - } - return tab; - } - } - for(var i=0; idiv.tabs-header>div.tabs-wrap'); - var pos = Math.min(wrap._scrollLeft() + deltaX, getMaxScrollWidth()); - wrap.animate({scrollLeft: pos}, opts.scrollDuration); - - function getMaxScrollWidth(){ - var w = 0; - var ul = wrap.children('ul'); - ul.children('li').each(function(){ - w += $(this).outerWidth(true); - }); - return w - wrap.width() + (ul.outerWidth() - ul.width()); - } - }); - } - }; - - $.fn.tabs.parseOptions = function(target){ - return $.extend({}, $.parser.parseOptions(target, [ - 'tools','toolPosition','tabPosition', - {fit:'boolean',border:'boolean',plain:'boolean'}, - {headerWidth:'number',tabWidth:'number',tabHeight:'number',selected:'number'}, - {showHeader:'boolean',justified:'boolean',narrow:'boolean',pill:'boolean'} - ])); - }; - - $.fn.tabs.defaults = { - width: 'auto', - height: 'auto', - headerWidth: 150, // the tab header width, it is valid only when tabPosition set to 'left' or 'right' - tabWidth: 'auto', // the tab width - tabHeight: 27, // the tab height - selected: 0, // the initialized selected tab index - showHeader: true, - plain: false, - fit: false, - border: true, - justified: false, - narrow: false, - pill: false, - tools: null, - toolPosition: 'right', // left,right - tabPosition: 'top', // possible values: top,bottom - scrollIncrement: 100, - scrollDuration: 400, - onLoad: function(panel){}, - onSelect: function(title, index){}, - onUnselect: function(title, index){}, - onBeforeClose: function(title, index){}, - onClose: function(title, index){}, - onAdd: function(title, index){}, - onUpdate: function(title, index){}, - onContextMenu: function(e, title, index){} - }; -})(jQuery); +/** + * jQuery EasyUI 1.4.2 + * + * Copyright (c) 2009-2015 www.jeasyui.com. All rights reserved. + * + * Licensed under the GPL license: http://www.gnu.org/licenses/gpl.txt + * To use it on other terms please contact us at info@jeasyui.com + * + */ +/** + * tabs - jQuery EasyUI + * + * Dependencies: + * panel + * linkbutton + * + */ +(function($){ + function getContentWidth(c){ + var w = 0; + $(c).children().each(function(){ + w += $(this).outerWidth(true); + }); + return w; + } + /** + * set the tabs scrollers to show or not, + * dependent on the tabs count and width + */ + function setScrollers(container) { + var opts = $.data(container, 'tabs').options; + if (opts.tabPosition == 'left' || opts.tabPosition == 'right' || !opts.showHeader){return} + + var header = $(container).children('div.tabs-header'); + var tool = header.children('div.tabs-tool'); + var sLeft = header.children('div.tabs-scroller-left'); + var sRight = header.children('div.tabs-scroller-right'); + var wrap = header.children('div.tabs-wrap'); + + // set the tool height + var tHeight = header.outerHeight(); + if (opts.plain){ + tHeight -= tHeight - header.height(); + } + tool._outerHeight(tHeight); + + var tabsWidth = getContentWidth(header.find('ul.tabs')); + var cWidth = header.width() - tool._outerWidth(); + + if (tabsWidth > cWidth) { + sLeft.add(sRight).show()._outerHeight(tHeight); + if (opts.toolPosition == 'left'){ + tool.css({ + left: sLeft.outerWidth(), + right: '' + }); + wrap.css({ + marginLeft: sLeft.outerWidth() + tool._outerWidth(), + marginRight: sRight._outerWidth(), + width: cWidth - sLeft.outerWidth() - sRight.outerWidth() + }); + } else { + tool.css({ + left: '', + right: sRight.outerWidth() + }); + wrap.css({ + marginLeft: sLeft.outerWidth(), + marginRight: sRight.outerWidth() + tool._outerWidth(), + width: cWidth - sLeft.outerWidth() - sRight.outerWidth() + }); + } + } else { + sLeft.add(sRight).hide(); + if (opts.toolPosition == 'left'){ + tool.css({ + left: 0, + right: '' + }); + wrap.css({ + marginLeft: tool._outerWidth(), + marginRight: 0, + width: cWidth + }); + } else { + tool.css({ + left: '', + right: 0 + }); + wrap.css({ + marginLeft: 0, + marginRight: tool._outerWidth(), + width: cWidth + }); + } + } + } + + function addTools(container){ + var opts = $.data(container, 'tabs').options; + var header = $(container).children('div.tabs-header'); + if (opts.tools) { + if (typeof opts.tools == 'string'){ + $(opts.tools).addClass('tabs-tool').appendTo(header); + $(opts.tools).show(); + } else { + header.children('div.tabs-tool').remove(); + var tools = $('
                                                                    ').appendTo(header); + var tr = tools.find('tr'); + for(var i=0; i').appendTo(tr); + var tool = $('').appendTo(td); + tool[0].onclick = eval(opts.tools[i].handler || function(){}); + tool.linkbutton($.extend({}, opts.tools[i], { + plain: true + })); + } + } + } else { + header.children('div.tabs-tool').remove(); + } + } + + function setSize(container, param) { + var state = $.data(container, 'tabs'); + var opts = state.options; + var cc = $(container); + + if (!opts.doSize){return} + if (param){ + $.extend(opts, { + width: param.width, + height: param.height + }); + } + cc._size(opts); + + var header = cc.children('div.tabs-header'); + var panels = cc.children('div.tabs-panels'); + var wrap = header.find('div.tabs-wrap'); + var ul = wrap.find('.tabs'); + ul.children('li').removeClass('tabs-first tabs-last'); + ul.children('li:first').addClass('tabs-first'); + ul.children('li:last').addClass('tabs-last'); + + if (opts.tabPosition == 'left' || opts.tabPosition == 'right'){ + header._outerWidth(opts.showHeader ? opts.headerWidth : 0); + panels._outerWidth(cc.width() - header.outerWidth()); + header.add(panels)._outerHeight(opts.height); + wrap._outerWidth(header.width()); + ul._outerWidth(wrap.width()).css('height',''); + } else { + header.children('div.tabs-scroller-left,div.tabs-scroller-right,div.tabs-tool').css('display', opts.showHeader?'block':'none'); + header._outerWidth(cc.width()).css('height',''); + if (opts.showHeader){ + header.css('background-color',''); + wrap.css('height',''); + } else { + header.css('background-color','transparent'); + header._outerHeight(0); + wrap._outerHeight(0); + } + ul._outerHeight(opts.tabHeight).css('width',''); + ul._outerHeight(ul.outerHeight()-ul.height()-1+opts.tabHeight).css('width',''); + + panels._size('height', isNaN(opts.height) ? '' : (opts.height-header.outerHeight())); + panels._size('width', isNaN(opts.width) ? '' : opts.width); + } + + if (state.tabs.length){ + var d1 = ul.outerWidth(true) - ul.width(); + var li = ul.children('li:first'); + var d2 = li.outerWidth(true) - li.width(); + var hwidth = header.width() - header.children('.tabs-tool')._outerWidth(); + var justifiedWidth = Math.floor((hwidth-d1-d2*state.tabs.length)/state.tabs.length); + + $.map(state.tabs, function(p){ + setTabSize(p, (opts.justified && $.inArray(opts.tabPosition,['top','bottom'])>=0) ? justifiedWidth : undefined); + }); + if (opts.justified && $.inArray(opts.tabPosition,['top','bottom'])>=0){ + var deltaWidth = hwidth - d1 - getContentWidth(ul); + setTabSize(state.tabs[state.tabs.length-1], justifiedWidth+deltaWidth); + } + } + setScrollers(container); + + function setTabSize(p, width){ + var p_opts = p.panel('options'); + var p_t = p_opts.tab.find('a.tabs-inner'); + var width = width ? width : (parseInt(p_opts.tabWidth||opts.tabWidth||undefined)); + if (width){ + p_t._outerWidth(width); + } else { + p_t.css('width', ''); + } + p_t._outerHeight(opts.tabHeight); + p_t.css('lineHeight', p_t.height()+'px'); + p_t.find('.easyui-fluid:visible').triggerHandler('_resize'); + } + } + + /** + * set selected tab panel size + */ + function setSelectedSize(container){ + var opts = $.data(container, 'tabs').options; + var tab = getSelectedTab(container); + if (tab){ + var panels = $(container).children('div.tabs-panels'); + var width = opts.width=='auto' ? 'auto' : panels.width(); + var height = opts.height=='auto' ? 'auto' : panels.height(); + tab.panel('resize', { + width: width, + height: height + }); + } + } + + /** + * wrap the tabs header and body + */ + function wrapTabs(container) { + var tabs = $.data(container, 'tabs').tabs; + var cc = $(container).addClass('tabs-container'); + var panels = $('
                                                                    ').insertBefore(cc); + cc.children('div').each(function(){ + panels[0].appendChild(this); + }); + cc[0].appendChild(panels[0]); + $('
                                                                    ' + + '
                                                                    ' + + '
                                                                    ' + + '
                                                                    ' + + '
                                                                      ' + + '
                                                                      ' + + '
                                                                      ').prependTo(container); + + cc.children('div.tabs-panels').children('div').each(function(i){ + var opts = $.extend({}, $.parser.parseOptions(this), { + selected: ($(this).attr('selected') ? true : undefined) + }); + createTab(container, opts, $(this)); + }); + + cc.children('div.tabs-header').find('.tabs-scroller-left, .tabs-scroller-right').hover( + function(){$(this).addClass('tabs-scroller-over');}, + function(){$(this).removeClass('tabs-scroller-over');} + ); + cc.bind('_resize', function(e,force){ + if ($(this).hasClass('easyui-fluid') || force){ + setSize(container); + setSelectedSize(container); + } + return false; + }); + } + + function bindEvents(container){ + var state = $.data(container, 'tabs') + var opts = state.options; + $(container).children('div.tabs-header').unbind().bind('click', function(e){ + if ($(e.target).hasClass('tabs-scroller-left')){ + $(container).tabs('scrollBy', -opts.scrollIncrement); + } else if ($(e.target).hasClass('tabs-scroller-right')){ + $(container).tabs('scrollBy', opts.scrollIncrement); + } else { + var li = $(e.target).closest('li'); + if (li.hasClass('tabs-disabled')){return false;} + var a = $(e.target).closest('a.tabs-close'); + if (a.length){ + closeTab(container, getLiIndex(li)); + } else if (li.length){ +// selectTab(container, getLiIndex(li)); + var index = getLiIndex(li); + var popts = state.tabs[index].panel('options'); + if (popts.collapsible){ + popts.closed ? selectTab(container, index) : unselectTab(container, index); + } else { + selectTab(container, index); + } + } + return false; + } + }).bind('contextmenu', function(e){ + var li = $(e.target).closest('li'); + if (li.hasClass('tabs-disabled')){return;} + if (li.length){ + opts.onContextMenu.call(container, e, li.find('span.tabs-title').html(), getLiIndex(li)); + } + }); + + function getLiIndex(li){ + var index = 0; + li.parent().children('li').each(function(i){ + if (li[0] == this){ + index = i; + return false; + } + }); + return index; + } + } + + function setProperties(container){ + var opts = $.data(container, 'tabs').options; + var header = $(container).children('div.tabs-header'); + var panels = $(container).children('div.tabs-panels'); + + header.removeClass('tabs-header-top tabs-header-bottom tabs-header-left tabs-header-right'); + panels.removeClass('tabs-panels-top tabs-panels-bottom tabs-panels-left tabs-panels-right'); + if (opts.tabPosition == 'top'){ + header.insertBefore(panels); + } else if (opts.tabPosition == 'bottom'){ + header.insertAfter(panels); + header.addClass('tabs-header-bottom'); + panels.addClass('tabs-panels-top'); + } else if (opts.tabPosition == 'left'){ + header.addClass('tabs-header-left'); + panels.addClass('tabs-panels-right'); + } else if (opts.tabPosition == 'right'){ + header.addClass('tabs-header-right'); + panels.addClass('tabs-panels-left'); + } + + if (opts.plain == true) { + header.addClass('tabs-header-plain'); + } else { + header.removeClass('tabs-header-plain'); + } + header.removeClass('tabs-header-narrow').addClass(opts.narrow?'tabs-header-narrow':''); + var tabs = header.find('.tabs'); + tabs.removeClass('tabs-pill').addClass(opts.pill?'tabs-pill':''); + tabs.removeClass('tabs-narrow').addClass(opts.narrow?'tabs-narrow':''); + tabs.removeClass('tabs-justified').addClass(opts.justified?'tabs-justified':''); + if (opts.border == true){ + header.removeClass('tabs-header-noborder'); + panels.removeClass('tabs-panels-noborder'); + } else { + header.addClass('tabs-header-noborder'); + panels.addClass('tabs-panels-noborder'); + } + opts.doSize = true; + } + + function createTab(container, options, pp) { + options = options || {}; + var state = $.data(container, 'tabs'); + var tabs = state.tabs; + if (options.index == undefined || options.index > tabs.length){options.index = tabs.length} + if (options.index < 0){options.index = 0} + + var ul = $(container).children('div.tabs-header').find('ul.tabs'); + var panels = $(container).children('div.tabs-panels'); + var tab = $( + '
                                                                    • ' + + '' + + '' + + '' + + '' + + '
                                                                    • '); + if (!pp){pp = $('
                                                                      ');} + if (options.index >= tabs.length){ + tab.appendTo(ul); + pp.appendTo(panels); + tabs.push(pp); + } else { + tab.insertBefore(ul.children('li:eq('+options.index+')')); + pp.insertBefore(panels.children('div.panel:eq('+options.index+')')); + tabs.splice(options.index, 0, pp); + } + + // create panel + pp.panel($.extend({}, options, { + tab: tab, + border: false, + noheader: true, + closed: true, + doSize: false, + iconCls: (options.icon ? options.icon : undefined), + onLoad: function(){ + if (options.onLoad){ + options.onLoad.call(this, arguments); + } + state.options.onLoad.call(container, $(this)); + }, + onBeforeOpen: function(){ + if (options.onBeforeOpen){ + if (options.onBeforeOpen.call(this) == false){return false;} + } + var p = $(container).tabs('getSelected'); + if (p){ + if (p[0] != this){ + $(container).tabs('unselect', getTabIndex(container, p)); + p = $(container).tabs('getSelected'); + if (p){ + return false; + } + } else { + setSelectedSize(container); + return false; + } + } + + var popts = $(this).panel('options'); + popts.tab.addClass('tabs-selected'); + // scroll the tab to center position if required. + var wrap = $(container).find('>div.tabs-header>div.tabs-wrap'); + var left = popts.tab.position().left; + var right = left + popts.tab.outerWidth(); + if (left < 0 || right > wrap.width()){ + var deltaX = left - (wrap.width()-popts.tab.width()) / 2; + $(container).tabs('scrollBy', deltaX); + } else { + $(container).tabs('scrollBy', 0); + } + + var panel = $(this).panel('panel'); + panel.css('display','block'); + setSelectedSize(container); + panel.css('display','none'); + }, + onOpen: function(){ + if (options.onOpen){ + options.onOpen.call(this); + } + var popts = $(this).panel('options'); + state.selectHis.push(popts.title); + state.options.onSelect.call(container, popts.title, getTabIndex(container, this)); + }, + onBeforeClose: function(){ + if (options.onBeforeClose){ + if (options.onBeforeClose.call(this) == false){return false;} + } + $(this).panel('options').tab.removeClass('tabs-selected'); + }, + onClose: function(){ + if (options.onClose){ + options.onClose.call(this); + } + var popts = $(this).panel('options'); + state.options.onUnselect.call(container, popts.title, getTabIndex(container, this)); + } + })); + + // only update the tab header + $(container).tabs('update', { + tab: pp, + options: pp.panel('options'), + type: 'header' + }); + } + + function addTab(container, options) { + var state = $.data(container, 'tabs'); + var opts = state.options; + if (options.selected == undefined) options.selected = true; + + createTab(container, options); + opts.onAdd.call(container, options.title, options.index); + if (options.selected){ + selectTab(container, options.index); // select the added tab panel + } + } + + /** + * update tab panel, param has following properties: + * tab: the tab panel to be updated + * options: the tab panel options + * type: the update type, possible values are: 'header','body','all' + */ + function updateTab(container, param){ + param.type = param.type || 'all'; + var selectHis = $.data(container, 'tabs').selectHis; + var pp = param.tab; // the tab panel + var oldTitle = pp.panel('options').title; + + if (param.type == 'all' || param == 'body'){ + pp.panel($.extend({}, param.options, { + iconCls: (param.options.icon ? param.options.icon : undefined) + })); + } + if (param.type == 'all' || param.type == 'header'){ + var opts = pp.panel('options'); // get the tab panel options + var tab = opts.tab; + + if (opts.header){ + tab.find('.tabs-inner').html($(opts.header)); + } else { + var s_title = tab.find('span.tabs-title'); + var s_icon = tab.find('span.tabs-icon'); + s_title.html(opts.title); + s_icon.attr('class', 'tabs-icon'); + + tab.find('a.tabs-close').remove(); + if (opts.closable){ + s_title.addClass('tabs-closable'); + $('').appendTo(tab); + } else{ + s_title.removeClass('tabs-closable'); + } + if (opts.iconCls){ + s_title.addClass('tabs-with-icon'); + s_icon.addClass(opts.iconCls); + } else { + s_title.removeClass('tabs-with-icon'); + } + if (opts.tools){ + var p_tool = tab.find('span.tabs-p-tool'); + if (!p_tool.length){ + var p_tool = $('').insertAfter(tab.find('a.tabs-inner')); + } + if ($.isArray(opts.tools)){ + for(var i=0; i').appendTo(p_tool); + t.addClass(opts.tools[i].iconCls); + if (opts.tools[i].handler){ + t.bind('click', {handler:opts.tools[i].handler}, function(e){ + if ($(this).parents('li').hasClass('tabs-disabled')){return;} + e.data.handler.call(this); + }); + } + } + } else { + $(opts.tools).children().appendTo(p_tool); + } + var pr = p_tool.children().length * 12; + if (opts.closable) { + pr += 8; + } else { + pr -= 3; + p_tool.css('right','5px'); + } + s_title.css('padding-right', pr+'px'); + } else { + tab.find('span.tabs-p-tool').remove(); + s_title.css('padding-right', ''); + } + } + if (oldTitle != opts.title){ + for(var i=0; i= tabs.length){ + return null; + } else { + var tab = tabs[which]; + if (removeit) { + tabs.splice(which, 1); + } + return tab; + } + } + for(var i=0; idiv.tabs-header>div.tabs-wrap'); + var pos = Math.min(wrap._scrollLeft() + deltaX, getMaxScrollWidth()); + wrap.animate({scrollLeft: pos}, opts.scrollDuration); + + function getMaxScrollWidth(){ + var w = 0; + var ul = wrap.children('ul'); + ul.children('li').each(function(){ + w += $(this).outerWidth(true); + }); + return w - wrap.width() + (ul.outerWidth() - ul.width()); + } + }); + } + }; + + $.fn.tabs.parseOptions = function(target){ + return $.extend({}, $.parser.parseOptions(target, [ + 'tools','toolPosition','tabPosition', + {fit:'boolean',border:'boolean',plain:'boolean'}, + {headerWidth:'number',tabWidth:'number',tabHeight:'number',selected:'number'}, + {showHeader:'boolean',justified:'boolean',narrow:'boolean',pill:'boolean'} + ])); + }; + + $.fn.tabs.defaults = { + width: 'auto', + height: 'auto', + headerWidth: 150, // the tab header width, it is valid only when tabPosition set to 'left' or 'right' + tabWidth: 'auto', // the tab width + tabHeight: 27, // the tab height + selected: 0, // the initialized selected tab index + showHeader: true, + plain: false, + fit: false, + border: true, + justified: false, + narrow: false, + pill: false, + tools: null, + toolPosition: 'right', // left,right + tabPosition: 'top', // possible values: top,bottom + scrollIncrement: 100, + scrollDuration: 400, + onLoad: function(panel){}, + onSelect: function(title, index){}, + onUnselect: function(title, index){}, + onBeforeClose: function(title, index){}, + onClose: function(title, index){}, + onAdd: function(title, index){}, + onUpdate: function(title, index){}, + onContextMenu: function(e, title, index){} + }; +})(jQuery); diff --git a/src/main/webapp/js/easyui/src/jquery.window.js b/src/main/webapp/js/easyui/src/jquery.window.js index e590bcb..209f445 100644 --- a/src/main/webapp/js/easyui/src/jquery.window.js +++ b/src/main/webapp/js/easyui/src/jquery.window.js @@ -1,379 +1,379 @@ -/** - * jQuery EasyUI 1.4.2 - * - * Copyright (c) 2009-2015 www.jeasyui.com. All rights reserved. - * - * Licensed under the GPL license: http://www.gnu.org/licenses/gpl.txt - * To use it on other terms please contact us at info@jeasyui.com - * - */ -/** - * window - jQuery EasyUI - * - * Dependencies: - * panel - * draggable - * resizable - * - */ -(function($){ - function moveWindow(target, param){ - var state = $.data(target, 'window'); - if (param){ - if (param.left != null) state.options.left = param.left; - if (param.top != null) state.options.top = param.top; - } - $(target).panel('move', state.options); - if (state.shadow){ - state.shadow.css({ - left: state.options.left, - top: state.options.top - }); - } - } - - /** - * center the window only horizontally - */ - function hcenter(target, tomove){ - var opts = $.data(target, 'window').options; - var pp = $(target).window('panel'); - var width = pp._outerWidth(); - if (opts.inline){ - var parent = pp.parent(); - opts.left = Math.ceil((parent.width() - width) / 2 + parent.scrollLeft()); - } else { - opts.left = Math.ceil(($(window)._outerWidth() - width) / 2 + $(document).scrollLeft()); - } - if (tomove){moveWindow(target);} - } - - /** - * center the window only vertically - */ - function vcenter(target, tomove){ - var opts = $.data(target, 'window').options; - var pp = $(target).window('panel'); - var height = pp._outerHeight(); - if (opts.inline){ - var parent = pp.parent(); - opts.top = Math.ceil((parent.height() - height) / 2 + parent.scrollTop()); - } else { - opts.top = Math.ceil(($(window)._outerHeight() - height) / 2 + $(document).scrollTop()); - } - if (tomove){moveWindow(target);} - } - - function create(target){ - var state = $.data(target, 'window'); - var opts = state.options; - var win = $(target).panel($.extend({}, state.options, { - border: false, - doSize: true, // size the panel, the property undefined in window component - closed: true, // close the panel - cls: 'window', - headerCls: 'window-header', - bodyCls: 'window-body ' + (opts.noheader ? 'window-body-noheader' : ''), - - onBeforeDestroy: function(){ - if (opts.onBeforeDestroy.call(target) == false){return false;} - if (state.shadow){state.shadow.remove();} - if (state.mask){state.mask.remove();} - }, - onClose: function(){ - if (state.shadow){state.shadow.hide();} - if (state.mask){state.mask.hide();} - opts.onClose.call(target); - }, - onOpen: function(){ - if (state.mask){ - state.mask.css({ - display:'block', - zIndex: $.fn.window.defaults.zIndex++ - }); - } - if (state.shadow){ - state.shadow.css({ - display:'block', - zIndex: $.fn.window.defaults.zIndex++, - left: opts.left, - top: opts.top, - width: state.window._outerWidth(), - height: state.window._outerHeight() - }); - } - state.window.css('z-index', $.fn.window.defaults.zIndex++); - - opts.onOpen.call(target); - }, - onResize: function(width, height){ - var popts = $(this).panel('options'); - $.extend(opts, { - width: popts.width, - height: popts.height, - left: popts.left, - top: popts.top - }); - if (state.shadow){ - state.shadow.css({ - left: opts.left, - top: opts.top, - width: state.window._outerWidth(), - height: state.window._outerHeight() - }); - } - opts.onResize.call(target, width, height); - }, - onMinimize: function(){ - if (state.shadow){state.shadow.hide();} - if (state.mask){state.mask.hide();} - state.options.onMinimize.call(target); - }, - onBeforeCollapse: function(){ - if (opts.onBeforeCollapse.call(target) == false){return false;} - if (state.shadow){state.shadow.hide();} - }, - onExpand: function(){ - if (state.shadow){state.shadow.show();} - opts.onExpand.call(target); - } - })); - - state.window = win.panel('panel'); - - // create mask - if (state.mask){state.mask.remove();} - if (opts.modal == true){ - state.mask = $('
                                                                      ').insertAfter(state.window); - state.mask.css({ - width: (opts.inline ? state.mask.parent().width() : getPageArea().width), - height: (opts.inline ? state.mask.parent().height() : getPageArea().height), - display: 'none' - }); - } - - // create shadow - if (state.shadow){state.shadow.remove();} - if (opts.shadow == true){ - state.shadow = $('
                                                                      ').insertAfter(state.window); - state.shadow.css({ - display: 'none' - }); - } - - // if require center the window - if (opts.left == null){hcenter(target);} - if (opts.top == null){vcenter(target);} - moveWindow(target); - - if (!opts.closed){ - win.window('open'); // open the window - } - } - - - /** - * set window drag and resize property - */ - function setProperties(target){ - var state = $.data(target, 'window'); - - state.window.draggable({ - handle: '>div.panel-header>div.panel-title', - disabled: state.options.draggable == false, - onStartDrag: function(e){ - if (state.mask) state.mask.css('z-index', $.fn.window.defaults.zIndex++); - if (state.shadow) state.shadow.css('z-index', $.fn.window.defaults.zIndex++); - state.window.css('z-index', $.fn.window.defaults.zIndex++); - - if (!state.proxy){ - state.proxy = $('
                                                                      ').insertAfter(state.window); - } - state.proxy.css({ - display:'none', - zIndex: $.fn.window.defaults.zIndex++, - left: e.data.left, - top: e.data.top - }); - state.proxy._outerWidth(state.window._outerWidth()); - state.proxy._outerHeight(state.window._outerHeight()); - setTimeout(function(){ - if (state.proxy) state.proxy.show(); - }, 500); - }, - onDrag: function(e){ - state.proxy.css({ - display:'block', - left: e.data.left, - top: e.data.top - }); - return false; - }, - onStopDrag: function(e){ - state.options.left = e.data.left; - state.options.top = e.data.top; - $(target).window('move'); - state.proxy.remove(); - state.proxy = null; - } - }); - - state.window.resizable({ - disabled: state.options.resizable == false, - onStartResize:function(e){ - if (state.pmask){state.pmask.remove();} - state.pmask = $('
                                                                      ').insertAfter(state.window); - state.pmask.css({ - zIndex: $.fn.window.defaults.zIndex++, - left: e.data.left, - top: e.data.top, - width: state.window._outerWidth(), - height: state.window._outerHeight() - }); - if (state.proxy){state.proxy.remove();} - state.proxy = $('
                                                                      ').insertAfter(state.window); - state.proxy.css({ - zIndex: $.fn.window.defaults.zIndex++, - left: e.data.left, - top: e.data.top - }); - state.proxy._outerWidth(e.data.width)._outerHeight(e.data.height); - }, - onResize: function(e){ - state.proxy.css({ - left: e.data.left, - top: e.data.top - }); - state.proxy._outerWidth(e.data.width); - state.proxy._outerHeight(e.data.height); - return false; - }, - onStopResize: function(e){ - $(target).window('resize', e.data); - state.pmask.remove(); - state.pmask = null; - state.proxy.remove(); - state.proxy = null; - } - }); - } - - function getPageArea() { - if (document.compatMode == 'BackCompat') { - return { - width: Math.max(document.body.scrollWidth, document.body.clientWidth), - height: Math.max(document.body.scrollHeight, document.body.clientHeight) - } - } else { - return { - width: Math.max(document.documentElement.scrollWidth, document.documentElement.clientWidth), - height: Math.max(document.documentElement.scrollHeight, document.documentElement.clientHeight) - } - } - } - - // when window resize, reset the width and height of the window's mask - $(window).resize(function(){ - $('body>div.window-mask').css({ - width: $(window)._outerWidth(), - height: $(window)._outerHeight() - }); - setTimeout(function(){ - $('body>div.window-mask').css({ - width: getPageArea().width, - height: getPageArea().height - }); - }, 50); - }); - - $.fn.window = function(options, param){ - if (typeof options == 'string'){ - var method = $.fn.window.methods[options]; - if (method){ - return method(this, param); - } else { - return this.panel(options, param); - } - } - - options = options || {}; - return this.each(function(){ - var state = $.data(this, 'window'); - if (state){ - $.extend(state.options, options); - } else { - state = $.data(this, 'window', { - options: $.extend({}, $.fn.window.defaults, $.fn.window.parseOptions(this), options) - }); - if (!state.options.inline){ -// $(this).appendTo('body'); - document.body.appendChild(this); - } - } - create(this); - setProperties(this); - }); - }; - - $.fn.window.methods = { - options: function(jq){ - var popts = jq.panel('options'); - var wopts = $.data(jq[0], 'window').options; - return $.extend(wopts, { - closed: popts.closed, - collapsed: popts.collapsed, - minimized: popts.minimized, - maximized: popts.maximized - }); - }, - window: function(jq){ - return $.data(jq[0], 'window').window; - }, - move: function(jq, param){ - return jq.each(function(){ - moveWindow(this, param); - }); - }, - hcenter: function(jq){ - return jq.each(function(){ - hcenter(this, true); - }); - }, - vcenter: function(jq){ - return jq.each(function(){ - vcenter(this, true); - }); - }, - center: function(jq){ - return jq.each(function(){ - hcenter(this); - vcenter(this); - moveWindow(this); - }); - } - }; - - $.fn.window.parseOptions = function(target){ - return $.extend({}, $.fn.panel.parseOptions(target), $.parser.parseOptions(target, [ - {draggable:'boolean',resizable:'boolean',shadow:'boolean',modal:'boolean',inline:'boolean'} - ])); - }; - - // Inherited from $.fn.panel.defaults - $.fn.window.defaults = $.extend({}, $.fn.panel.defaults, { - zIndex: 9000, - draggable: true, - resizable: true, - shadow: true, - modal: false, - inline: false, // true to stay inside its parent, false to go on top of all elements - - // window's property which difference from panel - title: 'New Window', - collapsible: true, - minimizable: true, - maximizable: true, - closable: true, - closed: false - }); -})(jQuery); +/** + * jQuery EasyUI 1.4.2 + * + * Copyright (c) 2009-2015 www.jeasyui.com. All rights reserved. + * + * Licensed under the GPL license: http://www.gnu.org/licenses/gpl.txt + * To use it on other terms please contact us at info@jeasyui.com + * + */ +/** + * window - jQuery EasyUI + * + * Dependencies: + * panel + * draggable + * resizable + * + */ +(function($){ + function moveWindow(target, param){ + var state = $.data(target, 'window'); + if (param){ + if (param.left != null) state.options.left = param.left; + if (param.top != null) state.options.top = param.top; + } + $(target).panel('move', state.options); + if (state.shadow){ + state.shadow.css({ + left: state.options.left, + top: state.options.top + }); + } + } + + /** + * center the window only horizontally + */ + function hcenter(target, tomove){ + var opts = $.data(target, 'window').options; + var pp = $(target).window('panel'); + var width = pp._outerWidth(); + if (opts.inline){ + var parent = pp.parent(); + opts.left = Math.ceil((parent.width() - width) / 2 + parent.scrollLeft()); + } else { + opts.left = Math.ceil(($(window)._outerWidth() - width) / 2 + $(document).scrollLeft()); + } + if (tomove){moveWindow(target);} + } + + /** + * center the window only vertically + */ + function vcenter(target, tomove){ + var opts = $.data(target, 'window').options; + var pp = $(target).window('panel'); + var height = pp._outerHeight(); + if (opts.inline){ + var parent = pp.parent(); + opts.top = Math.ceil((parent.height() - height) / 2 + parent.scrollTop()); + } else { + opts.top = Math.ceil(($(window)._outerHeight() - height) / 2 + $(document).scrollTop()); + } + if (tomove){moveWindow(target);} + } + + function create(target){ + var state = $.data(target, 'window'); + var opts = state.options; + var win = $(target).panel($.extend({}, state.options, { + border: false, + doSize: true, // size the panel, the property undefined in window component + closed: true, // close the panel + cls: 'window', + headerCls: 'window-header', + bodyCls: 'window-body ' + (opts.noheader ? 'window-body-noheader' : ''), + + onBeforeDestroy: function(){ + if (opts.onBeforeDestroy.call(target) == false){return false;} + if (state.shadow){state.shadow.remove();} + if (state.mask){state.mask.remove();} + }, + onClose: function(){ + if (state.shadow){state.shadow.hide();} + if (state.mask){state.mask.hide();} + opts.onClose.call(target); + }, + onOpen: function(){ + if (state.mask){ + state.mask.css({ + display:'block', + zIndex: $.fn.window.defaults.zIndex++ + }); + } + if (state.shadow){ + state.shadow.css({ + display:'block', + zIndex: $.fn.window.defaults.zIndex++, + left: opts.left, + top: opts.top, + width: state.window._outerWidth(), + height: state.window._outerHeight() + }); + } + state.window.css('z-index', $.fn.window.defaults.zIndex++); + + opts.onOpen.call(target); + }, + onResize: function(width, height){ + var popts = $(this).panel('options'); + $.extend(opts, { + width: popts.width, + height: popts.height, + left: popts.left, + top: popts.top + }); + if (state.shadow){ + state.shadow.css({ + left: opts.left, + top: opts.top, + width: state.window._outerWidth(), + height: state.window._outerHeight() + }); + } + opts.onResize.call(target, width, height); + }, + onMinimize: function(){ + if (state.shadow){state.shadow.hide();} + if (state.mask){state.mask.hide();} + state.options.onMinimize.call(target); + }, + onBeforeCollapse: function(){ + if (opts.onBeforeCollapse.call(target) == false){return false;} + if (state.shadow){state.shadow.hide();} + }, + onExpand: function(){ + if (state.shadow){state.shadow.show();} + opts.onExpand.call(target); + } + })); + + state.window = win.panel('panel'); + + // create mask + if (state.mask){state.mask.remove();} + if (opts.modal == true){ + state.mask = $('
                                                                      ').insertAfter(state.window); + state.mask.css({ + width: (opts.inline ? state.mask.parent().width() : getPageArea().width), + height: (opts.inline ? state.mask.parent().height() : getPageArea().height), + display: 'none' + }); + } + + // create shadow + if (state.shadow){state.shadow.remove();} + if (opts.shadow == true){ + state.shadow = $('
                                                                      ').insertAfter(state.window); + state.shadow.css({ + display: 'none' + }); + } + + // if require center the window + if (opts.left == null){hcenter(target);} + if (opts.top == null){vcenter(target);} + moveWindow(target); + + if (!opts.closed){ + win.window('open'); // open the window + } + } + + + /** + * set window drag and resize property + */ + function setProperties(target){ + var state = $.data(target, 'window'); + + state.window.draggable({ + handle: '>div.panel-header>div.panel-title', + disabled: state.options.draggable == false, + onStartDrag: function(e){ + if (state.mask) state.mask.css('z-index', $.fn.window.defaults.zIndex++); + if (state.shadow) state.shadow.css('z-index', $.fn.window.defaults.zIndex++); + state.window.css('z-index', $.fn.window.defaults.zIndex++); + + if (!state.proxy){ + state.proxy = $('
                                                                      ').insertAfter(state.window); + } + state.proxy.css({ + display:'none', + zIndex: $.fn.window.defaults.zIndex++, + left: e.data.left, + top: e.data.top + }); + state.proxy._outerWidth(state.window._outerWidth()); + state.proxy._outerHeight(state.window._outerHeight()); + setTimeout(function(){ + if (state.proxy) state.proxy.show(); + }, 500); + }, + onDrag: function(e){ + state.proxy.css({ + display:'block', + left: e.data.left, + top: e.data.top + }); + return false; + }, + onStopDrag: function(e){ + state.options.left = e.data.left; + state.options.top = e.data.top; + $(target).window('move'); + state.proxy.remove(); + state.proxy = null; + } + }); + + state.window.resizable({ + disabled: state.options.resizable == false, + onStartResize:function(e){ + if (state.pmask){state.pmask.remove();} + state.pmask = $('
                                                                      ').insertAfter(state.window); + state.pmask.css({ + zIndex: $.fn.window.defaults.zIndex++, + left: e.data.left, + top: e.data.top, + width: state.window._outerWidth(), + height: state.window._outerHeight() + }); + if (state.proxy){state.proxy.remove();} + state.proxy = $('
                                                                      ').insertAfter(state.window); + state.proxy.css({ + zIndex: $.fn.window.defaults.zIndex++, + left: e.data.left, + top: e.data.top + }); + state.proxy._outerWidth(e.data.width)._outerHeight(e.data.height); + }, + onResize: function(e){ + state.proxy.css({ + left: e.data.left, + top: e.data.top + }); + state.proxy._outerWidth(e.data.width); + state.proxy._outerHeight(e.data.height); + return false; + }, + onStopResize: function(e){ + $(target).window('resize', e.data); + state.pmask.remove(); + state.pmask = null; + state.proxy.remove(); + state.proxy = null; + } + }); + } + + function getPageArea() { + if (document.compatMode == 'BackCompat') { + return { + width: Math.max(document.body.scrollWidth, document.body.clientWidth), + height: Math.max(document.body.scrollHeight, document.body.clientHeight) + } + } else { + return { + width: Math.max(document.documentElement.scrollWidth, document.documentElement.clientWidth), + height: Math.max(document.documentElement.scrollHeight, document.documentElement.clientHeight) + } + } + } + + // when window resize, reset the width and height of the window's mask + $(window).resize(function(){ + $('body>div.window-mask').css({ + width: $(window)._outerWidth(), + height: $(window)._outerHeight() + }); + setTimeout(function(){ + $('body>div.window-mask').css({ + width: getPageArea().width, + height: getPageArea().height + }); + }, 50); + }); + + $.fn.window = function(options, param){ + if (typeof options == 'string'){ + var method = $.fn.window.methods[options]; + if (method){ + return method(this, param); + } else { + return this.panel(options, param); + } + } + + options = options || {}; + return this.each(function(){ + var state = $.data(this, 'window'); + if (state){ + $.extend(state.options, options); + } else { + state = $.data(this, 'window', { + options: $.extend({}, $.fn.window.defaults, $.fn.window.parseOptions(this), options) + }); + if (!state.options.inline){ +// $(this).appendTo('body'); + document.body.appendChild(this); + } + } + create(this); + setProperties(this); + }); + }; + + $.fn.window.methods = { + options: function(jq){ + var popts = jq.panel('options'); + var wopts = $.data(jq[0], 'window').options; + return $.extend(wopts, { + closed: popts.closed, + collapsed: popts.collapsed, + minimized: popts.minimized, + maximized: popts.maximized + }); + }, + window: function(jq){ + return $.data(jq[0], 'window').window; + }, + move: function(jq, param){ + return jq.each(function(){ + moveWindow(this, param); + }); + }, + hcenter: function(jq){ + return jq.each(function(){ + hcenter(this, true); + }); + }, + vcenter: function(jq){ + return jq.each(function(){ + vcenter(this, true); + }); + }, + center: function(jq){ + return jq.each(function(){ + hcenter(this); + vcenter(this); + moveWindow(this); + }); + } + }; + + $.fn.window.parseOptions = function(target){ + return $.extend({}, $.fn.panel.parseOptions(target), $.parser.parseOptions(target, [ + {draggable:'boolean',resizable:'boolean',shadow:'boolean',modal:'boolean',inline:'boolean'} + ])); + }; + + // Inherited from $.fn.panel.defaults + $.fn.window.defaults = $.extend({}, $.fn.panel.defaults, { + zIndex: 9000, + draggable: true, + resizable: true, + shadow: true, + modal: false, + inline: false, // true to stay inside its parent, false to go on top of all elements + + // window's property which difference from panel + title: 'New Window', + collapsible: true, + minimizable: true, + maximizable: true, + closable: true, + closed: false + }); +})(jQuery); diff --git a/src/main/webapp/js/easyui/themes/color.css b/src/main/webapp/js/easyui/themes/color.css index ee224c9..9f81159 100644 --- a/src/main/webapp/js/easyui/themes/color.css +++ b/src/main/webapp/js/easyui/themes/color.css @@ -1,112 +1,112 @@ -.c1,.c1:hover{ - color: #fff; - border-color: #3c8b3c; - background: #4cae4c; - background: -webkit-linear-gradient(top,#4cae4c 0,#449d44 100%); - background: -moz-linear-gradient(top,#4cae4c 0,#449d44 100%); - background: -o-linear-gradient(top,#4cae4c 0,#449d44 100%); - background: linear-gradient(to bottom,#4cae4c 0,#449d44 100%); - filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#4cae4c,endColorstr=#449d44,GradientType=0); -} -a.c1:hover{ - background: #449d44; - filter: none; -} -.c2,.c2:hover{ - color: #fff; - border-color: #5f5f5f; - background: #747474; - background: -webkit-linear-gradient(top,#747474 0,#676767 100%); - background: -moz-linear-gradient(top,#747474 0,#676767 100%); - background: -o-linear-gradient(top,#747474 0,#676767 100%); - background: linear-gradient(to bottom,#747474 0,#676767 100%); - filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#747474,endColorstr=#676767,GradientType=0); -} -a.c2:hover{ - background: #676767; - filter: none; -} -.c3,.c3:hover{ - color: #333; - border-color: #ff8080; - background: #ffb3b3; - background: -webkit-linear-gradient(top,#ffb3b3 0,#ff9999 100%); - background: -moz-linear-gradient(top,#ffb3b3 0,#ff9999 100%); - background: -o-linear-gradient(top,#ffb3b3 0,#ff9999 100%); - background: linear-gradient(to bottom,#ffb3b3 0,#ff9999 100%); - filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#ffb3b3,endColorstr=#ff9999,GradientType=0); -} -a.c3:hover{ - background: #ff9999; - filter: none; -} -.c4,.c4:hover{ - color: #333; - border-color: #52d689; - background: #b8eecf; - background: -webkit-linear-gradient(top,#b8eecf 0,#a4e9c1 100%); - background: -moz-linear-gradient(top,#b8eecf 0,#a4e9c1 100%); - background: -o-linear-gradient(top,#b8eecf 0,#a4e9c1 100%); - background: linear-gradient(to bottom,#b8eecf 0,#a4e9c1 100%); - filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#b8eecf,endColorstr=#a4e9c1,GradientType=0); -} -a.c4:hover{ - background: #a4e9c1; - filter: none; -} -.c5,.c5:hover{ - color: #fff; - border-color: #b52b27; - background: #d84f4b; - background: -webkit-linear-gradient(top,#d84f4b 0,#c9302c 100%); - background: -moz-linear-gradient(top,#d84f4b 0,#c9302c 100%); - background: -o-linear-gradient(top,#d84f4b 0,#c9302c 100%); - background: linear-gradient(to bottom,#d84f4b 0,#c9302c 100%); - filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#d84f4b,endColorstr=#c9302c,GradientType=0); -} -a.c5:hover{ - background: #c9302c; - filter: none; -} -.c6,.c6:hover{ - color: #fff; - border-color: #1f637b; - background: #2984a4; - background: -webkit-linear-gradient(top,#2984a4 0,#24748f 100%); - background: -moz-linear-gradient(top,#2984a4 0,#24748f 100%); - background: -o-linear-gradient(top,#2984a4 0,#24748f 100%); - background: linear-gradient(to bottom,#2984a4 0,#24748f 100%); - filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#2984a4,endColorstr=#24748f,GradientType=0); -} -a.c6:hover{ - background: #24748f; - filter: none; -} -.c7,.c7:hover{ - color: #333; - border-color: #e68900; - background: #ffab2e; - background: -webkit-linear-gradient(top,#ffab2e 0,#ff9900 100%); - background: -moz-linear-gradient(top,#ffab2e 0,#ff9900 100%); - background: -o-linear-gradient(top,#ffab2e 0,#ff9900 100%); - background: linear-gradient(to bottom,#ffab2e 0,#ff9900 100%); - filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#ffab2e,endColorstr=#ff9900,GradientType=0); -} -a.c7:hover{ - background: #ff9900; - filter: none; -} -.c8,.c8:hover{ - color: #fff; - border-color: #4b72a4; - background: #698cba; - background: -webkit-linear-gradient(top,#698cba 0,#577eb2 100%); - background: -moz-linear-gradient(top,#698cba 0,#577eb2 100%); - background: -o-linear-gradient(top,#698cba 0,#577eb2 100%); - background: linear-gradient(to bottom,#698cba 0,#577eb2 100%); - filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#698cba,endColorstr=#577eb2,GradientType=0); -} -a.c8:hover{ - background: #577eb2; - filter: none; -} +.c1,.c1:hover{ + color: #fff; + border-color: #3c8b3c; + background: #4cae4c; + background: -webkit-linear-gradient(top,#4cae4c 0,#449d44 100%); + background: -moz-linear-gradient(top,#4cae4c 0,#449d44 100%); + background: -o-linear-gradient(top,#4cae4c 0,#449d44 100%); + background: linear-gradient(to bottom,#4cae4c 0,#449d44 100%); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#4cae4c,endColorstr=#449d44,GradientType=0); +} +a.c1:hover{ + background: #449d44; + filter: none; +} +.c2,.c2:hover{ + color: #fff; + border-color: #5f5f5f; + background: #747474; + background: -webkit-linear-gradient(top,#747474 0,#676767 100%); + background: -moz-linear-gradient(top,#747474 0,#676767 100%); + background: -o-linear-gradient(top,#747474 0,#676767 100%); + background: linear-gradient(to bottom,#747474 0,#676767 100%); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#747474,endColorstr=#676767,GradientType=0); +} +a.c2:hover{ + background: #676767; + filter: none; +} +.c3,.c3:hover{ + color: #333; + border-color: #ff8080; + background: #ffb3b3; + background: -webkit-linear-gradient(top,#ffb3b3 0,#ff9999 100%); + background: -moz-linear-gradient(top,#ffb3b3 0,#ff9999 100%); + background: -o-linear-gradient(top,#ffb3b3 0,#ff9999 100%); + background: linear-gradient(to bottom,#ffb3b3 0,#ff9999 100%); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#ffb3b3,endColorstr=#ff9999,GradientType=0); +} +a.c3:hover{ + background: #ff9999; + filter: none; +} +.c4,.c4:hover{ + color: #333; + border-color: #52d689; + background: #b8eecf; + background: -webkit-linear-gradient(top,#b8eecf 0,#a4e9c1 100%); + background: -moz-linear-gradient(top,#b8eecf 0,#a4e9c1 100%); + background: -o-linear-gradient(top,#b8eecf 0,#a4e9c1 100%); + background: linear-gradient(to bottom,#b8eecf 0,#a4e9c1 100%); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#b8eecf,endColorstr=#a4e9c1,GradientType=0); +} +a.c4:hover{ + background: #a4e9c1; + filter: none; +} +.c5,.c5:hover{ + color: #fff; + border-color: #b52b27; + background: #d84f4b; + background: -webkit-linear-gradient(top,#d84f4b 0,#c9302c 100%); + background: -moz-linear-gradient(top,#d84f4b 0,#c9302c 100%); + background: -o-linear-gradient(top,#d84f4b 0,#c9302c 100%); + background: linear-gradient(to bottom,#d84f4b 0,#c9302c 100%); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#d84f4b,endColorstr=#c9302c,GradientType=0); +} +a.c5:hover{ + background: #c9302c; + filter: none; +} +.c6,.c6:hover{ + color: #fff; + border-color: #1f637b; + background: #2984a4; + background: -webkit-linear-gradient(top,#2984a4 0,#24748f 100%); + background: -moz-linear-gradient(top,#2984a4 0,#24748f 100%); + background: -o-linear-gradient(top,#2984a4 0,#24748f 100%); + background: linear-gradient(to bottom,#2984a4 0,#24748f 100%); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#2984a4,endColorstr=#24748f,GradientType=0); +} +a.c6:hover{ + background: #24748f; + filter: none; +} +.c7,.c7:hover{ + color: #333; + border-color: #e68900; + background: #ffab2e; + background: -webkit-linear-gradient(top,#ffab2e 0,#ff9900 100%); + background: -moz-linear-gradient(top,#ffab2e 0,#ff9900 100%); + background: -o-linear-gradient(top,#ffab2e 0,#ff9900 100%); + background: linear-gradient(to bottom,#ffab2e 0,#ff9900 100%); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#ffab2e,endColorstr=#ff9900,GradientType=0); +} +a.c7:hover{ + background: #ff9900; + filter: none; +} +.c8,.c8:hover{ + color: #fff; + border-color: #4b72a4; + background: #698cba; + background: -webkit-linear-gradient(top,#698cba 0,#577eb2 100%); + background: -moz-linear-gradient(top,#698cba 0,#577eb2 100%); + background: -o-linear-gradient(top,#698cba 0,#577eb2 100%); + background: linear-gradient(to bottom,#698cba 0,#577eb2 100%); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#698cba,endColorstr=#577eb2,GradientType=0); +} +a.c8:hover{ + background: #577eb2; + filter: none; +} diff --git a/src/main/webapp/js/easyui/themes/icon.css b/src/main/webapp/js/easyui/themes/icon.css index 50d4f1b..c2d3b21 100644 --- a/src/main/webapp/js/easyui/themes/icon.css +++ b/src/main/webapp/js/easyui/themes/icon.css @@ -1,96 +1,96 @@ -.icon-blank{ - background:url('icons/blank.gif') no-repeat center center; -} -.icon-add{ - background:url('icons/edit_add.png') no-repeat center center; -} -.icon-edit{ - background:url('icons/pencil.png') no-repeat center center; -} -.icon-clear{ - background:url('icons/clear.png') no-repeat center center; -} -.icon-remove{ - background:url('icons/edit_remove.png') no-repeat center center; -} -.icon-save{ - background:url('icons/filesave.png') no-repeat center center; -} -.icon-cut{ - background:url('icons/cut.png') no-repeat center center; -} -.icon-ok{ - background:url('icons/ok.png') no-repeat center center; -} -.icon-no{ - background:url('icons/no.png') no-repeat center center; -} -.icon-cancel{ - background:url('icons/cancel.png') no-repeat center center; -} -.icon-reload{ - background:url('icons/reload.png') no-repeat center center; -} -.icon-search{ - background:url('icons/search.png') no-repeat center center; -} -.icon-print{ - background:url('icons/print.png') no-repeat center center; -} -.icon-help{ - background:url('icons/help.png') no-repeat center center; -} -.icon-undo{ - background:url('icons/undo.png') no-repeat center center; -} -.icon-redo{ - background:url('icons/redo.png') no-repeat center center; -} -.icon-back{ - background:url('icons/back.png') no-repeat center center; -} -.icon-sum{ - background:url('icons/sum.png') no-repeat center center; -} -.icon-tip{ - background:url('icons/tip.png') no-repeat center center; -} -.icon-filter{ - background:url('icons/filter.png') no-repeat center center; -} -.icon-man{ - background:url('icons/man.png') no-repeat center center; -} -.icon-lock{ - background:url('icons/lock.png') no-repeat center center; -} -.icon-more{ - background:url('icons/more.png') no-repeat center center; -} - - -.icon-mini-add{ - background:url('icons/mini_add.png') no-repeat center center; -} -.icon-mini-edit{ - background:url('icons/mini_edit.png') no-repeat center center; -} -.icon-mini-refresh{ - background:url('icons/mini_refresh.png') no-repeat center center; -} - -.icon-large-picture{ - background:url('icons/large_picture.png') no-repeat center center; -} -.icon-large-clipart{ - background:url('icons/large_clipart.png') no-repeat center center; -} -.icon-large-shapes{ - background:url('icons/large_shapes.png') no-repeat center center; -} -.icon-large-smartart{ - background:url('icons/large_smartart.png') no-repeat center center; -} -.icon-large-chart{ - background:url('icons/large_chart.png') no-repeat center center; -} +.icon-blank{ + background:url('icons/blank.gif') no-repeat center center; +} +.icon-add{ + background:url('icons/edit_add.png') no-repeat center center; +} +.icon-edit{ + background:url('icons/pencil.png') no-repeat center center; +} +.icon-clear{ + background:url('icons/clear.png') no-repeat center center; +} +.icon-remove{ + background:url('icons/edit_remove.png') no-repeat center center; +} +.icon-save{ + background:url('icons/filesave.png') no-repeat center center; +} +.icon-cut{ + background:url('icons/cut.png') no-repeat center center; +} +.icon-ok{ + background:url('icons/ok.png') no-repeat center center; +} +.icon-no{ + background:url('icons/no.png') no-repeat center center; +} +.icon-cancel{ + background:url('icons/cancel.png') no-repeat center center; +} +.icon-reload{ + background:url('icons/reload.png') no-repeat center center; +} +.icon-search{ + background:url('icons/search.png') no-repeat center center; +} +.icon-print{ + background:url('icons/print.png') no-repeat center center; +} +.icon-help{ + background:url('icons/help.png') no-repeat center center; +} +.icon-undo{ + background:url('icons/undo.png') no-repeat center center; +} +.icon-redo{ + background:url('icons/redo.png') no-repeat center center; +} +.icon-back{ + background:url('icons/back.png') no-repeat center center; +} +.icon-sum{ + background:url('icons/sum.png') no-repeat center center; +} +.icon-tip{ + background:url('icons/tip.png') no-repeat center center; +} +.icon-filter{ + background:url('icons/filter.png') no-repeat center center; +} +.icon-man{ + background:url('icons/man.png') no-repeat center center; +} +.icon-lock{ + background:url('icons/lock.png') no-repeat center center; +} +.icon-more{ + background:url('icons/more.png') no-repeat center center; +} + + +.icon-mini-add{ + background:url('icons/mini_add.png') no-repeat center center; +} +.icon-mini-edit{ + background:url('icons/mini_edit.png') no-repeat center center; +} +.icon-mini-refresh{ + background:url('icons/mini_refresh.png') no-repeat center center; +} + +.icon-large-picture{ + background:url('icons/large_picture.png') no-repeat center center; +} +.icon-large-clipart{ + background:url('icons/large_clipart.png') no-repeat center center; +} +.icon-large-shapes{ + background:url('icons/large_shapes.png') no-repeat center center; +} +.icon-large-smartart{ + background:url('icons/large_smartart.png') no-repeat center center; +} +.icon-large-chart{ + background:url('icons/large_chart.png') no-repeat center center; +} diff --git a/src/main/webapp/js/ichart.1.2.js b/src/main/webapp/js/ichart.1.2.js index 3e2ec93..cfb85af 100644 --- a/src/main/webapp/js/ichart.1.2.js +++ b/src/main/webapp/js/ichart.1.2.js @@ -1,7815 +1,7815 @@ -/** - * ichartjs Library v1.2 http://www.ichartjs.com/ - * - * @author wanghe - * @Copyright 2013 wanghetommy@gmail.com Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 - */ -; -(function(window) { - var ua = navigator.userAgent.toLowerCase(), mc = function(e) { - return e.test(ua) - }, ts = Object.prototype.toString, isOpera = mc(/opera/), isChrome = mc(/\bchrome\b/), isWebKit = mc(/webkit/), isSafari = !isChrome && mc(/safari/), isIE = !isOpera && mc(/msie/), supportCanvas = !!document.createElement('canvas').getContext, isGecko = !isWebKit - && mc(/gecko/), isMobile = mc(/ipod|ipad|iphone|android/gi), arithmetic = { - Linear : function(t, b, c, d) { - return c * t / d + b; - }, - Cubic : { - easeIn : function(t, b, c, d) { - return c * (t /= d) * t * t + b; - }, - easeOut : function(t, b, c, d) { - return c * ((t = t / d - 1) * t * t + 1) + b; - }, - easeInOut : function(t, b, c, d) { - if ((t /= d / 2) < 1) - return c / 2 * t * t * t + b; - return c / 2 * ((t -= 2) * t * t + 2) + b; - } - } - }; - var iChart_ = (function(window) { - /** - * spirit from jquery - */ - var isReady = false, readyBound = false, readyList = [], DOMContentLoaded = (function() { - if (document.addEventListener) { - return function() { - document.removeEventListener("DOMContentLoaded", DOMContentLoaded, false); - ready(); - }; - } else if (document.attachEvent) { - return function() { - if (document.readyState === "complete") { - document.detachEvent("onreadystatechange", DOMContentLoaded); - ready(); - } - }; - } - })(), doScrollCheck = function() { - if (isReady) { - return; - } - try { - document.documentElement.doScroll("left"); - } catch (e) { - setTimeout(doScrollCheck, 1); - return; - } - ready(); - }, ready = function() { - if (!isReady) { - isReady = true; - for ( var i = 0; i < readyList.length; i++) { - readyList[i].call(document); - } - readyList = []; - } - }, bindReady = function() { - if (readyBound) - return; - readyBound = true; - if (document.readyState === "complete") { - return setTimeout(ready, 1); - } - if (document.addEventListener) { - document.addEventListener("DOMContentLoaded", DOMContentLoaded, false); - window.addEventListener("load", ready, false); - } else if (document.attachEvent) { - document.attachEvent("onreadystatechange", DOMContentLoaded); - window.attachEvent("onload", ready); - var toplevel = false; - - try { - toplevel = window.frameElement == null; - } catch (e) { - } - - if (document.documentElement.doScroll && toplevel) { - doScrollCheck(); - } - } - }, bind = function(fn) { - bindReady(); - if (isReady) - fn.call(document, _); - else - readyList.push(function() { - return fn.call(this); - }); - }, _ = function(selector) { - if (!selector || selector.nodeType) { - return selector; - } - if (typeof selector === "string") { - if (selector.indexOf("#") != -1) { - selector = selector.substring(1); - } - return document.getElementById(selector); - } - if (typeof selector === "function") { - bind(selector); - } - }; - - _.apply = function(d, e) { - if (d && e && typeof e == "object") { - for ( var a in e) { - if (typeof e[a] != 'undefined') - d[a] = e[a] - } - } - if (!e && d) { - var clone = {}; - for ( var a in d) { - clone[a] = d[a] - } - return clone; - } - return d - }; - - _.apply(_, { - version : "1.0", - email : 'taylor@ichartjs.com', - isEmpty : function(C, e) { - return C === null || C === undefined || ((_.isArray(C) && !C.length)) || (!e ? C === "" : false) - }, - isArray : function(e) { - return ts.apply(e) === "[object Array]" - }, - isDate : function(e) { - return ts.apply(e) === "[object Date]" - }, - isObject : function(e) { - return !!e && ts.apply(e) === "[object Object]" - }, - isFunction : function(e) { - return ts.apply(e) === "[object Function]" - }, - isNumber : function(e) { - return typeof e === "number" && isFinite(e) - }, - isString : function(e) { - return typeof e === "string" - }, - isBoolean : function(e) { - return typeof e === "boolean" - }, - isFalse : function(e) { - return typeof e === "boolean" && !e; - }, - isElement : function(e) { - return e ? !!e.tagName : false - }, - isDefined : function(e) { - return typeof e !== "undefined" - } - }); - - /** - * only get the attr that target not exist - */ - _.applyIf = function(d, e) { - if (d && _.isObject(e)) { - for ( var a in e) { - if (_.isDefined(e[a]) && !_.isDefined(d[a])) - d[a] = e[a] - } - } - if (!e && d) { - return _.apply(d); - } - return d - }; - /** - * there will apply a deep clone - */ - _.merge = function(d, e, f) { - if (d && _.isObject(e)) { - for ( var a in e) { - if (_.isDefined(e[a])) { - if (_.isObject(e[a])) { - if (_.isObject(d[a])) { - _.merge(d[a], e[a]); - } else { - d[a] = _.clone(e[a], true); - } - } else { - d[a] = e[a]; - } - } - } - if (_.isObject(f)) { - return _.merge(d, f); - } - } - return d; - }; - /** - * clone attribute that given - */ - _.clone = function(a, e, deep) { - var d = {}; - if (_.isArray(a)&& _.isObject(e)) { - for ( var i = 0; i < a.length; i++) { - if (deep && _.isObject(e[a[i]])) - d[a[i]] = _.clone(e[a[i]],deep); - else - d[a[i]] = e[a[i]]; - } - } else if (_.isObject(a)) { - for ( var b in a) { - // avoid recursion reference - if (e && _.isObject(a[b])&& !(a[b].ICHARTJS_OBJECT)) - d[b] = _.clone(a[b], e); - else - d[b] = a[b]; - } - } - return d; - }; - - _.override = function(e, D) { - if (e&&D) { - var C = e.prototype; - _.apply(C, D); - if (_.isIE && D.hasOwnProperty("toString")) { - C.toString = D.toString - } - } - }; - - /** - * spirit from ext2.0 - */ - _.extend = function() { - var C = function(E) { - for ( var D in E) { - this[D] = E[D]; - } - }; - var e = Object.prototype.constructor; - return function(G, O) { - var J = function() { - G.apply(this, arguments); - } - var E = function() { - }, H, D = G.prototype; - E.prototype = D; - H = J.prototype = new E(); - H.constructor = J; - J.superclass = D; - if (D.constructor == e) { - D.constructor = G; - } - J.override = function(F) { - _.override(J, F); - }; - H.superclass = H.supr = (function() { - return D; - }); - H.override = C; - _.override(J, O); - J.extend = function(F) { - return _.extend(J, F) - }; - J.plugin_ = {}; - - J.plugin = function(M,F) { - if (_.isString(M) && _.isFunction(F)) - J.plugin_[M] = F; - }; - return J; - } - }(); - - var sin = Math.sin, cos = Math.cos, atan = Math.atan, tan = Math.tan, acos = Math.acos, sqrt = Math.sqrt, abs = Math.abs, pi = Math.PI, pi2 = 2 * pi, ceil = Math.ceil, round = Math.round, floor = Math.floor, max = Math.max, min = Math.min, pF = parseFloat, - Registry={},Repository={}, - factor = function(v, w) { - if (v == 0) - return v; - var M = abs(v),f = 0.1; - if(M>1){ - while(M>1){ - M = M/10; - f = f*10; - } - return floor(v/f+w)*f; - }else{ - f = 1; - while(M<1){ - M = M*10; - f = f *10; - } - return round(v*f+w)/f; - } - }, colors = { - white : 'rgb(255,255,255)', - green : 'rgb(0,128,0)', - gray : 'rgb(80,80,80)', - red : 'rgb(255,0,0)', - blue : 'rgb(0,0,255)', - yellow : 'rgb(255,255,0)', - black : 'rgb(0,0,0)' - }, hex2Rgb = function(hex) { - hex = hex.replace(/#/g, "").replace(/^(\w)(\w)(\w)$/, "$1$1$2$2$3$3"); - return (hex.length==7?'rgba(':'rgb(') + parseInt(hex.substring(0, 2), 16) + ',' + parseInt(hex.substring(2, 4), 16) + ',' + parseInt(hex.substring(4, 6), 16) + (hex.length==7?',0.'+hex.substring(6,7)+')':')'); - }, i2hex = function(N) { - return ('0' + parseInt(N).toString(16)).slice(-2); - }, rgb2Hex = function(rgb) { - var m = rgb.match(/rgb\((\d+),(\d+),(\d+)\)/); - return m ? ('#' + i2hex(m[1]) + i2hex(m[2]) + i2hex(m[3])).toUpperCase() : null; - }, c2a = function(rgb) { - var result = /rgb\((\w*),(\w*),(\w*)\)/.exec(rgb); - if (result) { - return new Array(result[1], result[2], result[3]); - } - result = /rgba\((\w*),(\w*),(\w*),(.*)\)/.exec(rgb); - if (result) { - return new Array(result[1], result[2], result[3], result[4]); - } - throw new Error("invalid colors value '" + rgb + "'"); - }, toHsv = function(r, g, b) { - if (_.isArray(r)) { - g = r[1]; - b = r[2]; - r = r[0]; - } - r = r / 255; - g = g / 255; - b = b / 255; - var m = max(max(r, g), b), mi = min(min(r, g), b), dv = m - mi; - if (dv == 0) { - return new Array(0, 0, m); - } - var h; - if (r == m) { - h = (g - b) / dv; - } else if (g == m) { - h = (b - r) / dv + 2; - } else if (b == m) { - h = (r - g) / dv + 4; - } - h *= 60; - if (h < 0) - h += 360; - return new Array(h, dv / m, m); - }, toRgb = function(color) { - if (!color) - return color; - color = color.replace(/\s/g, '').toLowerCase(); - // Look for rgb(255,255,255) - if (/^rgb\([0-9]{1,3},[0-9]{1,3},[0-9]{1,3}\)$/.exec(color)) { - return color; - } - - // Look for rgba(255,255,255,0.3) - if (/^rgba\([0-9]{1,3},[0-9]{1,3},[0-9]{1,3},(0(\.[0-9])?|1(\.0)?)\)$/.exec(color)) { - return color; - } - - // Look for #a0b1c2 or #fff - if (/^#(([a-fA-F0-9]{6,7})|([a-fA-F0-9]{3}))$/.exec(color)) - return hex2Rgb(color); - // Look a string for green - if (colors[color]) - return colors[color]; - throw new Error("invalid colors value '" + color + "'"); - }, hsv2Rgb = function(h, s, v, a) { - if (_.isArray(h)) { - a = s; - s = h[1]; - v = h[2]; - h = h[0]; - } - var r, g, b, - hi = floor(h / 60) % 6, - f = h / 60 - hi, - p = v * (1 - s), - q = v * (1 - s * f), - t = v * (1 - s * (1 - f)); - switch (hi) { - case 0 : - r = v; - g = t; - b = p; - break; - case 1 : - r = q; - g = v; - b = p; - break; - case 2 : - r = p; - g = v; - b = t; - break; - case 3 : - r = p; - g = q; - b = v; - break; - case 4 : - r = t; - g = p; - b = v; - break; - case 5 : - r = v; - g = p; - b = q; - break; - } - return 'rgb' + (a ? 'a' : '') + '(' + round(r * 255) + ',' + round(g * 255) + ',' + round(b * 255) + (a ? ',' + a + ')' : ')'); - }, - /** - * the increment of s(v) of hsv model - */ - s_inc = 0.05, v_inc = 0.14, - inc = function(v, iv) { - iv = iv || v_inc; - if (v > 0.5) { - return iv - (1 - v) / 10; - } else if (v > 0.1) { - return iv - 0.16 + v / 5; - } else { - return v > iv ? iv : v / 2; - } - }, - /** - * @method anole,make color darker or lighter - * @param {Boolean} d true:dark,false:light - * @param {Object} rgb:color - * @param {Number} iv (0-1) - * @param {Number} is (0-1) - */ - anole = function(d, rgb, iv, is) { - if (!rgb) - return rgb; - rgb = c2a(toRgb(rgb)); - var hsv = toHsv(rgb); - is = is!=0?(is || s_inc):is; - hsv[1] -= is; - if (d) { - hsv[2] -= inc(hsv[2], iv); - hsv[1] = _.upTo(hsv[1], 1); - hsv[2] = _.lowTo(hsv[2], 0); - } else { - hsv[2] += inc((1 - hsv[2]), iv); - hsv[1] = _.lowTo(hsv[1], 0); - hsv[2] = _.upTo(hsv[2], 1); - } - return hsv2Rgb(hsv, rgb[3]); - }, - topi = function(v){ - if(v==0)return 0; - if(v%pi2==0)return pi2; - return v%pi2; - }; - - _.apply(_, { - getFont : function(w, s, f, u) { - return w + " " + s + (u||"px")+" " + f; - }, - /** - * obtain the Dom Document*/ - getDoc : function() { - var doc = window.contentWindow ? window.contentWindow.document : window.contentDocument ? window.contentDocument : window.document; - return doc; - }, - /** - * define the interface,the subclass must implement it - */ - DefineAbstract : function(M, H) { - if (!H[M]) - throw new Error("Cannot instantiate the type '" + H.type + "'.you must implements it with method '" + M + "'."); - }, - getAA : function(tf) { - if (tf == 'linear') - return arithmetic.Linear; - if (tf == 'easeInOut' || tf == 'easeIn' || tf == 'easeOut') - return arithmetic.Cubic[tf]; - return arithmetic.Linear; - }, - /** - * simple noConflict implements - */ - noConflict : function() { - return iChart_; - }, - plugin : function(t, m, f) { - if (_.isFunction(t)) - t.plugin(m, f); - }, - parsePadding : function(s, d) { - s = s || 0; - if (_.isNumber(s)) - return new Array(s, s, s, s); - if (_.isArray(s)) - return s; - d = d || 0; - s = s.replace(/^\s+|\s+$/g, "").replace(/\s{2,}/g, /\s/).replace(/\s/g, ',').split(","); - if (s.length == 1) { - s[0] = s[1] = s[2] = s[3] = pF(s[0]) || d; - } else if (s.length == 2) { - s[0] = s[2] = pF(s[0]) || d; - s[1] = s[3] = pF(s[1]) || d; - } else if (s.length == 3) { - s[0] = pF(s[0]) || d; - s[1] = s[3] = pF(s[1]) || d; - s[2] = pF(s[2]) || d; - } else { - s[0] = pF(s[0]) || d; - s[1] = pF(s[1]) || d; - s[2] = pF(s[2]) || d; - s[3] = pF(s[3]) || d; - } - return s; - }, - /** - * the distance of two point - */ - distanceP2P : function(x1, y1, x2, y2) { - return sqrt((x2 - x1) * (x2 - x1) + (y2 - y1) * (y2 - y1)); - }, - atan2Radian : function(ox, oy, x, y) { - if (ox == x) { - if (y > oy) - return pi / 2; - return pi * 3 / 2; - } - if (oy == y) { - if (x > ox) - return 0; - return pi; - } - - var q = _.quadrant(ox, oy, x, y), - r = atan(abs((oy - y) / (ox - x))); - - return q?(q == 3?pi2:pi)+(q == 2?r:-r):r; - }, - angle2Radian : function(a) { - return a * pi / 180; - }, - radian2Angle : function(r) { - return r * 180 / pi; - }, - /** - * indicate angle in which quadrant,and it different from concept of Math.this will return 0 if it in first quadrant(other eg.0,1,2,3) - */ - quadrant : function(ox, oy, x, y) { - if (ox < x) { - if (oy < y) { - return 0; - } else { - return 3; - } - } else { - if (oy < y) { - return 1; - } else { - return 2; - } - } - }, - toPI2 : function(a) { - while(a<0) - a+=pi2; - return a; - }, - visible:function(s, e, f){ - if(s>=e)return []; - var q1 = _.quadrantd(s),q2 = _.quadrantd(e); - if((q1==2||q1==3)&&(q2==2||q2==3)&&((e-s) pi){s = pi2;} - else if(e>pi2){ - return [{s:s,e:pi,f:f},{s:pi2,e:e,f:f}] - }else if(e>pi){ - e = pi; - } - return {s:s,e:e,f:f}; - }, - quadrantd : function(a) { - if(a==0)return 0; - if(a % pi2==0)return 3; - while(a<0) - a+=pi2; - return ceil(2 * (a % pi2) / pi)-1; - }, - upTo : function(u, v) { - return v > u ? u : v; - }, - lowTo : function(l, v) { - return v < l ? l : v; - }, - between : function(l, u, v) { - return l>u?_.between(u, l, v):(v > u ? u : v < l ? l : v); - }, - inRange : function(l, u, v) { - return u > v && l < v; - }, - angleInRange : function(l, u, v) { - v = (v -l); - v = v<0?v+pi2:v; - v = v %pi2; - return (u -l) > v; - }, - angleZInRange : function(l, u, v) { - return u < l?(v > l || v < u):(u > v && l < v); - }, - inRangeClosed : function(l, u, v) { - return u >= v && l <= v; - }, - inEllipse : function(x, y, a, b) { - return (x * x / a / a + y * y / b / b) <= 1; - }, - p2Point : function(x, y, a, C) { - return { - x : x + cos(a) * C, - y : y + sin(a) * C - } - }, - toRgb:toRgb, - toRgba:function(c,o){ - var rgb = c2a(toRgb(c)); - return 'rgba(' + rgb[0]+',' + rgb[1]+',' + rgb[2]+',' + o +')'; - }, - /** - * vector point - */ - vectorP2P : function(x, y, radian) { - if (!radian) { - y = _.angle2Radian(y); - x = _.angle2Radian(x); - } - y = sin(y); - return { - x : y * sin(x), - y : y * cos(x) - } - }, - uid : function(k) { - return (k || 'ichartjs') + '_' + ceil(Math.random()*10000)+new Date().getTime().toString().substring(4); - }, - register:function(c){ - if (_.isString(c)) { - Repository[c.toLowerCase()] = c; - }else{ - var id = c.get('id'); - if(!id||id==''){ - id = _.uid(c.type); - while(Registry[id]){ - id = _.uid(c.type); - } - c.push('id',id); - } - if(Registry[id]){ - throw new Error("exist reduplicate id :"+id); - } - c.id = id; - Registry[id] = c; - } - }, - create:function(C){ - if(!C.type||!Repository[C.type]){ - throw new Error("TypeNotFoundException["+C.type+"]"); - } - return new _[Repository[C.type]](C); - }, - get:function(id){ - return Registry[id]; - }, - isPercent:function(v){ - return _.isString(v)&&v.match(/(.*)%/); - }, - parsePercent:function(v,f){ - if(_.isString(v)){ - v = v.match(/(.*)%/); - if(v){ - v = f?floor(pF(v[1])*f/100):v[1]/100; - } - } - return (!v ||v <= 0 || v > f)?f:v; - }, - parseFloat : function(v, d) { - if (!_.isNumber(v)) { - v = pF(v); - if (!_.isNumber(v)) - throw new Error("[" + d +"]=" +v + "is not a valid number."); - } - return v; - }, - ceil : function(max) { - return factor(max,1); - }, - floor : function(max, f) { - return factor(max,-1); - }, - _2D : '2d', - _3D : '3d', - light : function(rgb, iv, is) { - return anole(false, rgb, iv, is); - }, - dark : function(rgb, iv, is) { - return anole(true, rgb, iv, is); - }, - fixPixel : function(v) { - return _.isNumber(v) ? v : pF(v.replace('px', "")) || 0; - }, - toPixel : function(v) { - return _.isNumber(v) ? v + 'px' : _.fixPixel(v) + 'px'; - }, - emptyFn : function() { - return true; - }, - supportCanvas : supportCanvas, - isOpera : isOpera, - isWebKit : isWebKit, - isChrome : isChrome, - isSafari : isSafari, - isIE : isIE, - isGecko : isGecko, - isMobile : isMobile, - touch: "ontouchend" in document, - FRAME : isMobile ? 30 : 60 - }); - - _.Assert = { - isTrue : function(v, cause) { - if (v !== true) - throw new Error(cause); - } - }; - /** - * shim layer with setTimeout fallback - */ - _.requestAnimFrame = (function() { - var raf = window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame || function(callback) { - window.setTimeout(callback, 1000 / 60); - }; - return function(f){raf(f)} - })(); - - - /** - * defined Event - */ - _.Event = { - addEvent : function(ele, type, fn, useCapture) { - if (ele.addEventListener) - ele.addEventListener(type, fn, useCapture); - else if (ele.attachEvent) - ele.attachEvent('on' + type, fn); - else - ele['on' + type] = fn; - }, - fix : function(e) { - /** - * Fix event for mise - */ - if (typeof (e) == 'undefined') { - e = window.event; - } - var E = { - target:e.target, - pageX : e.pageX, - pageY : e.pageY, - offsetX : e.offsetX, - offsetY : e.offsetY, - stopPropagation:false, - //time: new Date().getTime(), - event:e - }; - /** - * This is mainly for FF which doesn't provide offsetX - */ - if (typeof (e.offsetX) == 'undefined') { - /** - * Fix target property, if necessary - */ - if (!e.target) { - E.target = e.srcElement || document; - } - - if(e.targetTouches){ - E.pageX = e.targetTouches[0].pageX; - E.pageY = e.targetTouches[0].pageY; - } - /** - * Calculate pageX/Y if missing and clientX/Y available - */ - if (E.pageX == null && e.clientX != null) { - var doc = document.documentElement, body = document.body; - E.pageX = e.clientX + (doc && doc.scrollLeft || body && body.scrollLeft || 0) - (doc && doc.clientLeft || body && body.clientLeft || 0); - E.pageY = e.clientY + (doc && doc.scrollTop || body && body.scrollTop || 0) - (doc && doc.clientTop || body && body.clientTop || 0); - } - - /** - * Browser not with offsetX and offsetY - */ - var x = 0, y = 0, obj = e.target; - while (obj != document.body && obj) { - x += obj.offsetLeft-(obj.scrollLeft||0); - y += obj.offsetTop; - obj = obj.offsetParent; - } - E.offsetX = E.pageX - x; - E.offsetY = E.pageY - y; - } - - E.x = E.offsetX; - E.y = E.offsetY; - /** - * Any browser that doesn't implement stopPropagation() (MSIE) - */ - if (!e.stopPropagation) { - e.stopPropagation = function() { - window.event.cancelBubble = true; - } - } - - return E; - } - }; - return _; - - })(window); - - /** - * Add useful method,need to optimized - */ - Array.prototype.each = function(f, s) { - var j = this.length, r; - for ( var i = 0; i < j; i++) { - r = s ? f.call(s, this[i], i) : f(this[i], i); - if (typeof r === "boolean" && !r) { - break - } - }; - return this; - }; - - Array.prototype.eachAll = function(f, s) { - this.each(function(d, i) { - if (iChart_.isArray(d)) { - return d.eachAll(f, s); - } else { - return s ? f.call(s, d, i) : f(d, i); - } - }, s); - }; - - Array.prototype.sor = function(f) { - var _=this,L = _.length-1,T; - for(var i = 0; i < L; i++){ - for (var j = L; j > i;j--) { - if (f ? !f(_[j], _[j - 1]) : (_[j] < _[j - 1])) { - T = _[j]; - _[j] = _[j - 1]; - _[j - 1] = T; - } - } - } - }; - - - window.iChart = iChart_; - if (!window.$) { - window.$ = window.iChart; - } -})(window); - -;(function($){ -/** - * @overview This is base class of all element.All must extend this so that has ability for configuration and event - * this class include some base attribute - * @component#$.Element - * @extend#Object - */ -$.Element = function(config) { - var _ = this._(); - /** - * indicate the element's type - */ - _.type = 'element'; - - _.ICHARTJS_OBJECT = true; - - /** - * define abstract method - */ - $.DefineAbstract('configure', _); - $.DefineAbstract('afterConfiguration', _); - - /** - * All of the configuration will in this property - */ - _.options = {}; - - _.set({ - /** - * @cfg {Object} Specifies the border for this element. - * Available property are: - * @Option enable {boolean} If enable the border - * @Option color {String} the border's color.(default to '#BCBCBC') - * @Option style {String} the border's style.(default to 'solid') - * @Option width {Number/String} the border's width.If given array,the option radius will be 0.(default to 1) - * @Option radius {Number/String} the border's radius.(default to 0) - */ - border : { - enable : false, - color : '#BCBCBC', - style : 'solid', - width : 1, - radius : 0 - }, - /** - * @cfg {Boolean} Specifies whether the element should be show a shadow.In general there will be get a high render speed when apply false.(default to false) - */ - shadow : false, - /** - * @cfg {String} Specifies the color of your shadow is.(default to '#666666') - */ - shadow_color : '#666666', - /** - * @cfg {Number} Specifies How blur you want your shadow to be.(default to 4) - */ - shadow_blur : 4, - /** - * @cfg {Number} Specifies Horizontal distance (x-axis) between the shadow and the shape in pixel.(default to 0) - */ - shadow_offsetx : 0, - /** - * @cfg {Number} Specifies Vertical distance (y-axis) between the shadow and the shape in pixel.(default to 0) - */ - shadow_offsety : 0 - }); - - /** - * variable for short - */ - _.W = 'width'; - _.H = 'height'; - _.O = 'top'; - _.B = 'bottom'; - _.L = 'left'; - _.R = 'right'; - _.C = 'center'; - _.X = 'originx'; - _.Y = 'originy'; - /** - * the running variable cache - */ - _.variable = {}; - - /** - * the root of all events - */ - _.events = { - 'mouseup':[], - 'touchstart':[], - 'touchmove':[], - 'touchend':[], - 'mousedown':[], - 'dblclick':[] - }; - - _.registerEvent( - /** - * @event Fires after the element initializing is finished this is for test - * @paramter $.Painter#this - */ - 'initialize'); - - _.initialization = false; - - /** - * inititalize configure - */ - _.configure.apply(_, Array.prototype.slice.call(arguments, 1)); - - /** - * clone the original config - */ - _.default_ = $.clone(_.options,true); - - /** - * megre customize config - */ - _.set(config); - - _.afterConfiguration(_); -} - -$.Element.prototype = { - _:function(){return this}, - afterConfiguration : function(_) { - /** - * register customize event - */ - if ($.isObject(_.get('listeners'))) { - for ( var e in _.get('listeners')) { - _.on(e, _.get('listeners')[e]); - } - } - _.initialize(); - - /** - * fire the initialize event,this probable use to unit test - */ - _.fireEvent(_, 'initialize', [_]); - }, - registerEvent : function() { - for ( var i = 0; i < arguments.length; i++) { - this.events[arguments[i]] = []; - } - }, - fireString : function(socpe, name, args, s) { - var t = this.fireEvent(socpe, name, args); - return $.isString(t) ? t : (t!==true&&$.isDefined(t)?t.toString():s); - }, - fireEvent : function(socpe, name, args) { - var L = this.events[name].length; - if (L == 1) - return this.events[name][0].apply(socpe, args); - var r = true; - for ( var i = 0; i < L; i++) { - if(!this.events[name][i].apply(socpe, args)) - r = false; - } - return r; - }, - on : function(n, fn) { - if($.isString(n)&&$.isArray(this.events[n])){ - this.events[n].push(fn); - }else if($.isArray(n)){ - n.each(function(c){this.on(c, fn)},this); - } - return this; - }, - getPlugin:function(n){ - return this.constructor.plugin_[n]; - }, - set : function(c) { - if ($.isObject(c)) - $.merge(this.options, c); - }, - pushIf : function(n, v) { - if (!$.isDefined(this.get(n))||this.get(n)==null) { - return this.push(n, v); - } - return this.get(n); - }, - /** - * average write speed about 0.013ms - */ - push : function(n, v) { - var A = n.split("."),L=A.length - 1,V = this.options; - for (var i = 0; i < L; i++) { - if (!V[A[i]]) - V[A[i]] = {}; - V = V[A[i]]; - } - V[A[L]] = v; - return v; - }, - /** - * average read speed about 0.005ms - */ - get : function(n) { - var A = n.split("."), V = this.options[A[0]]; - for (var i = 1; i < A.length; i++) { - if (!V) - return null; - V = V[A[i]]; - } - return V; - } -} -/** - * @end - */ - - -/** - * @overview The interface this class defined d,so the sub class has must capability to draw and aware of event. this class is a abstract class,so you should not try to initialize it. - * @component#$.Painter - * @extend#$.Element - */ -$.Painter = $.extend($.Element, { - - configure : function() { - /** - * indicate the element's type - */ - this.type = 'painter'; - - this.dimension = $._2D; - - /** - * define abstract method - */ - $.DefineAbstract('commonDraw', this); - $.DefineAbstract('initialize', this); - - this.set({ - /** - * @cfg {String} Specifies the default strokeStyle of the canvas's context in this element.(defaults to 'gray') - */ - strokeStyle : 'gray', - /** - * @cfg {Number} Specifies the padding for this element in pixel,the same rule as css padding.(defaults to 10) - */ - padding : 10, - /** - * @cfg {String} Specifies the font's color for this element.(defaults to 'black') - */ - color : 'black', - /** - * @cfg {Number} Specifies Horizontal offset(x-axis) in pixel.(default to 0) - */ - offsetx : 0, - /** - * @cfg {Number}Specifies Vertical distance (y-axis) in pixel.(default to 0) - */ - offsety : 0, - /** - * @cfg {String} Specifies the backgroundColor for this element.(defaults to 'FDFDFD') - */ - background_color : '#FEFEFE', - /** - * @cfg {float} Specifies the factor make color dark or light for this element,relative to background-color,the bigger the value you set,the larger the color changed.scope{0.01 - 0.5}.(defaults to '0.15') - */ - color_factor : 0.15, - /** - * @inner {String} ('2d','3d') - */ - style : '', - /** - * @cfg {Object} Here,specify as true by default - */ - border : { - enable : true - }, - /** - * @cfg {Boolean} True to apply the gradient.(default to false) - */ - gradient : false, - /** - * @cfg {String} Specifies the gradient mode of background.(defaults to 'LinearGradientUpDown') - * @Option 'LinearGradientUpDown' - * @Option 'LinearGradientDownUp' - * @Option 'LinearGradientLeftRight' - * @Option 'LinearGradientRightLeft' - * @Option 'RadialGradientOutIn' - * @Option 'RadialGradientInOut' - */ - gradient_mode:'LinearGradientUpDown', - /** - * @cfg {Number}Specifies the z-index.(default to 0) - */ - z_index : 0, - /** - * @cfg {Object} A config object containing one or more event handlers.(default to null) - */ - listeners : null, - /** - * @cfg {Number} If you want to totally override the positioning of the chart,you should setting it.(default to null) - */ - originx : null, - /** - * @cfg {Number} If you want to totally override the positioning of the chart,you should setting it.(default to null) - */ - originy : null - }); - - this.variable.event = { - mouseover : false - }; - - this.variable.animation = {} - /** - * register the common event - */ - this.registerEvent( - /** - * @event Fires when this element is clicked - * @paramter $.Painter#this - * @paramter EventObject#e The click event object - * @paramter Object#param The additional parameter - */ - 'click', - /** - * @event Fires when the mouse move on the element - * @paramter $.Painter#this - * @paramter EventObject#e The mousemove event object - */ - 'mousemove', - /** - * @event Fires when the mouse hovers over the element - * @paramter $.Painter#this - * @paramter EventObject#e The mouseover event object - */ - 'mouseover', - /** - * @event Fires when the mouse exits the element - * @paramter $.Painter#this - * @paramter EventObject#e The mouseout event object - */ - 'mouseout', - /** - * @event Fires before the element drawing.Return false from an event handler to stop the draw. - * @paramter $.Painter#this - */ - 'beforedraw', - /** - * @event Fires after the element drawing when calling the draw method. - * @paramter $.Painter#this - */ - 'draw'); - - - }, - is3D : function() { - return this.dimension == $._3D; - }, - applyGradient:function(x,y,w,h){ - var _ = this._(); - if(_.get('gradient')&&_.get('f_color')){ - _.push('f_color', _.T.gradient(x||_.x||0,y||_.y||0,w||_.get(_.W),h||_.get(_.H),[_.get('dark_color'), _.get('light_color')],_.get('gradient_mode'))); - _.push('light_color', _.T.gradient(x||_.x||0,y||_.y||0,w||_.get(_.W),h||_.get(_.H),[_.get('background_color'), _.get('light_color')],_.get('gradient_mode'))); - _.push('f_color_',_.get('f_color')); - } - }, - /** - * @method The commnd fire to draw the chart use configuration, - * this is a abstract method.Currently known,both $.Chart and $.Component implement this method. - * @return void - */ - draw : function(e,comb) { - if(comb){ - /** - * fire the root Refresh - */ - this.root.draw(e); - }else{ - /** - * fire the beforedraw event - */ - if (!this.fireEvent(this, 'beforedraw', [this,e])) { - return this; - } - /** - * execute the commonDraw() that the subClass implement - */ - this.commonDraw(this,e); - - /** - * fire the draw event - */ - this.fireEvent(this, 'draw', [this,e]); - } - }, - inject : function(c) { - if (c) { - this.root = c; - this.target = this.T = c.T; - } - }, - doConfig : function() { - - var _ = this._(), p = $.parsePadding(_.get('padding')), b = _.get('border.enable'), b = b ? $.parsePadding(_.get('border.width')) : [0, 0, 0, 0], bg = $.toRgb(_.get('background_color')), f = _.get('color_factor'),g=_.get('gradient')?0:null; - - _.set({ - border_top:b[0], - border_right:b[1], - border_bottom:b[2], - border_left:b[3], - hborder:b[1] + b[3], - vborder:b[0] + b[2], - padding_top:p[0] + b[0], - padding_right:p[1] + b[1], - padding_bottom:p[2] + b[2], - padding_left:p[3] + b[3], - hpadding:p[1] + p[3] + b[1] + b[3], - vpadding:p[0] + p[2] + b[0] + b[2] - }); - - if (_.get('shadow')===true) { - _.push('shadow', { - color : _.get('shadow_color'), - blur : _.get('shadow_blur'), - offsetx : _.get('shadow_offsetx'), - offsety : _.get('shadow_offsety') - }); - } - - _.push('f_color', bg); - _.push('f_color_', bg); - _.push("light_color", $.light(bg, f,g)); - _.push("dark_color", $.dark(bg, f*0.8,g)); - _.push("light_color2", $.light(bg, f * 2,g)); - - if(_.is3D()&&!_.get('xAngle_')){ - var P = $.vectorP2P(_.get('xAngle'),_.get('yAngle')); - _.push('xAngle_',P.x); - _.push('yAngle_',P.y); - } - } -}); -/** - * @end - */ - -/** - * - * @overview the base class use for Html componment - * @component#$.Html - * @extend#$.Element - */ -$.Html = $.extend($.Element,{ - configure : function(T) { - - /** - * indicate the element's type - */ - this.type = 'html'; - - this.T = T; - - /** - * define abstract method - */ - $.DefineAbstract('beforeshow',this); - - this.set({ - animation:true, - /** - * @cfg If true the component will has defalut action when event fired.(default to true) - */ - default_action:true, - /** - * @inner Specifies the width of this element in pixels. - */ - width:0, - /** - * @inner Specifies the height of this element in pixels. - */ - height:0, - /** - * @cfg {String} Custom style specification to be applied to this element.(default to '') - * like this:'padding:10px;font-size:12px' - */ - style:'', - /** - * @inner The z-index of this element.(default to 999) - */ - index:999, - /** - * @inner The top of this element.(default to 0) - */ - offset_top:0, - /** - * @inner The left of this element.(default to 0) - */ - offset_left:0 - }); - - - this.transitions = ""; - }, - initialize:function(){ - var _ = this._(); - _.wrap = _.get('wrap'); - _.dom = document.createElement("div"); - - if(_.get('shadow')){ - _.css('boxShadow',_.get('shadow_offsetx')+'px '+_.get('shadow_offsety')+'px '+_.get('shadow_blur')+'px '+_.get('shadow_color')); - } - if(_.get('border.enable')){ - _.css('border',_.get('border.width')+"px "+_.get('border.style')+" "+_.get('border.color')); - _.css('borderRadius',_.get('border.radius')+"px"); - } - - _.css('position','absolute'); - _.css('zIndex',_.get('index')); - - _.applyStyle(); - - _.wrap.appendChild(_.dom); - - _.style = _.dom.style; - - if(_.get('default_action')){ - _.doAction(_); - } - }, - width:function(){ - return this.dom.offsetWidth; - }, - height:function(){ - return this.dom.offsetHeight; - }, - onTransitionEnd:function(fn,useCapture){ - var type = 'transitionend'; - if($.isWebKit){ - type = 'webkitTransitionEnd'; - }else if($.isOpera){ - type = 'oTransitionEnd'; - } - $.Event.addEvent(this.dom,type,fn,useCapture); - }, - destroy:function(){ - this.wrap.removeChild(this.dom); - this.dom = null; - }, - transition:function(v){ - this.transitions = this.transitions==''?v:this.transitions+','+v; - if($.isWebKit){ - this.css('WebkitTransition',this.transitions); - }else if($.isGecko){ - this.css('MozTransition',this.transitions); - }else if($.isOpera){ - this.css('OTransition',this.transitions); - }else{ - this.css('transition',this.transitions); - } - }, - beforeshow:function(e,m,_){ - _.follow(e,m,_); - }, - show:function(e,m){ - this.beforeshow(e,m,this); - this.css('visibility','visible'); - if(this.get('animation')){ - this.css('opacity',1); - } - }, - hidden:function(e){ - this.css('visibility','hidden'); - }, - getDom:function(){ - return this.dom; - }, - css:function(k,v){ - if($.isString(k))if($.isDefined(v))this.dom.style[k]=v;else return this.dom.style[k]; - }, - applyStyle:function(){ - var styles = this.get('style').split(";"),style; - for(var i = 0;i< styles.length;i++){ - style = styles[i].split(":"); - if(style.length>1)this.css(style[0],style[1]); - } - } -}); -/** - * @end - */ -/** - * @overview this a abstract component of all concrete chart - * @component#$.Component - * @extend#$.Painter - */ -$.Component = $.extend($.Painter, { - configure : function(c) { - /** - * invoked the super class's configuration - */ - $.Component.superclass.configure.apply(this, arguments); - - /** - * indicate the element's type - */ - this.type = 'component'; - - this.set({ - /** - * @cfg {Number} Specifies the font size of this element in pixels.(default to 12) - */ - fontsize : 12, - /** - * @cfg {String} Specifies the font of this element.(default to 'Verdana') - */ - font : 'Verdana', - /** - * @cfg {String} Specifies the font weight of this element.(default to 'normal') - */ - fontweight : 'normal', - /** - * @cfg {String} Specifies the unit of font-size.(default to 'px') - */ - fontunit:'px', - /** - * @inner {Boolean} Specifies the config of Tip.For details see $.Tip Note:this has a extra property named 'enable',indicate whether tip available(default to false) - */ - tip : { - enable : false, - border : { - width : 2 - } - } - }); - - /** - * If this element can split or contain others.(default to false) - */ - this.atomic = false; - /** - * If method draw be proxy.(default to false) - */ - this.proxy = false; - this.ICHARTJS_CHART = false; - this.inject(c); - }, - initialize : function() { - $.DefineAbstract('isEventValid', this); - $.DefineAbstract('doDraw', this); - - this.doConfig(); - this.initialization = true; - }, - /** - * @method return the component's dimension,return hold following property - * @property x:the left-top coordinate-x - * @property y:the left-top coordinate-y - * @property width:the width of component,note:available there applies box model - * @property height:the height of component,note:available there applies box model - * @return object - */ - getDimension : function() { - return { - x : this.x, - y : this.y, - width : this.get("width"), - height : this.get("height") - } - }, - destroy:function(){ - if(this.tip){ - this.tip.destroy(); - } - }, - doConfig : function() { - $.Component.superclass.doConfig.call(this); - var _ = this._(),w = _.get(_.W),W = _.get('maxwidth'),x = _.get(_.X); - if(w&&W){ - w = _.push(_.W,$.parsePercent(w,W)); - if(w>W){ - w = _.push('width',W); - } - if(W>w){ - var C = _.get('align')||_.C; - if(C == _.C){ - x +=(W-w)/2; - }else if(C == _.R){ - x += (W-w); - } - } - } - - _.x = _.push(_.X, x + _.get('offsetx')); - _.y = _.push(_.Y, _.get(_.Y) + _.get('offsety')); - - _.push('fontStyle', $.getFont(_.get('fontweight'), _.get('fontsize'), _.get('font'),_.get('fontunit'))); - - /** - * if have evaluate it - */ - _.data = _.get('data'); - - if (_.get('tip.enable')) { - /** - * make tip's border in accord with sector - */ - _.pushIf('tip.border.color', _.get('f_color')); - - if (!$.isFunction(_.get('tip.invokeOffset'))) - /** - * indicate the tip must calculate position - */ - _.push('tip.invokeOffset', _.tipInvoke()); - } - - }, - isMouseOver : function(e) { - return this.isEventValid(e,this); - }, - redraw : function(e) { - this.root.draw(e,this.root.Combination); - }, - last:$.emptyFn, - commonDraw : function(_) { - /** - * execute the doDraw() that the subClass implement - */ - if (!_.proxy) - _.doDraw.call(_,_); - - } -}); -/** - * @end - */ - - /** - * @overview the tip component. - * @component#$.Tip - * @extend#$.Element - */ - $.Tip = $.extend($.Html,{ - configure:function(){ - - /** - * invoked the super class's configuration - */ - $.Tip.superclass.configure.apply(this,arguments); - - /** - * indicate the legend's type - */ - this.type = 'tip'; - - this.set({ - name:'', - index:0, - value:'', - /** - * @cfg {String} Specifies the text want to disply.(default to '') - */ - text:'', - /** - * @cfg {String} Specifies the tip's type.(default to 'follow') Available value are: - * @Option follow - * @Option fixed - */ - showType:'follow', - /** - * @cfg {Function} Specifies Function to calculate the position.(default to null) - */ - invokeOffset:null, - /** - * @cfg {Number} Specifies the duration when fadeIn/fadeOut in millisecond.(default to 300) - */ - fade_duration:300, - /** - * @cfg {Number} Specifies the duration when move in millisecond.(default to 100) - */ - move_duration:100, - /** - * ease - * linear - * ease-in - * ease-out - * ease-in-out - */ - timing_function:'ease-out', - /** - * @cfg {Boolean} if calculate the position every time (default to false) - */ - invokeOffsetDynamic:false, - /** - * @cfg {String} Specifies the css of this Dom. - */ - style:'textAlign:left;padding:4px 5px;cursor:pointer;backgroundColor:rgba(239,239,239,.85);fontSize:12px;color:black;', - /** - * @cfg {Object} Override the default as enable = true,radius = 5 - */ - border:{ - enable:true, - radius : 5 - }, - delay:200 - }); - this.registerEvent( - /** - * @event Fires when parse this tip's text.Return value will override existing. - * @paramter $.Tip#tip - * @paramter string#name the current tip's name - * @paramter string#value the current tip's value - * @paramter string#text the current tip's text - * @paramter int#index index of data,if there was a line - */ - 'parseText'); - }, - position:function(t,l,_){ - _.style.top = (t<0?0:t)+"px"; - _.style.left = (l<0?0:l)+"px"; - }, - follow:function(e,m,_){ - //_.style.width = ""; - if(_.get('invokeOffsetDynamic')){ - if(m.hit){ - if($.isString(m.text)||$.isNumber(m.text)){ - _.text(m.name,m.value,m.text,m.i,_); - } - var o = _.get('invokeOffset')(_.width(),_.height(),m); - _.position(o.top,o.left,_); - } - }else{ - if(_.get('showType')!='follow'&&$.isFunction(_.get('invokeOffset'))){ - var o = _.get('invokeOffset')(_.width(),_.height(),m); - _.position(o.top,o.left,_); - }else{ - _.position((e.y-_.height()*1.1-2),e.x+2,_); - } - } - }, - text:function(n,v,t,i,_){ - _.dom.innerHTML = _.fireString(_, 'parseText', [_,n,v,t,i],t); - }, - hidden:function(e){ - if(this.get('animation')){ - this.css('opacity',0); - }else{ - this.css('visibility','hidden'); - } - }, - doAction:function(_){ - _.T.on('mouseover',function(c,e,m){ - _.show(e,m); - }).on('mouseout',function(c,e,m){ - _.hidden(e); - }); - - if(_.get('showType')=='follow'){ - _.T.on('mousemove',function(c,e,m){ - if(_.T.variable.event.mouseover){ - setTimeout(function(){ - if(_.T.variable.event.mouseover) - _.follow(e,m,_); - },_.get('delay')); - } - }); - } - }, - initialize:function(){ - $.Tip.superclass.initialize.call(this); - - var _ = this._(); - - _.text(_.get('name'),_.get('value'),_.get('text'),_.get('index'),_); - _.hidden(); - - if(_.get('animation')){ - var m = _.get('move_duration')/1000+'s '+_.get('timing_function')+' 0s'; - _.transition('opacity '+_.get('fade_duration')/1000+'s '+_.get('timing_function')+' 0s'); - _.transition('top '+m); - _.transition('left '+m); - _.onTransitionEnd(function(e){ - if(_.css('opacity')==0){ - _.css('visibility','hidden'); - } - },false); - } - - } -}); -/** - * @end - */ - - - /** - * @overview this element simulate the crosshair on the coordinate.actually this composed of some div of html. - * @component#$.CrossHair - * @extend#$.Html - */ - $.CrossHair = $.extend($.Html,{ - configure:function(){ - - /** - * invoked the super class's configuration - */ - $.CrossHair.superclass.configure.apply(this,arguments); - - /** - * indicate the component's type - */ - this.type = 'crosshair'; - - this.set({ - /** - * @inner {Number} Specifies the position top,normally this will given by chart.(default to 0) - */ - top:0, - /** - * @inner {Number} Specifies the position left,normally this will given by chart.(default to 0) - */ - left:0, - /** - * @inner {Boolean} private use - */ - hcross:true, - /** - * @inner {Boolean} private use - */ - vcross:true, - /** - * @inner {Function} private use - */ - invokeOffset:null, - /** - * @cfg {Number} Specifies the linewidth of the crosshair.(default to 1) - */ - line_width:1, - /** - * @cfg {Number} Specifies the linewidth of the crosshair.(default to 1) - */ - line_color:'#1A1A1A', - delay:200 - }); - }, - /** - * this function will implement at every target object,and this just default effect - */ - follow:function(e,m,_){ - if(_.get('invokeOffset')){ - var o = _.get('invokeOffset')(e,m); - if(o&&o.hit){ - _.o_valid = true; - _.position(o.top-_.top,o.left-_.left,_); - }else if(!o||!_.o_valid){ - _.position(_.owidth,_.oheight,_); - } - }else{ - /** - * set the 1px offset will make the line at the top left all the time - */ - _.position(e.y-_.top-1,e.x-_.left-1,_); - } - }, - position:function(t,l,_){ - _.horizontal.style.top = (t-_.size)+"px"; - _.vertical.style.left = (l-_.size)+"px"; - }, - doCreate:function(_,w,h){ - var d = document.createElement("div"); - d.style.width= $.toPixel(w); - d.style.height= $.toPixel(h); - d.style.backgroundColor = _.get('line_color'); - d.style.position="absolute"; - _.dom.appendChild(d); - return d; - }, - doAction:function(_){ - _.T.on('mouseover',function(c,e,m){ - _.show(e,m); - }).on('mouseout',function(c,e,m){ - _.hidden(e,m); - }).on('mousemove',function(c,e,m){ - _.follow(e,m,_); - }); - }, - initialize:function(){ - $.CrossHair.superclass.initialize.call(this); - - var _ = this._(),L = $.toPixel(_.get('line_width')); - - _.size = _.get('line_width')/2; - - _.top = $.fixPixel(_.get(_.O)); - _.left = $.fixPixel(_.get(_.L)); - _.owidth = -_.T.root.width; - _.oheight = -_.T.root.height; - _.o_valid = false; - /** - * set size zero make integration with vertical and horizontal - */ - _.css('width','0px'); - _.css('height','0px'); - _.css('top',_.top+'px'); - _.css('left',_.left+'px'); - _.css('visibility','hidden'); - - _.horizontal = _.doCreate(_,_.get('hcross')?$.toPixel(_.get(_.W)):"0px",L); - _.vertical = _.doCreate(_,L,_.get('vcross')?$.toPixel(_.get(_.H)):"0px"); - - - - } -}); -/** - * @end - */ -/** - * @overview the legend componment - * @component#$.Legend - * @extend#$.Component - */ -$.Legend = $.extend($.Component, { - configure : function() { - /** - * invoked the super class's configuration - */ - $.Legend.superclass.configure.apply(this, arguments); - - /** - * indicate the legend's type - */ - this.type = 'legend'; - - this.set({ - /** - * @cfg {Array} Required,The datasource of Legend.Normally,this will given by chart.(default to undefined) - */ - data : undefined, - /** - * @inner {Number} Specifies the width.Note if set to 'auto' will be fit the actual width.(default to 'auto') - */ - width : 'auto', - /** - * @cfg {Number/String} Specifies the number of column.(default to 1) Note:If set to 'max',the list will be lie on the property row - */ - column : 1, - /** - * @cfg {Number/String} Specifies the number of column.(default to 'max') Note:If set to 'max',the list will be lie on the property column - */ - row : 'max', - /** - * @cfg {Number} Specifies the limited width.Normally,this will given by chart.(default to 0) - */ - maxwidth : 0, - /** - * @cfg {Number} Specifies the lineheight when text display multiline.(default to 16) - */ - line_height : 16, - /** - * @cfg {String} Specifies the shape of legend' sign (default to 'square') Available value are: - * @Option 'round' - * @Option 'square' - * @Option 'bar' - * @Option 'round-bar' - * @Option 'square-bar' - */ - sign : 'square', - /** - * @cfg {Number} the size of legend' sign (default to 10) - */ - sign_size : 10, - /** - * @cfg {Number} the distance of legend' sign and text (default to 5) - */ - sign_space : 5, - /** - * @cfg {Number} Specifies the space between the sign and text.(default to 5) - */ - legend_space : 5, - - z_index : 1009, - /** - * @cfg {Boolean} If true the text's color will accord with sign's.(default to false) - */ - text_with_sign_color : false, - /** - * @cfg {String} Specifies the horizontal position of the legend in chart.(defaults to 'right').Available value are: - * @Option 'left' - * @Option 'center' Only applies when valign = 'top|bottom' - * @Option 'right' - */ - align : 'right', - /** - * @cfg {String} this property specifies the vertical position of the legend in an module (defaults to 'middle'). Available value are: - * @Option 'top' - * @Option 'middle' Only applies when align = 'left|right' - * @Option 'bottom' - */ - valign : 'middle' - }); - - /** - * this element support boxMode - */ - this.atomic = true; - - this.registerEvent( - /** - * @event Fires when parse this element'data.Return text value will override existing. - * @paramter $.Chart#this - * @paramter string#text the text will display - * @paramter int#i the index of data - * @return string - */ - 'parse'); - - }, - isEventValid : function(e,_) { - var r = { - valid : false - }; - if (e.x > this.x && e.x < (_.x + _.width) && e.y > _.y && e.y < (_.y + _.height)) { - _.data.each(function(d, i) { - if (e.x > d.x && e.x < (d.x + d.width_ + _.get('signwidth')) && e.y > d.y && e.y < (d.y + _.get('line_height'))) { - r = { - valid : true, - index : i, - target : d - } - return false; - } - }, _); - } - return r; - }, - drawCell : function(x, y, text, color,n,_) { - var s = _.get('sign_size'),f = _.getPlugin('sign'); - if(!f||!f.call(_,_.T,n,{x:x + s / 2,y:y},s,color)){ - if(n.indexOf("bar")!=-1){ - _.T.box(x, y - s / 12, s, s / 6, 0, color); - } - if(n=='round'){ - _.T.round(x + s / 2, y, s / 2, color); - }else if(n=='round-bar'){ - _.T.round(x + s / 2, y, s / 4, color); - }else if (n == 'square-bar') { - _.T.box(x + s / 4, y - s / 4, s / 2, s / 2, 0, color); - }else if (n == 'square'){ - _.T.box(x, y-s/2, s, s, 0, color); - } - } - _.T.fillText(text, x + _.get('signwidth'), y, 0, _.get('text_with_sign_color')?color:_.get('color'),'lr',_.get('line_height')); - }, - doDraw : function(_) { - _.T.box(_.x, _.y, _.width, _.height, _.get('border'), _.get('f_color'), false, _.get('shadow')); - _.T.textStyle(_.L, 'middle', $.getFont(_.get('fontweight'), _.get('fontsize'), _.get('font'))); - _.data.each(function(d) { - _.drawCell(d.x, d.y, d.text, d.color,d.sign,_); - }); - }, - doLayout:function(_,g){ - var ss = _.get('sign_size'), - w = 0, - h=0, - temp = 0, - c = _.get('column'), - r = _.get('row'), - L = _.data.length; - - _.T.textFont(_.get('fontStyle')); - - if (_.get('line_height') < ss) { - _.push('line_height', ss + ss / 5); - } - _.push('signwidth', (ss + _.get('sign_space'))); - /** - * calculate the width each item will used - */ - _.data.each(function(d) { - d.width_ = _.T.measureText(d.text); - }, _); - - /** - * calculate the each column's width it will used - */ - for ( var i = 0; i < c; i++) { - temp = 0; - for ( var j = i; j < L; j+=c) { - temp = Math.max(temp, _.data[j].width_); - } - _.columnwidth[i] = temp; - w += temp; - } - /** - * calculate the each row's height it will used - */ - for ( var i = 0; i < r; i++) { - temp =0; - for ( var j = i*c; j < L; j++) { - temp = Math.max(temp, _.data[j].text.split("\n").length); - } - _.columnheight[i] = temp; - h+=temp; - } - w = _.push(_.W, w + _.get('hpadding') + _.get('signwidth') * c + (c - 1) * _.get('legend_space')); - if (w > _.get('maxwidth')){ - var fs=Math.floor(_.get('fontsize')*(_.get('maxwidth')/w)); - if(!(fs<10&&c==1)){ - if(fs>9){ - _.push('fontStyle',$.getFont(_.get('fontweight'), _.push('fontsize', fs), _.get('font'))); - }else if(c>1){ - _.push('row', Math.ceil(L / _.push('column',c-1))); - } - _.doLayout(_,g); - return; - } - } - - var d,x,y,y2; - _.width = w; - - _.height = h = _.push(_.H, h * _.get('line_height') + _.get('vpadding')); - - if (_.get('valign') == _.O) { - _.y = g.get('t_originy'); - } else if (_.get('valign') == _.B) { - _.y = g.get('b_originy') - h; - } else { - _.y = g.get('centery') - h / 2; - } - - if (_.get('align') == _.L) { - _.x = g.get('l_originx'); - } else if (_.get('align') == _.C) { - _.x = g.get('centerx') - w / 2; - } else { - _.x = g.get('r_originx') - w; - } - - _.x = _.push(_.X, (_.x<0?g.get('l_originx'):_.x) + _.get('offsetx')); - _.y = _.push(_.Y, (_.y<0?g.get('t_originy'):_.y) + _.get('offsety')); - - - y = _.y + _.get('padding_top'); - - ss = _.get('legend_space')+_.get('signwidth'); - /** - * calculate the each cell's coordinate point - */ - for ( var i = 0; i < r; i++) { - x = _.x + _.get('padding_left'); - y2=(_.columnheight[i]/2)*_.get('line_height'); - y+=y2; - for ( var j = 0; j < c&&i*c+j r * c) { - r += Math.ceil((L - r * c) / c); - r = _.push('row', r); - } - _.columnwidth = []; - _.columnheight = []; - - _.doLayout(_,g); - - } -});/** @end */ - -/** - * @overview the label componment - * @component#$.Label - * @extend#$.Component - */ -$.Label = $.extend($.Component, { - configure : function() { - /** - * invoked the super class's configuration - */ - $.Label.superclass.configure.apply(this, arguments); - - /** - * indicate the legend's type - */ - this.type = 'label'; - - this.set({ - /** - * @cfg {String} Specifies the text of this label,Normally,this will given by chart.(default to ''). - */ - text : '', - /** - * @cfg {Number} Specifies the lineheight when text display multiline.(default to 12). - */ - line_height : 12, - /** - * @cfg {Number} Specifies the thickness of line in pixel.(default to 1). - */ - line_thickness : 1, - /** - * @cfg {String} Specifies the shape of legend' sign (default to 'square').Available value are: - * @Option 'round' - * @Option 'square' - */ - sign : 'square', - /** - * @cfg {Number} Specifies the size of legend' sign in pixel.(default to 12) - */ - sign_size : 12, - /** - * @cfg {Number} Override the default as 2 in pixel. - */ - padding : '2 5', - /** - * @cfg {Number} Override the default as 2 in pixel. - */ - offsety : 2, - /** - * @cfg {Number} Specifies the space between the sign and text.(default to 5) - */ - sign_space : 5, - /** - * @cfg {Number} Override the default as '#efefef'. - */ - background_color : '#efefef', - /** - * @cfg {Boolean} If true the text's color will accord with sign's.(default to false) - */ - text_with_sign_color : false - }); - - /** - * this element support boxMode - */ - this.atomic = true; - - this.registerEvent(); - - }, - isEventValid : function(e,_) { - return { - valid : $.inRange(_.labelx, _.labelx + _.get(_.W), e.x) && $.inRange(_.labely, _.labely + _.get(_.H), e.y) - }; - }, - text : function(text) { - if (text) - this.push('text', text); - this.push(this.W, this.T.measureText(this.get('text')) + this.get('hpadding') + this.get('sign_size') + this.get('sign_space')); - }, - localizer : function(_) { - var Q = _.get('quadrantd'),p = _.get('line_points'),m=_.get('smooth'),Q=(Q >= 1 && Q <= 2),x=_.get('labelx'),y=_.get('labely'); - _.labelx = x+(Q ? - _.get(_.W)-m : m); - _.labely = y-_.get(_.H)/2; - p[2] = {x:x,y:y}; - p[3] = {x:p[2].x+(Q ? -m : m),y:p[2].y}; - }, - doLayout : function(x, y,n,_) { - _.push('labelx', _.get('labelx') + x/n); - _.push('labely', _.get('labely') + y/n); - - _.get('line_points').each(function(p,i) { - p.x += x; - p.y += y; - return i==1; - }, _); - _.localizer(_); - }, - doDraw : function(_){ - var p = _.get('line_points'), ss = _.get('sign_size'), x = _.labelx + _.get('padding_left'), y = _.labely + _.get('padding_top'); - - _.T.label(p, _.get('line_thickness'), _.get('border.color')); - - _.T.box(_.labelx, _.labely, _.get(_.W), _.get(_.H), _.get('border'), _.get('f_color'), false, _.get('shadow')); - - _.T.textStyle(_.L, _.O, _.get('fontStyle')); - - var textcolor = _.get('color'); - if (_.get('text_with_sign_color')) { - textcolor = _.get('scolor'); - } - if (_.get('sign') == 'square') { - _.T.box(x, y, ss, ss, 0, _.get('scolor')); - } else if(_.get('sign')){ - _.T.round(x + ss / 2, y + ss / 2, ss / 2, _.get('scolor')); - } - _.T.fillText(_.get('text'), x + ss + _.get('sign_space'), y, _.get('textwidth'), textcolor); - }, - doConfig : function() { - $.Label.superclass.doConfig.call(this); - var _ = this._(); - - _.T.textFont(_.get('fontStyle')); - - if (_.get('fontsize') > _.get('line_height')) { - _.push('line_height', _.get('fontsize')); - } - if(!_.get('sign')){ - _.push('sign_size',0); - _.push('sign_space',0); - } - _.push(_.H, _.get('line_height') + _.get('vpadding')); - - _.text(); - - _.localizer(_); - - } -}); -/** - * @end - */ - - /** - * @overview the text componment - * @component#$.Text - * @extend#$.Component - */ - $.Text = $.extend($.Component,{ - configure:function(){ - /** - * invoked the super class's configuration - */ - $.Text.superclass.configure.apply(this,arguments); - - /** - * indicate the component's type - */ - this.type = 'text'; - - this.set({ - /** - * @cfg {String} Specifies the text want to disply.(default to '') - */ - text:'', - /** - * @cfg {String} there has two layers of meaning,when width is 0,Specifies the textAlign of html5.else this is the alignment of box.(default to 'center') - * when width is 0,Available value are: - * @Option start - * @Option end - * @Option left - * @Option right - * @Option center - * when width is not 0,Available value are: - * @Option left - * @Option right - * @Option center - */ - textAlign:'center', - /** - * @cfg {String} Specifies the alignment in box.(default to 'center') - * @Option left - * @Option right - * @Option center - */ - align:'center', - /** - * @cfg {String} Here,specify as false to make background transparent.(default to null) - */ - background_color : 0, - /** - * @cfg {String} Specifies the textBaseline of html5.(default to 'top') - * Available value are: - * @Option top - * @Option hanging - * @Option middle - * @Option alphabetic - * @Option ideographic - * @Option bottom - */ - textBaseline:'top', - /** - * @cfg {Object} Here,specify as false by default - * @see $.Element#border - */ - border : { - enable : false - }, - /** - * @cfg {Number} Specifies the maxwidth of text in pixels,if given 0 will not be limited.(default to 0) - */ - width:0, - /** - * @cfg {Number} Specifies the maxheight of text in pixels,if given 0 will not be limited(default to 0) - */ - height:0, - /** - * @cfg {Number} Here,specify as 0 by default - */ - padding:0, - /** - * @cfg {String} Specifies the writing-mode of text.(default to 'lr') . - * Available value are: - * @Option 'lr' - */ - writingmode : 'lr', - /** - * @cfg {Number} Specifies the lineheight when text display multiline.(default to 16). - */ - line_height : 16, - /** - * @cfg {Number} Specifies the angle that text writed.0 to horizontal,clockwise.(default to 0). - */ - rotate:0 - }); - - this.registerEvent(); - - }, - doDraw:function(_){ - if(_.get('box_feature')) - _.T.box(_.x,_.y,_.get(_.W),_.get(_.H),_.get('border'),_.get('f_color')); - _.T.text(_.get('text'),_.get('textx'),_.get('texty'),_.get(_.W)-_.get('hpadding'),_.get('color'),_.get('textAlign'),_.get('textBaseline'),_.get('fontStyle'),_.get('writingmode'),_.get('line_height'),_.get('shadow'),_.get('rotate')); - }, - isEventValid:function(){ - return {valid:false}; - }, - doLayout:function(x,y,n,_){ - _.x = _.push(_.X,_.x+x); - _.y = _.push(_.Y,_.y+y); - _.push('textx',_.get('textx')+x); - _.push('texty',_.get('texty')+y); - }, - doConfig:function(){ - $.Text.superclass.doConfig.call(this); - var _ = this._(),x = _.x,y=_.y+_.get('padding_top'),w=_.get(_.W),h=_.get(_.H),a=_.get('textAlign'); - x+=(a==_.C?w/2:(a==_.R?w-_.get('padding_right'):_.get('padding_left'))); - if(h){ - y+=h/2; - _.push('textBaseline','middle'); - } - _.push('textx',x); - _.push('texty',y); - _.push('box_feature',w&&h); - _.applyGradient(); - } -}); -/** - * @end - */ -; -(function($) { - - var PI = Math.PI, inc = PI / 90,inc2 = inc/2, ceil = Math.ceil, floor = Math.floor, PI2 = 2 * PI, max = Math.max, min = Math.min, sin = Math.sin, cos = Math.cos, fd = function(w, c) { - return w == 1 ? (floor(c) + 0.5) : Math.round(c); - }, getCurvePoint = function(seg, point, i, smo) { - var x = point.x, y = point.y, lp = seg[i - 1], np = seg[i + 1], lcx, lcy, rcx, rcy; - if (i < seg.length - 1) { - var lastY = lp.y, nextY = np.y, c; - lcx = (smo * x + lp.x) / (smo + 1); - lcy = (smo * y + lastY) / (smo + 1); - rcx = (smo * x + np.x) / (smo + 1); - rcy = (smo * y + nextY) / (smo + 1); - - c = ((rcy - lcy) * (rcx - x)) / (rcx - lcx) + y - rcy; - lcy += c; - rcy += c; - - if (lcy > lastY && lcy > y) { - lcy = max(lastY, y); - rcy = 2 * y - lcy; - } else if (lcy < lastY && lcy < y) { - lcy = min(lastY, y); - rcy = 2 * y - lcy; - } - if (rcy > nextY && rcy > y) { - rcy = max(nextY, y); - lcy = 2 * y - rcy; - } else if (rcy < nextY && rcy < y) { - rcy = min(nextY, y); - lcy = 2 * y - rcy; - } - point.rcx = rcx; - point.rcy = rcy; - } - return [lp.rcx || lp.x, lp.rcy || lp.y, lcx || x, lcy || y, x, y]; - }, - pF = function(n){ - return $.isNumber(n)?n:$.parseFloat(n,n); - }, - parse = function(c,_){ - var M,V=0,MI,ML=0,init=false,g = _.get('labels'); - _.data = c; - if(_.dataType=='simple'){ - _.total = 0; - c.each(function(d,i){ - d.background_color = d.color; - V = d.value||0; - if($.isArray(V)){ - var T = 0; - ML = V.length>ML?V.length:ML; - for(var j=0;jML?g.length:ML; - } - _.push('maxItemSize',ML); - }else if(_.dataType=='stacked'||_.dataType=='complex'){ - var L=g.length,item,T,r,stack=_.dataType=='stacked'; - if(L==0){ - L=c[0].value.length;for(var i=0;i= s) { - Lo.call(this, angle, h); - angle = angle - inc; - } - Lo.call(this, s, h); - this.lineTo(x + a * cos(s), y + (b * sin(s))).closePath().fill(true); - }, layerDraw = function(x, y, a, b, ccw, h, A, c) { - var x0 = x + a * cos(A); - var y0 = y + h + (b * sin(A)); - this.moveTo(x, y).beginPath().fillStyle(c).lineTo(x, y + h).lineTo(x0, y0).lineTo(x0, y0 - h).lineTo(x, y).closePath().fill(true); - }, layerPaint = function(x, y, a, b, s, e, ccw, h, c) { - var q1 = $.quadrantd(s),q2 = $.quadrantd(e); - c = $.dark(c); - if (q1==1||q1==2) - layerDraw.call(this, x, y, a, b, ccw, h, s, c); - if (q2==0||q2==3) - layerDraw.call(this, x, y, a, b, ccw, h, e, c); - }; - var s3 = function(x, y, a, b, s, e, h, c, bo, bow, boc, sw, ccw, isw) { - /** - * paint bottom layer - */ - this.ellipse(x, y + h, a, b, s, e, c, bo, bow, boc, sw, ccw, true); - /** - * paint inside layer - */ - layerPaint.call(this, x, y, a, b, s, e, ccw, h, c); - - /** - * paint top layer - */ - this.ellipse(x, y, a, b, s, e, c, bo, bow, boc, false, ccw, true); - /** - * paint outside layer - */ - sPaint.call(this, x, y, a, b, s, e, ccw, h, c); - return this; - } - s3.layerPaint = layerPaint; - s3.sPaint = sPaint; - s3.layerDraw = layerDraw; - return s3; - }(), - textStyle : function(a, l, f) { - return this.textAlign(a).textBaseline(l).textFont(f); - }, - strokeStyle : function(b,w, c, j) { - if(b){ - if (w) - this.c.lineWidth = w; - if (c) - this.c.strokeStyle = c; - if (j) - this.c.lineJoin = j; - } - return this; - }, - globalAlpha : function(v) { - if (v) - this.c.globalAlpha = v; - return this; - }, - fillStyle : function(c) { - if (c) - this.c.fillStyle = c; - return this; - }, - arc2 : function(x, y, r, s, e, c) { - if(r) - this.c.arc(x, y, r, s, e, c); - return this; - }, - textAlign : function(a) { - if (a) - this.c.textAlign = a; - return this; - }, - textBaseline : function(l) { - if (l) - this.c.textBaseline = l; - return this; - }, - textFont : function(font) { - if (font) - this.c.font = font; - return this; - }, - shadowOn : function(s) { - if (s) { - this.c.shadowColor = s.color; - this.c.shadowBlur = s.blur; - this.c.shadowOffsetX = s.offsetx; - this.c.shadowOffsetY = s.offsety; - } - return this; - }, - shadowOff : function() { - this.c.shadowColor = 'white'; - this.c.shadowBlur = this.c.shadowOffsetX = this.c.shadowOffsetY = 0; - return this; - }, - gradient : function(x, y, w, h, c,m,r) { - m = m.toLowerCase(); - var x0=x,y0=y,f=!m.indexOf("linear"); - m = m.substring(14); - if(f){ - switch (m) { - case 'updown': - y0 += h; - break; - case 'downup': - y += h; - break; - case 'leftright': - x0 += w; - break; - case 'rightleft': - x += w; - break; - default: - return c[0]; - } - return this.avgLinearGradient(x, y, x0, y0, c); - }else{ - x+=w/2; - y+=h/2; - return this.avgRadialGradient(x,y,(r||0),x,y,(w>h?h:w),m=='outin'?c.reverse():c); - } - }, - avgLinearGradient : function(xs, ys, xe, ye, c) { - var g = this.createLinearGradient(xs, ys, xe, ye); - for ( var i = 0; i < c.length; i++) - g.addColorStop(i / (c.length - 1), c[i]); - return g; - }, - createLinearGradient : function(xs, ys, xe, ye) { - return this.c.createLinearGradient(xs, ys, xe, ye); - }, - avgRadialGradient : function(xs, ys, rs, xe, ye, re, c) { - var g = this.createRadialGradient(xs, ys, rs, xe, ye, re); - for ( var i = 0; i < c.length; i++) - g.addColorStop(i/ (c.length - 1), c[i]); - return g; - }, - createRadialGradient : function(xs, ys, rs, xe, ye, re) { - return this.c.createRadialGradient(xs, ys, rs, xe, ye, re); - }, - text : function(t, x, y, max, color, align, line, font, mode, h,sw,ro) { - return this.save().textStyle(align, line, font).fillText(t, x, y, max, color, mode, h,sw,ro).restore(); - }, - fillText : function(t, x, y, max, color, mode, h,sw,ro) { - t = t.toString(); - if(!t||!t.length)return this; - max = max || false; - mode = mode || 'lr'; - h = h || 16; - x = fd(0, x); - y = fd(0, y); - var T = t.split(mode == 'tb' ? "" : "\n"); - if(T.length>1){ - if(this.c.textBaseline=='middle'){ - y = y - (T.length-1)*h/2; - }else if(this.c.textBaseline=='bottom'){ - y = y - (T.length-1)*h; - } - } - this.save().fillStyle(color).translate(x,y).rotate(inc2*ro).shadowOn(sw); - T.each(function(t,i) { - try { - if (max&&max>0) - this.c.fillText(t, 0,i*h, max); - else - this.c.fillText(t, 0, i*h); - } catch (e) { - console.log(e.message + '[' + t + ',' + x + ',' + y + ']'); - } - }, this); - - return this.restore(); - }, - measureText : function(t){ - t = t.split("\n"); - var m=0; - t.each(function(o){ - m = max(this.measureText(o).width,m); - },this.c); - return m; - }, - moveTo : function(x, y) { - x = x || 0; - y = y || 0; - this.c.moveTo(x, y); - return this; - }, - lineTo : function(x, y) { - x = x || 0; - y = y || 0; - this.c.lineTo(x, y); - return this; - }, - save : function() { - this.c.save(); - return this; - }, - restore : function() { - this.c.restore(); - return this; - }, - beginPath : function() { - this.c.beginPath(); - return this; - }, - closePath : function() { - this.c.closePath(); - return this; - }, - stroke : function(s) { - if(s) - this.c.stroke(); - return this; - }, - fill : function(f) { - if(f) - this.c.fill(); - return this; - }, - /** - * can use cube3D instead of this? - */ - cube : function(x, y, xv, yv, width, height, zdeep, bg, b, bw, bc, sw) { - x = fd(bw, x); - y = fd(bw, y); - zdeep = (zdeep && zdeep > 0) ? zdeep : width; - var x1 = x + zdeep * xv, y1 = y - zdeep * yv; - x1 = fd(bw, x1); - y1 = fd(bw, y1); - /** - * styles -> top-front-right - */ - if (sw) { - this.polygon(bg, b, bw, bc, sw, false, [{x:x, y:y},{x: x1, y:y1},{x: x1 + width, y:y1},{x: x + width, y:y}]); - this.polygon(bg, b, bw, bc, sw, false, [{x:x, y:y},{x: x, y:y + height},{x: x + width,y: y + height},{x: x + width, y:y}]); - this.polygon(bg, b, bw, bc, sw, false, [{x:x + width, y:y},{x: x1 + width, y:y1},{x: x1 + width, y:y1 + height},{x: x + width, y:y + height}]); - } - /** - * clear the shadow on the body - */ - this.polygon($.dark(bg), b, bw, bc, false, false, [{x:x, y:y}, {x:x1, y:y1}, {x:x1 + width, y:y1}, {x:x + width, y:y}]); - this.polygon(bg, b, bw, bc, false, false, [{x:x, y:y}, {x:x, y:y + height}, {x:x + width, y:y + height}, {x:x + width,y: y}]); - this.polygon($.dark(bg), b, bw, bc, false, false, [{x:x + width, y:y}, {x:x1 + width, y:y1}, {x:x1 + width, y:y1 + height}, {x:x + width, y:y + height}]); - return this; - }, - cube3D : function(x, y, rotatex, rotatey, angle, w, h, zh, b, bw, bc, styles) { - /** - * styles -> lowerBottom-bottom-left-right-top-front - */ - x = fd(bw, x); - y = fd(bw, y); - zh = (!zh || zh == 0) ? w : zh; - - if (angle) { - var P = $.vectorP2P(rotatex, rotatey); - rotatex = x + zh * P.x, rotatey = y - zh * P.y; - } else { - rotatex = x + zh * rotatex, rotatey = y - zh * rotatey; - } - - while (styles.length < 6) - styles.push(false); - - rotatex = fd(bw, rotatex); - rotatey = fd(bw, rotatey); - - var side = []; - - if (rotatey < 0) { - if ($.isObject(styles[4])) - side.push($.applyIf({ - points : [{x:x,y:y - h},{x:rotatex,y:rotatey - h},{x:rotatex + w, y:rotatey - h},{x: x + w, y:y - h}] - }, styles[4])); - } else { - if ($.isObject(styles[0])) - side.push($.applyIf({ - points : [{x:x, y:y},{x: rotatex, y:rotatey},{x: rotatex + w, y:rotatey},{x: x + w,y:y}] - }, styles[0])); - } - - if ($.isObject(styles[1])) - side.push($.applyIf({ - points : [{x:rotatex, y:rotatey},{x: rotatex, y:rotatey - h}, {x:rotatex + w, y:rotatey - h},{x: rotatex + w,y:rotatey}] - }, styles[1])); - - if ($.isObject(styles[2])) - side.push($.applyIf({ - points : [{x:x, y:y}, {x:x, y:y - h},{x: rotatex, y:rotatey - h},{x: rotatex, y:rotatey}] - }, styles[2])); - - if ($.isObject(styles[3])) - side.push($.applyIf({ - points : [{x:x + w, y:y}, {x:x + w, y:y - h}, {x:rotatex + w, y:rotatey - h}, {x:rotatex + w, y:rotatey}] - }, styles[3])); - - if (rotatey < 0) { - if ($.isObject(styles[0])) - side.push($.applyIf({ - points : [{x:x,y: y}, {x:rotatex, y:rotatey}, {x:rotatex + w, y:rotatey}, {x:x + w, y:y}] - }, styles[0])); - } else { - if ($.isObject(styles[4])) - side.push($.applyIf({ - points : [{x:x, y:y - h}, {x:rotatex, y:rotatey - h}, {x:rotatex + w, y:rotatey - h}, {x:x + w, y:y - h}] - }, styles[4])); - } - - if ($.isObject(styles[5])) - side.push($.applyIf({ - points : [{x:x, y:y}, {x:x, y:y - h}, {x:x + w, y:y - h}, {x:x + w, y:y}] - }, styles[5])); - - side.each(function(s) { - this.polygon(s.color, b, bw, bc, s.shadow, s.alpha, s.points); - }, this); - - return this; - }, - polygon : function(bg, b, bw, bc, sw, alpham, p, smooth, smo,l) { - this.save().strokeStyle(b,bw, bc).beginPath().fillStyle(bg).globalAlpha(alpham).shadowOn(sw).moveTo(p[0].x,p[0].y); - if (smooth) { - this.moveTo(fd(bw,l[0].x),fd(bw,l[0].y)).lineTo(fd(bw, p[0].x), fd(bw, p[0].y)); - for ( var i = 1; i < p.length; i++) - this.bezierCurveTo(getCurvePoint(p, p[i], i, smo)); - this.lineTo(fd(bw,l[1].x),fd(bw,l[1].y)); - } else { - for ( var i = 1; i < p.length; i++) - this.lineTo(fd(bw, p[i].x), fd(bw, p[i].y)); - } - return this.closePath().stroke(b).fill(bg).restore(); - }, - lines : function(p, w, c, last) { - if(!w)return this; - this.save().gCo(last).beginPath().strokeStyle(true,w, c).moveTo(fd(w, p[0]), fd(w, p[1])); - for ( var i = 2; i < p.length - 1; i += 2) { - this.lineTo(fd(w, p[i]), fd(w, p[i + 1])); - } - return this.stroke(true).restore(); - }, - bezierCurveTo : function(r) { - this.c.bezierCurveTo(r[0], r[1], r[2], r[3], r[4], r[5]); - return this; - }, - label : function(p, w, c) { - return this.save() - .beginPath() - .strokeStyle(true,w, c) - .moveTo(fd(w, p[0].x), fd(w, p[0].y)) - .bezierCurveTo([p[1].x,p[1].y,p[2].x,p[2].y,p[3].x,p[3].y]) - .stroke(true) - .restore(); - }, - lineArray : function(p, w, c, smooth, smo) { - if(!w)return this; - this.save().beginPath().strokeStyle(true,w, c).moveTo(fd(w, p[0].x), fd(w, p[0].y)); - for ( var i = 1; i < p.length; i++){ - if (smooth) { - this.bezierCurveTo(getCurvePoint(p, p[i], i, smo || 1.5)); - } else { - this.lineTo(fd(w, p[i].x), fd(w, p[i].y)); - } - } - return this.stroke(true).restore(); - }, - dotted : function(x1, y1, x2, y2, w, c,L,f,last) { - if (!w) - return this; - x1 = fd(w, x1); - y1 = fd(w, y1); - x2 = fd(w, x2); - y2 = fd(w, y2); - var d = $.distanceP2P(x1, y1, x2, y2),t; - if(L<=0||d<=L||(x1!=x2&&y1!=y2)){ - return this.line(x1, y1, x2, y2, w, c, last); - } - if(x1>x2||y1>y2){ - t = x1; - x1 = x2; - x2 = t; - t = y1; - y1 = y2; - y2 = t; - } - this.save().gCo(last).strokeStyle(true,w, c).beginPath().moveTo(x1,y1); - var S = L*(f || 1),g = floor(d/(L+S)),k = (d-g*(L+S))>L,h=(y1==y2); - g = k?g+1:g; - for(var i=1;i<=g;i++){ - this.lineTo(h?x1+L*i+S*(i-1):x1,h?y1:y1+L*i+S*(i-1)).moveTo(h?x1+(L+S)*i:x1, h?y1:y1+(L+S)*i); - } - if(!k){ - this.lineTo(x2,y2); - } - return this.stroke(true).restore(); - }, - line : function(x1, y1, x2, y2, w, c, last) { - if (!w) - return this; - this.save().gCo(last); - return this.beginPath().strokeStyle(true,w, c).moveTo(fd(w, x1), fd(w, y1)).lineTo(fd(w, x2), fd(w, y2)).stroke(true).restore(); - }, - round : function(x, y, r, c, bw, bc) { - return this.arc(x, y, r,0, 0, PI2, c, !!bc, bw, bc); - }, - round0 : function(q, r, c, bw, bc) { - return this.arc(q.x, q.y, r,0, 0, PI2, c, !!bc, bw, bc); - }, - fillRect : function(x, y, w, h) { - this.c.fillRect(x, y, w, h); - return this; - }, - translate : function(x, y) { - this.c.translate(x, y); - return this; - }, - rotate : function(r) { - this.c.rotate(r); - return this; - }, - clearRect : function(x, y, w, h) { - x = x || 0; - y = y || 0; - w = w || this.canvas.width; - h = h || this.canvas.height; - this.c.clearRect(x, y, w, h); - return this; - }, - gCo : function(l) { - if(l) - return this.gCO(l); - return this; - }, - gCO : function(l) { - this.c.globalCompositeOperation = l ? "destination-over" : "source-over"; - return this; - }, - box : function(x, y, w, h, b, bg, shadow, m,last) { - b = b || { - enable : 0 - } - if (b.enable) { - var j = b.width, c = b.color, r = b.radius, f = $.isNumber(j); - j = $.parsePadding(j); - if(j[0]==j[1]&&j[1]==j[2]&&j[2]==j[3]){ - f = true; - } - m = m?1:-1; - w += m*(j[1] + j[3]) / 2; - h += m*(j[0] + j[2]) / 2; - x -= m*(j[3] / 2); - y -= m*(j[0] / 2); - j = f ? j[0] : j; - r = (!f ||!r|| r == 0 || r == '0') ? 0 : $.parsePadding(r); - } - - this.save().gCo(last).fillStyle(bg).strokeStyle(f,j, c); - /** - * draw a round corners border - */ - if (r) { - this.beginPath().moveTo(fd(j,x+r[0]), fd(j, y)) - .lineTo(fd(j,x+w - r[1]), fd(j, y)) - .arc2(fd(j,x+w - r[1]), fd(j, y+r[1]), r[1], PI*3/2, PI2) - .lineTo(fd(j, x+w), fd(j,y+h - r[2])) - .arc2(fd(j,x+w - r[2]), fd(j, y+h-r[2]), r[2], 0, PI/2) - .lineTo(fd(j,x+r[3]), fd(j, y+h)) - .arc2(fd(j,x+r[3]), fd(j, y+h-r[3]), r[3], PI/2, PI) - .lineTo(fd(j,x), fd(j,y+r[0])) - .arc2(fd(j,x+r[0]), fd(j, y+r[0]), r[0], PI, PI*3/2) - .closePath().shadowOn(shadow).stroke(j).shadowOff().fill(bg); - } else { - if (!b.enable || f) { - if (j&&b.enable){ - this.shadowOn(shadow).c.strokeRect(x, y, w, h); - this.shadowOff(); - } - if (bg) - this.fillRect(x, y, w, h); - } else { - if(j){ - c = $.isArray(c) ? c : [c, c, c, c]; - this.shadowOn(shadow).line(x+w, y+j[0] / 2, x+w, y+h - j[0] / 2, j[1], c[1], 0).line(x, y+j[0] / 2, x, y+h - j[0] / 2, j[3], c[3], 0).line(floor(x-j[3] / 2),y, x+w + j[1] / 2, y, j[0], c[0], 0).line(floor(x-j[3] / 2), y+h, x+w + j[1] / 2, y+h, j[2], c[2], 0).shadowOff(); - } - if (bg) { - this.beginPath().moveTo(floor(x+j[3] / 2), floor(y+j[0] / 2)).lineTo(ceil(x+w - j[1] / 2), y+j[0] / 2).lineTo(ceil(x+w - j[1] / 2), ceil(y+h - j[2] / 2)).lineTo(floor(x+j[3] / 2), ceil(y+h - j[2] / 2)).lineTo(floor(x+j[3] / 2), floor(y+j[0] / 2)).closePath().fill(bg); - } - } - - } - return this.restore(); - }, - toDataURL : function(g) { - return this.canvas.toDataURL(g || "image/png"); - }, - addEvent : function(type, fn, useCapture) { - $.Event.addEvent(this.canvas, type, fn, useCapture); - } - } - - /** - * the public method,inner use - */ - $.taylor = { - light:function(_,e){ - e.highlight = false; - _.on('mouseover',function(){ - e.highlight = true; - _.redraw('mouseover'); - }).on('mouseout',function(){ - e.highlight = false; - _.redraw('mouseout'); - }).on('beforedraw',function(){ - _.push('f_color',e.highlight?_.get('light_color'):_.get('f_color_')); - return true; - }); - } - } - - /** - * @overview this component is a super class of all chart - * @component#$.Chart - * @extend#$.Painter - */ - $.Chart = $.extend($.Painter, { - /** - * @cfg {TypeName} - */ - configure : function() { - /** - * invoked the super class's configuration - */ - $.Chart.superclass.configure.apply(this, arguments); - - /** - * indicate the element's type - */ - this.type = 'chart'; - /** - * indicate the data structure - */ - this.dataType = 'simple'; - - this.set({ - /** - * @cfg {String} The unique id of this element (defaults to an auto-assigned id). - */ - id : '', - /** - * @cfg {String} id of dom you want rendered(defaults ''). - */ - render : '', - /** - * @cfg {Array} Required,The datasource of Chart.must be not empty. - */ - data : [], - /** - * @cfg {Number} Specifies the width of this canvas - */ - width : undefined, - /** - * @cfg {Number} Specifies the height of this canvas - */ - height : undefined, - /** - * @cfg {String} Specifies the default lineJoin of the canvas's context in this element.(defaults to 'round') - */ - lineJoin : 'round', - /** - * @cfg {String} this property specifies the horizontal alignment of chart in an module (defaults to 'center') Available value are: - * @Option 'left' - * @Option 'center' - * @Option 'right' - */ - align : 'center', - /** - * @cfg {Boolean} If true mouse change to a pointer when a mouseover fired.only available when use PC.(defaults to true) - */ - default_mouseover_css : true, - /** - * @cfg {Boolean} If true ignore the event touchmove.only available when support touchEvent.(defaults to false) - */ - turn_off_touchmove : false, - /** - * @cfg {Boolean} Specifies as true to display with percent.(default to false) - */ - showpercent : false, - /** - * @cfg {Number} Specifies the number of decimal when use percent.(default to 1) - */ - decimalsnum : 1, - /** - * @cfg {Object/String} Specifies the config of Title details see $.Text,If given a string,it will only apply the text.note:If the text is empty,then will not display - */ - title : { - text : '', - fontweight : 'bold', - /** - * Specifies the font-size in pixels of title.(default to 20) - */ - fontsize : 20, - /** - * Specifies the height of title will be take.(default to 30) - */ - height : 30 - }, - /** - * @cfg {Object/String}Specifies the config of subtitle details see $.Text,If given a string,it will only apply the text.note:If the title or subtitle'text is empty,then will not display - */ - subtitle : { - text : '', - fontweight : 'bold', - /** - * Specifies the font-size in pixels of title.(default to 16) - */ - fontsize : 16, - /** - * Specifies the height of title will be take.(default to 20) - */ - height : 20 - }, - /** - * @cfg {Object/String}Specifies the config of footnote details see $.Text,If given a string,it will only apply the text.note:If the text is empty,then will not display - */ - footnote : { - text : '', - /** - * Specifies the font-color of footnote.(default to '#5d7f97') - */ - color : '#5d7f97', - textAlign : 'right', - /** - * Specifies the height of title will be take.(default to 20) - */ - height : 20 - }, - /** - * @cfg {Boolean} If true element will have a animation when show, false to skip the animation.(default to false) - */ - animation : false, - /** - * @Function {Function} the custom funtion for animation.(default to null) - */ - doAnimation : null, - /** - * @cfg {String} (default to 'ease-in-out') Available value are: - * @Option 'easeIn' - * @Option 'easeOut' - * @Option 'easeInOut' - * @Option 'linear' - */ - animation_timing_function : 'easeInOut', - /** - * @cfg {Number} Specifies the duration when animation complete in millisecond.(default to 1000) - */ - animation_duration : 1000, - /** - * @cfg {Number} Specifies the chart's z_index.override the default as 999 to make it at top layer.(default to 999) - */ - z_index:999, - /** - * @cfg {Object}Specifies the config of Legend.For details see $.Legend Note:this has a extra property named 'enable',indicate whether legend available(default to false) - */ - legend : { - enable : false - }, - /** - * @cfg {Object} Specifies the config of Tip.For details see $.Tip Note:this has a extra property named 'enable',indicate whether tip available(default to false) - */ - tip : { - enable : false - } - }); - - /** - * register the common event - */ - this.registerEvent( - /** - * @event Fires before this element Animation.Only valid when animation is true - * @paramter $.Chart#this - */ - 'beforeAnimation', - /** - * @event Fires when this element Animation finished.Only valid when animation is true - * @paramter $.Chart#this - */ - 'afterAnimation', - /** - * @event Fires when chart resize. - * @paramter int#width chart's width - * @paramter int#height chart's height - * @return Object object the new config for chart - */ - 'resize', - 'animating'); - - this.T = null; - this.Rendered = false; - this.Combination = false; - this.Animationed = false; - this.show = false; - this.data = []; - this.plugins = []; - this.components = []; - this.oneways = []; - this.total = 0; - this.ICHARTJS_CHART = true; - }, - toDataURL : function(g) { - return this.T.toDataURL(g); - }, - segmentRect : function() { - if(!this.Combination) - this.T.clearRect(); - }, - resetCanvas : function() { - if(!this.Combination) - this.T.box(this.get('l_originx'), this.get('t_originy'), this.get('client_width'), this.get('client_height'),0,this.get('f_color'),0,0,true); - }, - animation : function(_) { - /** - * clear the part of canvas - */ - _.segmentRect(); - - /** - * draw coordinate - */ - if(_.coo&&!_.ILLUSIVE_COO) - _.coo.draw(); - - /** - * doAnimation of implement - */ - _.doAnimation(_.variable.animation.time, _.duration,_); - - /** - * draw plugins - */ - _.plugins.each(function(p){ - if(p.A_draw){ - p.variable.animation.animating =true; - p.variable.animation.time =_.variable.animation.time; - p.draw(); - p.variable.animation.animating =false; - } - }); - - if(_.Combination){ - return; - } - - _.oneways.each(function(o) {o.draw()}); - - if (_.variable.animation.time < _.duration) { - _.variable.animation.time++; - $.requestAnimFrame(function() { - _.animation(_); - }); - } else { - $.requestAnimFrame(function() { - _.Animationed = true; - - /** - * make plugins's status is the same as chart - */ - _.plugins.each(function(p){ - p.Animationed = true; - }); - _.processAnimation = false; - _.draw(); - _.plugins.each(function(p){ - p.processAnimation = false; - }); - _.fireEvent(_, 'afterAnimation', [_]); - }); - } - }, - runAnimation : function(_) { - _.fireEvent(_, 'beforeAnimation', [_]); - if(!_.A_draw) - _.variable.animation = { - type : 0, - time : 0, - queue : [] - } - _.processAnimation = true; - _.animation(_); - }, - doSort:function(){ - var f = function(p, q){return ($.isArray(p)?(p.zIndex||0):p.get('z_index'))>($.isArray(q)?(q.zIndex||0):q.get('z_index'))}; - this.components.sor(f); - this.oneways.sor(f); - }, - commonDraw : function(_,e) { - _.show = false; - - if (!_.redraw) { - $.Assert.isTrue(_.Rendered, _.type + ' has not rendered'); - $.Assert.isTrue(_.data&&_.data.length>0,_.type + '\'s data is empty'); - $.Assert.isTrue(_.initialization, _.type + ' Failed to initialize'); - _.doSort(); - } - - _.redraw = true; - - if (!_.Animationed && _.get('animation')) { - _.runAnimation(_); - return; - } - _.segmentRect(); - //order? - _.components.eachAll(function(c) { - c.draw(e); - }); - _.components.eachAll(function(c) { - if(c.last)c.last(c); - }); - //order? - _.oneways.each(function(o) {o.draw()}); - - _.show = true; - }, - /** - * @method register the customize component or combinate with other charts - * @paramter $.Custom$.Chart#object - * @return void - */ - plugin : function(c) { - var _ = this._(); - c.inject(_); - if(c.ICHARTJS_CHART){ - c.Combination = true; - c.setUp(); - } - if(!_.get('animation')){ - c.push('animation',false); - } - c.duration =_.duration; - _.register(c); - _.plugins.push(c); - }, - destroy:function(_){ - _.components.eachAll(function(C){ - C.destroy(); - }); - _.oneways.each(function(O){ - O.destroy(); - }); - }, - /** - * @method return the title,return undefined if unavailable - * @return $.Text#the title object - */ - getTitle:function(){ - return this.title; - }, - /** - * @method return the subtitle,return undefined if unavailable - * @return $.Text#the subtitle object - */ - getSubTitle:function(){ - return this.subtitle; - }, - /** - * @method return the footnote,return undefined if unavailable - * @return $.Text#the footnote object - */ - getFootNote:function(){ - return this.footnote; - }, - /** - * @method return the main Drawing Area's dimension,return following property: - * x:the left-top coordinate-x - * y:the left-top coordinate-y - * width:the width of drawing area - * height:the height of drawing area - * @return Object#contains dimension info - */ - getDrawingArea:function(){ - return { - x:this.get("l_originx"), - x:this.get("t_originy"), - width:this.get("client_width"), - height:this.get("client_height") - } - }, - create : function(_,shell) { - /** - * fit the window - */ - if(_.get('fit')){ - var w = window.innerWidth, - h = window.innerHeight, - style = $.getDoc().body.style; - style.padding = "0px"; - style.margin = "0px"; - style.overflow = "hidden"; - _.push(_.W, w); - _.push(_.H, h); - } - - _.canvasid = $.uid(_.type); - _.shellid = "shell-"+_.canvasid; - - var H = []; - H.push("
                                                                      "); - H.push(""); - H.push("

                                                                      Your browser does not support the canvas element

                                                                      "); - H.push("
                                                                      "); - - /** - * also use appendChild() - */ - shell.innerHTML = H.join(""); - - _.shell = $(_.shellid); - - /** - * the base canvas wrap for draw - */ - _.T = _.target = new Cans(_.canvasid); - - /** - * do size - */ - _.size(_); - _.Rendered = true; - }, - /** - * @method set up the chart by latest configruation - * @return void - */ - setUp:function(){ - var _ = this._(); - _.redraw = false; - _.T.clearRect(); - _.initialization = false; - _.initialize(); - }, - /** - * @method load the new data - * @paramter array#data - * @return void - */ - load:function(d){ - var _ = this._(); - _.push('data', d||[]); - _.setUp(); - (_.Combination?_.root:_).draw(); - }, - /** - * @method resize the chart - * @paramter int#width - * @paramter int#height - * @return void - */ - resize:function(w,h){ - w = $.parseFloat(w); - h = $.parseFloat(h); - var _ = this._(); - if(!_.Combination){ - _.width = _.push(_.W, w); - _.height = _.push(_.H, h); - _.size(_); - } - _.set(_.fireEvent(_,'resize',[w,h])); - _.setUp(); - _.plugins.eachAll(function(P) { - if(P.Combination){ - P.resize(w,h); - } - }); - if(!_.Combination){ - _.draw(); - } - }, - size:function(_){ - _.T.canvas.width = _.width = _.pushIf(_.W, 400); - _.T.canvas.height = _.height = _.pushIf(_.H, 300); - _.shell.style.width = _.width+'px'; - _.shell.style.height = _.height+'px'; - }, - initialize : function() { - var _ = this._(),d = _.get('data'),r = _.get('render'); - - _.push(_.X, null); - _.push(_.Y, null); - - if(_.Combination){ - $.apply(_.options, $.clone([_.W,_.H,'padding','border','client_height','client_width', - 'minDistance','maxDistance','centerx', 'centery', - 'l_originx','r_originx','t_originy','b_originy'], _.root.options,true)); - _.width = _.get(_.W); - _.height = _.get(_.H); - _.shell = _.root.shell; - _.Rendered = true; - }else if (!_.Rendered) { - if(r) - _.create(_,$(r)); - } - - if(_.Rendered && !_.initialization){ - if(d&&d.length>0){ - parse.call(_,d,_); - }else if($.isString(_.get('url'))){ - _.ajax.call(_,_.get('url'),function(D){ - _.push('data',D); - _.initialize(); - _.draw(); - }); - } - } - }, - /** - * @method turn off the event listener - * @return void - */ - eventOff:function(){this.stopEvent = true}, - /** - * @method turn on the event listener - * @return void - */ - eventOn:function(){this.stopEvent = false}, - /** - * this method only invoked once - */ - oneWay:function(_){ - - _.T.strokeStyle(true,0, _.get('strokeStyle'), _.get('lineJoin')); - - _.processAnimation = _.get('animation'); - - if($.isFunction(_.get('doAnimation'))){ - _.doAnimation = _.get('doAnimation'); - } - _.animationArithmetic = $.getAA(_.get('animation_timing_function')); - - var E = _.variable.event,comb=_.Combination,tot=!_.get('turn_off_touchmove')&&!comb, mCSS = !$.touch&&_.get('default_mouseover_css')&&!comb, O, AO,events = $.touch?['touchstart','touchmove']:['click','mousemove']; - _.stopEvent = false; - _.A_draw = comb&&_.processAnimation; - - /** - * register chart in Registry - */ - $.register(_); - - /** - * If Combination,ignore binding event because of root have been do this. - */ - if(!comb){ - events.each(function(it) { - _.T.addEvent(it, function(e) { - if (_.processAnimation||_.stopEvent) - return; - if(e.targetTouches&&e.targetTouches.length!=1){ - return; - } - _.fireEvent(_, it, [_, $.Event.fix(e)]); - }, false); - }); - } - - _.on(events[0], function(_, e) { - _.components.eachAll(function(C) { - if(C.ICHARTJS_CHART){ - /** - * meaning this component is a Combination Chart - */ - if(C.fireEvent(C,events[0], [C, e])){ - E.click = true; - return false; - } - }else{ - /** - * generic component - */ - var M = C.isMouseOver(e); - if (M.valid){ - E.click = true; - C.fireEvent(C,'click', [C, e, M]); - return !e.stopPropagation; - } - } - }); - if(E.click){ - if(tot) - e.event.preventDefault(); - E.click = false; - return true; - } - }); - - if(!$.touch||tot){ - _.on(events[1], function(_, e) { - O = AO = false; - _.components.eachAll(function(C) { - if(C.ICHARTJS_CHART){ - /** - * meaning this component is a Combination Chart - */ - if(C.fireEvent(C,events[1], [C, e])){ - O = true; - return false; - } - }else{ - var cE = C.variable.event, M = C.isMouseOver(e); - if (M.valid) { - O = O || C.atomic; - if (!cE.mouseover) { - cE.mouseover = true; - C.fireEvent(C, 'mouseover', [C,e, M]); - } - C.fireEvent(C, 'mousemove', [C,e, M]); - if(M.stop){ - return false; - } - } else { - if (cE.mouseover) { - cE.mouseover = false; - C.fireEvent(C, 'mouseout', [C,e, M]); - } - } - return !e.stopPropagation; - } - }); - if(E.mouseover){ - e.event.preventDefault(); - if (!O) { - E.mouseover = false; - _.fireEvent(_, 'mouseout', [_,e]); - } - return E.mouseover; - }else{ - if(O){ - E.mouseover = O; - _.fireEvent(_, 'mouseover', [_,e]); - } - } - }); - /** - * defalut mouse style - */ - if (mCSS) { - _.on('mouseover',function(){ - _.T.css("cursor", "pointer"); - }).on('mouseout',function(){ - _.T.css("cursor", "default"); - }); - } - } - /** - * clone config to sub_option - */ - $.applyIf(_.get('sub_option'), $.clone(['shadow','tip'], _.options,true)); - - if(!_.Combination){ - /** - * push the background in it - */ - _.bg = new $.Custom({ - z_index:-1, - drawFn:function(){ - _.T.box(0, 0, _.width, _.height, _.get('border'), _.get('f_color'),0,0,true); - } - }); - _.duration = ceil(_.get('animation_duration') * $.FRAME / 1000); - } - - _.oneWay = $.emptyFn; - }, - /** - * calculate chart's alignment - */ - originXY:function(_,x,y){ - var A = _.get('align'); - if (A == _.L) { - _.pushIf(_.X, x[0]); - } else if (A == _.R) { - _.pushIf(_.X, x[1]); - } else { - _.pushIf(_.X, x[2]); - } - _.x = _.push(_.X, _.get(_.X) + _.get('offsetx')); - _.y = _.push(_.Y, y[0]+ _.get('offsety')); - - return { - x:_.x, - y:_.y - } - }, - getPercent:function(v,T){ - return this.get('showpercent') ? (v / (T||this.total||1) * 100).toFixed(this.get('decimalsnum')) + '%' : v; - }, - doActing:function(_,d,o,i,t){ - var f=!!_.get('communal_acting'),v=_.getPercent(d.value,d.total); - /** - * store or restore the option - */ - _.push(f?'sub_option':'communal_acting',$.clone(_.get(f?'communal_acting':'sub_option'),true)); - /** - * merge the option - */ - $.merge(_.get('sub_option'),d); - - /** - * merge specific option - */ - $.merge(_.get('sub_option'),o); - - _.push('sub_option.value',v); - _.push('sub_option.value_',d.value); - - if (_.get('sub_option.tip.enable')){ - _.push('sub_option.tip.text',t || (d.name + ' ' +v)); - _.push('sub_option.tip.name',d.name); - _.push('sub_option.tip.index',i); - _.push('sub_option.tip.value',d.value); - _.push('sub_option.tip.total',d.total||_.total); - } - }, - register:function(c){ - c.id = $.uid(c.type); - this.components.push(c); - return c; - }, - remove:function(_,c){ - if(c) - _.components.each(function(C,i){ - if(c.id==C.id){ - _.components.splice(i,1); - return false; - } - }); - }, - doConfig : function() { - $.Chart.superclass.doConfig.call(this); - var _ = this._(); - - _.destroy(_); - - _.oneways.length =0; - - _.oneWay(_); - - /** - * for store the option of each item in chart - */ - _.push('communal_acting',0); - - if(!_.Combination){ - _.oneways.push(_.bg); - _.push('r_originx', _.width - _.get('padding_right')); - _.push('b_originy', _.height - _.get('padding_bottom')); - - _.applyGradient(); - - if ($.isString(_.get('title'))) { - _.push('title', $.applyIf({ - text : _.get('title') - }, _.default_.title)); - } - if ($.isString(_.get('subtitle'))) { - _.push('subtitle', $.applyIf({ - text : _.get('subtitle') - }, _.default_.subtitle)); - } - - if ($.isString(_.get('footnote'))) { - _.push('footnote', $.applyIf({ - text : _.get('footnote') - }, _.default_.footnote)); - } - var H = 0, l = _.push('l_originx', _.get('padding_left')), t = _.push('t_originy', _.get('padding_top')), w = _.push('client_width', (_.width - _.get('hpadding'))), h; - - if (_.get('title.text') != ''){ - var st = _.get('subtitle.text') != ''; - H = st ? _.get('title.height') + _.get('subtitle.height') : _.get('title.height'); - t = _.push('t_originy', t + H); - _.push('title.originx', l); - _.push('title.originy', _.get('padding_top')); - _.push('title.maxwidth', w); - _.pushIf('title.width', w); - _.title = new $.Text(_.get('title'), _); - _.oneways.push(_.title); - if (st) { - _.push('subtitle.originx', l); - _.push('subtitle.originy', _.get('padding_top') + _.get('title.height')); - _.pushIf('subtitle.width', w); - _.push('subtitle.maxwidth', w); - _.subtitle = new $.Text(_.get('subtitle'), _); - _.oneways.push(_.subtitle); - } - } - - if (_.get('footnote.text') != '') { - var g = _.get('footnote.height'); - H += g; - _.push('b_originy', _.get('b_originy') - g); - _.push('footnote.originx', l); - _.push('footnote.originy', _.get('b_originy')); - _.push('footnote.maxwidth', w); - _.pushIf('footnote.width', w); - _.footnote = new $.Text(_.get('footnote'), _); - _.oneways.push(_.footnote); - } - h = _.push('client_height', (_.get(_.H) - _.get('vpadding') - _.pushIf('other_height',H))); - - _.push('minDistance', min(w, h)); - _.push('maxDistance', max(w, h)); - _.push('centerx', l + w / 2); - _.push('centery', t + h / 2); - } - - /** - * TODO legend dosize? - */ - if (_.get('legend.enable')){ - _.legend = new $.Legend($.apply({ - maxwidth : _.get('client_width'), - data : _.data - }, _.get('legend')), _); - _.oneways.push(_.legend); - } - - _.push('sub_option.tip.wrap',_.push('tip.wrap', _.shell)); - } - }); -})($); -/** - * @end - */ - - - /** - * @overview the customize componment - * @component#$.Custom - * @extend#$.Component - */ - $.Custom = $.extend($.Component,{ - configure:function(){ - /** - * invoked the super class's configuration - */ - $.Custom.superclass.configure.apply(this,arguments); - - /** - * indicate the component's type - */ - this.type = 'custom'; - - this.set({ - /** - * @cfg {Function} Specifies the customize function.(default to emptyFn) - */ - drawFn:$.emptyFn, - configFn:$.emptyFn, - /** - * @cfg {Function} Specifies the customize event valid function.(default to undefined) - */ - eventValid:undefined, - /** - * @cfg {Boolean} If true when chart animating it also invoke darw.(default to true) - */ - animating_draw:true - }); - }, - doDraw:function(_){ - _.get('drawFn').call(_,_); - }, - isEventValid:function(e,_){ - if($.isFunction(this.get('eventValid'))) - return this.get('eventValid').call(this,e,_); - return {valid:false}; - }, - doConfig:function(){ - $.Custom.superclass.doConfig.call(this); - var _ = this._(); - _.A_draw = _.get('animating_draw'); - _.variable.animation = { - animating:false, - time : 0 - }; - _.duration = 0; - _.get('configFn').call(_,_); - } -}); -/** - * @end - */ -/** - * @overview this is inner use for axis - * @component#$.Scale - * @extend#$.Component - */ -$.Scale = $.extend($.Component, { - configure : function() { - - /** - * invoked the super class's configuration - */ - $.Scale.superclass.configure.apply(this, arguments); - - /** - * indicate the component's type - */ - this.type = 'scale'; - - this.set({ - /** - * @cfg {String} Specifies alignment of this scale.(default to 'left') - */ - position : 'left', - /** - * @cfg {String} the axis's type(default to 'h') Available value are: - * @Option 'h' :horizontal - * @Option 'v' :vertical - */ - which : 'h', - /** - * @cfg {Number} Specifies value of Baseline Coordinate.(default to 0) - */ - basic_value:0, - /** - * @cfg {Boolean} indicate whether the grid is accord with scale.(default to true) - */ - scale2grid : true, - /** - * @inner {Number} - */ - distance : undefined, - /** - * @cfg {Number} Specifies the start coordinate scale value.(default to 0) - */ - start_scale : 0, - /** - * @cfg {Number} Specifies the end coordinate scale value.Note either this or property of max_scale must be has the given value.(default to undefined) - */ - end_scale : undefined, - /** - * @cfg {Number} Specifies the chart's minimal value - */ - min_scale : undefined, - /** - * @cfg {Number} Specifies the chart's maximal value - */ - max_scale : undefined, - /** - * @cfg {Number} Specifies the space of two scale.Note either this or property of scale_share must be has the given value.(default to undefined) - */ - scale_space : undefined, - /** - * @cfg {Number} Specifies the number of scale on axis.(default to 5) - */ - scale_share : 5, - /** - * @cfg {Boolean} True to display the scale line.(default to true) - */ - scale_enable : true, - /** - * @cfg {Number} Specifies the size of brush(context.linewidth).(default to 1) - */ - scale_size : 1, - /** - * @cfg {Number} Specifies the width(length) of scale.(default to 4) - */ - scale_width : 4, - /** - * @cfg {String} Specifies the color of scale.(default to 4) - */ - scale_color : '#333333', - /** - * @cfg {String} Specifies the align against axis.(default to 'center') When the property of which set to 'h',Available value are: - * @Option 'left' - * @Option 'center' - * @Option 'right' - * When the property of which set to 'v', Available value are: - * @Option 'top' - * @Option 'center' - * @Option 'bottom' - */ - scaleAlign : 'center', - /** - * @cfg {Array} the customize labels - */ - labels : [], - /** - * @cfg {$.Text} Specifies label's option. - */ - label : {}, - /** - * @cfg {Number} Specifies the distance to scale.(default to 6) - */ - text_space : 6, - /** - * @cfg {String} Specifies the align against axis.(default to 'left' or 'bottom' in v mode) When the property of which set to 'h',Available value are: - * @Option 'left' - * @Option 'right' When the property of which set to 'v', Available value are: - * @Option 'top' - * @Option 'bottom' - */ - textAlign : 'left', - /** - * @cfg {Number} Specifies the number of decimal.this will change along with scale.(default to 0) - */ - decimalsnum : 0, - /** - * @inner {String} the style of overlapping(default to 'none') Available value are: - * @Option 'square' - * @Option 'round' - * @Option 'none' - */ - join_style : 'none', - /** - * @inner {Number} - */ - join_size : 2 - }); - - this.registerEvent( - /** - * @event Fires the event when parse text,you can return a object like this:{text:'',originx:100,originy:100} to override the given. - * @paramter string#text item's text - * @paramter int#originx coordinate-x of item's text - * @paramter int#originy coordinate-y of item's text - * @paramter int#index item's index - * @paramter boolean#last If last item - */ - 'parseText'); - - }, - isEventValid : function() { - return { - valid : false - }; - }, - getScale:function(_){ - var u = [_.get('basic_value'),_.get('start_scale'),_.get('end_scale'),_.get('end_scale') - _.get('start_scale'),0]; - u[4] = $.inRange(u[1],u[2]+1,u[0])||$.inRange(u[2]-1,u[1],u[0]); - return { - range:u[4], - basic:u[4]?(u[0]-u[1]) / u[3]:0, - start : u[4]?u[0]:u[1], - end : u[2], - distance : u[3] - } - }, - /** - * from left to right,top to bottom - */ - doDraw : function(_) { - if (_.get('scale_enable')) - _.items.each(function(item) { - _.T.line(item.x0, item.y0, item.x1, item.y1, _.get('scale_size'), _.get('scale_color'), false); - }); - _.labels.each(function(l) { - l.draw(); - }); - }, - doLayout:function(x,y,_){ - if (_.get('scale_enable')) - _.items.each(function(item) { - item.x0+=x; - item.y0+=y; - item.x1+=x; - item.y1+=y; - }); - _.labels.each(function(l) { - l.doLayout(x,y,0,l); - }); - }, - doConfig : function() { - $.Scale.superclass.doConfig.call(this); - - var _ = this._(),abs = Math.abs,customL = _.get('labels').length, min_s = _.get('min_scale'), max_s = _.get('max_scale'), s_space = _.get('scale_space'), e_scale = _.get('end_scale'), start_scale = _.get('start_scale'); - - _.items = []; - _.labels = []; - _.number = 0; - - if (customL > 0) { - _.number = customL - 1; - } else { - /** - * startScale must less than minScale - */ - if (start_scale > min_s) { - start_scale = _.push('start_scale', $.floor(min_s)); - } - - /** - * end_scale must greater than maxScale - */ - if (!$.isNumber(e_scale) || e_scale < max_s) { - e_scale = $.ceil(max_s); - e_scale = _.push('end_scale', (!e_scale&&!start_scale)?1:e_scale); - } - - - if (s_space && abs(s_space) < abs(e_scale - start_scale)) { - _.push('scale_share', (e_scale - start_scale) / s_space); - } - - _.number = _.push('scale_share', abs(_.get('scale_share'))); - - /** - * value of each scale - */ - if (!s_space || s_space >( e_scale - start_scale)) { - var W = ((e_scale - start_scale)+"").indexOf('.')+1,M=1; - while(W>0){W--;M*=10;} - s_space = _.push('scale', (e_scale - start_scale)*M / _.get('scale_share')/M); - } - - if (parseInt(s_space)!=s_space && _.get('decimalsnum') == 0) { - _.push('decimalsnum',(s_space+"").substring((s_space+"").indexOf('.')+1).length); - } - } - - /** - * the real distance of each scale - */ - _.push('distanceOne', _.get('valid_distance') / _.number); - - var text, x, y, x1 = 0, y1 = 0, x0 = 0, y0 = 0, tx = 0, ty = 0, w = _.get('scale_width'), w2 = w / 2, sa = _.get('scaleAlign'), ta = _.get('position'), ts = _.get('text_space'), tbl = '',aw = _.get('coo').get('axis.width'); - - _.push('which', _.get('which').toLowerCase()); - _.isH = _.get('which') == 'h'; - if (_.isH) { - if (sa == _.O) { - y0 = -w; - } else if (sa == _.C) { - y0 = -w2; - y1 = w2; - } else { - y1 = w; - } - - if (ta == _.O) { - ty = -ts-aw[0]; - tbl = _.B; - } else { - ty = ts+aw[2]; - tbl = _.O; - } - ta = _.C; - } else { - if (sa == _.L) { - x0 = -w; - } else if (sa == _.C) { - x0 = -w2; - x1 = w2; - } else { - x1 = w; - } - tbl = 'middle'; - if (ta == _.R) { - ta = _.L; - tx = ts+aw[1]; - } else { - ta = _.R; - tx = -ts-aw[3]; - } - } - /** - * valid width only applies when there is h,then valid_height only applies when there is v - */ - for ( var i = 0; i <= _.number; i++) { - text = customL ? _.get('labels')[i] : (s_space * i + start_scale).toFixed(_.get('decimalsnum')); - x = _.isH ? _.get('valid_x') + i * _.get('distanceOne') : _.x; - y = _.isH ? _.y : _.get('valid_y') + _.get('valid_distance') - i * _.get('distanceOne'); - - _.items.push({ - x : x, - y : y, - x0 : x + x0, - y0 : y + y0, - x1 : x + x1, - y1 : y + y1 - }); - /** - * put the label into a Text? - */ - if(_.get('label')) - _.labels.push(new $.Text($.applyIf($.apply(_.get('label'), $.merge({ - text : text, - x : x, - y : y, - originx : x + tx, - originy : y + ty - }, _.fireEvent(_, 'parseText', [text, x + tx, y + ty, i, _.number == i]))), { - textAlign : ta, - textBaseline : tbl - }), _)); - - /** - * maxwidth = Math.max(maxwidth, _.T.measureText(text)); - */ - } - } -}); - -/** - * @end - */ -$.Coordinate = { - coordinate_ : function(g) { - var _ = this._(),coo = _.get('coordinate'); - - if(coo.ICHARTJS_OBJECT){ - _.x = _.push(_.X, coo.x); - _.y = _.push(_.Y, coo.y); - /** - * Imply it was illusive - */ - _.ILLUSIVE_COO = true; - return coo; - } - /** - * Apply the coordinate feature - */ - var f = '85%', - parse=$.parsePercent, - scale = _.get('coordinate.scale'), - li=_.get('scaleAlign'), - w = _.push('coordinate._width',parse(_.get('coordinate.width')||f,Math.floor(_.get('client_width')))); - h = _.push('coordinate._height',parse(_.get('coordinate.height')||f,Math.floor(_.get('client_height')))-(_.is3D()?((_.get('coordinate.pedestal_height')||22) + (_.get('coordinate.board_deep')||20)):0)); - _.push('coordinate.valid_height_value',parse(_.get('coordinate.valid_height'),h)); - _.push('coordinate.valid_width_value',parse(_.get('coordinate.valid_width'),w)); - - _.originXY(_,[_.get('l_originx'),_.get('r_originx') - w,_.get('centerx') - w / 2],[_.get('centery') - h / 2]); - - _.push('coordinate.originx', _.x); - _.push('coordinate.originy', _.y); - - /** - * invoke call back - */ - if(g)g(); - - if($.isObject(scale)){ - scale = [scale]; - } - if($.isArray(scale)){ - var ST = _.dataType != 'stacked'; - scale.each(function(s){ - /** - * applies the percent shower - */ - if(_.get('percent')&&s.position==li){ - s = $.apply(s,{ - start_scale : 0, - end_scale : 100, - scale_space : 10, - listeners:{ - parseText:function(t,x,y){ - return {text:t+'%'} - } - } - }); - } - if(!s.start_scale||(ST&&s.start_scale>_.get('minValue'))) - s.min_scale = _.get('minValue'); - if(!s.end_scale||(ST&&s.end_scale<_.get('maxValue'))) - s.max_scale = _.get('maxValue'); - }); - }else{ - _.push('coordinate.scale',{ - position : li, - scaleAlign : li, - max_scale : _.get('maxValue'), - min_scale : _.get('minValue') - }); - } - - if (_.is3D()) { - _.push('coordinate.xAngle_', _.get('xAngle_')); - _.push('coordinate.yAngle_', _.get('yAngle_')); - /** - * the Coordinate' Z is same as long as the column's - */ - _.push('coordinate.zHeight', _.get('zHeight') * _.get('bottom_scale')); - } - _.remove(_,_.coo); - return _.register(new $[_.is3D()?'Coordinate3D':'Coordinate2D'](_.get('coordinate'), _));; - } -} -/** - * @overview the coordinate2d componment - * @component#$.Coordinate2D - * @extend#$.Component - */ -$.Coordinate2D = $.extend($.Component, { - configure : function() { - /** - * invoked the super class's configurationuration - */ - $.Coordinate2D.superclass.configure.apply(this, arguments); - - /** - * indicate the component's type - */ - this.type = 'coordinate2d'; - - this.set({ - /** - * @inner {Number} - */ - sign_size : 12, - /** - * @inner {Number} - */ - sign_space : 5, - /** - * @cfg {Array} the option for scale.For details see $.Scale - */ - scale : [], - /** - * @cfg {String/Number} Here,specify as '85%' relative to client width.(default to '85%') - */ - width:'85%', - /** - * @cfg {String/Number} Here,specify as '85%' relative to client height.(default to '85%') - */ - height:'85%', - /** - * @cfg {String/Number} Specifies the valid width,less than the width of coordinate.you can applies a percent value relative to width.(default to '100%') - */ - valid_width : '100%', - /** - * @cfg {String/Number} Specifies the valid height,less than the height of coordinate.you can applies a percent value relative to width.(default to '100%') - */ - valid_height : '100%', - /** - * @cfg {Number} Specifies the linewidth of the grid.(default to 1) - */ - grid_line_width : 1, - /** - * @cfg {String} Specifies the color of the grid.(default to '#dbe1e1') - */ - grid_color : '#dbe1e1', - /** - * @cfg {Object} Specifies the stlye of horizontal grid.(default to empty object).Available property are: - * @Option solid {Boolean} True to draw a solid line.else draw a dotted line.(default to true) - * @Option size {Number} Specifies size of line segment when solid is false.(default to 10) - * @Option fator {Number} Specifies the times to size(default to 1) - * @Option width {Number} Specifies the width of grid line.(default to 1) - * @Option color {String} Specifies the color of grid line.(default to '#dbe1e1') - */ - gridHStyle : {}, - /** - * @cfg {Object} Specifies the stlye of horizontal grid.(default to empty object).Available property are: - * @Option solid {Boolean} True to draw a solid line.else draw a dotted line.(default to true) - * @Option size {Number} Specifies size of line segment when solid is false.(default to 10) - * @Option fator {Number} Specifies the times to size(default to 1) - * @Option width {Number} Specifies the width of grid line.(default to 1) - * @Option color {String} Specifies the color of grid line.(default to '#dbe1e1') - */ - gridVStyle : {}, - /** - * @cfg {Boolean} True to display grid line.(default to true) - */ - gridlinesVisible : true, - /** - * @cfg {Boolean} indicate whether the grid is accord with scale,on the premise of grids is not specify. this just give a convenient way bulid grid for default.and actual value depend on scale's scale2grid - */ - scale2grid : true, - /** - * @cfg {Object} this is grid config for custom.there has two valid property horizontal and vertical.the property's sub property is: way:the manner calculate grid-line (default to 'share_alike') Available property are: - * @Option share_alike - * @Option given_value value: when property way apply to 'share_alike' this property mean to the number of grid's line. - * when apply to 'given_value' this property mean to the distance each grid line(unit:pixel) . - * code will like: - * { - * horizontal: {way:'share_alike',value:10}, - * vertical: { way:'given_value', value:40 } - * } - */ - grids : undefined, - /** - * @cfg {Boolean} If True the grid line will be ignored when gird and axis overlap.(default to true) - */ - ignoreOverlap : true, - /** - * @cfg {Boolean} If True the grid line will be ignored when gird and coordinate's edge overlap.(default to false) - */ - ignoreEdge : false, - /** - * @inner {String} Specifies the label on x-axis - */ - xlabel : '', - /** - * @inner {String} Specifies the label on y-axis - */ - ylabel : '', - /** - * @cfg {String} Here,specify as false to make background transparent.(default to null) - */ - background_color : 0, - /** - * @cfg {Boolean} True to stripe the axis.(default to true) - */ - striped : true, - /** - * @cfg {String} Specifies the direction apply striped color.(default to 'v')Available value are: - * @Option 'h' horizontal - * @Option 'v' vertical - */ - striped_direction : 'v', - /** - * @cfg {float(0.01 - 0.5)} Specifies the factor make color dark striped,relative to background-color,the bigger the value you set,the larger the color changed.(defaults to '0.01') - */ - striped_factor : 0.01, - /** - * @cfg {Object} Specifies config crosshair.(default enable to false).For details see $.CrossHair Note:this has a extra property named 'enable',indicate whether crosshair available(default to false) - */ - crosshair : { - enable : false - }, - /** - * @cfg {Number}Override the default as -1 to make sure it at the bottom.(default to -1) - */ - z_index : -1, - /** - * @cfg {Object} Specifies style for axis of this coordinate. Available property are: - * @Option enable {Boolean} True to display the axis.(default to true) - * @Option color {String} Specifies the color of each axis.(default to '#666666') - * @Option width {Number/Array} Specifies the width of each axis, If given the a array,there must be have have 4 element, like this:[1,0,0,1](top-right-bottom-left).(default to 1) - */ - axis : { - enable : true, - color : '#666666', - width : 1 - } - }); - - this.scale = []; - this.gridlines = []; - }, - getScale : function(p,L) { - var _ = this._(),r; - for(var i=0;i<_.scale.length;i++){ - if(_.scale[i].get('position')==p){ - return _.scale[i].getScale(_.scale[i]); - } - } - if(!L){ - if(p==_.L){ - p = _.R; - }else if(p==_.R){ - p = _.L; - }else if(p==_.O){ - p = _.B; - }else{ - p = _.O; - } - return _.getScale(p,true); - } - throw new Error("there no valid scale"); - }, - isEventValid : function(e,_) { - return { - valid : e.x > _.x && e.x < (_.x + _.width) && e.y < _.y + _.height && e.y > _.y - }; - }, - doDraw : function(_) { - _.T.box(_.x, _.y, _.width, _.height, 0, _.get('f_color')); - if (_.get('striped')) { - var x, y, f = false, axis = _.get('axis.width'), c = $.dark(_.get('background_color'), _.get('striped_factor'),0); - } - var v = (_.get('striped_direction') == 'v'); - _.gridlines.each(function(g,i) { - if (_.get('striped')) { - if (f) { - if (v) - _.T.box(g.x1, g.y1 + g.width, g.x2 - g.x1, y - g.y1 - g.width, 0, c); - else - _.T.box(x + g.width, g.y2, g.x1 - x, g.y1 - g.y2, 0, c); - } - x = g.x1; - y = g.y1; - f = !f; - } - }).each(function(g) { - if(!g.overlap){ - if(g.solid){ - _.T.line(g.x1, g.y1, g.x2, g.y2, g.width, g.color); - }else{ - _.T.dotted(g.x1, g.y1, g.x2, g.y2, g.width, g.color,g.size,g.fator); - } - } - }); - _.T.box(_.x, _.y, _.width, _.height, _.get('axis'), false, _.get('shadow'),true); - _.scale.each(function(s) { - s.draw() - }); - }, - destroy:function(){ - if(this.crosshair){ - this.crosshair.destroy(); - } - }, - doCrosshair:function(_){ - if (_.get('crosshair.enable')&&!_.crosshair) { - _.push('crosshair.wrap', _.root.shell); - _.push('crosshair.height', _.height); - _.push('crosshair.width', _.width); - _.push('crosshair.top', _.y); - _.push('crosshair.left', _.x); - _.crosshair = new $.CrossHair(_.get('crosshair'), _); - } - }, - doConfig : function() { - $.Coordinate2D.superclass.doConfig.call(this); - - var _ = this._(); - - /** - * this element not atomic because it is a container,so this is a particular case. - */ - _.atomic = false; - - _.width = _.get('_width'); - _.height = _.get('_height'); - _.valid_width = _.get('valid_width_value'); - _.valid_height = _.get('valid_height_value'); - /** - * apply the gradient color to f_color - */ - if (_.get('gradient') && $.isString(_.get('f_color'))) { - _.push('f_color', _.T.avgLinearGradient(_.x, _.y, _.x, _.y + _.height, [_.get('dark_color'), _.get('light_color')])); - } - - if (_.get('axis.enable')) { - var aw = _.get('axis.width'); - if (!$.isArray(aw)) - _.push('axis.width', [aw, aw, aw, aw]); - }else{ - _.push('axis.width', [0, 0, 0, 0]); - } - - _.doCrosshair(_); - var jp, cg = !!(_.get('gridlinesVisible') && _.get('grids')), hg = cg && !!_.get('grids.horizontal'), vg = cg && !!_.get('grids.vertical'), h = _.height, w = _.width, vw = _.valid_width, vh = _.valid_height, k2g = _.get('gridlinesVisible') - && _.get('scale2grid') && !(hg && vg), sw = _.push('x_start', _.x+(w - vw) / 2), sh = _.push('y_start', _.y+(h - vh) / 2), axis = _.get('axis.width'); - - _.push('x_end', _.x + (w + vw) / 2); - _.push('y_end', _.y + (h + vh) / 2); - - if (!$.isArray(_.get('scale'))) { - if ($.isObject(_.get('scale'))) - _.push('scale', [_.get('scale')]); - else - _.push('scale', []); - } - - _.get('scale').each(function(kd, i) { - jp = kd['position']; - jp = jp || _.L; - jp = jp.toLowerCase(); - kd[_.X] = _.x; - kd['coo'] = _; - kd[_.Y] = _.y; - kd['valid_x'] = sw; - kd['valid_y'] = sh; - kd['position'] = jp; - /** - * calculate coordinate,direction,distance - */ - if (jp == _.O) { - kd['which'] = 'h'; - kd['distance'] = w; - kd['valid_distance'] = vw; - } else if (jp == _.R) { - kd['which'] = 'v'; - kd['distance'] = h; - kd['valid_distance'] = vh; - kd[_.X] += w; - kd['valid_x'] += vw; - } else if (jp == _.B) { - kd['which'] = 'h'; - kd['distance'] = w; - kd['valid_distance'] = vw; - kd[_.Y] += h; - kd['valid_y'] += vh; - } else { - kd['which'] = 'v'; - kd['distance'] = h; - kd['valid_distance'] = vh; - } - _.scale.push(new $.Scale(kd, _.root)); - }, _); - - var iol = _.push('ignoreOverlap', _.get('ignoreOverlap') && _.get('axis.enable') || _.get('ignoreEdge')); - - if (iol) { - if (_.get('ignoreEdge')) { - var ignoreOverlap = function(w, x, y) { - return w == 'v' ? (y == _.y) || (y == _.y + h) : (x == _.x) || (x == _.x + w); - } - } else { - var ignoreOverlap = function(wh, x, y) { - return wh == 'v' ? (y == _.y && axis[0] > 0) || (y == (_.y + h) && axis[2] > 0) : (x == _.x && axis[3] > 0) || (x == (_.x + w) && axis[1] > 0); - } - } - } - var g = { - solid : true, - size : 10, - fator : 1, - width : _.get('grid_line_width'), - color : _.get('grid_color') - }, - ghs = $.applyIf(_.get('gridHStyle'),g), - gvs = $.applyIf(_.get('gridVStyle'),g); - - if (k2g) { - var scale, x, y, p; - _.scale.each(function(scale) { - p = scale.get('position'); - /** - * disable,given specfiy grid will ignore scale2grid - */ - if ($.isFalse(scale.get('scale2grid')) || hg && scale.get('which') == 'v' || vg && scale.get('which') == 'h') { - return; - } - x = y = 0; - if (p == _.O) { - y = h; - } else if (p == _.R) { - x = -w; - } else if (p == _.B) { - y = -h; - } else { - x = w; - } - - scale.items.each(function(e) { - if (iol) - _.gridlines.push($.applyIf({ - overlap:ignoreOverlap.call(_, scale.get('which'), e.x, e.y), - x1 : e.x, - y1 : e.y, - x2 : e.x + x, - y2 : e.y + y - },scale.isH?gvs:ghs)); - }); - }); - } - if (vg) { - var gv = _.get('grids.vertical'); - $.Assert.isTrue(gv['value']>0, 'vertical value'); - var d = w / gv['value'], n = gv['value']; - if (gv['way'] == 'given_value') { - n = d; - d = gv['value']; - d = d > w ? w : d; - } - - for ( var i = 0; i <= n; i++) { - if (iol) - _.gridlines.push($.applyIf({ - overlap:ignoreOverlap.call(_, 'h', _.x + i * d, _.y), - x1 : _.x + i * d, - y1 : _.y, - x2 : _.x + i * d, - y2 : _.y + h, - H : false, - width : gvs.width, - color : gvs.color - },gvs)); - } - } - if (hg) { - var gh = _.get('grids.horizontal'); - $.Assert.isTrue(gh['value']>0,'horizontal value'); - var d = h / gh['value'], n = gh['value']; - if (gh['way'] == 'given_value') { - n = d; - d = gh['value']; - d = d > h ? h : d; - } - - for ( var i = 0; i <= n; i++) { - if (iol) - _.gridlines.push($.applyIf({ - overlap:ignoreOverlap.call(_, 'v', _.x, _.y + i * d), - x1 : _.x, - y1 : _.y + i * d, - x2 : _.x + w, - y2 : _.y + i * d, - H : true, - width : ghs.width, - color : ghs.color - },ghs)); - } - } - } -}); -/** - * @end - */ -/** - * @overview the coordinate3d componment - * @component#$.Coordinate3D - * @extend#$.Coordinate2D - */ -$.Coordinate3D = $.extend($.Coordinate2D, { - configure : function() { - /** - * invoked the super class's configurationuration - */ - $.Coordinate3D.superclass.configure.apply(this, arguments); - - /** - * indicate the component's type - */ - this.type = 'coordinate3d'; - this.dimension = $._3D; - - this.set({ - /** - * @cfg {Number} Three-dimensional rotation X in degree(angle).socpe{0-90},Normally, this will accord with the chart.(default to 60) - */ - xAngle : 60, - /** - * @cfg {Number} Three-dimensional rotation Y in degree(angle).socpe{0-90},Normally, this will accord with the chart.(default to 20) - */ - yAngle : 20, - xAngle_ : undefined, - yAngle_ : undefined, - /** - * @cfg {Number} Required,Specifies the z-axis deep of this coordinate,Normally, this will given by chart.(default to 0) - */ - zHeight : 0, - /** - * @cfg {Number} Specifies pedestal height of this coordinate.(default to 22) - */ - pedestal_height : 22, - /** - * @cfg {Number} Specifies board deep of this coordinate.(default to 20) - */ - board_deep : 20, - /** - * @cfg {Boolean} If true display the left board.(default to true) - */ - left_board:true, - /** - * @cfg {Boolean} Override the default as true - */ - gradient : true, - /** - * @cfg {float} Override the default as 0.18. - */ - color_factor : 0.18, - /** - * @cfg {Boolean} Override the default as true. - */ - ignoreEdge : true, - /** - * @cfg {Boolean} Override the default as false. - */ - striped : false, - /** - * @cfg {String} Override the default as '#a4ad96'. - */ - grid_color : '#a4ad96', - /** - * @cfg {String} Override the default as '#d6dbd2'. - */ - background_color : '#d6dbd2', - /** - * @cfg {Number} Override the default as 4. - */ - shadow_offsetx : 4, - /** - * @cfg {Number} Override the default as 2. - */ - shadow_offsety : 2, - /** - * @cfg {Array} Specifies the style of board(wall) of this coordinate. - * the length of array will be 6,if less than 6,it will instead of background_color.and each object option has two property. Available property are: - * @Option color the color of wall - * @Option alpha the opacity of wall - */ - wall_style : [], - /** - * @cfg {Boolean} Override the default as axis.enable = false. - */ - axis : { - enable : false - } - }); - }, - doDraw : function(_) { - var w = _.width, h = _.height, xa = _.get('xAngle_'), ya = _.get('yAngle_'), zh = _.get('zHeight'), offx = _.get('z_offx'), offy = _.get('z_offy'); - /** - * bottom - */ - if(_.get('pedestal_height')) - _.T.cube3D(_.x, _.y + h + _.get('pedestal_height'), xa, ya, false, w, _.get('pedestal_height'), zh * 3 / 2, _.get('axis.enable'), _.get('axis.width'), _.get('axis.color'), _.get('bottom_style')); - /** - * board_style - */ - if(_.get('board_deep')) - _.T.cube3D(_.x +offx, _.y+h - offy, xa, ya, false, w, h, _.get('board_deep'), _.get('axis.enable'), _.get('axis.width'), _.get('axis.color'), _.get('board_style')); - - _.T.cube3D(_.x, _.y + h, xa, ya, false, w, h, zh, _.get('axis.enable'), _.get('axis.width'), _.get('axis.color'), _.get('wall_style')); - - _.gridlines.each(function(g) { - if(g.solid){ - if(_.get('left_board')) - _.T.line(g.x1, g.y1, g.x1 + offx, g.y1 - offy,g.width, g.color); - _.T.line(g.x1 + offx, g.y1 - offy, g.x2 + offx, g.y2 - offy, g.width, g.color); - }else{ - if(_.get('left_board')) - _.T.dotted(g.x1, g.y1, g.x1 + offx, g.y1 - offy,g.width, g.color,g.size,g.fator); - _.T.dotted(g.x1 + offx, g.y1 - offy, g.x2 + offx, g.y2 - offy, g.width, g.color,g.size,g.fator); - } - }); - _.scale.each(function(s) { - s.draw(); - }); - }, - doConfig : function() { - $.Coordinate3D.superclass.doConfig.call(this); - - var _ = this._(), - ws = _.get('wall_style'), - bg = _.get('background_color')||'#d6dbd2', - h = _.height, - w = _.width, - f = _.get('color_factor'), - offx = _.push('z_offx',_.get('xAngle_') * _.get('zHeight')), - offy = _.push('z_offy',_.get('yAngle_') * _.get('zHeight')); - /** - * bottom-lower bottom-left - */ - while(ws.length < 6){ - ws.push({color : bg}); - } - if(!_.get('left_board')){ - ws[2] = false; - _.scale.each(function(s){ - s.doLayout(offx,-offy,s); - }); - } - - /** - * right-front - */ - _.push('bottom_style', [{ - color : _.get('shadow_color'), - shadow : _.get('shadow') - }, false, false, { - color : ws[3].color - },false, { - color : ws[3].color - }]); - - /** - * right-top - */ - _.push('board_style', [false, false, false,{ - color : ws[4].color - },{ - color : ws[5].color - }, false]); - - /** - * lowerBottom-bottom-left-right-top-front - */ - if (_.get('gradient')) { - if ($.isString(ws[0].color)) { - ws[0].color = _.T.avgLinearGradient(_.x, _.y + h, _.x + w, _.y + h, [$.dark(ws[0].color,f/2+0.06),$.dark(ws[0].color,f/2+0.06)]); - } - if ($.isString(ws[1].color)) { - ws[1].color = _.T.avgLinearGradient(_.x + offx, _.y - offy, _.x + offx, _.y + h - offy, [$.dark(ws[1].color,f),$.light(ws[1].color,f)]); - } - if ($.isString(ws[2].color)) { - ws[2].color = _.T.avgLinearGradient(_.x, _.y, _.x, _.y + h, [$.light(ws[2].color,f/3),$.dark(ws[2].color,f)]); - } - _.get('bottom_style')[5].color = _.T.avgLinearGradient(_.x, _.y + h, _.x, _.y + h + _.get('pedestal_height'), [$.light(ws[3].color,f/2+0.06),$.dark(ws[3].color,f/2,0)]); - } - _.push('wall_style', [ws[0],ws[1],ws[2]]); - - } -}); -/* - * @end - */ - - - /** - * @overview the base class of rectangle - * @component#$.Rectangle - * @extend#$.Component - */ - $.Rectangle = $.extend($.Component,{ - configure:function(){ - /** - * invoked the super class's configuration - */ - $.Rectangle.superclass.configure.apply(this,arguments); - - /** - * indicate the component's type - */ - this.type = 'rectangle'; - - this.set({ - /** - * @cfg {Number} Specifies the width of this element in pixels,Normally,this will given by chart.(default to 0) - */ - width:0, - /** - * @cfg {Number} Specifies the height of this element in pixels,Normally,this will given by chart.(default to 0) - */ - height:0, - /** - * @cfg {Number} the distance of column's edge and value in pixels.(default to 4) - */ - value_space:4, - /** - * @cfg {String} Specifies the text of this element,Normally,this will given by chart.(default to '') - */ - value:'', - /** - * @cfg {$.Text} Specifies the config of label,set false to make label disabled. - */ - label : {}, - /** - * @cfg {String} Specifies the name of this element,Normally,this will given by chart.(default to '') - */ - name:'', - /** - * @cfg {String} Specifies the tip alignment of chart(defaults to 'top').Available value are: - * @Option 'left' - * @Option 'right' - * @Option 'top' - * @Option 'bottom' - */ - tipAlign:'top', - /** - * @cfg {String} Specifies the value's text alignment of chart(defaults to 'top') Available value are: - * @Option 'left' - * @Option 'right' - * @Option 'middle' - * @Option 'top' - * @Option 'bottom' - */ - valueAlign:'top', - /** - * @cfg {Number} Override the default as 3 - */ - shadow_blur:3, - /** - * @cfg {Number} Override the default as -1 - */ - shadow_offsety:-1 - }); - - /** - * this element support boxMode - */ - this.atomic = true; - - this.registerEvent( - /** - * @event Fires when parse this label's data.Return value will override existing. - * @paramter $.Rectangle#rect - * @paramter string#text the current label's text - */ - 'parseText'); - - this.label = null; - }, - last:function(_){ - if(_.label) - _.label.draw(); - }, - doDraw:function(_){ - _.drawRectangle(); - }, - doConfig:function(){ - $.Rectangle.superclass.doConfig.call(this); - var _ = this._(),v = _.variable.event,vA=_.get('valueAlign'); - - /** - * mouseover light - */ - $.taylor.light(_,v); - - _.width = _.get(_.W); - _.height = _.get(_.H); - - var x = _.push('centerx',_.x + _.width/2), - y = _.push('centery',_.y + _.height/2), - a = _.C, - b = 'middle', - s=_.get('value_space'); - - - if(vA==_.L){ - a = _.R; - x = _.x - s; - }else if(vA==_.R){ - a = _.L; - x =_.x + _.width + s; - }else if(vA==_.B){ - y = _.y + _.height + s; - b = _.O; - }else if(vA==_.O){ - y = _.y - s; - b = _.B; - } - - if(_.get('label')){ - _.push('label.originx', x); - _.push('label.originy', y); - _.push('label.text',_.push('value',_.fireString(_, 'parseText', [_, _.get('value')], _.get('value')))); - $.applyIf(_.get('label'),{ - textAlign : a, - textBaseline : b, - color:_.get('color') - }); - _.label = new $.Text(_.get('label'), _); - } - - if(_.get('tip.enable')){ - if(_.get('tip.showType')!='follow'){ - _.push('tip.invokeOffsetDynamic',false); - } - _.tip = new $.Tip(_.get('tip'),_); - } - } -}); -/** - *@end - */ - /** - * @overview the rectangle2d componment - * @component#$.Rectangle2D - * @extend#$.Rectangle - */ - $.Rectangle2D = $.extend($.Rectangle,{ - configure:function(){ - /** - * invoked the super class's configuration - */ - $.Rectangle2D.superclass.configure.apply(this,arguments); - - /** - * indicate the component's type - */ - this.type = 'rectangle2d'; - - this.set({ - /** - * @cfg {Number} Override the default as -2 - */ - shadow_offsety:-2 - }); - - }, - drawRectangle:function(){ - var _ = this._(); - _.T.box( - _.get(_.X), - _.get(_.Y), - _.get(_.W), - _.get(_.H), - _.get('border'), - _.get('f_color'), - _.get('shadow')); - }, - isEventValid:function(e,_){ - return {valid:e.x>_.x&&e.x<(_.x+_.width)&&e.y<(_.y+_.height)&&e.y>(_.y)}; - }, - tipInvoke:function(){ - var _ = this._(); - /** - * base on event? - */ - return function(w,h){ - return { - left:_.tipX(w,h), - top:_.tipY(w,h) - } - } - }, - doConfig:function(){ - $.Rectangle2D.superclass.doConfig.call(this); - var _ = this._(),tipAlign = _.get('tipAlign'); - if(tipAlign==_.L||tipAlign==_.R){ - _.tipY = function(w,h){return _.get('centery') - h/2;}; - }else{ - _.tipX = function(w,h){return _.get('centerx') -w/2;}; - } - - if(tipAlign==_.L){ - _.tipX = function(w,h){return _.x - _.get('value_space') -w;}; - }else if(tipAlign==_.R){ - _.tipX = function(w,h){return _.x + _.width + _.get('value_space');}; - }else if(tipAlign==_.B){ - _.tipY = function(w,h){return _.y +_.height+3;}; - }else{ - _.tipY = function(w,h){return _.y - h -3;}; - } - - _.applyGradient(); - - - } -}); -/** - *@end - */ - /** - * @overview the rectangle3d componment - * @component#$.Rectangle3D - * @extend#$.Rectangle - */ - $.Rectangle3D = $.extend($.Rectangle,{ - configure:function(){ - /** - * invoked the super class's configuration - */ - $.Rectangle3D.superclass.configure.apply(this,arguments); - - /** - * indicate the component's type - */ - this.type = 'rectangle3d'; - this.dimension = $._3D; - - this.set({ - /** - * @cfg {Number} Specifies Three-dimensional z-axis deep in pixels.Normally,this will given by chart.(default to undefined) - */ - zHeight:undefined, - /** - * @cfg {Number} Three-dimensional rotation X in degree(angle).socpe{0-90}.Normally,this will given by chart.(default to 60) - */ - xAngle:60, - /** - * @cfg {Number} Three-dimensional rotation Y in degree(angle).socpe{0-90}.Normally,this will given by chart.(default to 20) - */ - yAngle:20, - xAngle_:undefined, - yAngle_:undefined, - /** - * @cfg {Number} Override the default as 2 - */ - shadow_offsetx:2 - }); - - }, - drawRectangle:function(){ - var _ = this._(); - _.T.cube( - _.get(_.X), - _.get(_.Y), - _.get('xAngle_'), - _.get('yAngle_'), - _.get(_.W), - _.get(_.H), - _.get('zHeight'), - _.get('f_color'), - _.get('border.enable'), - _.get('border.width'), - _.get('light_color'), - _.get('shadow') - ); - }, - isEventValid:function(e,_){ - return {valid:e.x>_.x&&e.x<(_.x+_.get(_.W))&&e.y<_.y+_.get(_.H)&&e.y>_.y}; - }, - tipInvoke:function(){ - var _ = this._(); - return function(w,h){ - return { - left:_.topCenterX - w/2, - top:_.topCenterY - h - } - } - }, - doConfig:function(){ - $.Rectangle3D.superclass.doConfig.call(this); - var _ = this._(); - _.pushIf("zHeight",_.get(_.W)); - - _.topCenterX=_.x+(_.get(_.W)+_.get(_.W)*_.get('xAngle_'))/2; - _.topCenterY=_.y-_.get(_.W)*_.get('yAngle_')/2-_.get('value_space'); - - if(_.get('valueAlign')==_.O&&_.label){ - _.label.push('textx',_.topCenterX); - _.label.push('texty',_.topCenterY); - } - - } -}); -/** - *@end - */ -/** - * @overview this component use for config sector,this is a abstract class. - * @component#$.Sector - * @extend#$.Component - */ -$.Sector = $.extend($.Component, { - configure : function() { - /** - * invoked the super class's configuration - */ - $.Sector.superclass.configure.apply(this, arguments); - - /** - * indicate the component's type - */ - this.type = 'sector'; - - this.set({ - /** - * @cfg {String} Specifies the value of this element,Normally,this will given by chart.(default to '') - */ - value : '', - /** - * @cfg {String} Specifies the name of this element,Normally,this will given by chart.(default to '') - */ - name : '', - /** - * @cfg {Boolean} True will not darw.(default to false) - */ - ignored : false, - /** - * @inner {Boolean} True to make sector counterclockwise.(default to false) - */ - counterclockwise : false, - /** - * @cfg {Number} Specifies the start angle of this sector.Normally,this will given by chart.(default to 0) - */ - startAngle : 0, - /** - * @cfg {Number} middleAngle = (endAngle - startAngle)/2.Normally,this will given by chart.(default to 0) - */ - middleAngle : 0, - /** - * @cfg {Number} Specifies the end angle of this sector.Normally,this will given by chart.(default to 0) - */ - endAngle : 0, - /** - * @cfg {Number} Specifies total angle of this sector,totalAngle = (endAngle - startAngle).Normally,this will given by chart.(default to 0) - */ - totalAngle : 0, - /** - * @inner {String} the event's name trigger pie bound(default to 'click'). - */ - bound_event : 'click', - /** - * @cfg {Boolean} True to bound this sector.(default to false) - */ - expand : false, - /** - * @cfg {Number} Specifies the width when show a donut.only applies when it not 0.(default to 0) - */ - donutwidth : 0, - /** - * @inner {Boolean} If true means just one piece could bound at same time.(default to false) - */ - mutex : false, - /** - * @inner {Number} Specifies the offset when bounded.Normally,this will given by chart.(default to undefined) - */ - increment : undefined, - label_length : undefined, - /** - * @cfg {String} Specifies the gradient mode of background.(defaults to 'RadialGradientOutIn') - * @Option 'RadialGradientOutIn' - * @Option 'RadialGradientInOut' - */ - gradient_mode : 'RadialGradientOutIn', - /** - * @cfg {Number} Specifies the threshold value in angle that applies mini_label.(default to 15) - */ - mini_label_threshold_angle : 15, - /** - * @cfg {$.Text} Specifies the config of label.when mini_label is a object,there will as a $.Text.(default to false) note:set false to make minilabel disabled. - */ - mini_label : false, - /** - * @cfg {$.Label} Specifies the config of label.when mini_label is unavailable,there will as a $.Label. note:set false to make label disabled. - */ - label : {}, - rounded:false - }); - - /** - * this element support boxMode - */ - this.atomic = true; - - this.registerEvent('changed', - /** - * @event Fires when parse this label's data.Return value will override existing. Only valid when label is available - * @paramter $.Sector#sector the sector object - * @paramter string#text the current label's text - */ - 'parseText'); - - this.label = null; - this.tip = null; - }, - bound : function() { - if (!this.expanded) - this.toggle(); - }, - rebound : function() { - if (this.expanded) - this.toggle(); - }, - toggle : function() { - this.fireEvent(this, this.get('bound_event'), [this]); - }, - /** - * @method get the sector's dimension,return hold following property - * @property x:the x-coordinate of the center of the sector - * @property y:the y-coordinate of the center of the sector - * @property startAngle:The starting angle, in radians (0 is at the 3 o'clock position of the arc's circle) - * @property endAngle:the ending angle, in radians - * @property middleAngle:the middle angle, in radians - * @return object - */ - getDimension : function() { - var _ = this._(); - return { - x : _.x, - x : _.y, - startAngle : _.get("startAngle"), - middleAngle : _.get("middleAngle"), - endAngle : _.get("endAngle") - } - }, - doDraw : function(_) { - if (!_.get('ignored')) { - if (_.label&&!_.get('mini_label')){ - _.label.draw(); - } - _.drawSector(); - if (_.label&&_.get('mini_label')){ - _.label.draw(); - } - } - }, - doText : function(_, x, y) { - _.push('label.originx', x); - _.push('label.originy', y); - _.push('label.textBaseline', 'middle'); - _.label = new $.Text(_.get('label'), _); - }, - doLabel : function(_, x, y, Q, p, x0, y0,L) { - _.push('label.originx', x); - _.push('label.originy', y); - _.push('label.quadrantd', Q); - _.push('label.line_points', p); - _.push('label.labelx', x0); - _.push('label.labely', y0); - _.push('label.smooth', L); - _.push('label.angle', _.get('middleAngle')%(Math.PI*2)); - _.label = new $.Label(_.get('label'), _); - }, - isLabel : function() { - return this.get('label') && !this.get('mini_label'); - }, - doConfig : function() { - $.Sector.superclass.doConfig.call(this); - - var _ = this._(), v = _.variable.event, f = _.get('label'),event=_.get('bound_event'),g; - - if(_.get('rounded')){ - _.push('startAngle',0); - _.push('endAngle',Math.PI*2); - return; - } - - /** - * mouseover light - */ - $.taylor.light(_,v); - - _.push('totalAngle', _.get('endAngle') - _.get('startAngle')); - - if (f) { - if (_.get('mini_label')) { - if ((_.get('mini_label_threshold_angle') * Math.PI / 180) > _.get('totalAngle')) { - _.push('mini_label', false); - } else { - $.apply(_.get('label'),_.get('mini_label')); - } - } - - _.push('label.text', _.fireString(_, 'parseText', [_,_.get('label.text')], _.get('label.text'))); - - _.pushIf('label.border.color', _.get('border.color')); - /** - * make the label's color in accord with sector - */ - _.push('label.scolor', _.get('background_color')); - } - - _.variable.event.status = _.expanded = _.get('expand'); - - if (_.get('tip.enable')) { - if (_.get('tip.showType') != 'follow') { - _.push('tip.invokeOffsetDynamic', false); - } - _.tip = new $.Tip(_.get('tip'), _); - } - - v.poped = false; - - /** - *need test profile/time - */ - _.on(event, function() { - v.poped = true; - _.expanded = !_.expanded; - _.redraw(event); - v.poped = false; - }); - - _.on('beforedraw', function(a,b) { - if(b==event){ - g = false; - _.x = _.get(_.X); - _.y = _.get(_.Y); - if (_.expanded) { - if (_.get('mutex') && !v.poped) { - _.expanded = false; - g = true; - } else { - _.x += _.get('inc_x'); - _.y -= _.get('inc_y'); - } - } - if (v.status != _.expanded) { - _.fireEvent(_, 'changed', [_, _.expanded]); - g = true; - v.status = _.expanded; - } - if (f&&g) - _.label.doLayout(_.get('inc_x') * (_.expanded ? 1 : -1), -_.get('inc_y') * (_.expanded ? 1 : -1),2,_.label); - } - return true; - }); - - } -}); -/** - * @end - */ - /** - * @overview the sector2d componment - * @component#$.Sector2D - * @extend#$.Sector - */ - $.Sector2D = $.extend($.Sector,{ - configure:function(){ - /** - * invoked the super class's configuration - */ - $.Sector2D.superclass.configure.apply(this,arguments); - - /** - * indicate the component's type - */ - this.type = 'sector2d'; - - this.set({ - /** - * @cfg {Float (0~)} Specifies the sector's radius.Normally,this will given by chart.(default to 0) - */ - radius:0 - }); - - }, - drawSector:function(){ - this.T.sector( - this.x, - this.y, - this.r, - this.get('donutwidth'), - this.get('startAngle'), - this.get('endAngle'), - this.get('f_color'), - this.get('border.enable'), - this.get('border.width'), - this.get('border.color'), - this.get('shadow'), - this.get('counterclockwise')); - }, - isEventValid:function(e,_){ - if(!_.get('ignored')){ - if(_.isLabel()&&_.label.isEventValid(e,_.label).valid){ - return {valid:true}; - } - - var r = $.distanceP2P(_.x,_.y,e.x,e.y),b=_.get('donutwidth'); - if(_.rr)){ - return {valid:false}; - } - if($.angleInRange(_.get('startAngle'),_.get('endAngle'),$.atan2Radian(_.x,_.y,e.x,e.y))){ - return {valid:true}; - } - } - return {valid:false}; - }, - tipInvoke:function(){ - var _ = this,A = _.get('middleAngle'),Q = $.quadrantd(A); - return function(w,h){ - var P = $.p2Point(_.x,_.y,A,_.r*0.8) - return { - left:(Q>=1&&Q<=2)?(P.x - w):P.x, - top:Q>=2?(P.y - h):P.y - } - } - }, - doConfig:function(){ - $.Sector2D.superclass.doConfig.call(this); - var _ = this._(); - _.r = _.get('radius'); - - if(_.get('donutwidth')>_.r){ - _.push('donutwidth',0); - } - - _.applyGradient(_.x-_.r,_.y-_.r,2*_.r*0.9,2*_.r*0.9); - - var A = _.get('middleAngle'),L = _.pushIf('increment',$.lowTo(5,_.r/10)),p2; - _.push('inc_x',L * Math.cos(2 * Math.PI -A)); - _.push('inc_y',L * Math.sin(2 * Math.PI - A)); - L *=2; - if(_.get('label')){ - if(_.get('mini_label')){ - P2 = $.p2Point(_.x,_.y,A,_.get('donutwidth')?_.r - _.get('donutwidth')/2:_.r*5/8); - _.doText(_,P2.x,P2.y); - }else{ - var Q = $.quadrantd(A), - P = $.p2Point(_.x,_.y,A,_.r + L), - C1 = $.p2Point(_.x,_.y,A,_.r + L*0.6); - P2 = $.p2Point(_.x,_.y,A,_.r); - _.doLabel(_,P2.x,P2.y,Q,[{x:P2.x,y:P2.y},{x:C1.x,y:C1.y},{x:P.x,y:P.y}],P.x,P.y,L*0.4); - } - } - } -}); -/** - * @end - */ - /** - * @overview the sector3d componment - * @component#$.Sector3D - * @extend#$.Sector - */ - $.Sector3D = $.extend($.Sector,{ - configure:function(){ - /** - * invoked the super class's configuration - */ - $.Sector3D.superclass.configure.apply(this,arguments); - - /** - * indicate the component's type - */ - this.type = 'sector3d'; - this.dimension = $._3D; - - this.set({ - /** - * @cfg {Number} Specifies major semiaxis of ellipse.Normally,this will given by chart.(default to 0) - */ - semi_major_axis:0, - /** - * @cfg {Number} Specifies minor semiaxis of ellipse.Normally,this will given by chart.(default to 0) - */ - semi_minor_axis:0, - /** - * @cfg {Float (0~)} Specifies the sector's height(thickness).Normally,this will given by chart.(default to 0) - */ - cylinder_height:0 - }); - - this.proxy = true; - }, - isEventValid:function(e,_){ - if(!_.get('ignored')){ - if(_.isLabel()&&_.label.isEventValid(e,_.label).valid){ - return {valid:true}; - } - if(!$.inEllipse(e.x - _.x,e.y-_.y,_.a,_.b)){ - return {valid:false}; - } - if($.angleZInRange(_.sA,_.eA,$.atan2Radian(_.x,_.y,e.x,e.y))){ - return {valid:true}; - } - } - return {valid:false}; - }, - p2p:function(x,y,a,z){ - return { - x:x+this.a*Math.cos(a)*z, - y:y+this.b*Math.sin(a)*z - }; - }, - tipInvoke:function(){ - var _ = this,A = _.get('middleAngle'),Q = $.quadrantd(A); - return function(w,h){ - var P = _.p2p(_.x,_.y,A,0.6); - return { - left:(Q>=2&&Q<=3)?(P.x - w):P.x, - top:Q>=3?(P.y - h):P.y - } - } - }, - doConfig:function(){ - $.Sector3D.superclass.doConfig.call(this); - var _ = this._(),ccw = _.get('counterclockwise'),mA = _.get('middleAngle'); - - _.a = _.get('semi_major_axis'); - _.b = _.get('semi_minor_axis'); - _.h = _.get('cylinder_height'); - - $.Assert.isTrue(_.a*_.b>=0,'major&minor'); - - var pi2 = 2 * Math.PI,toAngle = function(A){ - while(A<0)A+=pi2; - return Math.abs($.atan2Radian(0,0,_.a*Math.cos(A),ccw?(-_.b*Math.sin(A)):(_.b*Math.sin(A)))); - }, - L = _.pushIf('increment',$.lowTo(5,_.a/10)); - _.sA = toAngle.call(_,_.get('startAngle')); - _.eA = toAngle.call(_,_.get('endAngle')); - _.mA = toAngle.call(_,mA); - - _.push('inc_x',L * Math.cos(pi2 -_.mA)); - _.push('inc_y',L * Math.sin(pi2 - _.mA)); - L *=2; - if(_.get('label')){ - if(_.get('mini_label')){ - var P3 = _.p2p(_.x,_.y,mA,0.5); - _.doText(_,P3.x,P3.y); - }else{ - var Q = $.quadrantd(mA), - P = _.p2p(_.x,_.y,mA,L/_.a+1), - C1 = _.p2p(_.x,_.y,mA,L*0.6/_.a+1), - P2 = _.p2p(_.x,_.y,mA,1); - _.doLabel(_,P2.x,P2.y,Q,[{x:P2.x,y:P2.y},{x:C1.x,y:C1.y},{x:P.x,y:P.y}],P.x,P.y,L*0.4); - - } - } - } -}); -/** - *@end - */ -/** - * @overview the base class of pie chart - * @component#$.Pie - * @extend#$.Chart - */ -$.Pie = $.extend($.Chart, { - /** - * initialize the context for the pie - */ - configure : function() { - /** - * invoked the super class's configuration - */ - $.Pie.superclass.configure.call(this); - - this.type = 'pie'; - - this.set({ - /** - * @cfg {Float/String} Specifies the pie's radius.If given a percentage,it will relative to minDistance.(default to '100%') - */ - radius : '100%', - /** - * @cfg {Number} initial angle for first sector.(default to 0) - */ - offset_angle : 0, - /** - * @cfg {Number(0~90)} separate angle of all sector.(default to 0) - */ - separate_angle:0, - /** - * @cfg {String} the event's name trigger pie pop(default to 'click') - */ - bound_event : 'click', - /** - * @inner {Boolean} True to make sector counterclockwise.(default to false) - */ - counterclockwise : false, - /** - * @cfg {Boolean} when label's position in conflict.auto layout.(default to true). - */ - intellectLayout : true, - /** - * @cfg {Number} Specifies the distance in pixels when two label is incompatible with each other.(default 4), - */ - layout_distance : 4, - /** - * @inner {Boolean} if it has animate when a piece popd (default to false) - */ - pop_animate : false, - /** - * @cfg {Boolean} Specifies as true it means just one piece could pop (default to false) - */ - mutex : false, - /** - * @cfg {Number} Specifies the length when sector bounded.(default to 1/8 radius,and minimum is 5), - */ - increment : undefined, - /** - * @cfg {$.Sector} option of sector.Note,Pie2d depend on Sector2d and pie3d depend on Sector3d.For details see $.Sector - */ - sub_option : { - label : {} - } - }); - - this.registerEvent( - /** - * @event Fires when this element' sector bounded - * @paramter $.Sector2d#sector - * @paramter string#name - * @paramter int#index - */ - 'bound', - /** - * @event Fires when this element' sector rebounded - * @paramter $.Sector2d#sector - * @paramter string#name - * @paramter int#index - */ - 'rebound'); - this.sectors = []; - this.components.push(this.sectors); - this.ILLUSIVE_COO = true; - }, - /** - * @method Toggle sector bound or rebound by a specific index. - * @paramter int#i the index of sector - * @return void - */ - toggle : function(i) { - this.sectors[i || 0].toggle(); - }, - /** - * @method bound sector by a specific index. - * @paramter int#i the index of sector - * @return void - */ - bound : function(i) { - this.sectors[i || 0].bound(); - }, - /** - * @method rebound sector by a specific index. - * @paramter int#i the index of sector - * @return void - */ - rebound : function(i) { - this.sectors[i || 0].rebound(); - }, - /** - * @method Returns an array containing all sectors of this pie - * @return Array#the collection of sectors - */ - getSectors : function() { - return this.sectors; - }, - doAnimation : function(t, d,_) { - var si = 0, cs = _.oA; - _.sectors.each(function(s, i) { - si = _.animationArithmetic(t, 0, s.get('totalAngle'), d); - s.push('startAngle', cs); - s.push('endAngle', cs+=si); - if (!_.is3D()) - s.drawSector(); - }); - - if (_.is3D()) { - _.proxy.drawSector(); - } - }, - parse : function(_) { - _.data.each(function(d,i){ - _.doParse(_,d,i); - },_); - /** - * layout the label - */ - _.localizer(_); - }, - doParse : function(_,d, i) { - var t = d.name + ' ' +_.getPercent(d.value); - - _.doActing(_,d,null,i,t); - - _.push('sub_option.id', i); - - if(_.get('sub_option.label')) - _.push('sub_option.label.text', t); - - _.push('sub_option.listeners.changed', function(se, st, i) { - _.fireEvent(_, st ? 'bound' : 'rebound', [_, se.get('name')]); - }); - - _.sectors.push(_.doSector(_,d)); - }, - doSector:function(_){ - return new $[_.sub](_.get('sub_option'), _); - }, - dolayout : function(_,x,y,l,d,Q) { - if(_.is3D()?$.inEllipse(_.get(_.X) - x,_.topY-y,_.a,_.b):$.distanceP2P(_.get(_.X),_.topY,x,y)<_.r){ - y=_.topY-y; - l.push('labelx',_.get(_.X)+(Math.sqrt(_.r*_.r-y*y)*2+d)*(Q==0||Q==3?1:-1)); - l.localizer(l); - } - }, - localizer:function(_){ - if (_.get('intellectLayout')) { - var unlayout = [],layouted = [],d = _.get('layout_distance'),Q,x,y; - - _.sectors.each(function(f, i) { - if(f.isLabel()) - unlayout.push(f.label); - }); - - unlayout.sor(function(p, q) { - return Math.abs(Math.sin(p.get('angle'))) - Math.abs(Math.sin(q.get('angle')))>0; - }); - - unlayout.each(function(la) { - layouted.each(function(l) { - x = l.labelx, y = l.labely; - if ((la.labely <= y && (y - la.labely-1) < la.get(_.H)) || (la.labely > y && (la.labely - y-1) < l.get(_.H))) { - if ((la.labelx <= x && (x - la.labelx) < la.get(_.W)) || (la.labelx > x && (la.labelx - x) < l.get(_.W))) { - Q = la.get('quadrantd'); - la.push('labely', (la.get('labely')+ y - la.labely) + (la.get(_.H) + d)*(Q>1?-1:1)); - la.localizer(la); - _.dolayout(_,la.get('labelx'),la.get('labely')+la.get(_.H)/2*(Q<2?-1:1),la,d,Q); - } - } - }, _); - layouted.push(la); - }); - } - }, - doConfig : function() { - $.Pie.superclass.doConfig.call(this); - var _ = this._(),V,r = _.get('radius'), f = _.get('sub_option.label') ? 0.35 : 0.44,pi2=Math.PI*2; - _.sub = _.is3D()?'Sector3D':'Sector2D'; - _.sectors.zIndex = _.get('z_index'); - _.sectors.length = 0; - - _.oA = $.angle2Radian(_.get('offset_angle'))%pi2; - //If 3D,let it bigger - if (_.is3D()) - f += 0.06; - - var L = _.data.length,sepa = $.angle2Radian($.between(0,90,_.get('separate_angle'))),PI = pi2-sepa,sepa=sepa/L,eA = _.oA+sepa, sA = eA; - if(_.total==0){ - V = 1/L; - } - _.data.each(function(d, i) { - eA += (V||(d.value / _.total)) * PI; - if (i == (L - 1)) { - eA = pi2 + _.oA; - } - d.startAngle = sA; - d.endAngle = eA; - d.totalAngle = eA - sA; - d.middleAngle = (sA + eA) / 2; - sA = eA+sepa; - }, _); - - _.r = r = $.parsePercent(r,Math.floor(_.get('minDistance') * f)); - - _.topY = _.originXY(_,[r + _.get('l_originx'),_.get('r_originx') - r,_.get('centerx')],[_.get('centery')]).y; - - $.apply(_.get('sub_option'),$.clone([_.X, _.Y, 'bound_event','mutex','increment'], _.options)); - - } -}); -/** @end */ - -/** - * @overview the pie2d componment - * @component#@chart#$.Pie2D - * @extend#$.Pie - */ -$.Pie2D = $.extend($.Pie, { - /** - * initialize the context for the pie2d - */ - configure : function() { - /** - * invoked the super class's configuration - */ - $.Pie2D.superclass.configure.call(this); - - this.type = 'pie2d'; - - }, - doConfig : function() { - $.Pie2D.superclass.doConfig.call(this); - var _ = this._(); - /** - * quick config to all rectangle - */ - _.push('sub_option.radius',_.r) - _.parse(_); - - - } -}); -$.register('Pie2D'); -/** - * @end - */ -/** - * @overview the pie3d componment - * @component#@chart#$.Pie3D - * @extend#$.Pie - */ -$.Pie3D = $.extend($.Pie, { - configure : function() { - /** - * invoked the super class's configuration - */ - $.Pie3D.superclass.configure.apply(this, arguments); - - this.type = 'pie3d'; - this.dimension = $._3D; - - this.set({ - /** - * @cfg {Number} Three-dimensional rotation Z in degree(angle).socpe{0-90}.(default to 45) - */ - zRotate : 45, - /** - * @cfg {Number} Specifies the pie's thickness in pixels.(default to 30) - */ - yHeight : 30 - }); - this.positive = true; - }, - doSector : function(_,d) { - _.push('sub_option.cylinder_height', (d.cylinder_height ? d.cylinder_height * _.get('zRotate_') : _.get('cylinder_height'))); - return new $[_.sub](_.get('sub_option'), _); - }, - one:function(_){ - var layer,spaint,L = [],c = _.get('counterclockwise'), abs = function(n,M) { - /** - * If M,close to pi/2,else pi*3/2 - */ - return 1 + Math.sin(M?(n+Math.PI):n); - }, t = 'startAngle', d = 'endAngle',Q,s,e - /** - * If the inside layer visibile - */ - lay =function(C,g,z,f){ - Q = $.quadrantd(g); - if (C &&(Q ==0 || Q ==3) || (!C && (Q ==2 || Q ==1))) { - layer.push({ - g : g, - z : g==z, - x : f.x, - y : f.y, - a : f.a, - b : f.b, - color : $.dark(f.get('background_color')), - h : f.h, - F : f - }); - } - }; - - _.proxy = new $.Custom({ - z_index : _.get('z_index') + 1, - drawFn : function() { - this.drawSector(); - L = []; - _.sectors.each(function(s) { - if (s.get('label')) { - if (s.expanded) - L.push(s.label); - else - s.label.draw(); - } - }); - L.each(function(l) { - l.draw() - }); - } - }); - _.proxy.drawSector = function() { - /** - * paint bottom layer - */ - _.sectors.each(function(s, i) { - _.T.ellipse(s.x, s.y + s.h, s.a, s.b, s.get(t), s.get(d), 0, s.get('border.enable'), s.get('border.width'), s.get('border.color'), s.get('shadow'), c, true); - }, _); - layer = []; - spaint = []; - /** - * sort layer - */ - _.sectors.each(function(f) { - lay(c,f.get(t),f.get(d),f); - lay(!c,f.get(d),f.get(t),f); - spaint = spaint.concat($.visible(f.get(t),f.get(d),f)); - }, _); - - /** - * realtime sort - */ - layer.sor(function(p, q) { - var r = abs(p.g) - abs(q.g); - return r==0?p.z:r > 0; - }); - - /** - * paint inside layer - */ - layer.each(function(f, i) { - _.T.sector3D.layerDraw.call(_.T, f.x, f.y, f.a + 0.5, f.b + 0.5, c, f.h, f.g, f.color); - }, _); - - if(!_.processAnimation){ - /** - * realtime sort - */ - spaint.sor(function(p, q) { - return abs((p.s+p.e)/2,1) - abs((q.s+q.e)/2,1)<0; - }); - } - /** - * paint outside layer - */ - spaint.each(function(s, i) { - _.T.sector3D.sPaint.call(_.T, s.f.x, s.f.y, s.f.a, s.f.b, s.s, s.e, c, s.f.h, s.f.get('f_color')); - }, _); - - /** - * paint top layer - */ - _.sectors.each(function(s, i) { - _.T.ellipse(s.x, s.y, s.a, s.b, s.get(t), s.get(d), s.get('f_color'), s.get('border.enable'), s.get('border.width'), s.get('border.color'), false, false, true); - }, _); - } - _.one = $.emptyFn; - }, - doConfig : function() { - $.Pie3D.superclass.doConfig.call(this); - var _ = this._(), z = $.angle2Radian(_.get('zRotate')); - - _.push('cylinder_height', _.get('yHeight') * _.push('zRotate_',Math.abs(Math.cos(z)))); - - _.a = _.push('sub_option.semi_major_axis', _.r); - _.b = _.push('sub_option.semi_minor_axis', _.r * Math.abs(Math.sin(z))); - - _.topY = _.push('sub_option.originy', _.get(_.Y) - _.get('yHeight') / 2); - - _.parse(_); - - _.one(_); - - _.components.push(_.proxy); - } -}); -$.register('Pie3D'); -/** - * @end - */ - -/** - * @overview this component use for show a donut chart - * @component#@chart#$.Donut2D - * @extend#$.Pie - */ -$.Donut2D = $.extend($.Pie, { - /** - * initialize the context for the pie2d - */ - configure : function() { - /** - * invoked the super class's configuration - */ - $.Donut2D.superclass.configure.call(this); - - this.type = 'donut2d'; - - this.set({ - /** - * @cfg {Number} Specifies the width when show a donut.If the value lt 1,It will be as a percentage,value will be radius*donutwidth.only applies when it not 0.(default to 0.3) - */ - donutwidth : 0.3, - /** - * @cfg {Object/String} Specifies the config of Center Text details see $.Text,If given a string,it will only apply the text.note:If the text is empty,then will not display - */ - center : { - text:'', - line_height:24, - fontweight : 'bold', - /** - * Specifies the font-size in pixels of center text.(default to 24) - */ - fontsize : 24 - } - }); - }, - doConfig : function() { - $.Donut2D.superclass.doConfig.call(this); - - var _ = this._(),d='donutwidth',r = _.r; - /** - * quick config to all rectangle - */ - _.push('sub_option.radius',r) - if(_.get(d)>0){ - if(_.get(d)<1){ - _.push(d,Math.floor(r*_.get(d))); - }else if(_.get(d)>=r){ - _.push(d,0); - } - _.push('sub_option.donutwidth',_.get(d)); - } - if ($.isString(_.get('center'))) { - _.push('center', $.applyIf({ - text : _.get('center') - }, _.default_.center)); - } - - if (_.get('center.text') != '') { - _.push('center.originx',_.get(_.X)); - _.push('center.originy',_.get(_.Y)); - _.push('center.textBaseline','middle'); - _.center = new $.Text(_.get('center'), _); - _.components.push(_.center); - } - - _.parse(_); - } -}); -$.register('Donut2D'); -/** - * @end - */ -/** - * @overview this class is abstract,use for config column - * @component#$.Column - * @extend#$.Chart - */ -$.Column = $.extend($.Chart, { - /** - * initialize the context for the Column - */ - configure : function(config) { - /** - * invoked the super class's configuration - */ - $.Column.superclass.configure.call(this); - - this.type = 'column'; - - this.set({ - /** - * @cfg {$.Coordinate2D} the option for coordinate. - */ - coordinate : {}, - /** - * @cfg {Number} By default,if a width is not specified the chart will attempt to distribution in horizontally.(default to undefined) - */ - column_width : undefined, - /** - * @cfg {Number} the space of each column.this option is readOnly.(default to undefined) - */ - column_space : undefined, - /** - * @cfg {Number} the distance of column's bottom and text(default to 6) - */ - text_space : 6, - /** - * @cfg {String} the align of scale(default to 'left') Available value are: - * @Option 'left' - * @Option 'right' - */ - scaleAlign : 'left', - /** - * @cfg {$.Rectangle} Specifies option of rectangle. - */ - sub_option : {}, - /** - * @cfg {$.Text} Specifies option of label at bottom. - */ - label:{} - }); - - this.registerEvent(); - this.rectangles = []; - this.labels = []; - this.components.push(this.labels); - this.components.push(this.rectangles); - }, - doAnimation : function(t, d,_) { - var h; - _.labels.each(function(l){ - l.draw(); - }); - _.rectangles.each(function(r){ - h = Math.ceil(_.animationArithmetic(t, 0, r.height, d)); - r.push(_.Y, r.y + (r.height - h)); - r.push(_.H, h); - r.drawRectangle(); - }); - }, - /** - * @method Returns the coordinate of this element. - * @return $.Coordinate2D - */ - getCoordinate:function(){ - return this.coo; - }, - doLabel:function(_,id,text,x, y){ - _.labels.push(new $.Text($.apply(_.get('label'),{ - id : id, - text : text, - originx : x, - originy : y - }), _)); - }, - doParse : function(_,d, i, o) { - _.doActing(_,d,o,i); - }, - engine:function(_){ - var cw = _.get('column_width'), - s = _.get('column_space'), - S = _.coo.getScale(_.get('scaleAlign')), - H = _.coo.valid_height, - w2 = cw / 2, - q = cw * (_.get('group_fator') || 0), - gw = _.dataType != 'complex'?(cw + s):(_.data.length * cw + s + (_.is3D() ? (_.data.length - 1) * q : 0)), - y0 = _.coo.get('y_end'), - y = y0 - S.basic*H - (_.is3D()?(_.get('zHeight') * (_.get('bottom_scale') - 1) / 2 * _.get('yAngle_')):0), - x = s+_.coo.get('x_start'); - y0 = y0 + _.get('text_space') + _.coo.get('axis.width')[2]; - /** - * applies paramters to subClass - */ - _.doEngine(_,cw,s,S,H,w2,q,gw,x,y,y0); - }, - doConfig : function() { - $.Column.superclass.doConfig.call(this); - - var _ = this._(),c = 'column_width',z = 'z_index'; - _.sub = _.is3D()?'Rectangle3D':'Rectangle2D'; - _.rectangles.length = 0; - _.labels.length = 0; - _.rectangles.zIndex = _.get(z); - _.labels.zIndex = _.get(z) + 1; - - /** - * use option create a coordinate - */ - _.coo = $.Coordinate.coordinate_.call(_,function(){ - var L = _.data.length, W = _.get('coordinate.valid_width_value'),w_,hw,KL; - if (_.dataType == 'complex') { - KL = _.get('labels').length; - L = KL * L + (_.is3D()?(L-1)*KL*_.get('group_fator'):0); - w_= Math.floor(W / (KL + 1 + L)); - hw = _.pushIf(c,w_); - KL +=1; - }else{ - if(_.dataType == 'stacked'){ - L = _.get('labels').length; - } - w_= Math.floor(W*2 / (L * 3 + 1)); - hw = _.pushIf(c, w_); - KL = L+1; - } - - if(hw * L > W){ - hw = _.push(c, w_); - } - - /** - * the space of two column - */ - _.push('column_space', (W - hw * L) / KL); - - if (_.is3D()) { - _.push('zHeight', _.get(c) * _.get('zScale')); - _.push('sub_option.zHeight', _.get('zHeight')); - _.push('sub_option.xAngle_', _.get('xAngle_')); - _.push('sub_option.yAngle_', _.get('yAngle_')); - } - }); - _.push('sub_option.width', _.get(c)); - } - -}); -/** - * @end - */ -/** - * @overview the column2d componment - * @component#@chart#$.Column2D - * @extend#$.Column - */ -$.Column2D = $.extend($.Column, { - /** - * initialize the context for the Column2D - */ - configure : function() { - /** - * invoked the super class's configuration - */ - $.Column2D.superclass.configure.call(this); - - this.type = 'column2d'; - }, - doEngine:function(_,cw,s,S,H,w2,q,gw,x,y,y0){ - var h; - _.data.each(function(d, i) { - h = (d.value - S.start) * H / S.distance; - _.doParse(_,d, i, { - id : i, - originx :x + i * gw, - originy : y - (h>0? h :0), - height : Math.abs(h) - }); - _.rectangles.push(new $[_.sub](_.get('sub_option'), _)); - _.doLabel(_,i, d.name, x + gw * i + w2, y0); - }, _); - }, - doConfig : function() { - $.Column2D.superclass.doConfig.call(this); - - /** - * start up engine - */ - this.engine(this); - - } -}); -$.register('Column2D'); -/** - *@end - */ -/** - * @overview the column3d componment - * @component#@chart#$.Column3D - * @extend#$.Column2D - */ -$.Column3D = $.extend($.Column2D, { - /** - * initialize the context for the Column3D - */ - configure : function() { - /** - * invoked the super class's configuration - */ - $.Column3D.superclass.configure.call(this); - - this.type = 'column3d'; - this.dimension = $._3D; - - this.set({ - /** - * @cfg {$.Coordinate3D} the option for coordinate. - */ - coordinate : {}, - /** - * @cfg {Number(0~90)} Three-dimensional rotation X in degree(angle).(default to 60) - */ - xAngle : 60, - /** - * @cfg {Number(0~90)} Three-dimensional rotation Y in degree(angle).(default to 20) - */ - yAngle : 20, - /** - * @cfg {Number} Three-dimensional z-axis deep factor.frame of reference is width.(default to 1) - */ - zScale : 1, - /** - * @cfg {Number(1~)} Three-dimensional z-axis deep factor of pedestal.frame of reference is width.(default to 1.4) - */ - bottom_scale : 1.4 - }); - }, - doConfig : function() { - $.Column3D.superclass.doConfig.call(this); - } -}); -$.register('Column3D'); -/** - *@end - */ - -/** - * @overview this component will draw a cluster column2d chart. - * @component#@chart#$.ColumnMulti2D - * @extend#$.Column - */ -$.ColumnMulti2D = $.extend($.Column, { - /** - * initialize the context for the ColumnMulti2D - */ - configure : function() { - /** - * invoked the super class's configuration - */ - $.ColumnMulti2D.superclass.configure.call(this); - - this.type = 'columnmulti2d'; - this.dataType = 'complex'; - - this.set({ - /** - * @cfg {Array} the array of labels close to the axis - */ - labels : [] - }); - - }, - doEngine:function(_,cw,s,S,H,w2,q,gw,x,y,y0){ - var h; - _.columns.each(function(c, i) { - c.item.each(function(d, j) { - h = (d.value - S.start) * H / S.distance; - _.doParse(_, d, j, { - id : i + '_' + j, - originx : x + j * (cw + q) + i * gw, - originy : y - (h > 0 ? h : 0), - height : Math.abs(h) - }); - _.rectangles.push(new $[_.sub](_.get('sub_option'), _)); - }, _); - - _.doLabel(_, i, c.name, x - s * 0.5 + (i + 0.5) * gw, y0); - }, _); - }, - doConfig : function() { - $.ColumnMulti2D.superclass.doConfig.call(this); - - /** - * start up engine - */ - this.engine(this); - } -}); -$.register('ColumnMulti2D'); -/** - * @end - */ - -/** - * @overview this component will draw a cluster column3d chart. - * @component#@chart#$.ColumnMulti3D - * @extend#$.ColumnMulti2D - */ -$.ColumnMulti3D = $.extend($.ColumnMulti2D, { - /** - * initialize the context for the ColumnMulti3D - */ - configure : function() { - /** - * invoked the super class's configuration - */ - $.ColumnMulti3D.superclass.configure.call(this); - - this.type = 'columnmulti3d'; - this.dataType = 'complex'; - this.dimension = $._3D; - - this.set({ - /** - * @cfg {Number(0~90)} Three-dimensional rotation X in degree(angle).(default to 60) - */ - xAngle : 60, - /** - * @cfg {Number(0~90)} Three-dimensional rotation Y in degree(angle).(default to 20) - */ - yAngle : 20, - /** - * @cfg {Number} Three-dimensional z-axis deep factor.frame of reference is width.(default to 1) - */ - zScale : 1, - group_fator : 0.3, - /** - * @cfg {Number(1~)} Three-dimensional z-axis deep factor of pedestal.frame of reference is width.(default to 1.4) - */ - bottom_scale : 1.4 - }); - }, - doConfig : function() { - $.ColumnMulti3D.superclass.doConfig.call(this); - - - } -}); -$.register('ColumnMulti3D'); -/** - * @end - */ - -/** - * @overview the stacked column2d componment - * @component#@chart#$.ColumnStacked2D - * @extend#$.Column - */ -$.ColumnStacked2D = $.extend($.Column, { - /** - * initialize the context for the ColumnStacked2D - */ - configure : function() { - /** - * invoked the super class's configuration - */ - $.ColumnStacked2D.superclass.configure.call(this); - - this.type = 'columnstacked2d'; - /** - * indicate the data structure - */ - this.dataType = 'stacked'; - - this.set({ - /** - * @cfg {Boolean} Specifies as true to display with percent.(default to false) - */ - percent : false, - /** - * @cfg {Array} the array of labels close to the axis - */ - labels : [], - sub_option:{ - label:{color:'#ffffff'}, - valueAlign:'middle' - } - }); - - }, - doEngine:function(_,cw,s,S,H,w2,q,gw,x,y,y0){ - var h0,h,v,p = _.get('percent'); - _.columns.each(function(c, i) { - h0 = 0; - v = p?100/c.total:1; - c.item.each(function(d, j) { - h = (d.value*v - S.start) * H / S.distance; - d.total = c.total; - _.doParse(_, d, j, { - id : i + '_' + j, - originx : x + i * gw, - originy : y - (h > 0 ? h : 0)-h0, - height : Math.abs(h) - }); - h0 += h; - _.rectangles.push(new $[_.sub](_.get('sub_option'), _)); - }, _); - _.doLabel(_, i, c.name, x - s * 0.5 + (i + 0.5) * gw, y0); - }, _); - }, - doConfig : function() { - $.ColumnStacked2D.superclass.doConfig.call(this); - /** - * start up engine - */ - this.engine(this); - } -}); -$.register('ColumnStacked2D'); -/** - *@end - */ -/** - * @overview the stacked column2d componment - * @component#@chart#$.ColumnStacked3D - * @extend#$.ColumnStacked2D - */ -$.ColumnStacked3D = $.extend($.ColumnStacked2D, { - /** - * initialize the context for the ColumnStacked2D - */ - configure : function() { - /** - * invoked the super class's configuration - */ - $.ColumnStacked3D.superclass.configure.call(this); - - this.type = 'columnstacked3d'; - /** - * indicate the data structure - */ - this.dataType = 'stacked'; - - this.dimension = $._3D; - - this.set({ - /** - * @cfg {Boolean} Specifies as true to display with percent.(default to false) - */ - percent : false, - sub_option:{ - label:{color:'#ffffff'}, - valueAlign:'middle' - }, - /** - * @cfg {$.Coordinate3D} the option for coordinate. - */ - coordinate : {}, - /** - * @cfg {Number(0~90)} Three-dimensional rotation X in degree(angle).(default to 60) - */ - xAngle : 60, - /** - * @cfg {Number(0~90)} Three-dimensional rotation Y in degree(angle).(default to 20) - */ - yAngle : 20, - /** - * @cfg {Number} Three-dimensional z-axis deep factor.frame of reference is width.(default to 1) - */ - zScale : 1, - /** - * @cfg {Number(1~)} Three-dimensional z-axis deep factor of pedestal.frame of reference is width.(default to 1.4) - */ - bottom_scale : 1.4 - }); - - - }, - doConfig : function() { - $.ColumnStacked3D.superclass.doConfig.call(this); - } -}); -$.register('ColumnStacked3D'); -/** - *@end - */ -/** - * @overview this class is abstract,use for config bar - * @component#$.Bar - * @extend#$.Chart - */ -$.Bar = $.extend($.Chart, { - /** - * initialize the context for the bar - */ - configure : function() { - /** - * invoked the super class's configuration - */ - $.Bar.superclass.configure.call(this); - - this.type = 'bar'; - this.set({ - /** - * @cfg {$.Coordinate2D} the option for coordinate. - */ - coordinate : { - striped_direction : 'h' - }, - /** - * @cfg {Number} Specifies the width of each bar(default to calculate according to coordinate's height) - */ - bar_height : undefined, - /** - * @cfg {Number} the space of each column.this option is readOnly.(default to undefined) - */ - bar_space : undefined, - /** - * @cfg {Number} Specifies the distance of bar's bottom and text(default to 6) - */ - text_space : 6, - /** - * @cfg {String} Specifies the align of scale(default to 'bottom') Available value are: - * @Option 'bottom' - */ - scaleAlign : 'bottom', - /** - * @cfg {$.Rectangle} Specifies option of rectangle. - */ - sub_option : {}, - /** - * @cfg {$.Text} Specifies option of label at left. - */ - label : {} - }); - }, - /** - * @method Returns the coordinate of this element. - * @return $.Coordinate2D - */ - getCoordinate : function() { - return this.coo; - }, - doLabel : function(_,id, text, x, y) { - _.labels.push(new $.Text($.apply(_.get('label'), { - id : id, - text : text, - textAlign : 'right', - textBaseline : 'middle', - originx : x, - originy : y - }), _)); - }, - doParse : function(_, d, i, o) { - _.doActing(_, d, o,i); - }, - engine:function(_){ - var bh = _.get('bar_height'), - s = _.get('bar_space'), - S = _.coo.getScale(_.get('scaleAlign')), - W = _.coo.valid_width, - h2 = bh / 2, - gw = _.dataType != 'complex'?bh + s:_.data.length * bh + s, - x = _.coo.get('x_start')+ S.basic * W, - x0 = _.coo.get(_.X) - _.get('text_space')-_.coo.get('axis.width')[3], - y0 = _.coo.get('y_start')+ s; - - _.doEngine(_,bh,s,S,W,h2,gw,x,x0,y0); - }, - doAnimation : function(t, d,_) { - _.labels.each(function(l) { - l.draw(); - }); - _.rectangles.each(function(r) { - r.push(_.W, Math.ceil(_.animationArithmetic(t, 0, r.width, d))); - r.drawRectangle(); - }); - }, - doConfig : function() { - $.Bar.superclass.doConfig.call(this); - - var _ = this._(), b = 'bar_height', z = 'z_index'; - - _.rectangles = []; - _.labels = []; - _.rectangles.zIndex = _.get(z); - _.labels.zIndex = _.get(z) + 1; - _.components.push(_.labels); - _.components.push(_.rectangles); - - /** - * use option create a coordinate - */ - _.coo = $.Coordinate.coordinate_.call(_,function(){ - var L = _.data.length, H = _.get('coordinate.valid_height_value'),h_,bh,KL; - - if (_.dataType == 'complex') { - KL = _.get('labels').length; - L = KL * L + (_.is3D()?(L-1)*KL*_.get('group_fator'):0); - h_= Math.floor(H / (KL + 1 + L)); - bh = _.pushIf(b,h_); - KL +=1; - }else{ - if(_.dataType == 'stacked'){ - L = _.get('labels').length; - } - h_= Math.floor(H*2 / (L * 3 + 1)); - bh = _.pushIf(b, h_); - KL = L+1; - } - - if (bh * L > H) { - bh = _.push(b, h_); - } - /** - * the space of two bar - */ - _.push('bar_space', (H - bh * L) / KL); - - }); - - /** - * quick config to all rectangle - */ - _.push('sub_option.height', _.get(b)); - _.push('sub_option.valueAlign', _.R); - _.push('sub_option.tipAlign', _.R); - } - -}); -/** - * @end - */ - -/** - * @overview this component will draw a bar2d chart. - * @component#@chart#$.Bar2D - * @extend#$.Bar - */ -$.Bar2D = $.extend($.Bar, { - /** - * initialize the context for the pie - */ - configure : function() { - /** - * invoked the super class's configuration - */ - $.Bar2D.superclass.configure.call(this); - - this.type = 'bar2d'; - - }, - doEngine:function(_,bh,s,S,W,h2,gw,x,x0,y0){ - var w; - _.data.each(function(d, i) { - w = (d.value - S.start) * W / S.distance; - _.doParse(_, d, i, { - id : i, - originy : y0 + i * gw, - width : Math.abs(w), - originx : x + (w > 0 ? 0 : -Math.abs(w)) - }); - - _.rectangles.push(new $.Rectangle2D(_.get('sub_option'), _)); - _.doLabel(_,i, d.name, x0, y0 + i * gw + h2); - }, _); - }, - doConfig : function() { - $.Bar2D.superclass.doConfig.call(this); - /** - * start up engine - */ - this.engine(this); - } -}); -$.register('Bar2D'); -/** - * @end - */ - -/** - * @overview this component will draw a cluster bar2d chart. - * @component#@chart#$.BarMulti2D - * @extend#$.Bar - */ -$.BarMulti2D = $.extend($.Bar, { - /** - * initialize the context for the BarMulti2D - */ - configure : function() { - /** - * invoked the super class's configuration - */ - $.BarMulti2D.superclass.configure.call(this); - - this.type = 'barmulti2d'; - this.dataType = 'complex'; - - this.set({ - /** - * @cfg {Array} the array of labels close to the axis - */ - labels : [] - }); - }, - doEngine:function(_,bh,s,S,W,h2,gw,x,x0,y0){ - var w; - _.columns.each(function(c, i) { - c.item.each(function(d, j) { - w = (d.value - S.start) * W / S.distance; - _.doParse(_, d, j, { - id : i + '_' + j, - originy : y0 + j * bh + i * gw, - width : Math.abs(w), - originx: x+(w>0?0:-Math.abs(w)) - }); - _.rectangles.push(new $.Rectangle2D(_.get('sub_option'), _)); - }, _); - _.doLabel(_,i, c.name, x0, y0 - s * 0.5 + (i + 0.5) * gw); - }, _); - }, - doConfig : function() { - $.BarMulti2D.superclass.doConfig.call(this); - /** - * start up engine - */ - this.engine(this); - } -}); -$.register('BarMulti2D'); -/** - * @end - */ - -/** - * @overview the stacked bar2d componment - * @component#@chart#$.BarStacked2D - * @extend#$.Bar - */ -$.BarStacked2D = $.extend($.Bar, { - /** - * initialize the context for the BarStacked2D - */ - configure : function() { - /** - * invoked the super class's configuration - */ - $.BarStacked2D.superclass.configure.call(this); - - this.type = 'barstacked2d'; - /** - * indicate the data structure - */ - this.dataType = 'stacked'; - - this.set({ - /** - * @cfg {Boolean} Specifies as true to display with percent.(default to false) - */ - percent : false, - /** - * @cfg {Array} the array of labels close to the axis - */ - labels : [], - sub_option:{ - label:{color:'#ffffff'}, - valueAlign:'middle' - } - }); - - }, - doEngine:function(_,bh,s,S,W,h2,gw,x,x0,y0){ - var w0,w,v,p = _.get('percent'); - _.columns.each(function(c, i) { - w0 = 0; - v = p?100/c.total:1; - c.item.each(function(d, j) { - w = (d.value*v - S.start) * W / S.distance; - d.total = c.total; - _.doParse(_, d, j, { - id : i + '_' + j, - originy : y0 + i * gw, - originx : x + (w > 0 ? 0 : -Math.abs(w))+w0, - width : Math.abs(w) - }); - w0 += w; - _.rectangles.push(new $.Rectangle2D(_.get('sub_option'), _)); - }, _); - _.doLabel(_, i, c.name,x0, y0 - s * 0.5 + (i + 0.5) * gw); - }, _); - }, - doConfig : function() { - $.BarStacked2D.superclass.doConfig.call(this); - - this.push('sub_option.valueAlign', this.C); - /** - * start up engine - */ - this.engine(this); - } -}); -$.register('BarStacked2D'); -/** - *@end - */ -/** - * @overview the line segment componment - * @component#$.LineSegment - * @extend#$.Component - */ -$.LineSegment = $.extend($.Component, { - configure : function() { - /** - * invoked the super class's configuration - */ - $.LineSegment.superclass.configure.apply(this, arguments); - - /** - * indicate the component's type - */ - this.type = 'linesegment'; - - this.set({ - /** - * @cfg {Number} Specifies the default linewidth of the canvas's context in this element.(defaults to 1) - */ - brushsize : 1, - /** - * @cfg {Boolean} If true there show a point when Line-line intersection(default to true) - */ - intersection : true, - /** - * @cfg {$.Text} Specifies the config of label,set false to make label disabled. - */ - label : {}, - /** - * @cfg {String} Specifies the shape of two line segment' point(default to 'round').Only applies when intersection is true Available value are: - * @Option 'round' - */ - sign : 'round', - /** - * @cfg {String} Specifies the bgcolor when applies a Area.If not given,use lighter bgcolor of line.(default to null) - */ - area_color:null, - /** - * @cfg {Boolean} If true the centre of point will be hollow.(default to true) - */ - hollow : true, - /** - * @cfg {Boolean} If true the color of the centre of point will be hollow_color.else will be background_color.(default to true) - */ - hollow_inside:true, - /** - * @cfg {String} Specifies the bgcolor when hollow applies true.(default to '#FEFEFE') - */ - hollow_color : '#FEFEFE', - /** - * @cfg {Boolean} If true Line will smooth.(default to false) - */ - smooth : false, - /** - * @cfg {Number} Specifies smoothness of line will be.(default to 1.5) - * 1 means control points midway between points, 2 means 1/3 from the point,formula is 1/(smoothing + 1) from the point - */ - smoothing : 1.5, - /** - * @cfg {Number} Specifies the size of point.(default size 6).Only applies when intersection is true - */ - point_size : 6, - /** - * @inner {Array} the set of points to compose line segment - */ - points : [], - /** - * @inner {Boolean} If true the event accord width coordinate.(default to false) - */ - keep_with_coordinate : false, - /** - * @cfg {Number} Override the default as 1 - */ - shadow_blur : 1, - /** - * @cfg {Number} Override the default as 1 - */ - shadow_offsety : 1, - /** - * @inner {Number} Specifies the space between two point - */ - point_space : 0, - /** - * @inner {Object} reference of coordinate - */ - coordinate : null, - /** - * @cfg {Number} Specifies the valid range of x-direction.(default to 0) - */ - event_range_x : 0, - /** - * @cfg {Boolean} If true tip show when the mouse must enter the valid distance of axis y.(default to false) - */ - limit_y : false, - /** - * @cfg {Number} Specifies the space between the tip and point.(default to 2) - */ - tip_offset : 2, - /** - * @cfg {Number} Specifies the valid range of y-direction.(default to 0) - */ - event_range_y : 0 - }); - - this.registerEvent( - /** - * @event Fires when parse this label's data.Return value will override existing. - * @paramter $.LineSegment#seg - * @paramter string#text the current label's text - */ - 'parseText'); - - this.tip = null; - }, - drawSegment : function() { - var _ = this._(); - - _.polygons.each(function(P){ - _.T.polygon.apply(_.T,P); - }); - - _.T.shadowOn(_.get('shadow')); - - _.lines.each(function(L){ - _.T.lineArray.apply(_.T,L); - }); - - _.intersections.each(function(I){ - if(_.sign_plugin){ - _.sign_plugin_fn.apply(_,I); - }else{ - _.T.round0.apply(_.T,I); - } - }); - - if (_.get('shadow')) { - _.T.shadowOff(); - } - }, - doDraw : function(_) { - _.drawSegment(); - if (_.get('label')) { - _.labels.each(function(l){ - l.draw(); - }); - } - }, - isEventValid : function() {}, - tipInvoke : function() { - var x = this.x, y = this.y, o = this.get('tip_offset'), s = this.get('point_size') + o, _ = this; - return function(w, h, m) { - var l = m.left, t = m.top; - l = ((_.tipPosition < 3 && (l - w - x - o > 0)) || (_.tipPosition > 2 && (l - w - x - o < 0))) ? l - (w + o) : l + o; - t = _.tipPosition % 2 == 0 ? t + s : t - h - s; - return { - left : l, - top : t - } - } - }, - PP:function(_,p,x1,y1,x2,y2){ - if(_.get('area')){ - _.polygons.push([_.get('area_color')||_.get('light_color2'),0,_.get('brushsize'),0,0,_.get('area_opacity'),_.get('smooth')?p:[{x:x1,y:y1}].concat(p.concat([{x:x2,y:y2}])),_.get('smooth'),_.get('smoothing') || 1.5,[{x:x1,y:y1},{x:x2,y:y2}]]); - } - }, - parse:function(_){ - _.polygons = []; - _.lines = []; - _.intersections = []; - _.labels = []; - - var p = _.get('points'),I = _.get('intersection'),L = !!_.get('label'), T = [],Q = false,s = _.get('smooth'), sm = _.get('smoothing') || 1.5, b = _.get('f_color'), h = _.get('brushsize'),ps=_.get('point_size'); - - if (I) { - var f = _.getPlugin('sign'),g=b,j = _.get('hollow_color'); - _.sign_plugin = $.isFunction(f); - _.sign_plugin_fn = f; - if(_.get('hollow_inside')){ - g = j; - j = b; - } - } - - p.each(function(q){ - q.x_ = q.x; - q.y_ = q.y; - if(!q.ignored&&L){ - _.push('label.originx', q.x); - _.push('label.originy', q.y-ps/2-1); - _.push('label.text',_.fireString(_, 'parseText', [_, q.value],q.value)); - $.applyIf(_.get('label'),{ - textBaseline : 'bottom', - color:_.get('f_color') - }); - _.labels.push(new $.Text(_.get('label'), _)) - } - if(q.ignored&&Q){ - _.lines.push([T, h, b, s, sm]); - _.PP(_,T,T[0].x,_.y,T[T.length-1].x,_.y); - T = []; - Q = false; - }else if(!q.ignored){ - T.push(q); - Q = true; - } - - if(I&&!q.ignored){ - _.intersections.push(_.sign_plugin?[_.T,_.get('sign'),q,ps,q.color||g,q.hollow_color||j]:_.get('hollow')?[q, ps/2-h+1,q.color||g,h+1,q.hollow_color||j]:[q,ps/2,q.color||g]); - } - - }); - - if(T.length){ - _.lines.push([T, h, b, s, sm]); - _.PP(_,T,T[0].x,_.y,T[T.length-1].x,_.y); - } - }, - doConfig : function() { - $.LineSegment.superclass.doConfig.call(this); - $.Assert.isTrue(this.get('point_space')>0,'point_space'); - - var _ = this._(), ps = _.get('point_size') * 3 / 2, sp = _.get('point_space'), ry = _.get('event_range_y'), rx = _ - .get('event_range_x'), heap = _.get('tipInvokeHeap'), p = _.get('points'), N = _.get('name'); - - _.parse(_); - - if (rx <= 0||rx > sp / 2) { - rx = _.push('event_range_x', sp / 2); - } - - if (ry == 0) { - ry = _.push('event_range_y', ps/2); - } - - if (_.get('tip.enable')) { - /** - * _ use for tip coincidence - */ - _.on('mouseover', function(c,e, m) { - heap.push(_); - _.tipPosition = heap.length; - }).on('mouseout', function(c,e, m) { - heap.pop(); - }); - _.push('tip.invokeOffsetDynamic', true); - _.tip = new $.Tip(_.get('tip'), _); - } - - var c = _.get('coordinate'), ly = _.get('limit_y'), k = _.get('keep_with_coordinate'), valid = function(p0, x, y) { - if (!p0.ignored&&Math.abs(x - (p0.x)) < rx && (!ly || (ly && Math.abs(y - (p0.y)) < ry))) { - return true; - } - return false; - }, to = function(i) { - return { - valid : true, - name : N, - value : p[i].value, - text : p[i].text, - top : p[i].y, - left : p[i].x, - i:i, - hit : true - }; - }; - - /** - * override the default method - */ - _.isEventValid = function(e) { - if (c && !c.isEventValid(e,c).valid) { - return { - valid : false - }; - } - - var ii = Math.floor((e.x - _.x) / sp); - - if (ii < 0 || ii >= (p.length - 1)) { - ii = $.between(0, p.length - 1, ii); - if (valid(p[ii], e.x, e.y)) - return to(ii); - else - return { - valid : k - }; - } - - /** - * calculate the pointer's position will between which two point?this function can improve location speed - */ - for ( var i = ii; i <= ii + 1; i++) { - if (valid(p[i], e.x, e.y)) - return to(i); - } - return { - valid : k - }; - } - - } -}); -/** - *@end - */ - -/** - * @overview this class is abstract,use for config line - * @component#$.Line - * @extend#$.Chart - */ -$.Line = $.extend($.Chart, { - /** - * initialize the context for the line - */ - configure : function() { - /** - * invoked the super class's configuration - */ - $.Line.superclass.configure.call(this); - - this.type = 'line'; - - this.set({ - /** - * @cfg {Number} Specifies the default linewidth of the canvas's context in this element.(defaults to 1) - */ - brushsize : 1, - /** - * @cfg {Object} the option for coordinate - */ - coordinate : { - axis : { - width : [0, 0, 2, 2] - } - }, - /** - * @cfg {Object} Specifies config crosshair.(default enable to false).For details see $.CrossHair Note:this has a extra property named 'enable',indicate whether crosshair available(default to false) - */ - crosshair : { - enable : false - }, - /** - * @cfg {Function} when there has more than one linesegment,you can use tipMocker make them as a tip.(default to null) - * @paramter Array tips the array of linesegment's tip - * @paramter int the index of data - * @return String - */ - tipMocker:null, - /** - * @cfg {Number(0.0~1.0)} If null,the position there will follow the points.If given a number,there has a fixed postion,0 is top,and 1 to bottom.(default to null) - */ - tipMockerOffset:null, - /** - * @cfg {String} the align of scale.(default to 'left') Available value are: - * @Option 'left' - * @Option 'right' - */ - scaleAlign : 'left', - /** - * @cfg {String} the align of label.(default to 'bottom') Available value are: - * @Option 'top,'bottom' - */ - labelAlign : 'bottom', - /** - * @cfg {Array} the array of labels close to the axis - */ - labels : [], - /** - * @inner {Number} the distance of column's bottom and text.(default to 6) - */ - label_space : 6, - /** - * @inner {Boolean} if the point are proportional space.(default to true) - */ - proportional_spacing : true, - /** - * @cfg {$.LineSegment} the option for linesegment. - */ - sub_option : {}, - /** - * {Object} the option for legend. - */ - legend : { - sign : 'bar' - }, - /** - * @cfg {$.Text} Specifies option of label at bottom. - */ - label:{} - }); - - this.registerEvent( - /** - * @event Fires when parse this element'data.Return value will override existing. - * @paramter object#data the data of one linesegment - * @paramter object#v the point's value - * @paramter int#x coordinate-x of point - * @paramter int#y coordinate-y of point - * @paramter int#index the index of point - * @return Object object Detail: - * @property text the text of point - * @property x coordinate-x of point - * @property y coordinate-y of point - */ - 'parsePoint'); - - this.lines = []; - this.components.push(this.lines); - }, - /** - * @method Returns the coordinate of this element. - * @return $.Coordinate2D - */ - getCoordinate : function() { - return this.coo; - }, - doConfig : function() { - $.Line.superclass.doConfig.call(this); - var _ = this._(), s = _.data.length == 1; - - _.lines.length = 0; - _.lines.zIndex = _.get('z_index'); - - var k = _.pushIf('sub_option.keep_with_coordinate',s); - if (_.get('crosshair.enable')) { - _.pushIf('crosshair.hcross', s); - _.push('crosshair.invokeOffset', function(e, m) { - /** - * TODO how fire muti line?now fire by first line - */ - var r = _.lines[0].isEventValid(e); - return r.valid ? r : k; - }); - } - - if(!_.Combination){ - _.push('coordinate.crosshair', _.get('crosshair')); - _.pushIf('coordinate.scale',[{ - position : _.get('scaleAlign'), - max_scale : _.get('maxValue') - }, { - position : _.get('labelAlign'), - start_scale : 1, - scale : 1, - end_scale : _.get('maxItemSize'), - labels : _.get('labels'), - label:_.get('label') - }]); - } - - /** - * use option create a coordinate - */ - _.coo = $.Coordinate.coordinate_.call(_); - - if(_.Combination){ - _.coo.push('crosshair', _.get('crosshair')); - _.coo.doCrosshair(_.coo); - } - - var vw = _.coo.valid_width,nw=vw,size=_.get('maxItemSize') - 1,M=vw / (size),ps=_.get('point_space'); - - if (_.get('proportional_spacing')){ - if(ps&&ps1?1:f)):null; - _.push('tip.invokeOffset',function(w,h,m){ - if(f!=null){ - m.top = y+(H-h)*f; - }else{ - m.top = m.maxTop-(m.maxTop-m.minTop)/3-h; - if(h>H||y>m.top){ - m.top = y; - } - } - return { - left:(m.left - w - x > 5)?m.left-w-5:m.left+5, - top:m.top - } - }); - /** - * proxy the event parseText - */ - var p = _.get('tip.listeners.parseText'); - if(p) - delete _.get('tip.listeners').parseText; - _.mocker = new $.Custom({ - eventValid:function(e){ - r = _.lines[0].isEventValid(e); - r.hit = r0 != r.i; - if(r.valid){ - r0 = r.i; - U = []; - _.lines.each(function(l,i){ - r1 = l.isEventValid(e); - if(i==0){ - r.minTop = r.maxTop = r1.top; - }else{ - r.minTop = Math.min(r.minTop,r1.top); - r.maxTop = Math.max(r.maxTop,r1.top); - } - U.push(p?p(null,r1.name,r1.value,r1.text,r1.i):(r1.name+' '+r1.value)); - }); - r.text = _.get('tipMocker').call(_,U,r.i)||'tipMocker not return'; - } - return r.valid ? r : false; - } - }); - new $.Tip(_.get('tip'),_.mocker); - _.register(_.mocker); - } - } - _.pushIf('sub_option.area_opacity',_.get('area_opacity')); - } - -}); -/** - * @end - */ - -/** - * @overview this component will draw a line2d chart. - * @component#@chart#$.LineBasic2D - * @extend#$.Line - */ -$.LineBasic2D = $.extend($.Line, { - /** - * initialize the context for the LineBasic2D - */ - configure : function() { - /** - * invoked the super class's configuration - */ - $.LineBasic2D.superclass.configure.call(this); - - this.type = 'basicline2d'; - - this.tipInvokeHeap = []; - }, - doAnimation : function(t, d,_) { - _.lines.each(function(l){ - l.get('points').each(function(p){ - p.y = l.y - Math.ceil(_.animationArithmetic(t, 0, l.y - p.y_, d)); - }); - l.drawSegment(); - }); - }, - doConfig : function() { - $.LineBasic2D.superclass.doConfig.call(this); - var _ = this._(); - - /** - * get the max/min scale of this coordinate for calculated the height - */ - var S, H = _.coo.valid_height, sp = _.get('point_space'), points, x, y, - ox = _.get('sub_option.originx'), oy, p; - - _.push('sub_option.tip.showType', 'follow'); - _.push('sub_option.coordinate', _.coo); - _.push('sub_option.tipInvokeHeap', _.tipInvokeHeap); - _.push('sub_option.point_space', sp); - _.data.each(function(d, i) { - S = _.coo.getScale(d.scaleAlign||_.get('scaleAlign')); - oy = _.get('sub_option.originy')- S.basic*H; - points = []; - d.value.each(function(v, j) { - x = sp * j; - y = (v - S.start) * H / S.distance; - p = { - x : ox + x, - y : oy - y, - value : v, - text : d.name+' '+v - }; - $.merge(p, _.fireEvent(_, 'parsePoint', [d, v, x, y, j,S])); - points.push(p); - }, _); - /** - * merge the option - */ - $.merge(_.get('sub_option'),d); - - _.push('sub_option.points', points); - _.push('sub_option.brushsize', d.linewidth || d.line_width); - _.lines.push(new $.LineSegment(_.get('sub_option'), _)); - }, this); - } -}); -$.register('LineBasic2D'); -/** - * @end - */ - -/** - * @overview the area2d componment - * @component#@chart#$.Area2D - * @extend#$.LineBasic2D - */ -$.Area2D = $.extend($.LineBasic2D, { - /** - * initialize the context for the area2d - */ - configure : function() { - /** - * invoked the super class's configuration - */ - $.Area2D.superclass.configure.call(this); - - this.type = 'area2d'; - - this.set({ - /** - * @cfg {Float} Specifies the opacity of this area.(default to 0.3) - */ - area_opacity : 0.3 - }); - - }, - doConfig : function() { - /** - * must apply the area's config before - */ - this.push('sub_option.area', true); - $.Area2D.superclass.doConfig.call(this); - } -}); -$.register('Area2D'); -/** - * @end - */ - -})(iChart); +/** + * ichartjs Library v1.2 http://www.ichartjs.com/ + * + * @author wanghe + * @Copyright 2013 wanghetommy@gmail.com Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 + */ +; +(function(window) { + var ua = navigator.userAgent.toLowerCase(), mc = function(e) { + return e.test(ua) + }, ts = Object.prototype.toString, isOpera = mc(/opera/), isChrome = mc(/\bchrome\b/), isWebKit = mc(/webkit/), isSafari = !isChrome && mc(/safari/), isIE = !isOpera && mc(/msie/), supportCanvas = !!document.createElement('canvas').getContext, isGecko = !isWebKit + && mc(/gecko/), isMobile = mc(/ipod|ipad|iphone|android/gi), arithmetic = { + Linear : function(t, b, c, d) { + return c * t / d + b; + }, + Cubic : { + easeIn : function(t, b, c, d) { + return c * (t /= d) * t * t + b; + }, + easeOut : function(t, b, c, d) { + return c * ((t = t / d - 1) * t * t + 1) + b; + }, + easeInOut : function(t, b, c, d) { + if ((t /= d / 2) < 1) + return c / 2 * t * t * t + b; + return c / 2 * ((t -= 2) * t * t + 2) + b; + } + } + }; + var iChart_ = (function(window) { + /** + * spirit from jquery + */ + var isReady = false, readyBound = false, readyList = [], DOMContentLoaded = (function() { + if (document.addEventListener) { + return function() { + document.removeEventListener("DOMContentLoaded", DOMContentLoaded, false); + ready(); + }; + } else if (document.attachEvent) { + return function() { + if (document.readyState === "complete") { + document.detachEvent("onreadystatechange", DOMContentLoaded); + ready(); + } + }; + } + })(), doScrollCheck = function() { + if (isReady) { + return; + } + try { + document.documentElement.doScroll("left"); + } catch (e) { + setTimeout(doScrollCheck, 1); + return; + } + ready(); + }, ready = function() { + if (!isReady) { + isReady = true; + for ( var i = 0; i < readyList.length; i++) { + readyList[i].call(document); + } + readyList = []; + } + }, bindReady = function() { + if (readyBound) + return; + readyBound = true; + if (document.readyState === "complete") { + return setTimeout(ready, 1); + } + if (document.addEventListener) { + document.addEventListener("DOMContentLoaded", DOMContentLoaded, false); + window.addEventListener("load", ready, false); + } else if (document.attachEvent) { + document.attachEvent("onreadystatechange", DOMContentLoaded); + window.attachEvent("onload", ready); + var toplevel = false; + + try { + toplevel = window.frameElement == null; + } catch (e) { + } + + if (document.documentElement.doScroll && toplevel) { + doScrollCheck(); + } + } + }, bind = function(fn) { + bindReady(); + if (isReady) + fn.call(document, _); + else + readyList.push(function() { + return fn.call(this); + }); + }, _ = function(selector) { + if (!selector || selector.nodeType) { + return selector; + } + if (typeof selector === "string") { + if (selector.indexOf("#") != -1) { + selector = selector.substring(1); + } + return document.getElementById(selector); + } + if (typeof selector === "function") { + bind(selector); + } + }; + + _.apply = function(d, e) { + if (d && e && typeof e == "object") { + for ( var a in e) { + if (typeof e[a] != 'undefined') + d[a] = e[a] + } + } + if (!e && d) { + var clone = {}; + for ( var a in d) { + clone[a] = d[a] + } + return clone; + } + return d + }; + + _.apply(_, { + version : "1.0", + email : 'taylor@ichartjs.com', + isEmpty : function(C, e) { + return C === null || C === undefined || ((_.isArray(C) && !C.length)) || (!e ? C === "" : false) + }, + isArray : function(e) { + return ts.apply(e) === "[object Array]" + }, + isDate : function(e) { + return ts.apply(e) === "[object Date]" + }, + isObject : function(e) { + return !!e && ts.apply(e) === "[object Object]" + }, + isFunction : function(e) { + return ts.apply(e) === "[object Function]" + }, + isNumber : function(e) { + return typeof e === "number" && isFinite(e) + }, + isString : function(e) { + return typeof e === "string" + }, + isBoolean : function(e) { + return typeof e === "boolean" + }, + isFalse : function(e) { + return typeof e === "boolean" && !e; + }, + isElement : function(e) { + return e ? !!e.tagName : false + }, + isDefined : function(e) { + return typeof e !== "undefined" + } + }); + + /** + * only get the attr that target not exist + */ + _.applyIf = function(d, e) { + if (d && _.isObject(e)) { + for ( var a in e) { + if (_.isDefined(e[a]) && !_.isDefined(d[a])) + d[a] = e[a] + } + } + if (!e && d) { + return _.apply(d); + } + return d + }; + /** + * there will apply a deep clone + */ + _.merge = function(d, e, f) { + if (d && _.isObject(e)) { + for ( var a in e) { + if (_.isDefined(e[a])) { + if (_.isObject(e[a])) { + if (_.isObject(d[a])) { + _.merge(d[a], e[a]); + } else { + d[a] = _.clone(e[a], true); + } + } else { + d[a] = e[a]; + } + } + } + if (_.isObject(f)) { + return _.merge(d, f); + } + } + return d; + }; + /** + * clone attribute that given + */ + _.clone = function(a, e, deep) { + var d = {}; + if (_.isArray(a)&& _.isObject(e)) { + for ( var i = 0; i < a.length; i++) { + if (deep && _.isObject(e[a[i]])) + d[a[i]] = _.clone(e[a[i]],deep); + else + d[a[i]] = e[a[i]]; + } + } else if (_.isObject(a)) { + for ( var b in a) { + // avoid recursion reference + if (e && _.isObject(a[b])&& !(a[b].ICHARTJS_OBJECT)) + d[b] = _.clone(a[b], e); + else + d[b] = a[b]; + } + } + return d; + }; + + _.override = function(e, D) { + if (e&&D) { + var C = e.prototype; + _.apply(C, D); + if (_.isIE && D.hasOwnProperty("toString")) { + C.toString = D.toString + } + } + }; + + /** + * spirit from ext2.0 + */ + _.extend = function() { + var C = function(E) { + for ( var D in E) { + this[D] = E[D]; + } + }; + var e = Object.prototype.constructor; + return function(G, O) { + var J = function() { + G.apply(this, arguments); + } + var E = function() { + }, H, D = G.prototype; + E.prototype = D; + H = J.prototype = new E(); + H.constructor = J; + J.superclass = D; + if (D.constructor == e) { + D.constructor = G; + } + J.override = function(F) { + _.override(J, F); + }; + H.superclass = H.supr = (function() { + return D; + }); + H.override = C; + _.override(J, O); + J.extend = function(F) { + return _.extend(J, F) + }; + J.plugin_ = {}; + + J.plugin = function(M,F) { + if (_.isString(M) && _.isFunction(F)) + J.plugin_[M] = F; + }; + return J; + } + }(); + + var sin = Math.sin, cos = Math.cos, atan = Math.atan, tan = Math.tan, acos = Math.acos, sqrt = Math.sqrt, abs = Math.abs, pi = Math.PI, pi2 = 2 * pi, ceil = Math.ceil, round = Math.round, floor = Math.floor, max = Math.max, min = Math.min, pF = parseFloat, + Registry={},Repository={}, + factor = function(v, w) { + if (v == 0) + return v; + var M = abs(v),f = 0.1; + if(M>1){ + while(M>1){ + M = M/10; + f = f*10; + } + return floor(v/f+w)*f; + }else{ + f = 1; + while(M<1){ + M = M*10; + f = f *10; + } + return round(v*f+w)/f; + } + }, colors = { + white : 'rgb(255,255,255)', + green : 'rgb(0,128,0)', + gray : 'rgb(80,80,80)', + red : 'rgb(255,0,0)', + blue : 'rgb(0,0,255)', + yellow : 'rgb(255,255,0)', + black : 'rgb(0,0,0)' + }, hex2Rgb = function(hex) { + hex = hex.replace(/#/g, "").replace(/^(\w)(\w)(\w)$/, "$1$1$2$2$3$3"); + return (hex.length==7?'rgba(':'rgb(') + parseInt(hex.substring(0, 2), 16) + ',' + parseInt(hex.substring(2, 4), 16) + ',' + parseInt(hex.substring(4, 6), 16) + (hex.length==7?',0.'+hex.substring(6,7)+')':')'); + }, i2hex = function(N) { + return ('0' + parseInt(N).toString(16)).slice(-2); + }, rgb2Hex = function(rgb) { + var m = rgb.match(/rgb\((\d+),(\d+),(\d+)\)/); + return m ? ('#' + i2hex(m[1]) + i2hex(m[2]) + i2hex(m[3])).toUpperCase() : null; + }, c2a = function(rgb) { + var result = /rgb\((\w*),(\w*),(\w*)\)/.exec(rgb); + if (result) { + return new Array(result[1], result[2], result[3]); + } + result = /rgba\((\w*),(\w*),(\w*),(.*)\)/.exec(rgb); + if (result) { + return new Array(result[1], result[2], result[3], result[4]); + } + throw new Error("invalid colors value '" + rgb + "'"); + }, toHsv = function(r, g, b) { + if (_.isArray(r)) { + g = r[1]; + b = r[2]; + r = r[0]; + } + r = r / 255; + g = g / 255; + b = b / 255; + var m = max(max(r, g), b), mi = min(min(r, g), b), dv = m - mi; + if (dv == 0) { + return new Array(0, 0, m); + } + var h; + if (r == m) { + h = (g - b) / dv; + } else if (g == m) { + h = (b - r) / dv + 2; + } else if (b == m) { + h = (r - g) / dv + 4; + } + h *= 60; + if (h < 0) + h += 360; + return new Array(h, dv / m, m); + }, toRgb = function(color) { + if (!color) + return color; + color = color.replace(/\s/g, '').toLowerCase(); + // Look for rgb(255,255,255) + if (/^rgb\([0-9]{1,3},[0-9]{1,3},[0-9]{1,3}\)$/.exec(color)) { + return color; + } + + // Look for rgba(255,255,255,0.3) + if (/^rgba\([0-9]{1,3},[0-9]{1,3},[0-9]{1,3},(0(\.[0-9])?|1(\.0)?)\)$/.exec(color)) { + return color; + } + + // Look for #a0b1c2 or #fff + if (/^#(([a-fA-F0-9]{6,7})|([a-fA-F0-9]{3}))$/.exec(color)) + return hex2Rgb(color); + // Look a string for green + if (colors[color]) + return colors[color]; + throw new Error("invalid colors value '" + color + "'"); + }, hsv2Rgb = function(h, s, v, a) { + if (_.isArray(h)) { + a = s; + s = h[1]; + v = h[2]; + h = h[0]; + } + var r, g, b, + hi = floor(h / 60) % 6, + f = h / 60 - hi, + p = v * (1 - s), + q = v * (1 - s * f), + t = v * (1 - s * (1 - f)); + switch (hi) { + case 0 : + r = v; + g = t; + b = p; + break; + case 1 : + r = q; + g = v; + b = p; + break; + case 2 : + r = p; + g = v; + b = t; + break; + case 3 : + r = p; + g = q; + b = v; + break; + case 4 : + r = t; + g = p; + b = v; + break; + case 5 : + r = v; + g = p; + b = q; + break; + } + return 'rgb' + (a ? 'a' : '') + '(' + round(r * 255) + ',' + round(g * 255) + ',' + round(b * 255) + (a ? ',' + a + ')' : ')'); + }, + /** + * the increment of s(v) of hsv model + */ + s_inc = 0.05, v_inc = 0.14, + inc = function(v, iv) { + iv = iv || v_inc; + if (v > 0.5) { + return iv - (1 - v) / 10; + } else if (v > 0.1) { + return iv - 0.16 + v / 5; + } else { + return v > iv ? iv : v / 2; + } + }, + /** + * @method anole,make color darker or lighter + * @param {Boolean} d true:dark,false:light + * @param {Object} rgb:color + * @param {Number} iv (0-1) + * @param {Number} is (0-1) + */ + anole = function(d, rgb, iv, is) { + if (!rgb) + return rgb; + rgb = c2a(toRgb(rgb)); + var hsv = toHsv(rgb); + is = is!=0?(is || s_inc):is; + hsv[1] -= is; + if (d) { + hsv[2] -= inc(hsv[2], iv); + hsv[1] = _.upTo(hsv[1], 1); + hsv[2] = _.lowTo(hsv[2], 0); + } else { + hsv[2] += inc((1 - hsv[2]), iv); + hsv[1] = _.lowTo(hsv[1], 0); + hsv[2] = _.upTo(hsv[2], 1); + } + return hsv2Rgb(hsv, rgb[3]); + }, + topi = function(v){ + if(v==0)return 0; + if(v%pi2==0)return pi2; + return v%pi2; + }; + + _.apply(_, { + getFont : function(w, s, f, u) { + return w + " " + s + (u||"px")+" " + f; + }, + /** + * obtain the Dom Document*/ + getDoc : function() { + var doc = window.contentWindow ? window.contentWindow.document : window.contentDocument ? window.contentDocument : window.document; + return doc; + }, + /** + * define the interface,the subclass must implement it + */ + DefineAbstract : function(M, H) { + if (!H[M]) + throw new Error("Cannot instantiate the type '" + H.type + "'.you must implements it with method '" + M + "'."); + }, + getAA : function(tf) { + if (tf == 'linear') + return arithmetic.Linear; + if (tf == 'easeInOut' || tf == 'easeIn' || tf == 'easeOut') + return arithmetic.Cubic[tf]; + return arithmetic.Linear; + }, + /** + * simple noConflict implements + */ + noConflict : function() { + return iChart_; + }, + plugin : function(t, m, f) { + if (_.isFunction(t)) + t.plugin(m, f); + }, + parsePadding : function(s, d) { + s = s || 0; + if (_.isNumber(s)) + return new Array(s, s, s, s); + if (_.isArray(s)) + return s; + d = d || 0; + s = s.replace(/^\s+|\s+$/g, "").replace(/\s{2,}/g, /\s/).replace(/\s/g, ',').split(","); + if (s.length == 1) { + s[0] = s[1] = s[2] = s[3] = pF(s[0]) || d; + } else if (s.length == 2) { + s[0] = s[2] = pF(s[0]) || d; + s[1] = s[3] = pF(s[1]) || d; + } else if (s.length == 3) { + s[0] = pF(s[0]) || d; + s[1] = s[3] = pF(s[1]) || d; + s[2] = pF(s[2]) || d; + } else { + s[0] = pF(s[0]) || d; + s[1] = pF(s[1]) || d; + s[2] = pF(s[2]) || d; + s[3] = pF(s[3]) || d; + } + return s; + }, + /** + * the distance of two point + */ + distanceP2P : function(x1, y1, x2, y2) { + return sqrt((x2 - x1) * (x2 - x1) + (y2 - y1) * (y2 - y1)); + }, + atan2Radian : function(ox, oy, x, y) { + if (ox == x) { + if (y > oy) + return pi / 2; + return pi * 3 / 2; + } + if (oy == y) { + if (x > ox) + return 0; + return pi; + } + + var q = _.quadrant(ox, oy, x, y), + r = atan(abs((oy - y) / (ox - x))); + + return q?(q == 3?pi2:pi)+(q == 2?r:-r):r; + }, + angle2Radian : function(a) { + return a * pi / 180; + }, + radian2Angle : function(r) { + return r * 180 / pi; + }, + /** + * indicate angle in which quadrant,and it different from concept of Math.this will return 0 if it in first quadrant(other eg.0,1,2,3) + */ + quadrant : function(ox, oy, x, y) { + if (ox < x) { + if (oy < y) { + return 0; + } else { + return 3; + } + } else { + if (oy < y) { + return 1; + } else { + return 2; + } + } + }, + toPI2 : function(a) { + while(a<0) + a+=pi2; + return a; + }, + visible:function(s, e, f){ + if(s>=e)return []; + var q1 = _.quadrantd(s),q2 = _.quadrantd(e); + if((q1==2||q1==3)&&(q2==2||q2==3)&&((e-s) pi){s = pi2;} + else if(e>pi2){ + return [{s:s,e:pi,f:f},{s:pi2,e:e,f:f}] + }else if(e>pi){ + e = pi; + } + return {s:s,e:e,f:f}; + }, + quadrantd : function(a) { + if(a==0)return 0; + if(a % pi2==0)return 3; + while(a<0) + a+=pi2; + return ceil(2 * (a % pi2) / pi)-1; + }, + upTo : function(u, v) { + return v > u ? u : v; + }, + lowTo : function(l, v) { + return v < l ? l : v; + }, + between : function(l, u, v) { + return l>u?_.between(u, l, v):(v > u ? u : v < l ? l : v); + }, + inRange : function(l, u, v) { + return u > v && l < v; + }, + angleInRange : function(l, u, v) { + v = (v -l); + v = v<0?v+pi2:v; + v = v %pi2; + return (u -l) > v; + }, + angleZInRange : function(l, u, v) { + return u < l?(v > l || v < u):(u > v && l < v); + }, + inRangeClosed : function(l, u, v) { + return u >= v && l <= v; + }, + inEllipse : function(x, y, a, b) { + return (x * x / a / a + y * y / b / b) <= 1; + }, + p2Point : function(x, y, a, C) { + return { + x : x + cos(a) * C, + y : y + sin(a) * C + } + }, + toRgb:toRgb, + toRgba:function(c,o){ + var rgb = c2a(toRgb(c)); + return 'rgba(' + rgb[0]+',' + rgb[1]+',' + rgb[2]+',' + o +')'; + }, + /** + * vector point + */ + vectorP2P : function(x, y, radian) { + if (!radian) { + y = _.angle2Radian(y); + x = _.angle2Radian(x); + } + y = sin(y); + return { + x : y * sin(x), + y : y * cos(x) + } + }, + uid : function(k) { + return (k || 'ichartjs') + '_' + ceil(Math.random()*10000)+new Date().getTime().toString().substring(4); + }, + register:function(c){ + if (_.isString(c)) { + Repository[c.toLowerCase()] = c; + }else{ + var id = c.get('id'); + if(!id||id==''){ + id = _.uid(c.type); + while(Registry[id]){ + id = _.uid(c.type); + } + c.push('id',id); + } + if(Registry[id]){ + throw new Error("exist reduplicate id :"+id); + } + c.id = id; + Registry[id] = c; + } + }, + create:function(C){ + if(!C.type||!Repository[C.type]){ + throw new Error("TypeNotFoundException["+C.type+"]"); + } + return new _[Repository[C.type]](C); + }, + get:function(id){ + return Registry[id]; + }, + isPercent:function(v){ + return _.isString(v)&&v.match(/(.*)%/); + }, + parsePercent:function(v,f){ + if(_.isString(v)){ + v = v.match(/(.*)%/); + if(v){ + v = f?floor(pF(v[1])*f/100):v[1]/100; + } + } + return (!v ||v <= 0 || v > f)?f:v; + }, + parseFloat : function(v, d) { + if (!_.isNumber(v)) { + v = pF(v); + if (!_.isNumber(v)) + throw new Error("[" + d +"]=" +v + "is not a valid number."); + } + return v; + }, + ceil : function(max) { + return factor(max,1); + }, + floor : function(max, f) { + return factor(max,-1); + }, + _2D : '2d', + _3D : '3d', + light : function(rgb, iv, is) { + return anole(false, rgb, iv, is); + }, + dark : function(rgb, iv, is) { + return anole(true, rgb, iv, is); + }, + fixPixel : function(v) { + return _.isNumber(v) ? v : pF(v.replace('px', "")) || 0; + }, + toPixel : function(v) { + return _.isNumber(v) ? v + 'px' : _.fixPixel(v) + 'px'; + }, + emptyFn : function() { + return true; + }, + supportCanvas : supportCanvas, + isOpera : isOpera, + isWebKit : isWebKit, + isChrome : isChrome, + isSafari : isSafari, + isIE : isIE, + isGecko : isGecko, + isMobile : isMobile, + touch: "ontouchend" in document, + FRAME : isMobile ? 30 : 60 + }); + + _.Assert = { + isTrue : function(v, cause) { + if (v !== true) + throw new Error(cause); + } + }; + /** + * shim layer with setTimeout fallback + */ + _.requestAnimFrame = (function() { + var raf = window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame || function(callback) { + window.setTimeout(callback, 1000 / 60); + }; + return function(f){raf(f)} + })(); + + + /** + * defined Event + */ + _.Event = { + addEvent : function(ele, type, fn, useCapture) { + if (ele.addEventListener) + ele.addEventListener(type, fn, useCapture); + else if (ele.attachEvent) + ele.attachEvent('on' + type, fn); + else + ele['on' + type] = fn; + }, + fix : function(e) { + /** + * Fix event for mise + */ + if (typeof (e) == 'undefined') { + e = window.event; + } + var E = { + target:e.target, + pageX : e.pageX, + pageY : e.pageY, + offsetX : e.offsetX, + offsetY : e.offsetY, + stopPropagation:false, + //time: new Date().getTime(), + event:e + }; + /** + * This is mainly for FF which doesn't provide offsetX + */ + if (typeof (e.offsetX) == 'undefined') { + /** + * Fix target property, if necessary + */ + if (!e.target) { + E.target = e.srcElement || document; + } + + if(e.targetTouches){ + E.pageX = e.targetTouches[0].pageX; + E.pageY = e.targetTouches[0].pageY; + } + /** + * Calculate pageX/Y if missing and clientX/Y available + */ + if (E.pageX == null && e.clientX != null) { + var doc = document.documentElement, body = document.body; + E.pageX = e.clientX + (doc && doc.scrollLeft || body && body.scrollLeft || 0) - (doc && doc.clientLeft || body && body.clientLeft || 0); + E.pageY = e.clientY + (doc && doc.scrollTop || body && body.scrollTop || 0) - (doc && doc.clientTop || body && body.clientTop || 0); + } + + /** + * Browser not with offsetX and offsetY + */ + var x = 0, y = 0, obj = e.target; + while (obj != document.body && obj) { + x += obj.offsetLeft-(obj.scrollLeft||0); + y += obj.offsetTop; + obj = obj.offsetParent; + } + E.offsetX = E.pageX - x; + E.offsetY = E.pageY - y; + } + + E.x = E.offsetX; + E.y = E.offsetY; + /** + * Any browser that doesn't implement stopPropagation() (MSIE) + */ + if (!e.stopPropagation) { + e.stopPropagation = function() { + window.event.cancelBubble = true; + } + } + + return E; + } + }; + return _; + + })(window); + + /** + * Add useful method,need to optimized + */ + Array.prototype.each = function(f, s) { + var j = this.length, r; + for ( var i = 0; i < j; i++) { + r = s ? f.call(s, this[i], i) : f(this[i], i); + if (typeof r === "boolean" && !r) { + break + } + }; + return this; + }; + + Array.prototype.eachAll = function(f, s) { + this.each(function(d, i) { + if (iChart_.isArray(d)) { + return d.eachAll(f, s); + } else { + return s ? f.call(s, d, i) : f(d, i); + } + }, s); + }; + + Array.prototype.sor = function(f) { + var _=this,L = _.length-1,T; + for(var i = 0; i < L; i++){ + for (var j = L; j > i;j--) { + if (f ? !f(_[j], _[j - 1]) : (_[j] < _[j - 1])) { + T = _[j]; + _[j] = _[j - 1]; + _[j - 1] = T; + } + } + } + }; + + + window.iChart = iChart_; + if (!window.$) { + window.$ = window.iChart; + } +})(window); + +;(function($){ +/** + * @overview This is base class of all element.All must extend this so that has ability for configuration and event + * this class include some base attribute + * @component#$.Element + * @extend#Object + */ +$.Element = function(config) { + var _ = this._(); + /** + * indicate the element's type + */ + _.type = 'element'; + + _.ICHARTJS_OBJECT = true; + + /** + * define abstract method + */ + $.DefineAbstract('configure', _); + $.DefineAbstract('afterConfiguration', _); + + /** + * All of the configuration will in this property + */ + _.options = {}; + + _.set({ + /** + * @cfg {Object} Specifies the border for this element. + * Available property are: + * @Option enable {boolean} If enable the border + * @Option color {String} the border's color.(default to '#BCBCBC') + * @Option style {String} the border's style.(default to 'solid') + * @Option width {Number/String} the border's width.If given array,the option radius will be 0.(default to 1) + * @Option radius {Number/String} the border's radius.(default to 0) + */ + border : { + enable : false, + color : '#BCBCBC', + style : 'solid', + width : 1, + radius : 0 + }, + /** + * @cfg {Boolean} Specifies whether the element should be show a shadow.In general there will be get a high render speed when apply false.(default to false) + */ + shadow : false, + /** + * @cfg {String} Specifies the color of your shadow is.(default to '#666666') + */ + shadow_color : '#666666', + /** + * @cfg {Number} Specifies How blur you want your shadow to be.(default to 4) + */ + shadow_blur : 4, + /** + * @cfg {Number} Specifies Horizontal distance (x-axis) between the shadow and the shape in pixel.(default to 0) + */ + shadow_offsetx : 0, + /** + * @cfg {Number} Specifies Vertical distance (y-axis) between the shadow and the shape in pixel.(default to 0) + */ + shadow_offsety : 0 + }); + + /** + * variable for short + */ + _.W = 'width'; + _.H = 'height'; + _.O = 'top'; + _.B = 'bottom'; + _.L = 'left'; + _.R = 'right'; + _.C = 'center'; + _.X = 'originx'; + _.Y = 'originy'; + /** + * the running variable cache + */ + _.variable = {}; + + /** + * the root of all events + */ + _.events = { + 'mouseup':[], + 'touchstart':[], + 'touchmove':[], + 'touchend':[], + 'mousedown':[], + 'dblclick':[] + }; + + _.registerEvent( + /** + * @event Fires after the element initializing is finished this is for test + * @paramter $.Painter#this + */ + 'initialize'); + + _.initialization = false; + + /** + * inititalize configure + */ + _.configure.apply(_, Array.prototype.slice.call(arguments, 1)); + + /** + * clone the original config + */ + _.default_ = $.clone(_.options,true); + + /** + * megre customize config + */ + _.set(config); + + _.afterConfiguration(_); +} + +$.Element.prototype = { + _:function(){return this}, + afterConfiguration : function(_) { + /** + * register customize event + */ + if ($.isObject(_.get('listeners'))) { + for ( var e in _.get('listeners')) { + _.on(e, _.get('listeners')[e]); + } + } + _.initialize(); + + /** + * fire the initialize event,this probable use to unit test + */ + _.fireEvent(_, 'initialize', [_]); + }, + registerEvent : function() { + for ( var i = 0; i < arguments.length; i++) { + this.events[arguments[i]] = []; + } + }, + fireString : function(socpe, name, args, s) { + var t = this.fireEvent(socpe, name, args); + return $.isString(t) ? t : (t!==true&&$.isDefined(t)?t.toString():s); + }, + fireEvent : function(socpe, name, args) { + var L = this.events[name].length; + if (L == 1) + return this.events[name][0].apply(socpe, args); + var r = true; + for ( var i = 0; i < L; i++) { + if(!this.events[name][i].apply(socpe, args)) + r = false; + } + return r; + }, + on : function(n, fn) { + if($.isString(n)&&$.isArray(this.events[n])){ + this.events[n].push(fn); + }else if($.isArray(n)){ + n.each(function(c){this.on(c, fn)},this); + } + return this; + }, + getPlugin:function(n){ + return this.constructor.plugin_[n]; + }, + set : function(c) { + if ($.isObject(c)) + $.merge(this.options, c); + }, + pushIf : function(n, v) { + if (!$.isDefined(this.get(n))||this.get(n)==null) { + return this.push(n, v); + } + return this.get(n); + }, + /** + * average write speed about 0.013ms + */ + push : function(n, v) { + var A = n.split("."),L=A.length - 1,V = this.options; + for (var i = 0; i < L; i++) { + if (!V[A[i]]) + V[A[i]] = {}; + V = V[A[i]]; + } + V[A[L]] = v; + return v; + }, + /** + * average read speed about 0.005ms + */ + get : function(n) { + var A = n.split("."), V = this.options[A[0]]; + for (var i = 1; i < A.length; i++) { + if (!V) + return null; + V = V[A[i]]; + } + return V; + } +} +/** + * @end + */ + + +/** + * @overview The interface this class defined d,so the sub class has must capability to draw and aware of event. this class is a abstract class,so you should not try to initialize it. + * @component#$.Painter + * @extend#$.Element + */ +$.Painter = $.extend($.Element, { + + configure : function() { + /** + * indicate the element's type + */ + this.type = 'painter'; + + this.dimension = $._2D; + + /** + * define abstract method + */ + $.DefineAbstract('commonDraw', this); + $.DefineAbstract('initialize', this); + + this.set({ + /** + * @cfg {String} Specifies the default strokeStyle of the canvas's context in this element.(defaults to 'gray') + */ + strokeStyle : 'gray', + /** + * @cfg {Number} Specifies the padding for this element in pixel,the same rule as css padding.(defaults to 10) + */ + padding : 10, + /** + * @cfg {String} Specifies the font's color for this element.(defaults to 'black') + */ + color : 'black', + /** + * @cfg {Number} Specifies Horizontal offset(x-axis) in pixel.(default to 0) + */ + offsetx : 0, + /** + * @cfg {Number}Specifies Vertical distance (y-axis) in pixel.(default to 0) + */ + offsety : 0, + /** + * @cfg {String} Specifies the backgroundColor for this element.(defaults to 'FDFDFD') + */ + background_color : '#FEFEFE', + /** + * @cfg {float} Specifies the factor make color dark or light for this element,relative to background-color,the bigger the value you set,the larger the color changed.scope{0.01 - 0.5}.(defaults to '0.15') + */ + color_factor : 0.15, + /** + * @inner {String} ('2d','3d') + */ + style : '', + /** + * @cfg {Object} Here,specify as true by default + */ + border : { + enable : true + }, + /** + * @cfg {Boolean} True to apply the gradient.(default to false) + */ + gradient : false, + /** + * @cfg {String} Specifies the gradient mode of background.(defaults to 'LinearGradientUpDown') + * @Option 'LinearGradientUpDown' + * @Option 'LinearGradientDownUp' + * @Option 'LinearGradientLeftRight' + * @Option 'LinearGradientRightLeft' + * @Option 'RadialGradientOutIn' + * @Option 'RadialGradientInOut' + */ + gradient_mode:'LinearGradientUpDown', + /** + * @cfg {Number}Specifies the z-index.(default to 0) + */ + z_index : 0, + /** + * @cfg {Object} A config object containing one or more event handlers.(default to null) + */ + listeners : null, + /** + * @cfg {Number} If you want to totally override the positioning of the chart,you should setting it.(default to null) + */ + originx : null, + /** + * @cfg {Number} If you want to totally override the positioning of the chart,you should setting it.(default to null) + */ + originy : null + }); + + this.variable.event = { + mouseover : false + }; + + this.variable.animation = {} + /** + * register the common event + */ + this.registerEvent( + /** + * @event Fires when this element is clicked + * @paramter $.Painter#this + * @paramter EventObject#e The click event object + * @paramter Object#param The additional parameter + */ + 'click', + /** + * @event Fires when the mouse move on the element + * @paramter $.Painter#this + * @paramter EventObject#e The mousemove event object + */ + 'mousemove', + /** + * @event Fires when the mouse hovers over the element + * @paramter $.Painter#this + * @paramter EventObject#e The mouseover event object + */ + 'mouseover', + /** + * @event Fires when the mouse exits the element + * @paramter $.Painter#this + * @paramter EventObject#e The mouseout event object + */ + 'mouseout', + /** + * @event Fires before the element drawing.Return false from an event handler to stop the draw. + * @paramter $.Painter#this + */ + 'beforedraw', + /** + * @event Fires after the element drawing when calling the draw method. + * @paramter $.Painter#this + */ + 'draw'); + + + }, + is3D : function() { + return this.dimension == $._3D; + }, + applyGradient:function(x,y,w,h){ + var _ = this._(); + if(_.get('gradient')&&_.get('f_color')){ + _.push('f_color', _.T.gradient(x||_.x||0,y||_.y||0,w||_.get(_.W),h||_.get(_.H),[_.get('dark_color'), _.get('light_color')],_.get('gradient_mode'))); + _.push('light_color', _.T.gradient(x||_.x||0,y||_.y||0,w||_.get(_.W),h||_.get(_.H),[_.get('background_color'), _.get('light_color')],_.get('gradient_mode'))); + _.push('f_color_',_.get('f_color')); + } + }, + /** + * @method The commnd fire to draw the chart use configuration, + * this is a abstract method.Currently known,both $.Chart and $.Component implement this method. + * @return void + */ + draw : function(e,comb) { + if(comb){ + /** + * fire the root Refresh + */ + this.root.draw(e); + }else{ + /** + * fire the beforedraw event + */ + if (!this.fireEvent(this, 'beforedraw', [this,e])) { + return this; + } + /** + * execute the commonDraw() that the subClass implement + */ + this.commonDraw(this,e); + + /** + * fire the draw event + */ + this.fireEvent(this, 'draw', [this,e]); + } + }, + inject : function(c) { + if (c) { + this.root = c; + this.target = this.T = c.T; + } + }, + doConfig : function() { + + var _ = this._(), p = $.parsePadding(_.get('padding')), b = _.get('border.enable'), b = b ? $.parsePadding(_.get('border.width')) : [0, 0, 0, 0], bg = $.toRgb(_.get('background_color')), f = _.get('color_factor'),g=_.get('gradient')?0:null; + + _.set({ + border_top:b[0], + border_right:b[1], + border_bottom:b[2], + border_left:b[3], + hborder:b[1] + b[3], + vborder:b[0] + b[2], + padding_top:p[0] + b[0], + padding_right:p[1] + b[1], + padding_bottom:p[2] + b[2], + padding_left:p[3] + b[3], + hpadding:p[1] + p[3] + b[1] + b[3], + vpadding:p[0] + p[2] + b[0] + b[2] + }); + + if (_.get('shadow')===true) { + _.push('shadow', { + color : _.get('shadow_color'), + blur : _.get('shadow_blur'), + offsetx : _.get('shadow_offsetx'), + offsety : _.get('shadow_offsety') + }); + } + + _.push('f_color', bg); + _.push('f_color_', bg); + _.push("light_color", $.light(bg, f,g)); + _.push("dark_color", $.dark(bg, f*0.8,g)); + _.push("light_color2", $.light(bg, f * 2,g)); + + if(_.is3D()&&!_.get('xAngle_')){ + var P = $.vectorP2P(_.get('xAngle'),_.get('yAngle')); + _.push('xAngle_',P.x); + _.push('yAngle_',P.y); + } + } +}); +/** + * @end + */ + +/** + * + * @overview the base class use for Html componment + * @component#$.Html + * @extend#$.Element + */ +$.Html = $.extend($.Element,{ + configure : function(T) { + + /** + * indicate the element's type + */ + this.type = 'html'; + + this.T = T; + + /** + * define abstract method + */ + $.DefineAbstract('beforeshow',this); + + this.set({ + animation:true, + /** + * @cfg If true the component will has defalut action when event fired.(default to true) + */ + default_action:true, + /** + * @inner Specifies the width of this element in pixels. + */ + width:0, + /** + * @inner Specifies the height of this element in pixels. + */ + height:0, + /** + * @cfg {String} Custom style specification to be applied to this element.(default to '') + * like this:'padding:10px;font-size:12px' + */ + style:'', + /** + * @inner The z-index of this element.(default to 999) + */ + index:999, + /** + * @inner The top of this element.(default to 0) + */ + offset_top:0, + /** + * @inner The left of this element.(default to 0) + */ + offset_left:0 + }); + + + this.transitions = ""; + }, + initialize:function(){ + var _ = this._(); + _.wrap = _.get('wrap'); + _.dom = document.createElement("div"); + + if(_.get('shadow')){ + _.css('boxShadow',_.get('shadow_offsetx')+'px '+_.get('shadow_offsety')+'px '+_.get('shadow_blur')+'px '+_.get('shadow_color')); + } + if(_.get('border.enable')){ + _.css('border',_.get('border.width')+"px "+_.get('border.style')+" "+_.get('border.color')); + _.css('borderRadius',_.get('border.radius')+"px"); + } + + _.css('position','absolute'); + _.css('zIndex',_.get('index')); + + _.applyStyle(); + + _.wrap.appendChild(_.dom); + + _.style = _.dom.style; + + if(_.get('default_action')){ + _.doAction(_); + } + }, + width:function(){ + return this.dom.offsetWidth; + }, + height:function(){ + return this.dom.offsetHeight; + }, + onTransitionEnd:function(fn,useCapture){ + var type = 'transitionend'; + if($.isWebKit){ + type = 'webkitTransitionEnd'; + }else if($.isOpera){ + type = 'oTransitionEnd'; + } + $.Event.addEvent(this.dom,type,fn,useCapture); + }, + destroy:function(){ + this.wrap.removeChild(this.dom); + this.dom = null; + }, + transition:function(v){ + this.transitions = this.transitions==''?v:this.transitions+','+v; + if($.isWebKit){ + this.css('WebkitTransition',this.transitions); + }else if($.isGecko){ + this.css('MozTransition',this.transitions); + }else if($.isOpera){ + this.css('OTransition',this.transitions); + }else{ + this.css('transition',this.transitions); + } + }, + beforeshow:function(e,m,_){ + _.follow(e,m,_); + }, + show:function(e,m){ + this.beforeshow(e,m,this); + this.css('visibility','visible'); + if(this.get('animation')){ + this.css('opacity',1); + } + }, + hidden:function(e){ + this.css('visibility','hidden'); + }, + getDom:function(){ + return this.dom; + }, + css:function(k,v){ + if($.isString(k))if($.isDefined(v))this.dom.style[k]=v;else return this.dom.style[k]; + }, + applyStyle:function(){ + var styles = this.get('style').split(";"),style; + for(var i = 0;i< styles.length;i++){ + style = styles[i].split(":"); + if(style.length>1)this.css(style[0],style[1]); + } + } +}); +/** + * @end + */ +/** + * @overview this a abstract component of all concrete chart + * @component#$.Component + * @extend#$.Painter + */ +$.Component = $.extend($.Painter, { + configure : function(c) { + /** + * invoked the super class's configuration + */ + $.Component.superclass.configure.apply(this, arguments); + + /** + * indicate the element's type + */ + this.type = 'component'; + + this.set({ + /** + * @cfg {Number} Specifies the font size of this element in pixels.(default to 12) + */ + fontsize : 12, + /** + * @cfg {String} Specifies the font of this element.(default to 'Verdana') + */ + font : 'Verdana', + /** + * @cfg {String} Specifies the font weight of this element.(default to 'normal') + */ + fontweight : 'normal', + /** + * @cfg {String} Specifies the unit of font-size.(default to 'px') + */ + fontunit:'px', + /** + * @inner {Boolean} Specifies the config of Tip.For details see $.Tip Note:this has a extra property named 'enable',indicate whether tip available(default to false) + */ + tip : { + enable : false, + border : { + width : 2 + } + } + }); + + /** + * If this element can split or contain others.(default to false) + */ + this.atomic = false; + /** + * If method draw be proxy.(default to false) + */ + this.proxy = false; + this.ICHARTJS_CHART = false; + this.inject(c); + }, + initialize : function() { + $.DefineAbstract('isEventValid', this); + $.DefineAbstract('doDraw', this); + + this.doConfig(); + this.initialization = true; + }, + /** + * @method return the component's dimension,return hold following property + * @property x:the left-top coordinate-x + * @property y:the left-top coordinate-y + * @property width:the width of component,note:available there applies box model + * @property height:the height of component,note:available there applies box model + * @return object + */ + getDimension : function() { + return { + x : this.x, + y : this.y, + width : this.get("width"), + height : this.get("height") + } + }, + destroy:function(){ + if(this.tip){ + this.tip.destroy(); + } + }, + doConfig : function() { + $.Component.superclass.doConfig.call(this); + var _ = this._(),w = _.get(_.W),W = _.get('maxwidth'),x = _.get(_.X); + if(w&&W){ + w = _.push(_.W,$.parsePercent(w,W)); + if(w>W){ + w = _.push('width',W); + } + if(W>w){ + var C = _.get('align')||_.C; + if(C == _.C){ + x +=(W-w)/2; + }else if(C == _.R){ + x += (W-w); + } + } + } + + _.x = _.push(_.X, x + _.get('offsetx')); + _.y = _.push(_.Y, _.get(_.Y) + _.get('offsety')); + + _.push('fontStyle', $.getFont(_.get('fontweight'), _.get('fontsize'), _.get('font'),_.get('fontunit'))); + + /** + * if have evaluate it + */ + _.data = _.get('data'); + + if (_.get('tip.enable')) { + /** + * make tip's border in accord with sector + */ + _.pushIf('tip.border.color', _.get('f_color')); + + if (!$.isFunction(_.get('tip.invokeOffset'))) + /** + * indicate the tip must calculate position + */ + _.push('tip.invokeOffset', _.tipInvoke()); + } + + }, + isMouseOver : function(e) { + return this.isEventValid(e,this); + }, + redraw : function(e) { + this.root.draw(e,this.root.Combination); + }, + last:$.emptyFn, + commonDraw : function(_) { + /** + * execute the doDraw() that the subClass implement + */ + if (!_.proxy) + _.doDraw.call(_,_); + + } +}); +/** + * @end + */ + + /** + * @overview the tip component. + * @component#$.Tip + * @extend#$.Element + */ + $.Tip = $.extend($.Html,{ + configure:function(){ + + /** + * invoked the super class's configuration + */ + $.Tip.superclass.configure.apply(this,arguments); + + /** + * indicate the legend's type + */ + this.type = 'tip'; + + this.set({ + name:'', + index:0, + value:'', + /** + * @cfg {String} Specifies the text want to disply.(default to '') + */ + text:'', + /** + * @cfg {String} Specifies the tip's type.(default to 'follow') Available value are: + * @Option follow + * @Option fixed + */ + showType:'follow', + /** + * @cfg {Function} Specifies Function to calculate the position.(default to null) + */ + invokeOffset:null, + /** + * @cfg {Number} Specifies the duration when fadeIn/fadeOut in millisecond.(default to 300) + */ + fade_duration:300, + /** + * @cfg {Number} Specifies the duration when move in millisecond.(default to 100) + */ + move_duration:100, + /** + * ease + * linear + * ease-in + * ease-out + * ease-in-out + */ + timing_function:'ease-out', + /** + * @cfg {Boolean} if calculate the position every time (default to false) + */ + invokeOffsetDynamic:false, + /** + * @cfg {String} Specifies the css of this Dom. + */ + style:'textAlign:left;padding:4px 5px;cursor:pointer;backgroundColor:rgba(239,239,239,.85);fontSize:12px;color:black;', + /** + * @cfg {Object} Override the default as enable = true,radius = 5 + */ + border:{ + enable:true, + radius : 5 + }, + delay:200 + }); + this.registerEvent( + /** + * @event Fires when parse this tip's text.Return value will override existing. + * @paramter $.Tip#tip + * @paramter string#name the current tip's name + * @paramter string#value the current tip's value + * @paramter string#text the current tip's text + * @paramter int#index index of data,if there was a line + */ + 'parseText'); + }, + position:function(t,l,_){ + _.style.top = (t<0?0:t)+"px"; + _.style.left = (l<0?0:l)+"px"; + }, + follow:function(e,m,_){ + //_.style.width = ""; + if(_.get('invokeOffsetDynamic')){ + if(m.hit){ + if($.isString(m.text)||$.isNumber(m.text)){ + _.text(m.name,m.value,m.text,m.i,_); + } + var o = _.get('invokeOffset')(_.width(),_.height(),m); + _.position(o.top,o.left,_); + } + }else{ + if(_.get('showType')!='follow'&&$.isFunction(_.get('invokeOffset'))){ + var o = _.get('invokeOffset')(_.width(),_.height(),m); + _.position(o.top,o.left,_); + }else{ + _.position((e.y-_.height()*1.1-2),e.x+2,_); + } + } + }, + text:function(n,v,t,i,_){ + _.dom.innerHTML = _.fireString(_, 'parseText', [_,n,v,t,i],t); + }, + hidden:function(e){ + if(this.get('animation')){ + this.css('opacity',0); + }else{ + this.css('visibility','hidden'); + } + }, + doAction:function(_){ + _.T.on('mouseover',function(c,e,m){ + _.show(e,m); + }).on('mouseout',function(c,e,m){ + _.hidden(e); + }); + + if(_.get('showType')=='follow'){ + _.T.on('mousemove',function(c,e,m){ + if(_.T.variable.event.mouseover){ + setTimeout(function(){ + if(_.T.variable.event.mouseover) + _.follow(e,m,_); + },_.get('delay')); + } + }); + } + }, + initialize:function(){ + $.Tip.superclass.initialize.call(this); + + var _ = this._(); + + _.text(_.get('name'),_.get('value'),_.get('text'),_.get('index'),_); + _.hidden(); + + if(_.get('animation')){ + var m = _.get('move_duration')/1000+'s '+_.get('timing_function')+' 0s'; + _.transition('opacity '+_.get('fade_duration')/1000+'s '+_.get('timing_function')+' 0s'); + _.transition('top '+m); + _.transition('left '+m); + _.onTransitionEnd(function(e){ + if(_.css('opacity')==0){ + _.css('visibility','hidden'); + } + },false); + } + + } +}); +/** + * @end + */ + + + /** + * @overview this element simulate the crosshair on the coordinate.actually this composed of some div of html. + * @component#$.CrossHair + * @extend#$.Html + */ + $.CrossHair = $.extend($.Html,{ + configure:function(){ + + /** + * invoked the super class's configuration + */ + $.CrossHair.superclass.configure.apply(this,arguments); + + /** + * indicate the component's type + */ + this.type = 'crosshair'; + + this.set({ + /** + * @inner {Number} Specifies the position top,normally this will given by chart.(default to 0) + */ + top:0, + /** + * @inner {Number} Specifies the position left,normally this will given by chart.(default to 0) + */ + left:0, + /** + * @inner {Boolean} private use + */ + hcross:true, + /** + * @inner {Boolean} private use + */ + vcross:true, + /** + * @inner {Function} private use + */ + invokeOffset:null, + /** + * @cfg {Number} Specifies the linewidth of the crosshair.(default to 1) + */ + line_width:1, + /** + * @cfg {Number} Specifies the linewidth of the crosshair.(default to 1) + */ + line_color:'#1A1A1A', + delay:200 + }); + }, + /** + * this function will implement at every target object,and this just default effect + */ + follow:function(e,m,_){ + if(_.get('invokeOffset')){ + var o = _.get('invokeOffset')(e,m); + if(o&&o.hit){ + _.o_valid = true; + _.position(o.top-_.top,o.left-_.left,_); + }else if(!o||!_.o_valid){ + _.position(_.owidth,_.oheight,_); + } + }else{ + /** + * set the 1px offset will make the line at the top left all the time + */ + _.position(e.y-_.top-1,e.x-_.left-1,_); + } + }, + position:function(t,l,_){ + _.horizontal.style.top = (t-_.size)+"px"; + _.vertical.style.left = (l-_.size)+"px"; + }, + doCreate:function(_,w,h){ + var d = document.createElement("div"); + d.style.width= $.toPixel(w); + d.style.height= $.toPixel(h); + d.style.backgroundColor = _.get('line_color'); + d.style.position="absolute"; + _.dom.appendChild(d); + return d; + }, + doAction:function(_){ + _.T.on('mouseover',function(c,e,m){ + _.show(e,m); + }).on('mouseout',function(c,e,m){ + _.hidden(e,m); + }).on('mousemove',function(c,e,m){ + _.follow(e,m,_); + }); + }, + initialize:function(){ + $.CrossHair.superclass.initialize.call(this); + + var _ = this._(),L = $.toPixel(_.get('line_width')); + + _.size = _.get('line_width')/2; + + _.top = $.fixPixel(_.get(_.O)); + _.left = $.fixPixel(_.get(_.L)); + _.owidth = -_.T.root.width; + _.oheight = -_.T.root.height; + _.o_valid = false; + /** + * set size zero make integration with vertical and horizontal + */ + _.css('width','0px'); + _.css('height','0px'); + _.css('top',_.top+'px'); + _.css('left',_.left+'px'); + _.css('visibility','hidden'); + + _.horizontal = _.doCreate(_,_.get('hcross')?$.toPixel(_.get(_.W)):"0px",L); + _.vertical = _.doCreate(_,L,_.get('vcross')?$.toPixel(_.get(_.H)):"0px"); + + + + } +}); +/** + * @end + */ +/** + * @overview the legend componment + * @component#$.Legend + * @extend#$.Component + */ +$.Legend = $.extend($.Component, { + configure : function() { + /** + * invoked the super class's configuration + */ + $.Legend.superclass.configure.apply(this, arguments); + + /** + * indicate the legend's type + */ + this.type = 'legend'; + + this.set({ + /** + * @cfg {Array} Required,The datasource of Legend.Normally,this will given by chart.(default to undefined) + */ + data : undefined, + /** + * @inner {Number} Specifies the width.Note if set to 'auto' will be fit the actual width.(default to 'auto') + */ + width : 'auto', + /** + * @cfg {Number/String} Specifies the number of column.(default to 1) Note:If set to 'max',the list will be lie on the property row + */ + column : 1, + /** + * @cfg {Number/String} Specifies the number of column.(default to 'max') Note:If set to 'max',the list will be lie on the property column + */ + row : 'max', + /** + * @cfg {Number} Specifies the limited width.Normally,this will given by chart.(default to 0) + */ + maxwidth : 0, + /** + * @cfg {Number} Specifies the lineheight when text display multiline.(default to 16) + */ + line_height : 16, + /** + * @cfg {String} Specifies the shape of legend' sign (default to 'square') Available value are: + * @Option 'round' + * @Option 'square' + * @Option 'bar' + * @Option 'round-bar' + * @Option 'square-bar' + */ + sign : 'square', + /** + * @cfg {Number} the size of legend' sign (default to 10) + */ + sign_size : 10, + /** + * @cfg {Number} the distance of legend' sign and text (default to 5) + */ + sign_space : 5, + /** + * @cfg {Number} Specifies the space between the sign and text.(default to 5) + */ + legend_space : 5, + + z_index : 1009, + /** + * @cfg {Boolean} If true the text's color will accord with sign's.(default to false) + */ + text_with_sign_color : false, + /** + * @cfg {String} Specifies the horizontal position of the legend in chart.(defaults to 'right').Available value are: + * @Option 'left' + * @Option 'center' Only applies when valign = 'top|bottom' + * @Option 'right' + */ + align : 'right', + /** + * @cfg {String} this property specifies the vertical position of the legend in an module (defaults to 'middle'). Available value are: + * @Option 'top' + * @Option 'middle' Only applies when align = 'left|right' + * @Option 'bottom' + */ + valign : 'middle' + }); + + /** + * this element support boxMode + */ + this.atomic = true; + + this.registerEvent( + /** + * @event Fires when parse this element'data.Return text value will override existing. + * @paramter $.Chart#this + * @paramter string#text the text will display + * @paramter int#i the index of data + * @return string + */ + 'parse'); + + }, + isEventValid : function(e,_) { + var r = { + valid : false + }; + if (e.x > this.x && e.x < (_.x + _.width) && e.y > _.y && e.y < (_.y + _.height)) { + _.data.each(function(d, i) { + if (e.x > d.x && e.x < (d.x + d.width_ + _.get('signwidth')) && e.y > d.y && e.y < (d.y + _.get('line_height'))) { + r = { + valid : true, + index : i, + target : d + } + return false; + } + }, _); + } + return r; + }, + drawCell : function(x, y, text, color,n,_) { + var s = _.get('sign_size'),f = _.getPlugin('sign'); + if(!f||!f.call(_,_.T,n,{x:x + s / 2,y:y},s,color)){ + if(n.indexOf("bar")!=-1){ + _.T.box(x, y - s / 12, s, s / 6, 0, color); + } + if(n=='round'){ + _.T.round(x + s / 2, y, s / 2, color); + }else if(n=='round-bar'){ + _.T.round(x + s / 2, y, s / 4, color); + }else if (n == 'square-bar') { + _.T.box(x + s / 4, y - s / 4, s / 2, s / 2, 0, color); + }else if (n == 'square'){ + _.T.box(x, y-s/2, s, s, 0, color); + } + } + _.T.fillText(text, x + _.get('signwidth'), y, 0, _.get('text_with_sign_color')?color:_.get('color'),'lr',_.get('line_height')); + }, + doDraw : function(_) { + _.T.box(_.x, _.y, _.width, _.height, _.get('border'), _.get('f_color'), false, _.get('shadow')); + _.T.textStyle(_.L, 'middle', $.getFont(_.get('fontweight'), _.get('fontsize'), _.get('font'))); + _.data.each(function(d) { + _.drawCell(d.x, d.y, d.text, d.color,d.sign,_); + }); + }, + doLayout:function(_,g){ + var ss = _.get('sign_size'), + w = 0, + h=0, + temp = 0, + c = _.get('column'), + r = _.get('row'), + L = _.data.length; + + _.T.textFont(_.get('fontStyle')); + + if (_.get('line_height') < ss) { + _.push('line_height', ss + ss / 5); + } + _.push('signwidth', (ss + _.get('sign_space'))); + /** + * calculate the width each item will used + */ + _.data.each(function(d) { + d.width_ = _.T.measureText(d.text); + }, _); + + /** + * calculate the each column's width it will used + */ + for ( var i = 0; i < c; i++) { + temp = 0; + for ( var j = i; j < L; j+=c) { + temp = Math.max(temp, _.data[j].width_); + } + _.columnwidth[i] = temp; + w += temp; + } + /** + * calculate the each row's height it will used + */ + for ( var i = 0; i < r; i++) { + temp =0; + for ( var j = i*c; j < L; j++) { + temp = Math.max(temp, _.data[j].text.split("\n").length); + } + _.columnheight[i] = temp; + h+=temp; + } + w = _.push(_.W, w + _.get('hpadding') + _.get('signwidth') * c + (c - 1) * _.get('legend_space')); + if (w > _.get('maxwidth')){ + var fs=Math.floor(_.get('fontsize')*(_.get('maxwidth')/w)); + if(!(fs<10&&c==1)){ + if(fs>9){ + _.push('fontStyle',$.getFont(_.get('fontweight'), _.push('fontsize', fs), _.get('font'))); + }else if(c>1){ + _.push('row', Math.ceil(L / _.push('column',c-1))); + } + _.doLayout(_,g); + return; + } + } + + var d,x,y,y2; + _.width = w; + + _.height = h = _.push(_.H, h * _.get('line_height') + _.get('vpadding')); + + if (_.get('valign') == _.O) { + _.y = g.get('t_originy'); + } else if (_.get('valign') == _.B) { + _.y = g.get('b_originy') - h; + } else { + _.y = g.get('centery') - h / 2; + } + + if (_.get('align') == _.L) { + _.x = g.get('l_originx'); + } else if (_.get('align') == _.C) { + _.x = g.get('centerx') - w / 2; + } else { + _.x = g.get('r_originx') - w; + } + + _.x = _.push(_.X, (_.x<0?g.get('l_originx'):_.x) + _.get('offsetx')); + _.y = _.push(_.Y, (_.y<0?g.get('t_originy'):_.y) + _.get('offsety')); + + + y = _.y + _.get('padding_top'); + + ss = _.get('legend_space')+_.get('signwidth'); + /** + * calculate the each cell's coordinate point + */ + for ( var i = 0; i < r; i++) { + x = _.x + _.get('padding_left'); + y2=(_.columnheight[i]/2)*_.get('line_height'); + y+=y2; + for ( var j = 0; j < c&&i*c+j r * c) { + r += Math.ceil((L - r * c) / c); + r = _.push('row', r); + } + _.columnwidth = []; + _.columnheight = []; + + _.doLayout(_,g); + + } +});/** @end */ + +/** + * @overview the label componment + * @component#$.Label + * @extend#$.Component + */ +$.Label = $.extend($.Component, { + configure : function() { + /** + * invoked the super class's configuration + */ + $.Label.superclass.configure.apply(this, arguments); + + /** + * indicate the legend's type + */ + this.type = 'label'; + + this.set({ + /** + * @cfg {String} Specifies the text of this label,Normally,this will given by chart.(default to ''). + */ + text : '', + /** + * @cfg {Number} Specifies the lineheight when text display multiline.(default to 12). + */ + line_height : 12, + /** + * @cfg {Number} Specifies the thickness of line in pixel.(default to 1). + */ + line_thickness : 1, + /** + * @cfg {String} Specifies the shape of legend' sign (default to 'square').Available value are: + * @Option 'round' + * @Option 'square' + */ + sign : 'square', + /** + * @cfg {Number} Specifies the size of legend' sign in pixel.(default to 12) + */ + sign_size : 12, + /** + * @cfg {Number} Override the default as 2 in pixel. + */ + padding : '2 5', + /** + * @cfg {Number} Override the default as 2 in pixel. + */ + offsety : 2, + /** + * @cfg {Number} Specifies the space between the sign and text.(default to 5) + */ + sign_space : 5, + /** + * @cfg {Number} Override the default as '#efefef'. + */ + background_color : '#efefef', + /** + * @cfg {Boolean} If true the text's color will accord with sign's.(default to false) + */ + text_with_sign_color : false + }); + + /** + * this element support boxMode + */ + this.atomic = true; + + this.registerEvent(); + + }, + isEventValid : function(e,_) { + return { + valid : $.inRange(_.labelx, _.labelx + _.get(_.W), e.x) && $.inRange(_.labely, _.labely + _.get(_.H), e.y) + }; + }, + text : function(text) { + if (text) + this.push('text', text); + this.push(this.W, this.T.measureText(this.get('text')) + this.get('hpadding') + this.get('sign_size') + this.get('sign_space')); + }, + localizer : function(_) { + var Q = _.get('quadrantd'),p = _.get('line_points'),m=_.get('smooth'),Q=(Q >= 1 && Q <= 2),x=_.get('labelx'),y=_.get('labely'); + _.labelx = x+(Q ? - _.get(_.W)-m : m); + _.labely = y-_.get(_.H)/2; + p[2] = {x:x,y:y}; + p[3] = {x:p[2].x+(Q ? -m : m),y:p[2].y}; + }, + doLayout : function(x, y,n,_) { + _.push('labelx', _.get('labelx') + x/n); + _.push('labely', _.get('labely') + y/n); + + _.get('line_points').each(function(p,i) { + p.x += x; + p.y += y; + return i==1; + }, _); + _.localizer(_); + }, + doDraw : function(_){ + var p = _.get('line_points'), ss = _.get('sign_size'), x = _.labelx + _.get('padding_left'), y = _.labely + _.get('padding_top'); + + _.T.label(p, _.get('line_thickness'), _.get('border.color')); + + _.T.box(_.labelx, _.labely, _.get(_.W), _.get(_.H), _.get('border'), _.get('f_color'), false, _.get('shadow')); + + _.T.textStyle(_.L, _.O, _.get('fontStyle')); + + var textcolor = _.get('color'); + if (_.get('text_with_sign_color')) { + textcolor = _.get('scolor'); + } + if (_.get('sign') == 'square') { + _.T.box(x, y, ss, ss, 0, _.get('scolor')); + } else if(_.get('sign')){ + _.T.round(x + ss / 2, y + ss / 2, ss / 2, _.get('scolor')); + } + _.T.fillText(_.get('text'), x + ss + _.get('sign_space'), y, _.get('textwidth'), textcolor); + }, + doConfig : function() { + $.Label.superclass.doConfig.call(this); + var _ = this._(); + + _.T.textFont(_.get('fontStyle')); + + if (_.get('fontsize') > _.get('line_height')) { + _.push('line_height', _.get('fontsize')); + } + if(!_.get('sign')){ + _.push('sign_size',0); + _.push('sign_space',0); + } + _.push(_.H, _.get('line_height') + _.get('vpadding')); + + _.text(); + + _.localizer(_); + + } +}); +/** + * @end + */ + + /** + * @overview the text componment + * @component#$.Text + * @extend#$.Component + */ + $.Text = $.extend($.Component,{ + configure:function(){ + /** + * invoked the super class's configuration + */ + $.Text.superclass.configure.apply(this,arguments); + + /** + * indicate the component's type + */ + this.type = 'text'; + + this.set({ + /** + * @cfg {String} Specifies the text want to disply.(default to '') + */ + text:'', + /** + * @cfg {String} there has two layers of meaning,when width is 0,Specifies the textAlign of html5.else this is the alignment of box.(default to 'center') + * when width is 0,Available value are: + * @Option start + * @Option end + * @Option left + * @Option right + * @Option center + * when width is not 0,Available value are: + * @Option left + * @Option right + * @Option center + */ + textAlign:'center', + /** + * @cfg {String} Specifies the alignment in box.(default to 'center') + * @Option left + * @Option right + * @Option center + */ + align:'center', + /** + * @cfg {String} Here,specify as false to make background transparent.(default to null) + */ + background_color : 0, + /** + * @cfg {String} Specifies the textBaseline of html5.(default to 'top') + * Available value are: + * @Option top + * @Option hanging + * @Option middle + * @Option alphabetic + * @Option ideographic + * @Option bottom + */ + textBaseline:'top', + /** + * @cfg {Object} Here,specify as false by default + * @see $.Element#border + */ + border : { + enable : false + }, + /** + * @cfg {Number} Specifies the maxwidth of text in pixels,if given 0 will not be limited.(default to 0) + */ + width:0, + /** + * @cfg {Number} Specifies the maxheight of text in pixels,if given 0 will not be limited(default to 0) + */ + height:0, + /** + * @cfg {Number} Here,specify as 0 by default + */ + padding:0, + /** + * @cfg {String} Specifies the writing-mode of text.(default to 'lr') . + * Available value are: + * @Option 'lr' + */ + writingmode : 'lr', + /** + * @cfg {Number} Specifies the lineheight when text display multiline.(default to 16). + */ + line_height : 16, + /** + * @cfg {Number} Specifies the angle that text writed.0 to horizontal,clockwise.(default to 0). + */ + rotate:0 + }); + + this.registerEvent(); + + }, + doDraw:function(_){ + if(_.get('box_feature')) + _.T.box(_.x,_.y,_.get(_.W),_.get(_.H),_.get('border'),_.get('f_color')); + _.T.text(_.get('text'),_.get('textx'),_.get('texty'),_.get(_.W)-_.get('hpadding'),_.get('color'),_.get('textAlign'),_.get('textBaseline'),_.get('fontStyle'),_.get('writingmode'),_.get('line_height'),_.get('shadow'),_.get('rotate')); + }, + isEventValid:function(){ + return {valid:false}; + }, + doLayout:function(x,y,n,_){ + _.x = _.push(_.X,_.x+x); + _.y = _.push(_.Y,_.y+y); + _.push('textx',_.get('textx')+x); + _.push('texty',_.get('texty')+y); + }, + doConfig:function(){ + $.Text.superclass.doConfig.call(this); + var _ = this._(),x = _.x,y=_.y+_.get('padding_top'),w=_.get(_.W),h=_.get(_.H),a=_.get('textAlign'); + x+=(a==_.C?w/2:(a==_.R?w-_.get('padding_right'):_.get('padding_left'))); + if(h){ + y+=h/2; + _.push('textBaseline','middle'); + } + _.push('textx',x); + _.push('texty',y); + _.push('box_feature',w&&h); + _.applyGradient(); + } +}); +/** + * @end + */ +; +(function($) { + + var PI = Math.PI, inc = PI / 90,inc2 = inc/2, ceil = Math.ceil, floor = Math.floor, PI2 = 2 * PI, max = Math.max, min = Math.min, sin = Math.sin, cos = Math.cos, fd = function(w, c) { + return w == 1 ? (floor(c) + 0.5) : Math.round(c); + }, getCurvePoint = function(seg, point, i, smo) { + var x = point.x, y = point.y, lp = seg[i - 1], np = seg[i + 1], lcx, lcy, rcx, rcy; + if (i < seg.length - 1) { + var lastY = lp.y, nextY = np.y, c; + lcx = (smo * x + lp.x) / (smo + 1); + lcy = (smo * y + lastY) / (smo + 1); + rcx = (smo * x + np.x) / (smo + 1); + rcy = (smo * y + nextY) / (smo + 1); + + c = ((rcy - lcy) * (rcx - x)) / (rcx - lcx) + y - rcy; + lcy += c; + rcy += c; + + if (lcy > lastY && lcy > y) { + lcy = max(lastY, y); + rcy = 2 * y - lcy; + } else if (lcy < lastY && lcy < y) { + lcy = min(lastY, y); + rcy = 2 * y - lcy; + } + if (rcy > nextY && rcy > y) { + rcy = max(nextY, y); + lcy = 2 * y - rcy; + } else if (rcy < nextY && rcy < y) { + rcy = min(nextY, y); + lcy = 2 * y - rcy; + } + point.rcx = rcx; + point.rcy = rcy; + } + return [lp.rcx || lp.x, lp.rcy || lp.y, lcx || x, lcy || y, x, y]; + }, + pF = function(n){ + return $.isNumber(n)?n:$.parseFloat(n,n); + }, + parse = function(c,_){ + var M,V=0,MI,ML=0,init=false,g = _.get('labels'); + _.data = c; + if(_.dataType=='simple'){ + _.total = 0; + c.each(function(d,i){ + d.background_color = d.color; + V = d.value||0; + if($.isArray(V)){ + var T = 0; + ML = V.length>ML?V.length:ML; + for(var j=0;jML?g.length:ML; + } + _.push('maxItemSize',ML); + }else if(_.dataType=='stacked'||_.dataType=='complex'){ + var L=g.length,item,T,r,stack=_.dataType=='stacked'; + if(L==0){ + L=c[0].value.length;for(var i=0;i= s) { + Lo.call(this, angle, h); + angle = angle - inc; + } + Lo.call(this, s, h); + this.lineTo(x + a * cos(s), y + (b * sin(s))).closePath().fill(true); + }, layerDraw = function(x, y, a, b, ccw, h, A, c) { + var x0 = x + a * cos(A); + var y0 = y + h + (b * sin(A)); + this.moveTo(x, y).beginPath().fillStyle(c).lineTo(x, y + h).lineTo(x0, y0).lineTo(x0, y0 - h).lineTo(x, y).closePath().fill(true); + }, layerPaint = function(x, y, a, b, s, e, ccw, h, c) { + var q1 = $.quadrantd(s),q2 = $.quadrantd(e); + c = $.dark(c); + if (q1==1||q1==2) + layerDraw.call(this, x, y, a, b, ccw, h, s, c); + if (q2==0||q2==3) + layerDraw.call(this, x, y, a, b, ccw, h, e, c); + }; + var s3 = function(x, y, a, b, s, e, h, c, bo, bow, boc, sw, ccw, isw) { + /** + * paint bottom layer + */ + this.ellipse(x, y + h, a, b, s, e, c, bo, bow, boc, sw, ccw, true); + /** + * paint inside layer + */ + layerPaint.call(this, x, y, a, b, s, e, ccw, h, c); + + /** + * paint top layer + */ + this.ellipse(x, y, a, b, s, e, c, bo, bow, boc, false, ccw, true); + /** + * paint outside layer + */ + sPaint.call(this, x, y, a, b, s, e, ccw, h, c); + return this; + } + s3.layerPaint = layerPaint; + s3.sPaint = sPaint; + s3.layerDraw = layerDraw; + return s3; + }(), + textStyle : function(a, l, f) { + return this.textAlign(a).textBaseline(l).textFont(f); + }, + strokeStyle : function(b,w, c, j) { + if(b){ + if (w) + this.c.lineWidth = w; + if (c) + this.c.strokeStyle = c; + if (j) + this.c.lineJoin = j; + } + return this; + }, + globalAlpha : function(v) { + if (v) + this.c.globalAlpha = v; + return this; + }, + fillStyle : function(c) { + if (c) + this.c.fillStyle = c; + return this; + }, + arc2 : function(x, y, r, s, e, c) { + if(r) + this.c.arc(x, y, r, s, e, c); + return this; + }, + textAlign : function(a) { + if (a) + this.c.textAlign = a; + return this; + }, + textBaseline : function(l) { + if (l) + this.c.textBaseline = l; + return this; + }, + textFont : function(font) { + if (font) + this.c.font = font; + return this; + }, + shadowOn : function(s) { + if (s) { + this.c.shadowColor = s.color; + this.c.shadowBlur = s.blur; + this.c.shadowOffsetX = s.offsetx; + this.c.shadowOffsetY = s.offsety; + } + return this; + }, + shadowOff : function() { + this.c.shadowColor = 'white'; + this.c.shadowBlur = this.c.shadowOffsetX = this.c.shadowOffsetY = 0; + return this; + }, + gradient : function(x, y, w, h, c,m,r) { + m = m.toLowerCase(); + var x0=x,y0=y,f=!m.indexOf("linear"); + m = m.substring(14); + if(f){ + switch (m) { + case 'updown': + y0 += h; + break; + case 'downup': + y += h; + break; + case 'leftright': + x0 += w; + break; + case 'rightleft': + x += w; + break; + default: + return c[0]; + } + return this.avgLinearGradient(x, y, x0, y0, c); + }else{ + x+=w/2; + y+=h/2; + return this.avgRadialGradient(x,y,(r||0),x,y,(w>h?h:w),m=='outin'?c.reverse():c); + } + }, + avgLinearGradient : function(xs, ys, xe, ye, c) { + var g = this.createLinearGradient(xs, ys, xe, ye); + for ( var i = 0; i < c.length; i++) + g.addColorStop(i / (c.length - 1), c[i]); + return g; + }, + createLinearGradient : function(xs, ys, xe, ye) { + return this.c.createLinearGradient(xs, ys, xe, ye); + }, + avgRadialGradient : function(xs, ys, rs, xe, ye, re, c) { + var g = this.createRadialGradient(xs, ys, rs, xe, ye, re); + for ( var i = 0; i < c.length; i++) + g.addColorStop(i/ (c.length - 1), c[i]); + return g; + }, + createRadialGradient : function(xs, ys, rs, xe, ye, re) { + return this.c.createRadialGradient(xs, ys, rs, xe, ye, re); + }, + text : function(t, x, y, max, color, align, line, font, mode, h,sw,ro) { + return this.save().textStyle(align, line, font).fillText(t, x, y, max, color, mode, h,sw,ro).restore(); + }, + fillText : function(t, x, y, max, color, mode, h,sw,ro) { + t = t.toString(); + if(!t||!t.length)return this; + max = max || false; + mode = mode || 'lr'; + h = h || 16; + x = fd(0, x); + y = fd(0, y); + var T = t.split(mode == 'tb' ? "" : "\n"); + if(T.length>1){ + if(this.c.textBaseline=='middle'){ + y = y - (T.length-1)*h/2; + }else if(this.c.textBaseline=='bottom'){ + y = y - (T.length-1)*h; + } + } + this.save().fillStyle(color).translate(x,y).rotate(inc2*ro).shadowOn(sw); + T.each(function(t,i) { + try { + if (max&&max>0) + this.c.fillText(t, 0,i*h, max); + else + this.c.fillText(t, 0, i*h); + } catch (e) { + console.log(e.message + '[' + t + ',' + x + ',' + y + ']'); + } + }, this); + + return this.restore(); + }, + measureText : function(t){ + t = t.split("\n"); + var m=0; + t.each(function(o){ + m = max(this.measureText(o).width,m); + },this.c); + return m; + }, + moveTo : function(x, y) { + x = x || 0; + y = y || 0; + this.c.moveTo(x, y); + return this; + }, + lineTo : function(x, y) { + x = x || 0; + y = y || 0; + this.c.lineTo(x, y); + return this; + }, + save : function() { + this.c.save(); + return this; + }, + restore : function() { + this.c.restore(); + return this; + }, + beginPath : function() { + this.c.beginPath(); + return this; + }, + closePath : function() { + this.c.closePath(); + return this; + }, + stroke : function(s) { + if(s) + this.c.stroke(); + return this; + }, + fill : function(f) { + if(f) + this.c.fill(); + return this; + }, + /** + * can use cube3D instead of this? + */ + cube : function(x, y, xv, yv, width, height, zdeep, bg, b, bw, bc, sw) { + x = fd(bw, x); + y = fd(bw, y); + zdeep = (zdeep && zdeep > 0) ? zdeep : width; + var x1 = x + zdeep * xv, y1 = y - zdeep * yv; + x1 = fd(bw, x1); + y1 = fd(bw, y1); + /** + * styles -> top-front-right + */ + if (sw) { + this.polygon(bg, b, bw, bc, sw, false, [{x:x, y:y},{x: x1, y:y1},{x: x1 + width, y:y1},{x: x + width, y:y}]); + this.polygon(bg, b, bw, bc, sw, false, [{x:x, y:y},{x: x, y:y + height},{x: x + width,y: y + height},{x: x + width, y:y}]); + this.polygon(bg, b, bw, bc, sw, false, [{x:x + width, y:y},{x: x1 + width, y:y1},{x: x1 + width, y:y1 + height},{x: x + width, y:y + height}]); + } + /** + * clear the shadow on the body + */ + this.polygon($.dark(bg), b, bw, bc, false, false, [{x:x, y:y}, {x:x1, y:y1}, {x:x1 + width, y:y1}, {x:x + width, y:y}]); + this.polygon(bg, b, bw, bc, false, false, [{x:x, y:y}, {x:x, y:y + height}, {x:x + width, y:y + height}, {x:x + width,y: y}]); + this.polygon($.dark(bg), b, bw, bc, false, false, [{x:x + width, y:y}, {x:x1 + width, y:y1}, {x:x1 + width, y:y1 + height}, {x:x + width, y:y + height}]); + return this; + }, + cube3D : function(x, y, rotatex, rotatey, angle, w, h, zh, b, bw, bc, styles) { + /** + * styles -> lowerBottom-bottom-left-right-top-front + */ + x = fd(bw, x); + y = fd(bw, y); + zh = (!zh || zh == 0) ? w : zh; + + if (angle) { + var P = $.vectorP2P(rotatex, rotatey); + rotatex = x + zh * P.x, rotatey = y - zh * P.y; + } else { + rotatex = x + zh * rotatex, rotatey = y - zh * rotatey; + } + + while (styles.length < 6) + styles.push(false); + + rotatex = fd(bw, rotatex); + rotatey = fd(bw, rotatey); + + var side = []; + + if (rotatey < 0) { + if ($.isObject(styles[4])) + side.push($.applyIf({ + points : [{x:x,y:y - h},{x:rotatex,y:rotatey - h},{x:rotatex + w, y:rotatey - h},{x: x + w, y:y - h}] + }, styles[4])); + } else { + if ($.isObject(styles[0])) + side.push($.applyIf({ + points : [{x:x, y:y},{x: rotatex, y:rotatey},{x: rotatex + w, y:rotatey},{x: x + w,y:y}] + }, styles[0])); + } + + if ($.isObject(styles[1])) + side.push($.applyIf({ + points : [{x:rotatex, y:rotatey},{x: rotatex, y:rotatey - h}, {x:rotatex + w, y:rotatey - h},{x: rotatex + w,y:rotatey}] + }, styles[1])); + + if ($.isObject(styles[2])) + side.push($.applyIf({ + points : [{x:x, y:y}, {x:x, y:y - h},{x: rotatex, y:rotatey - h},{x: rotatex, y:rotatey}] + }, styles[2])); + + if ($.isObject(styles[3])) + side.push($.applyIf({ + points : [{x:x + w, y:y}, {x:x + w, y:y - h}, {x:rotatex + w, y:rotatey - h}, {x:rotatex + w, y:rotatey}] + }, styles[3])); + + if (rotatey < 0) { + if ($.isObject(styles[0])) + side.push($.applyIf({ + points : [{x:x,y: y}, {x:rotatex, y:rotatey}, {x:rotatex + w, y:rotatey}, {x:x + w, y:y}] + }, styles[0])); + } else { + if ($.isObject(styles[4])) + side.push($.applyIf({ + points : [{x:x, y:y - h}, {x:rotatex, y:rotatey - h}, {x:rotatex + w, y:rotatey - h}, {x:x + w, y:y - h}] + }, styles[4])); + } + + if ($.isObject(styles[5])) + side.push($.applyIf({ + points : [{x:x, y:y}, {x:x, y:y - h}, {x:x + w, y:y - h}, {x:x + w, y:y}] + }, styles[5])); + + side.each(function(s) { + this.polygon(s.color, b, bw, bc, s.shadow, s.alpha, s.points); + }, this); + + return this; + }, + polygon : function(bg, b, bw, bc, sw, alpham, p, smooth, smo,l) { + this.save().strokeStyle(b,bw, bc).beginPath().fillStyle(bg).globalAlpha(alpham).shadowOn(sw).moveTo(p[0].x,p[0].y); + if (smooth) { + this.moveTo(fd(bw,l[0].x),fd(bw,l[0].y)).lineTo(fd(bw, p[0].x), fd(bw, p[0].y)); + for ( var i = 1; i < p.length; i++) + this.bezierCurveTo(getCurvePoint(p, p[i], i, smo)); + this.lineTo(fd(bw,l[1].x),fd(bw,l[1].y)); + } else { + for ( var i = 1; i < p.length; i++) + this.lineTo(fd(bw, p[i].x), fd(bw, p[i].y)); + } + return this.closePath().stroke(b).fill(bg).restore(); + }, + lines : function(p, w, c, last) { + if(!w)return this; + this.save().gCo(last).beginPath().strokeStyle(true,w, c).moveTo(fd(w, p[0]), fd(w, p[1])); + for ( var i = 2; i < p.length - 1; i += 2) { + this.lineTo(fd(w, p[i]), fd(w, p[i + 1])); + } + return this.stroke(true).restore(); + }, + bezierCurveTo : function(r) { + this.c.bezierCurveTo(r[0], r[1], r[2], r[3], r[4], r[5]); + return this; + }, + label : function(p, w, c) { + return this.save() + .beginPath() + .strokeStyle(true,w, c) + .moveTo(fd(w, p[0].x), fd(w, p[0].y)) + .bezierCurveTo([p[1].x,p[1].y,p[2].x,p[2].y,p[3].x,p[3].y]) + .stroke(true) + .restore(); + }, + lineArray : function(p, w, c, smooth, smo) { + if(!w)return this; + this.save().beginPath().strokeStyle(true,w, c).moveTo(fd(w, p[0].x), fd(w, p[0].y)); + for ( var i = 1; i < p.length; i++){ + if (smooth) { + this.bezierCurveTo(getCurvePoint(p, p[i], i, smo || 1.5)); + } else { + this.lineTo(fd(w, p[i].x), fd(w, p[i].y)); + } + } + return this.stroke(true).restore(); + }, + dotted : function(x1, y1, x2, y2, w, c,L,f,last) { + if (!w) + return this; + x1 = fd(w, x1); + y1 = fd(w, y1); + x2 = fd(w, x2); + y2 = fd(w, y2); + var d = $.distanceP2P(x1, y1, x2, y2),t; + if(L<=0||d<=L||(x1!=x2&&y1!=y2)){ + return this.line(x1, y1, x2, y2, w, c, last); + } + if(x1>x2||y1>y2){ + t = x1; + x1 = x2; + x2 = t; + t = y1; + y1 = y2; + y2 = t; + } + this.save().gCo(last).strokeStyle(true,w, c).beginPath().moveTo(x1,y1); + var S = L*(f || 1),g = floor(d/(L+S)),k = (d-g*(L+S))>L,h=(y1==y2); + g = k?g+1:g; + for(var i=1;i<=g;i++){ + this.lineTo(h?x1+L*i+S*(i-1):x1,h?y1:y1+L*i+S*(i-1)).moveTo(h?x1+(L+S)*i:x1, h?y1:y1+(L+S)*i); + } + if(!k){ + this.lineTo(x2,y2); + } + return this.stroke(true).restore(); + }, + line : function(x1, y1, x2, y2, w, c, last) { + if (!w) + return this; + this.save().gCo(last); + return this.beginPath().strokeStyle(true,w, c).moveTo(fd(w, x1), fd(w, y1)).lineTo(fd(w, x2), fd(w, y2)).stroke(true).restore(); + }, + round : function(x, y, r, c, bw, bc) { + return this.arc(x, y, r,0, 0, PI2, c, !!bc, bw, bc); + }, + round0 : function(q, r, c, bw, bc) { + return this.arc(q.x, q.y, r,0, 0, PI2, c, !!bc, bw, bc); + }, + fillRect : function(x, y, w, h) { + this.c.fillRect(x, y, w, h); + return this; + }, + translate : function(x, y) { + this.c.translate(x, y); + return this; + }, + rotate : function(r) { + this.c.rotate(r); + return this; + }, + clearRect : function(x, y, w, h) { + x = x || 0; + y = y || 0; + w = w || this.canvas.width; + h = h || this.canvas.height; + this.c.clearRect(x, y, w, h); + return this; + }, + gCo : function(l) { + if(l) + return this.gCO(l); + return this; + }, + gCO : function(l) { + this.c.globalCompositeOperation = l ? "destination-over" : "source-over"; + return this; + }, + box : function(x, y, w, h, b, bg, shadow, m,last) { + b = b || { + enable : 0 + } + if (b.enable) { + var j = b.width, c = b.color, r = b.radius, f = $.isNumber(j); + j = $.parsePadding(j); + if(j[0]==j[1]&&j[1]==j[2]&&j[2]==j[3]){ + f = true; + } + m = m?1:-1; + w += m*(j[1] + j[3]) / 2; + h += m*(j[0] + j[2]) / 2; + x -= m*(j[3] / 2); + y -= m*(j[0] / 2); + j = f ? j[0] : j; + r = (!f ||!r|| r == 0 || r == '0') ? 0 : $.parsePadding(r); + } + + this.save().gCo(last).fillStyle(bg).strokeStyle(f,j, c); + /** + * draw a round corners border + */ + if (r) { + this.beginPath().moveTo(fd(j,x+r[0]), fd(j, y)) + .lineTo(fd(j,x+w - r[1]), fd(j, y)) + .arc2(fd(j,x+w - r[1]), fd(j, y+r[1]), r[1], PI*3/2, PI2) + .lineTo(fd(j, x+w), fd(j,y+h - r[2])) + .arc2(fd(j,x+w - r[2]), fd(j, y+h-r[2]), r[2], 0, PI/2) + .lineTo(fd(j,x+r[3]), fd(j, y+h)) + .arc2(fd(j,x+r[3]), fd(j, y+h-r[3]), r[3], PI/2, PI) + .lineTo(fd(j,x), fd(j,y+r[0])) + .arc2(fd(j,x+r[0]), fd(j, y+r[0]), r[0], PI, PI*3/2) + .closePath().shadowOn(shadow).stroke(j).shadowOff().fill(bg); + } else { + if (!b.enable || f) { + if (j&&b.enable){ + this.shadowOn(shadow).c.strokeRect(x, y, w, h); + this.shadowOff(); + } + if (bg) + this.fillRect(x, y, w, h); + } else { + if(j){ + c = $.isArray(c) ? c : [c, c, c, c]; + this.shadowOn(shadow).line(x+w, y+j[0] / 2, x+w, y+h - j[0] / 2, j[1], c[1], 0).line(x, y+j[0] / 2, x, y+h - j[0] / 2, j[3], c[3], 0).line(floor(x-j[3] / 2),y, x+w + j[1] / 2, y, j[0], c[0], 0).line(floor(x-j[3] / 2), y+h, x+w + j[1] / 2, y+h, j[2], c[2], 0).shadowOff(); + } + if (bg) { + this.beginPath().moveTo(floor(x+j[3] / 2), floor(y+j[0] / 2)).lineTo(ceil(x+w - j[1] / 2), y+j[0] / 2).lineTo(ceil(x+w - j[1] / 2), ceil(y+h - j[2] / 2)).lineTo(floor(x+j[3] / 2), ceil(y+h - j[2] / 2)).lineTo(floor(x+j[3] / 2), floor(y+j[0] / 2)).closePath().fill(bg); + } + } + + } + return this.restore(); + }, + toDataURL : function(g) { + return this.canvas.toDataURL(g || "image/png"); + }, + addEvent : function(type, fn, useCapture) { + $.Event.addEvent(this.canvas, type, fn, useCapture); + } + } + + /** + * the public method,inner use + */ + $.taylor = { + light:function(_,e){ + e.highlight = false; + _.on('mouseover',function(){ + e.highlight = true; + _.redraw('mouseover'); + }).on('mouseout',function(){ + e.highlight = false; + _.redraw('mouseout'); + }).on('beforedraw',function(){ + _.push('f_color',e.highlight?_.get('light_color'):_.get('f_color_')); + return true; + }); + } + } + + /** + * @overview this component is a super class of all chart + * @component#$.Chart + * @extend#$.Painter + */ + $.Chart = $.extend($.Painter, { + /** + * @cfg {TypeName} + */ + configure : function() { + /** + * invoked the super class's configuration + */ + $.Chart.superclass.configure.apply(this, arguments); + + /** + * indicate the element's type + */ + this.type = 'chart'; + /** + * indicate the data structure + */ + this.dataType = 'simple'; + + this.set({ + /** + * @cfg {String} The unique id of this element (defaults to an auto-assigned id). + */ + id : '', + /** + * @cfg {String} id of dom you want rendered(defaults ''). + */ + render : '', + /** + * @cfg {Array} Required,The datasource of Chart.must be not empty. + */ + data : [], + /** + * @cfg {Number} Specifies the width of this canvas + */ + width : undefined, + /** + * @cfg {Number} Specifies the height of this canvas + */ + height : undefined, + /** + * @cfg {String} Specifies the default lineJoin of the canvas's context in this element.(defaults to 'round') + */ + lineJoin : 'round', + /** + * @cfg {String} this property specifies the horizontal alignment of chart in an module (defaults to 'center') Available value are: + * @Option 'left' + * @Option 'center' + * @Option 'right' + */ + align : 'center', + /** + * @cfg {Boolean} If true mouse change to a pointer when a mouseover fired.only available when use PC.(defaults to true) + */ + default_mouseover_css : true, + /** + * @cfg {Boolean} If true ignore the event touchmove.only available when support touchEvent.(defaults to false) + */ + turn_off_touchmove : false, + /** + * @cfg {Boolean} Specifies as true to display with percent.(default to false) + */ + showpercent : false, + /** + * @cfg {Number} Specifies the number of decimal when use percent.(default to 1) + */ + decimalsnum : 1, + /** + * @cfg {Object/String} Specifies the config of Title details see $.Text,If given a string,it will only apply the text.note:If the text is empty,then will not display + */ + title : { + text : '', + fontweight : 'bold', + /** + * Specifies the font-size in pixels of title.(default to 20) + */ + fontsize : 20, + /** + * Specifies the height of title will be take.(default to 30) + */ + height : 30 + }, + /** + * @cfg {Object/String}Specifies the config of subtitle details see $.Text,If given a string,it will only apply the text.note:If the title or subtitle'text is empty,then will not display + */ + subtitle : { + text : '', + fontweight : 'bold', + /** + * Specifies the font-size in pixels of title.(default to 16) + */ + fontsize : 16, + /** + * Specifies the height of title will be take.(default to 20) + */ + height : 20 + }, + /** + * @cfg {Object/String}Specifies the config of footnote details see $.Text,If given a string,it will only apply the text.note:If the text is empty,then will not display + */ + footnote : { + text : '', + /** + * Specifies the font-color of footnote.(default to '#5d7f97') + */ + color : '#5d7f97', + textAlign : 'right', + /** + * Specifies the height of title will be take.(default to 20) + */ + height : 20 + }, + /** + * @cfg {Boolean} If true element will have a animation when show, false to skip the animation.(default to false) + */ + animation : false, + /** + * @Function {Function} the custom funtion for animation.(default to null) + */ + doAnimation : null, + /** + * @cfg {String} (default to 'ease-in-out') Available value are: + * @Option 'easeIn' + * @Option 'easeOut' + * @Option 'easeInOut' + * @Option 'linear' + */ + animation_timing_function : 'easeInOut', + /** + * @cfg {Number} Specifies the duration when animation complete in millisecond.(default to 1000) + */ + animation_duration : 1000, + /** + * @cfg {Number} Specifies the chart's z_index.override the default as 999 to make it at top layer.(default to 999) + */ + z_index:999, + /** + * @cfg {Object}Specifies the config of Legend.For details see $.Legend Note:this has a extra property named 'enable',indicate whether legend available(default to false) + */ + legend : { + enable : false + }, + /** + * @cfg {Object} Specifies the config of Tip.For details see $.Tip Note:this has a extra property named 'enable',indicate whether tip available(default to false) + */ + tip : { + enable : false + } + }); + + /** + * register the common event + */ + this.registerEvent( + /** + * @event Fires before this element Animation.Only valid when animation is true + * @paramter $.Chart#this + */ + 'beforeAnimation', + /** + * @event Fires when this element Animation finished.Only valid when animation is true + * @paramter $.Chart#this + */ + 'afterAnimation', + /** + * @event Fires when chart resize. + * @paramter int#width chart's width + * @paramter int#height chart's height + * @return Object object the new config for chart + */ + 'resize', + 'animating'); + + this.T = null; + this.Rendered = false; + this.Combination = false; + this.Animationed = false; + this.show = false; + this.data = []; + this.plugins = []; + this.components = []; + this.oneways = []; + this.total = 0; + this.ICHARTJS_CHART = true; + }, + toDataURL : function(g) { + return this.T.toDataURL(g); + }, + segmentRect : function() { + if(!this.Combination) + this.T.clearRect(); + }, + resetCanvas : function() { + if(!this.Combination) + this.T.box(this.get('l_originx'), this.get('t_originy'), this.get('client_width'), this.get('client_height'),0,this.get('f_color'),0,0,true); + }, + animation : function(_) { + /** + * clear the part of canvas + */ + _.segmentRect(); + + /** + * draw coordinate + */ + if(_.coo&&!_.ILLUSIVE_COO) + _.coo.draw(); + + /** + * doAnimation of implement + */ + _.doAnimation(_.variable.animation.time, _.duration,_); + + /** + * draw plugins + */ + _.plugins.each(function(p){ + if(p.A_draw){ + p.variable.animation.animating =true; + p.variable.animation.time =_.variable.animation.time; + p.draw(); + p.variable.animation.animating =false; + } + }); + + if(_.Combination){ + return; + } + + _.oneways.each(function(o) {o.draw()}); + + if (_.variable.animation.time < _.duration) { + _.variable.animation.time++; + $.requestAnimFrame(function() { + _.animation(_); + }); + } else { + $.requestAnimFrame(function() { + _.Animationed = true; + + /** + * make plugins's status is the same as chart + */ + _.plugins.each(function(p){ + p.Animationed = true; + }); + _.processAnimation = false; + _.draw(); + _.plugins.each(function(p){ + p.processAnimation = false; + }); + _.fireEvent(_, 'afterAnimation', [_]); + }); + } + }, + runAnimation : function(_) { + _.fireEvent(_, 'beforeAnimation', [_]); + if(!_.A_draw) + _.variable.animation = { + type : 0, + time : 0, + queue : [] + } + _.processAnimation = true; + _.animation(_); + }, + doSort:function(){ + var f = function(p, q){return ($.isArray(p)?(p.zIndex||0):p.get('z_index'))>($.isArray(q)?(q.zIndex||0):q.get('z_index'))}; + this.components.sor(f); + this.oneways.sor(f); + }, + commonDraw : function(_,e) { + _.show = false; + + if (!_.redraw) { + $.Assert.isTrue(_.Rendered, _.type + ' has not rendered'); + $.Assert.isTrue(_.data&&_.data.length>0,_.type + '\'s data is empty'); + $.Assert.isTrue(_.initialization, _.type + ' Failed to initialize'); + _.doSort(); + } + + _.redraw = true; + + if (!_.Animationed && _.get('animation')) { + _.runAnimation(_); + return; + } + _.segmentRect(); + //order? + _.components.eachAll(function(c) { + c.draw(e); + }); + _.components.eachAll(function(c) { + if(c.last)c.last(c); + }); + //order? + _.oneways.each(function(o) {o.draw()}); + + _.show = true; + }, + /** + * @method register the customize component or combinate with other charts + * @paramter $.Custom$.Chart#object + * @return void + */ + plugin : function(c) { + var _ = this._(); + c.inject(_); + if(c.ICHARTJS_CHART){ + c.Combination = true; + c.setUp(); + } + if(!_.get('animation')){ + c.push('animation',false); + } + c.duration =_.duration; + _.register(c); + _.plugins.push(c); + }, + destroy:function(_){ + _.components.eachAll(function(C){ + C.destroy(); + }); + _.oneways.each(function(O){ + O.destroy(); + }); + }, + /** + * @method return the title,return undefined if unavailable + * @return $.Text#the title object + */ + getTitle:function(){ + return this.title; + }, + /** + * @method return the subtitle,return undefined if unavailable + * @return $.Text#the subtitle object + */ + getSubTitle:function(){ + return this.subtitle; + }, + /** + * @method return the footnote,return undefined if unavailable + * @return $.Text#the footnote object + */ + getFootNote:function(){ + return this.footnote; + }, + /** + * @method return the main Drawing Area's dimension,return following property: + * x:the left-top coordinate-x + * y:the left-top coordinate-y + * width:the width of drawing area + * height:the height of drawing area + * @return Object#contains dimension info + */ + getDrawingArea:function(){ + return { + x:this.get("l_originx"), + x:this.get("t_originy"), + width:this.get("client_width"), + height:this.get("client_height") + } + }, + create : function(_,shell) { + /** + * fit the window + */ + if(_.get('fit')){ + var w = window.innerWidth, + h = window.innerHeight, + style = $.getDoc().body.style; + style.padding = "0px"; + style.margin = "0px"; + style.overflow = "hidden"; + _.push(_.W, w); + _.push(_.H, h); + } + + _.canvasid = $.uid(_.type); + _.shellid = "shell-"+_.canvasid; + + var H = []; + H.push("
                                                                      "); + H.push(""); + H.push("

                                                                      Your browser does not support the canvas element

                                                                      "); + H.push("
                                                                      "); + + /** + * also use appendChild() + */ + shell.innerHTML = H.join(""); + + _.shell = $(_.shellid); + + /** + * the base canvas wrap for draw + */ + _.T = _.target = new Cans(_.canvasid); + + /** + * do size + */ + _.size(_); + _.Rendered = true; + }, + /** + * @method set up the chart by latest configruation + * @return void + */ + setUp:function(){ + var _ = this._(); + _.redraw = false; + _.T.clearRect(); + _.initialization = false; + _.initialize(); + }, + /** + * @method load the new data + * @paramter array#data + * @return void + */ + load:function(d){ + var _ = this._(); + _.push('data', d||[]); + _.setUp(); + (_.Combination?_.root:_).draw(); + }, + /** + * @method resize the chart + * @paramter int#width + * @paramter int#height + * @return void + */ + resize:function(w,h){ + w = $.parseFloat(w); + h = $.parseFloat(h); + var _ = this._(); + if(!_.Combination){ + _.width = _.push(_.W, w); + _.height = _.push(_.H, h); + _.size(_); + } + _.set(_.fireEvent(_,'resize',[w,h])); + _.setUp(); + _.plugins.eachAll(function(P) { + if(P.Combination){ + P.resize(w,h); + } + }); + if(!_.Combination){ + _.draw(); + } + }, + size:function(_){ + _.T.canvas.width = _.width = _.pushIf(_.W, 400); + _.T.canvas.height = _.height = _.pushIf(_.H, 300); + _.shell.style.width = _.width+'px'; + _.shell.style.height = _.height+'px'; + }, + initialize : function() { + var _ = this._(),d = _.get('data'),r = _.get('render'); + + _.push(_.X, null); + _.push(_.Y, null); + + if(_.Combination){ + $.apply(_.options, $.clone([_.W,_.H,'padding','border','client_height','client_width', + 'minDistance','maxDistance','centerx', 'centery', + 'l_originx','r_originx','t_originy','b_originy'], _.root.options,true)); + _.width = _.get(_.W); + _.height = _.get(_.H); + _.shell = _.root.shell; + _.Rendered = true; + }else if (!_.Rendered) { + if(r) + _.create(_,$(r)); + } + + if(_.Rendered && !_.initialization){ + if(d&&d.length>0){ + parse.call(_,d,_); + }else if($.isString(_.get('url'))){ + _.ajax.call(_,_.get('url'),function(D){ + _.push('data',D); + _.initialize(); + _.draw(); + }); + } + } + }, + /** + * @method turn off the event listener + * @return void + */ + eventOff:function(){this.stopEvent = true}, + /** + * @method turn on the event listener + * @return void + */ + eventOn:function(){this.stopEvent = false}, + /** + * this method only invoked once + */ + oneWay:function(_){ + + _.T.strokeStyle(true,0, _.get('strokeStyle'), _.get('lineJoin')); + + _.processAnimation = _.get('animation'); + + if($.isFunction(_.get('doAnimation'))){ + _.doAnimation = _.get('doAnimation'); + } + _.animationArithmetic = $.getAA(_.get('animation_timing_function')); + + var E = _.variable.event,comb=_.Combination,tot=!_.get('turn_off_touchmove')&&!comb, mCSS = !$.touch&&_.get('default_mouseover_css')&&!comb, O, AO,events = $.touch?['touchstart','touchmove']:['click','mousemove']; + _.stopEvent = false; + _.A_draw = comb&&_.processAnimation; + + /** + * register chart in Registry + */ + $.register(_); + + /** + * If Combination,ignore binding event because of root have been do this. + */ + if(!comb){ + events.each(function(it) { + _.T.addEvent(it, function(e) { + if (_.processAnimation||_.stopEvent) + return; + if(e.targetTouches&&e.targetTouches.length!=1){ + return; + } + _.fireEvent(_, it, [_, $.Event.fix(e)]); + }, false); + }); + } + + _.on(events[0], function(_, e) { + _.components.eachAll(function(C) { + if(C.ICHARTJS_CHART){ + /** + * meaning this component is a Combination Chart + */ + if(C.fireEvent(C,events[0], [C, e])){ + E.click = true; + return false; + } + }else{ + /** + * generic component + */ + var M = C.isMouseOver(e); + if (M.valid){ + E.click = true; + C.fireEvent(C,'click', [C, e, M]); + return !e.stopPropagation; + } + } + }); + if(E.click){ + if(tot) + e.event.preventDefault(); + E.click = false; + return true; + } + }); + + if(!$.touch||tot){ + _.on(events[1], function(_, e) { + O = AO = false; + _.components.eachAll(function(C) { + if(C.ICHARTJS_CHART){ + /** + * meaning this component is a Combination Chart + */ + if(C.fireEvent(C,events[1], [C, e])){ + O = true; + return false; + } + }else{ + var cE = C.variable.event, M = C.isMouseOver(e); + if (M.valid) { + O = O || C.atomic; + if (!cE.mouseover) { + cE.mouseover = true; + C.fireEvent(C, 'mouseover', [C,e, M]); + } + C.fireEvent(C, 'mousemove', [C,e, M]); + if(M.stop){ + return false; + } + } else { + if (cE.mouseover) { + cE.mouseover = false; + C.fireEvent(C, 'mouseout', [C,e, M]); + } + } + return !e.stopPropagation; + } + }); + if(E.mouseover){ + e.event.preventDefault(); + if (!O) { + E.mouseover = false; + _.fireEvent(_, 'mouseout', [_,e]); + } + return E.mouseover; + }else{ + if(O){ + E.mouseover = O; + _.fireEvent(_, 'mouseover', [_,e]); + } + } + }); + /** + * defalut mouse style + */ + if (mCSS) { + _.on('mouseover',function(){ + _.T.css("cursor", "pointer"); + }).on('mouseout',function(){ + _.T.css("cursor", "default"); + }); + } + } + /** + * clone config to sub_option + */ + $.applyIf(_.get('sub_option'), $.clone(['shadow','tip'], _.options,true)); + + if(!_.Combination){ + /** + * push the background in it + */ + _.bg = new $.Custom({ + z_index:-1, + drawFn:function(){ + _.T.box(0, 0, _.width, _.height, _.get('border'), _.get('f_color'),0,0,true); + } + }); + _.duration = ceil(_.get('animation_duration') * $.FRAME / 1000); + } + + _.oneWay = $.emptyFn; + }, + /** + * calculate chart's alignment + */ + originXY:function(_,x,y){ + var A = _.get('align'); + if (A == _.L) { + _.pushIf(_.X, x[0]); + } else if (A == _.R) { + _.pushIf(_.X, x[1]); + } else { + _.pushIf(_.X, x[2]); + } + _.x = _.push(_.X, _.get(_.X) + _.get('offsetx')); + _.y = _.push(_.Y, y[0]+ _.get('offsety')); + + return { + x:_.x, + y:_.y + } + }, + getPercent:function(v,T){ + return this.get('showpercent') ? (v / (T||this.total||1) * 100).toFixed(this.get('decimalsnum')) + '%' : v; + }, + doActing:function(_,d,o,i,t){ + var f=!!_.get('communal_acting'),v=_.getPercent(d.value,d.total); + /** + * store or restore the option + */ + _.push(f?'sub_option':'communal_acting',$.clone(_.get(f?'communal_acting':'sub_option'),true)); + /** + * merge the option + */ + $.merge(_.get('sub_option'),d); + + /** + * merge specific option + */ + $.merge(_.get('sub_option'),o); + + _.push('sub_option.value',v); + _.push('sub_option.value_',d.value); + + if (_.get('sub_option.tip.enable')){ + _.push('sub_option.tip.text',t || (d.name + ' ' +v)); + _.push('sub_option.tip.name',d.name); + _.push('sub_option.tip.index',i); + _.push('sub_option.tip.value',d.value); + _.push('sub_option.tip.total',d.total||_.total); + } + }, + register:function(c){ + c.id = $.uid(c.type); + this.components.push(c); + return c; + }, + remove:function(_,c){ + if(c) + _.components.each(function(C,i){ + if(c.id==C.id){ + _.components.splice(i,1); + return false; + } + }); + }, + doConfig : function() { + $.Chart.superclass.doConfig.call(this); + var _ = this._(); + + _.destroy(_); + + _.oneways.length =0; + + _.oneWay(_); + + /** + * for store the option of each item in chart + */ + _.push('communal_acting',0); + + if(!_.Combination){ + _.oneways.push(_.bg); + _.push('r_originx', _.width - _.get('padding_right')); + _.push('b_originy', _.height - _.get('padding_bottom')); + + _.applyGradient(); + + if ($.isString(_.get('title'))) { + _.push('title', $.applyIf({ + text : _.get('title') + }, _.default_.title)); + } + if ($.isString(_.get('subtitle'))) { + _.push('subtitle', $.applyIf({ + text : _.get('subtitle') + }, _.default_.subtitle)); + } + + if ($.isString(_.get('footnote'))) { + _.push('footnote', $.applyIf({ + text : _.get('footnote') + }, _.default_.footnote)); + } + var H = 0, l = _.push('l_originx', _.get('padding_left')), t = _.push('t_originy', _.get('padding_top')), w = _.push('client_width', (_.width - _.get('hpadding'))), h; + + if (_.get('title.text') != ''){ + var st = _.get('subtitle.text') != ''; + H = st ? _.get('title.height') + _.get('subtitle.height') : _.get('title.height'); + t = _.push('t_originy', t + H); + _.push('title.originx', l); + _.push('title.originy', _.get('padding_top')); + _.push('title.maxwidth', w); + _.pushIf('title.width', w); + _.title = new $.Text(_.get('title'), _); + _.oneways.push(_.title); + if (st) { + _.push('subtitle.originx', l); + _.push('subtitle.originy', _.get('padding_top') + _.get('title.height')); + _.pushIf('subtitle.width', w); + _.push('subtitle.maxwidth', w); + _.subtitle = new $.Text(_.get('subtitle'), _); + _.oneways.push(_.subtitle); + } + } + + if (_.get('footnote.text') != '') { + var g = _.get('footnote.height'); + H += g; + _.push('b_originy', _.get('b_originy') - g); + _.push('footnote.originx', l); + _.push('footnote.originy', _.get('b_originy')); + _.push('footnote.maxwidth', w); + _.pushIf('footnote.width', w); + _.footnote = new $.Text(_.get('footnote'), _); + _.oneways.push(_.footnote); + } + h = _.push('client_height', (_.get(_.H) - _.get('vpadding') - _.pushIf('other_height',H))); + + _.push('minDistance', min(w, h)); + _.push('maxDistance', max(w, h)); + _.push('centerx', l + w / 2); + _.push('centery', t + h / 2); + } + + /** + * TODO legend dosize? + */ + if (_.get('legend.enable')){ + _.legend = new $.Legend($.apply({ + maxwidth : _.get('client_width'), + data : _.data + }, _.get('legend')), _); + _.oneways.push(_.legend); + } + + _.push('sub_option.tip.wrap',_.push('tip.wrap', _.shell)); + } + }); +})($); +/** + * @end + */ + + + /** + * @overview the customize componment + * @component#$.Custom + * @extend#$.Component + */ + $.Custom = $.extend($.Component,{ + configure:function(){ + /** + * invoked the super class's configuration + */ + $.Custom.superclass.configure.apply(this,arguments); + + /** + * indicate the component's type + */ + this.type = 'custom'; + + this.set({ + /** + * @cfg {Function} Specifies the customize function.(default to emptyFn) + */ + drawFn:$.emptyFn, + configFn:$.emptyFn, + /** + * @cfg {Function} Specifies the customize event valid function.(default to undefined) + */ + eventValid:undefined, + /** + * @cfg {Boolean} If true when chart animating it also invoke darw.(default to true) + */ + animating_draw:true + }); + }, + doDraw:function(_){ + _.get('drawFn').call(_,_); + }, + isEventValid:function(e,_){ + if($.isFunction(this.get('eventValid'))) + return this.get('eventValid').call(this,e,_); + return {valid:false}; + }, + doConfig:function(){ + $.Custom.superclass.doConfig.call(this); + var _ = this._(); + _.A_draw = _.get('animating_draw'); + _.variable.animation = { + animating:false, + time : 0 + }; + _.duration = 0; + _.get('configFn').call(_,_); + } +}); +/** + * @end + */ +/** + * @overview this is inner use for axis + * @component#$.Scale + * @extend#$.Component + */ +$.Scale = $.extend($.Component, { + configure : function() { + + /** + * invoked the super class's configuration + */ + $.Scale.superclass.configure.apply(this, arguments); + + /** + * indicate the component's type + */ + this.type = 'scale'; + + this.set({ + /** + * @cfg {String} Specifies alignment of this scale.(default to 'left') + */ + position : 'left', + /** + * @cfg {String} the axis's type(default to 'h') Available value are: + * @Option 'h' :horizontal + * @Option 'v' :vertical + */ + which : 'h', + /** + * @cfg {Number} Specifies value of Baseline Coordinate.(default to 0) + */ + basic_value:0, + /** + * @cfg {Boolean} indicate whether the grid is accord with scale.(default to true) + */ + scale2grid : true, + /** + * @inner {Number} + */ + distance : undefined, + /** + * @cfg {Number} Specifies the start coordinate scale value.(default to 0) + */ + start_scale : 0, + /** + * @cfg {Number} Specifies the end coordinate scale value.Note either this or property of max_scale must be has the given value.(default to undefined) + */ + end_scale : undefined, + /** + * @cfg {Number} Specifies the chart's minimal value + */ + min_scale : undefined, + /** + * @cfg {Number} Specifies the chart's maximal value + */ + max_scale : undefined, + /** + * @cfg {Number} Specifies the space of two scale.Note either this or property of scale_share must be has the given value.(default to undefined) + */ + scale_space : undefined, + /** + * @cfg {Number} Specifies the number of scale on axis.(default to 5) + */ + scale_share : 5, + /** + * @cfg {Boolean} True to display the scale line.(default to true) + */ + scale_enable : true, + /** + * @cfg {Number} Specifies the size of brush(context.linewidth).(default to 1) + */ + scale_size : 1, + /** + * @cfg {Number} Specifies the width(length) of scale.(default to 4) + */ + scale_width : 4, + /** + * @cfg {String} Specifies the color of scale.(default to 4) + */ + scale_color : '#333333', + /** + * @cfg {String} Specifies the align against axis.(default to 'center') When the property of which set to 'h',Available value are: + * @Option 'left' + * @Option 'center' + * @Option 'right' + * When the property of which set to 'v', Available value are: + * @Option 'top' + * @Option 'center' + * @Option 'bottom' + */ + scaleAlign : 'center', + /** + * @cfg {Array} the customize labels + */ + labels : [], + /** + * @cfg {$.Text} Specifies label's option. + */ + label : {}, + /** + * @cfg {Number} Specifies the distance to scale.(default to 6) + */ + text_space : 6, + /** + * @cfg {String} Specifies the align against axis.(default to 'left' or 'bottom' in v mode) When the property of which set to 'h',Available value are: + * @Option 'left' + * @Option 'right' When the property of which set to 'v', Available value are: + * @Option 'top' + * @Option 'bottom' + */ + textAlign : 'left', + /** + * @cfg {Number} Specifies the number of decimal.this will change along with scale.(default to 0) + */ + decimalsnum : 0, + /** + * @inner {String} the style of overlapping(default to 'none') Available value are: + * @Option 'square' + * @Option 'round' + * @Option 'none' + */ + join_style : 'none', + /** + * @inner {Number} + */ + join_size : 2 + }); + + this.registerEvent( + /** + * @event Fires the event when parse text,you can return a object like this:{text:'',originx:100,originy:100} to override the given. + * @paramter string#text item's text + * @paramter int#originx coordinate-x of item's text + * @paramter int#originy coordinate-y of item's text + * @paramter int#index item's index + * @paramter boolean#last If last item + */ + 'parseText'); + + }, + isEventValid : function() { + return { + valid : false + }; + }, + getScale:function(_){ + var u = [_.get('basic_value'),_.get('start_scale'),_.get('end_scale'),_.get('end_scale') - _.get('start_scale'),0]; + u[4] = $.inRange(u[1],u[2]+1,u[0])||$.inRange(u[2]-1,u[1],u[0]); + return { + range:u[4], + basic:u[4]?(u[0]-u[1]) / u[3]:0, + start : u[4]?u[0]:u[1], + end : u[2], + distance : u[3] + } + }, + /** + * from left to right,top to bottom + */ + doDraw : function(_) { + if (_.get('scale_enable')) + _.items.each(function(item) { + _.T.line(item.x0, item.y0, item.x1, item.y1, _.get('scale_size'), _.get('scale_color'), false); + }); + _.labels.each(function(l) { + l.draw(); + }); + }, + doLayout:function(x,y,_){ + if (_.get('scale_enable')) + _.items.each(function(item) { + item.x0+=x; + item.y0+=y; + item.x1+=x; + item.y1+=y; + }); + _.labels.each(function(l) { + l.doLayout(x,y,0,l); + }); + }, + doConfig : function() { + $.Scale.superclass.doConfig.call(this); + + var _ = this._(),abs = Math.abs,customL = _.get('labels').length, min_s = _.get('min_scale'), max_s = _.get('max_scale'), s_space = _.get('scale_space'), e_scale = _.get('end_scale'), start_scale = _.get('start_scale'); + + _.items = []; + _.labels = []; + _.number = 0; + + if (customL > 0) { + _.number = customL - 1; + } else { + /** + * startScale must less than minScale + */ + if (start_scale > min_s) { + start_scale = _.push('start_scale', $.floor(min_s)); + } + + /** + * end_scale must greater than maxScale + */ + if (!$.isNumber(e_scale) || e_scale < max_s) { + e_scale = $.ceil(max_s); + e_scale = _.push('end_scale', (!e_scale&&!start_scale)?1:e_scale); + } + + + if (s_space && abs(s_space) < abs(e_scale - start_scale)) { + _.push('scale_share', (e_scale - start_scale) / s_space); + } + + _.number = _.push('scale_share', abs(_.get('scale_share'))); + + /** + * value of each scale + */ + if (!s_space || s_space >( e_scale - start_scale)) { + var W = ((e_scale - start_scale)+"").indexOf('.')+1,M=1; + while(W>0){W--;M*=10;} + s_space = _.push('scale', (e_scale - start_scale)*M / _.get('scale_share')/M); + } + + if (parseInt(s_space)!=s_space && _.get('decimalsnum') == 0) { + _.push('decimalsnum',(s_space+"").substring((s_space+"").indexOf('.')+1).length); + } + } + + /** + * the real distance of each scale + */ + _.push('distanceOne', _.get('valid_distance') / _.number); + + var text, x, y, x1 = 0, y1 = 0, x0 = 0, y0 = 0, tx = 0, ty = 0, w = _.get('scale_width'), w2 = w / 2, sa = _.get('scaleAlign'), ta = _.get('position'), ts = _.get('text_space'), tbl = '',aw = _.get('coo').get('axis.width'); + + _.push('which', _.get('which').toLowerCase()); + _.isH = _.get('which') == 'h'; + if (_.isH) { + if (sa == _.O) { + y0 = -w; + } else if (sa == _.C) { + y0 = -w2; + y1 = w2; + } else { + y1 = w; + } + + if (ta == _.O) { + ty = -ts-aw[0]; + tbl = _.B; + } else { + ty = ts+aw[2]; + tbl = _.O; + } + ta = _.C; + } else { + if (sa == _.L) { + x0 = -w; + } else if (sa == _.C) { + x0 = -w2; + x1 = w2; + } else { + x1 = w; + } + tbl = 'middle'; + if (ta == _.R) { + ta = _.L; + tx = ts+aw[1]; + } else { + ta = _.R; + tx = -ts-aw[3]; + } + } + /** + * valid width only applies when there is h,then valid_height only applies when there is v + */ + for ( var i = 0; i <= _.number; i++) { + text = customL ? _.get('labels')[i] : (s_space * i + start_scale).toFixed(_.get('decimalsnum')); + x = _.isH ? _.get('valid_x') + i * _.get('distanceOne') : _.x; + y = _.isH ? _.y : _.get('valid_y') + _.get('valid_distance') - i * _.get('distanceOne'); + + _.items.push({ + x : x, + y : y, + x0 : x + x0, + y0 : y + y0, + x1 : x + x1, + y1 : y + y1 + }); + /** + * put the label into a Text? + */ + if(_.get('label')) + _.labels.push(new $.Text($.applyIf($.apply(_.get('label'), $.merge({ + text : text, + x : x, + y : y, + originx : x + tx, + originy : y + ty + }, _.fireEvent(_, 'parseText', [text, x + tx, y + ty, i, _.number == i]))), { + textAlign : ta, + textBaseline : tbl + }), _)); + + /** + * maxwidth = Math.max(maxwidth, _.T.measureText(text)); + */ + } + } +}); + +/** + * @end + */ +$.Coordinate = { + coordinate_ : function(g) { + var _ = this._(),coo = _.get('coordinate'); + + if(coo.ICHARTJS_OBJECT){ + _.x = _.push(_.X, coo.x); + _.y = _.push(_.Y, coo.y); + /** + * Imply it was illusive + */ + _.ILLUSIVE_COO = true; + return coo; + } + /** + * Apply the coordinate feature + */ + var f = '85%', + parse=$.parsePercent, + scale = _.get('coordinate.scale'), + li=_.get('scaleAlign'), + w = _.push('coordinate._width',parse(_.get('coordinate.width')||f,Math.floor(_.get('client_width')))); + h = _.push('coordinate._height',parse(_.get('coordinate.height')||f,Math.floor(_.get('client_height')))-(_.is3D()?((_.get('coordinate.pedestal_height')||22) + (_.get('coordinate.board_deep')||20)):0)); + _.push('coordinate.valid_height_value',parse(_.get('coordinate.valid_height'),h)); + _.push('coordinate.valid_width_value',parse(_.get('coordinate.valid_width'),w)); + + _.originXY(_,[_.get('l_originx'),_.get('r_originx') - w,_.get('centerx') - w / 2],[_.get('centery') - h / 2]); + + _.push('coordinate.originx', _.x); + _.push('coordinate.originy', _.y); + + /** + * invoke call back + */ + if(g)g(); + + if($.isObject(scale)){ + scale = [scale]; + } + if($.isArray(scale)){ + var ST = _.dataType != 'stacked'; + scale.each(function(s){ + /** + * applies the percent shower + */ + if(_.get('percent')&&s.position==li){ + s = $.apply(s,{ + start_scale : 0, + end_scale : 100, + scale_space : 10, + listeners:{ + parseText:function(t,x,y){ + return {text:t+'%'} + } + } + }); + } + if(!s.start_scale||(ST&&s.start_scale>_.get('minValue'))) + s.min_scale = _.get('minValue'); + if(!s.end_scale||(ST&&s.end_scale<_.get('maxValue'))) + s.max_scale = _.get('maxValue'); + }); + }else{ + _.push('coordinate.scale',{ + position : li, + scaleAlign : li, + max_scale : _.get('maxValue'), + min_scale : _.get('minValue') + }); + } + + if (_.is3D()) { + _.push('coordinate.xAngle_', _.get('xAngle_')); + _.push('coordinate.yAngle_', _.get('yAngle_')); + /** + * the Coordinate' Z is same as long as the column's + */ + _.push('coordinate.zHeight', _.get('zHeight') * _.get('bottom_scale')); + } + _.remove(_,_.coo); + return _.register(new $[_.is3D()?'Coordinate3D':'Coordinate2D'](_.get('coordinate'), _));; + } +} +/** + * @overview the coordinate2d componment + * @component#$.Coordinate2D + * @extend#$.Component + */ +$.Coordinate2D = $.extend($.Component, { + configure : function() { + /** + * invoked the super class's configurationuration + */ + $.Coordinate2D.superclass.configure.apply(this, arguments); + + /** + * indicate the component's type + */ + this.type = 'coordinate2d'; + + this.set({ + /** + * @inner {Number} + */ + sign_size : 12, + /** + * @inner {Number} + */ + sign_space : 5, + /** + * @cfg {Array} the option for scale.For details see $.Scale + */ + scale : [], + /** + * @cfg {String/Number} Here,specify as '85%' relative to client width.(default to '85%') + */ + width:'85%', + /** + * @cfg {String/Number} Here,specify as '85%' relative to client height.(default to '85%') + */ + height:'85%', + /** + * @cfg {String/Number} Specifies the valid width,less than the width of coordinate.you can applies a percent value relative to width.(default to '100%') + */ + valid_width : '100%', + /** + * @cfg {String/Number} Specifies the valid height,less than the height of coordinate.you can applies a percent value relative to width.(default to '100%') + */ + valid_height : '100%', + /** + * @cfg {Number} Specifies the linewidth of the grid.(default to 1) + */ + grid_line_width : 1, + /** + * @cfg {String} Specifies the color of the grid.(default to '#dbe1e1') + */ + grid_color : '#dbe1e1', + /** + * @cfg {Object} Specifies the stlye of horizontal grid.(default to empty object).Available property are: + * @Option solid {Boolean} True to draw a solid line.else draw a dotted line.(default to true) + * @Option size {Number} Specifies size of line segment when solid is false.(default to 10) + * @Option fator {Number} Specifies the times to size(default to 1) + * @Option width {Number} Specifies the width of grid line.(default to 1) + * @Option color {String} Specifies the color of grid line.(default to '#dbe1e1') + */ + gridHStyle : {}, + /** + * @cfg {Object} Specifies the stlye of horizontal grid.(default to empty object).Available property are: + * @Option solid {Boolean} True to draw a solid line.else draw a dotted line.(default to true) + * @Option size {Number} Specifies size of line segment when solid is false.(default to 10) + * @Option fator {Number} Specifies the times to size(default to 1) + * @Option width {Number} Specifies the width of grid line.(default to 1) + * @Option color {String} Specifies the color of grid line.(default to '#dbe1e1') + */ + gridVStyle : {}, + /** + * @cfg {Boolean} True to display grid line.(default to true) + */ + gridlinesVisible : true, + /** + * @cfg {Boolean} indicate whether the grid is accord with scale,on the premise of grids is not specify. this just give a convenient way bulid grid for default.and actual value depend on scale's scale2grid + */ + scale2grid : true, + /** + * @cfg {Object} this is grid config for custom.there has two valid property horizontal and vertical.the property's sub property is: way:the manner calculate grid-line (default to 'share_alike') Available property are: + * @Option share_alike + * @Option given_value value: when property way apply to 'share_alike' this property mean to the number of grid's line. + * when apply to 'given_value' this property mean to the distance each grid line(unit:pixel) . + * code will like: + * { + * horizontal: {way:'share_alike',value:10}, + * vertical: { way:'given_value', value:40 } + * } + */ + grids : undefined, + /** + * @cfg {Boolean} If True the grid line will be ignored when gird and axis overlap.(default to true) + */ + ignoreOverlap : true, + /** + * @cfg {Boolean} If True the grid line will be ignored when gird and coordinate's edge overlap.(default to false) + */ + ignoreEdge : false, + /** + * @inner {String} Specifies the label on x-axis + */ + xlabel : '', + /** + * @inner {String} Specifies the label on y-axis + */ + ylabel : '', + /** + * @cfg {String} Here,specify as false to make background transparent.(default to null) + */ + background_color : 0, + /** + * @cfg {Boolean} True to stripe the axis.(default to true) + */ + striped : true, + /** + * @cfg {String} Specifies the direction apply striped color.(default to 'v')Available value are: + * @Option 'h' horizontal + * @Option 'v' vertical + */ + striped_direction : 'v', + /** + * @cfg {float(0.01 - 0.5)} Specifies the factor make color dark striped,relative to background-color,the bigger the value you set,the larger the color changed.(defaults to '0.01') + */ + striped_factor : 0.01, + /** + * @cfg {Object} Specifies config crosshair.(default enable to false).For details see $.CrossHair Note:this has a extra property named 'enable',indicate whether crosshair available(default to false) + */ + crosshair : { + enable : false + }, + /** + * @cfg {Number}Override the default as -1 to make sure it at the bottom.(default to -1) + */ + z_index : -1, + /** + * @cfg {Object} Specifies style for axis of this coordinate. Available property are: + * @Option enable {Boolean} True to display the axis.(default to true) + * @Option color {String} Specifies the color of each axis.(default to '#666666') + * @Option width {Number/Array} Specifies the width of each axis, If given the a array,there must be have have 4 element, like this:[1,0,0,1](top-right-bottom-left).(default to 1) + */ + axis : { + enable : true, + color : '#666666', + width : 1 + } + }); + + this.scale = []; + this.gridlines = []; + }, + getScale : function(p,L) { + var _ = this._(),r; + for(var i=0;i<_.scale.length;i++){ + if(_.scale[i].get('position')==p){ + return _.scale[i].getScale(_.scale[i]); + } + } + if(!L){ + if(p==_.L){ + p = _.R; + }else if(p==_.R){ + p = _.L; + }else if(p==_.O){ + p = _.B; + }else{ + p = _.O; + } + return _.getScale(p,true); + } + throw new Error("there no valid scale"); + }, + isEventValid : function(e,_) { + return { + valid : e.x > _.x && e.x < (_.x + _.width) && e.y < _.y + _.height && e.y > _.y + }; + }, + doDraw : function(_) { + _.T.box(_.x, _.y, _.width, _.height, 0, _.get('f_color')); + if (_.get('striped')) { + var x, y, f = false, axis = _.get('axis.width'), c = $.dark(_.get('background_color'), _.get('striped_factor'),0); + } + var v = (_.get('striped_direction') == 'v'); + _.gridlines.each(function(g,i) { + if (_.get('striped')) { + if (f) { + if (v) + _.T.box(g.x1, g.y1 + g.width, g.x2 - g.x1, y - g.y1 - g.width, 0, c); + else + _.T.box(x + g.width, g.y2, g.x1 - x, g.y1 - g.y2, 0, c); + } + x = g.x1; + y = g.y1; + f = !f; + } + }).each(function(g) { + if(!g.overlap){ + if(g.solid){ + _.T.line(g.x1, g.y1, g.x2, g.y2, g.width, g.color); + }else{ + _.T.dotted(g.x1, g.y1, g.x2, g.y2, g.width, g.color,g.size,g.fator); + } + } + }); + _.T.box(_.x, _.y, _.width, _.height, _.get('axis'), false, _.get('shadow'),true); + _.scale.each(function(s) { + s.draw() + }); + }, + destroy:function(){ + if(this.crosshair){ + this.crosshair.destroy(); + } + }, + doCrosshair:function(_){ + if (_.get('crosshair.enable')&&!_.crosshair) { + _.push('crosshair.wrap', _.root.shell); + _.push('crosshair.height', _.height); + _.push('crosshair.width', _.width); + _.push('crosshair.top', _.y); + _.push('crosshair.left', _.x); + _.crosshair = new $.CrossHair(_.get('crosshair'), _); + } + }, + doConfig : function() { + $.Coordinate2D.superclass.doConfig.call(this); + + var _ = this._(); + + /** + * this element not atomic because it is a container,so this is a particular case. + */ + _.atomic = false; + + _.width = _.get('_width'); + _.height = _.get('_height'); + _.valid_width = _.get('valid_width_value'); + _.valid_height = _.get('valid_height_value'); + /** + * apply the gradient color to f_color + */ + if (_.get('gradient') && $.isString(_.get('f_color'))) { + _.push('f_color', _.T.avgLinearGradient(_.x, _.y, _.x, _.y + _.height, [_.get('dark_color'), _.get('light_color')])); + } + + if (_.get('axis.enable')) { + var aw = _.get('axis.width'); + if (!$.isArray(aw)) + _.push('axis.width', [aw, aw, aw, aw]); + }else{ + _.push('axis.width', [0, 0, 0, 0]); + } + + _.doCrosshair(_); + var jp, cg = !!(_.get('gridlinesVisible') && _.get('grids')), hg = cg && !!_.get('grids.horizontal'), vg = cg && !!_.get('grids.vertical'), h = _.height, w = _.width, vw = _.valid_width, vh = _.valid_height, k2g = _.get('gridlinesVisible') + && _.get('scale2grid') && !(hg && vg), sw = _.push('x_start', _.x+(w - vw) / 2), sh = _.push('y_start', _.y+(h - vh) / 2), axis = _.get('axis.width'); + + _.push('x_end', _.x + (w + vw) / 2); + _.push('y_end', _.y + (h + vh) / 2); + + if (!$.isArray(_.get('scale'))) { + if ($.isObject(_.get('scale'))) + _.push('scale', [_.get('scale')]); + else + _.push('scale', []); + } + + _.get('scale').each(function(kd, i) { + jp = kd['position']; + jp = jp || _.L; + jp = jp.toLowerCase(); + kd[_.X] = _.x; + kd['coo'] = _; + kd[_.Y] = _.y; + kd['valid_x'] = sw; + kd['valid_y'] = sh; + kd['position'] = jp; + /** + * calculate coordinate,direction,distance + */ + if (jp == _.O) { + kd['which'] = 'h'; + kd['distance'] = w; + kd['valid_distance'] = vw; + } else if (jp == _.R) { + kd['which'] = 'v'; + kd['distance'] = h; + kd['valid_distance'] = vh; + kd[_.X] += w; + kd['valid_x'] += vw; + } else if (jp == _.B) { + kd['which'] = 'h'; + kd['distance'] = w; + kd['valid_distance'] = vw; + kd[_.Y] += h; + kd['valid_y'] += vh; + } else { + kd['which'] = 'v'; + kd['distance'] = h; + kd['valid_distance'] = vh; + } + _.scale.push(new $.Scale(kd, _.root)); + }, _); + + var iol = _.push('ignoreOverlap', _.get('ignoreOverlap') && _.get('axis.enable') || _.get('ignoreEdge')); + + if (iol) { + if (_.get('ignoreEdge')) { + var ignoreOverlap = function(w, x, y) { + return w == 'v' ? (y == _.y) || (y == _.y + h) : (x == _.x) || (x == _.x + w); + } + } else { + var ignoreOverlap = function(wh, x, y) { + return wh == 'v' ? (y == _.y && axis[0] > 0) || (y == (_.y + h) && axis[2] > 0) : (x == _.x && axis[3] > 0) || (x == (_.x + w) && axis[1] > 0); + } + } + } + var g = { + solid : true, + size : 10, + fator : 1, + width : _.get('grid_line_width'), + color : _.get('grid_color') + }, + ghs = $.applyIf(_.get('gridHStyle'),g), + gvs = $.applyIf(_.get('gridVStyle'),g); + + if (k2g) { + var scale, x, y, p; + _.scale.each(function(scale) { + p = scale.get('position'); + /** + * disable,given specfiy grid will ignore scale2grid + */ + if ($.isFalse(scale.get('scale2grid')) || hg && scale.get('which') == 'v' || vg && scale.get('which') == 'h') { + return; + } + x = y = 0; + if (p == _.O) { + y = h; + } else if (p == _.R) { + x = -w; + } else if (p == _.B) { + y = -h; + } else { + x = w; + } + + scale.items.each(function(e) { + if (iol) + _.gridlines.push($.applyIf({ + overlap:ignoreOverlap.call(_, scale.get('which'), e.x, e.y), + x1 : e.x, + y1 : e.y, + x2 : e.x + x, + y2 : e.y + y + },scale.isH?gvs:ghs)); + }); + }); + } + if (vg) { + var gv = _.get('grids.vertical'); + $.Assert.isTrue(gv['value']>0, 'vertical value'); + var d = w / gv['value'], n = gv['value']; + if (gv['way'] == 'given_value') { + n = d; + d = gv['value']; + d = d > w ? w : d; + } + + for ( var i = 0; i <= n; i++) { + if (iol) + _.gridlines.push($.applyIf({ + overlap:ignoreOverlap.call(_, 'h', _.x + i * d, _.y), + x1 : _.x + i * d, + y1 : _.y, + x2 : _.x + i * d, + y2 : _.y + h, + H : false, + width : gvs.width, + color : gvs.color + },gvs)); + } + } + if (hg) { + var gh = _.get('grids.horizontal'); + $.Assert.isTrue(gh['value']>0,'horizontal value'); + var d = h / gh['value'], n = gh['value']; + if (gh['way'] == 'given_value') { + n = d; + d = gh['value']; + d = d > h ? h : d; + } + + for ( var i = 0; i <= n; i++) { + if (iol) + _.gridlines.push($.applyIf({ + overlap:ignoreOverlap.call(_, 'v', _.x, _.y + i * d), + x1 : _.x, + y1 : _.y + i * d, + x2 : _.x + w, + y2 : _.y + i * d, + H : true, + width : ghs.width, + color : ghs.color + },ghs)); + } + } + } +}); +/** + * @end + */ +/** + * @overview the coordinate3d componment + * @component#$.Coordinate3D + * @extend#$.Coordinate2D + */ +$.Coordinate3D = $.extend($.Coordinate2D, { + configure : function() { + /** + * invoked the super class's configurationuration + */ + $.Coordinate3D.superclass.configure.apply(this, arguments); + + /** + * indicate the component's type + */ + this.type = 'coordinate3d'; + this.dimension = $._3D; + + this.set({ + /** + * @cfg {Number} Three-dimensional rotation X in degree(angle).socpe{0-90},Normally, this will accord with the chart.(default to 60) + */ + xAngle : 60, + /** + * @cfg {Number} Three-dimensional rotation Y in degree(angle).socpe{0-90},Normally, this will accord with the chart.(default to 20) + */ + yAngle : 20, + xAngle_ : undefined, + yAngle_ : undefined, + /** + * @cfg {Number} Required,Specifies the z-axis deep of this coordinate,Normally, this will given by chart.(default to 0) + */ + zHeight : 0, + /** + * @cfg {Number} Specifies pedestal height of this coordinate.(default to 22) + */ + pedestal_height : 22, + /** + * @cfg {Number} Specifies board deep of this coordinate.(default to 20) + */ + board_deep : 20, + /** + * @cfg {Boolean} If true display the left board.(default to true) + */ + left_board:true, + /** + * @cfg {Boolean} Override the default as true + */ + gradient : true, + /** + * @cfg {float} Override the default as 0.18. + */ + color_factor : 0.18, + /** + * @cfg {Boolean} Override the default as true. + */ + ignoreEdge : true, + /** + * @cfg {Boolean} Override the default as false. + */ + striped : false, + /** + * @cfg {String} Override the default as '#a4ad96'. + */ + grid_color : '#a4ad96', + /** + * @cfg {String} Override the default as '#d6dbd2'. + */ + background_color : '#d6dbd2', + /** + * @cfg {Number} Override the default as 4. + */ + shadow_offsetx : 4, + /** + * @cfg {Number} Override the default as 2. + */ + shadow_offsety : 2, + /** + * @cfg {Array} Specifies the style of board(wall) of this coordinate. + * the length of array will be 6,if less than 6,it will instead of background_color.and each object option has two property. Available property are: + * @Option color the color of wall + * @Option alpha the opacity of wall + */ + wall_style : [], + /** + * @cfg {Boolean} Override the default as axis.enable = false. + */ + axis : { + enable : false + } + }); + }, + doDraw : function(_) { + var w = _.width, h = _.height, xa = _.get('xAngle_'), ya = _.get('yAngle_'), zh = _.get('zHeight'), offx = _.get('z_offx'), offy = _.get('z_offy'); + /** + * bottom + */ + if(_.get('pedestal_height')) + _.T.cube3D(_.x, _.y + h + _.get('pedestal_height'), xa, ya, false, w, _.get('pedestal_height'), zh * 3 / 2, _.get('axis.enable'), _.get('axis.width'), _.get('axis.color'), _.get('bottom_style')); + /** + * board_style + */ + if(_.get('board_deep')) + _.T.cube3D(_.x +offx, _.y+h - offy, xa, ya, false, w, h, _.get('board_deep'), _.get('axis.enable'), _.get('axis.width'), _.get('axis.color'), _.get('board_style')); + + _.T.cube3D(_.x, _.y + h, xa, ya, false, w, h, zh, _.get('axis.enable'), _.get('axis.width'), _.get('axis.color'), _.get('wall_style')); + + _.gridlines.each(function(g) { + if(g.solid){ + if(_.get('left_board')) + _.T.line(g.x1, g.y1, g.x1 + offx, g.y1 - offy,g.width, g.color); + _.T.line(g.x1 + offx, g.y1 - offy, g.x2 + offx, g.y2 - offy, g.width, g.color); + }else{ + if(_.get('left_board')) + _.T.dotted(g.x1, g.y1, g.x1 + offx, g.y1 - offy,g.width, g.color,g.size,g.fator); + _.T.dotted(g.x1 + offx, g.y1 - offy, g.x2 + offx, g.y2 - offy, g.width, g.color,g.size,g.fator); + } + }); + _.scale.each(function(s) { + s.draw(); + }); + }, + doConfig : function() { + $.Coordinate3D.superclass.doConfig.call(this); + + var _ = this._(), + ws = _.get('wall_style'), + bg = _.get('background_color')||'#d6dbd2', + h = _.height, + w = _.width, + f = _.get('color_factor'), + offx = _.push('z_offx',_.get('xAngle_') * _.get('zHeight')), + offy = _.push('z_offy',_.get('yAngle_') * _.get('zHeight')); + /** + * bottom-lower bottom-left + */ + while(ws.length < 6){ + ws.push({color : bg}); + } + if(!_.get('left_board')){ + ws[2] = false; + _.scale.each(function(s){ + s.doLayout(offx,-offy,s); + }); + } + + /** + * right-front + */ + _.push('bottom_style', [{ + color : _.get('shadow_color'), + shadow : _.get('shadow') + }, false, false, { + color : ws[3].color + },false, { + color : ws[3].color + }]); + + /** + * right-top + */ + _.push('board_style', [false, false, false,{ + color : ws[4].color + },{ + color : ws[5].color + }, false]); + + /** + * lowerBottom-bottom-left-right-top-front + */ + if (_.get('gradient')) { + if ($.isString(ws[0].color)) { + ws[0].color = _.T.avgLinearGradient(_.x, _.y + h, _.x + w, _.y + h, [$.dark(ws[0].color,f/2+0.06),$.dark(ws[0].color,f/2+0.06)]); + } + if ($.isString(ws[1].color)) { + ws[1].color = _.T.avgLinearGradient(_.x + offx, _.y - offy, _.x + offx, _.y + h - offy, [$.dark(ws[1].color,f),$.light(ws[1].color,f)]); + } + if ($.isString(ws[2].color)) { + ws[2].color = _.T.avgLinearGradient(_.x, _.y, _.x, _.y + h, [$.light(ws[2].color,f/3),$.dark(ws[2].color,f)]); + } + _.get('bottom_style')[5].color = _.T.avgLinearGradient(_.x, _.y + h, _.x, _.y + h + _.get('pedestal_height'), [$.light(ws[3].color,f/2+0.06),$.dark(ws[3].color,f/2,0)]); + } + _.push('wall_style', [ws[0],ws[1],ws[2]]); + + } +}); +/* + * @end + */ + + + /** + * @overview the base class of rectangle + * @component#$.Rectangle + * @extend#$.Component + */ + $.Rectangle = $.extend($.Component,{ + configure:function(){ + /** + * invoked the super class's configuration + */ + $.Rectangle.superclass.configure.apply(this,arguments); + + /** + * indicate the component's type + */ + this.type = 'rectangle'; + + this.set({ + /** + * @cfg {Number} Specifies the width of this element in pixels,Normally,this will given by chart.(default to 0) + */ + width:0, + /** + * @cfg {Number} Specifies the height of this element in pixels,Normally,this will given by chart.(default to 0) + */ + height:0, + /** + * @cfg {Number} the distance of column's edge and value in pixels.(default to 4) + */ + value_space:4, + /** + * @cfg {String} Specifies the text of this element,Normally,this will given by chart.(default to '') + */ + value:'', + /** + * @cfg {$.Text} Specifies the config of label,set false to make label disabled. + */ + label : {}, + /** + * @cfg {String} Specifies the name of this element,Normally,this will given by chart.(default to '') + */ + name:'', + /** + * @cfg {String} Specifies the tip alignment of chart(defaults to 'top').Available value are: + * @Option 'left' + * @Option 'right' + * @Option 'top' + * @Option 'bottom' + */ + tipAlign:'top', + /** + * @cfg {String} Specifies the value's text alignment of chart(defaults to 'top') Available value are: + * @Option 'left' + * @Option 'right' + * @Option 'middle' + * @Option 'top' + * @Option 'bottom' + */ + valueAlign:'top', + /** + * @cfg {Number} Override the default as 3 + */ + shadow_blur:3, + /** + * @cfg {Number} Override the default as -1 + */ + shadow_offsety:-1 + }); + + /** + * this element support boxMode + */ + this.atomic = true; + + this.registerEvent( + /** + * @event Fires when parse this label's data.Return value will override existing. + * @paramter $.Rectangle#rect + * @paramter string#text the current label's text + */ + 'parseText'); + + this.label = null; + }, + last:function(_){ + if(_.label) + _.label.draw(); + }, + doDraw:function(_){ + _.drawRectangle(); + }, + doConfig:function(){ + $.Rectangle.superclass.doConfig.call(this); + var _ = this._(),v = _.variable.event,vA=_.get('valueAlign'); + + /** + * mouseover light + */ + $.taylor.light(_,v); + + _.width = _.get(_.W); + _.height = _.get(_.H); + + var x = _.push('centerx',_.x + _.width/2), + y = _.push('centery',_.y + _.height/2), + a = _.C, + b = 'middle', + s=_.get('value_space'); + + + if(vA==_.L){ + a = _.R; + x = _.x - s; + }else if(vA==_.R){ + a = _.L; + x =_.x + _.width + s; + }else if(vA==_.B){ + y = _.y + _.height + s; + b = _.O; + }else if(vA==_.O){ + y = _.y - s; + b = _.B; + } + + if(_.get('label')){ + _.push('label.originx', x); + _.push('label.originy', y); + _.push('label.text',_.push('value',_.fireString(_, 'parseText', [_, _.get('value')], _.get('value')))); + $.applyIf(_.get('label'),{ + textAlign : a, + textBaseline : b, + color:_.get('color') + }); + _.label = new $.Text(_.get('label'), _); + } + + if(_.get('tip.enable')){ + if(_.get('tip.showType')!='follow'){ + _.push('tip.invokeOffsetDynamic',false); + } + _.tip = new $.Tip(_.get('tip'),_); + } + } +}); +/** + *@end + */ + /** + * @overview the rectangle2d componment + * @component#$.Rectangle2D + * @extend#$.Rectangle + */ + $.Rectangle2D = $.extend($.Rectangle,{ + configure:function(){ + /** + * invoked the super class's configuration + */ + $.Rectangle2D.superclass.configure.apply(this,arguments); + + /** + * indicate the component's type + */ + this.type = 'rectangle2d'; + + this.set({ + /** + * @cfg {Number} Override the default as -2 + */ + shadow_offsety:-2 + }); + + }, + drawRectangle:function(){ + var _ = this._(); + _.T.box( + _.get(_.X), + _.get(_.Y), + _.get(_.W), + _.get(_.H), + _.get('border'), + _.get('f_color'), + _.get('shadow')); + }, + isEventValid:function(e,_){ + return {valid:e.x>_.x&&e.x<(_.x+_.width)&&e.y<(_.y+_.height)&&e.y>(_.y)}; + }, + tipInvoke:function(){ + var _ = this._(); + /** + * base on event? + */ + return function(w,h){ + return { + left:_.tipX(w,h), + top:_.tipY(w,h) + } + } + }, + doConfig:function(){ + $.Rectangle2D.superclass.doConfig.call(this); + var _ = this._(),tipAlign = _.get('tipAlign'); + if(tipAlign==_.L||tipAlign==_.R){ + _.tipY = function(w,h){return _.get('centery') - h/2;}; + }else{ + _.tipX = function(w,h){return _.get('centerx') -w/2;}; + } + + if(tipAlign==_.L){ + _.tipX = function(w,h){return _.x - _.get('value_space') -w;}; + }else if(tipAlign==_.R){ + _.tipX = function(w,h){return _.x + _.width + _.get('value_space');}; + }else if(tipAlign==_.B){ + _.tipY = function(w,h){return _.y +_.height+3;}; + }else{ + _.tipY = function(w,h){return _.y - h -3;}; + } + + _.applyGradient(); + + + } +}); +/** + *@end + */ + /** + * @overview the rectangle3d componment + * @component#$.Rectangle3D + * @extend#$.Rectangle + */ + $.Rectangle3D = $.extend($.Rectangle,{ + configure:function(){ + /** + * invoked the super class's configuration + */ + $.Rectangle3D.superclass.configure.apply(this,arguments); + + /** + * indicate the component's type + */ + this.type = 'rectangle3d'; + this.dimension = $._3D; + + this.set({ + /** + * @cfg {Number} Specifies Three-dimensional z-axis deep in pixels.Normally,this will given by chart.(default to undefined) + */ + zHeight:undefined, + /** + * @cfg {Number} Three-dimensional rotation X in degree(angle).socpe{0-90}.Normally,this will given by chart.(default to 60) + */ + xAngle:60, + /** + * @cfg {Number} Three-dimensional rotation Y in degree(angle).socpe{0-90}.Normally,this will given by chart.(default to 20) + */ + yAngle:20, + xAngle_:undefined, + yAngle_:undefined, + /** + * @cfg {Number} Override the default as 2 + */ + shadow_offsetx:2 + }); + + }, + drawRectangle:function(){ + var _ = this._(); + _.T.cube( + _.get(_.X), + _.get(_.Y), + _.get('xAngle_'), + _.get('yAngle_'), + _.get(_.W), + _.get(_.H), + _.get('zHeight'), + _.get('f_color'), + _.get('border.enable'), + _.get('border.width'), + _.get('light_color'), + _.get('shadow') + ); + }, + isEventValid:function(e,_){ + return {valid:e.x>_.x&&e.x<(_.x+_.get(_.W))&&e.y<_.y+_.get(_.H)&&e.y>_.y}; + }, + tipInvoke:function(){ + var _ = this._(); + return function(w,h){ + return { + left:_.topCenterX - w/2, + top:_.topCenterY - h + } + } + }, + doConfig:function(){ + $.Rectangle3D.superclass.doConfig.call(this); + var _ = this._(); + _.pushIf("zHeight",_.get(_.W)); + + _.topCenterX=_.x+(_.get(_.W)+_.get(_.W)*_.get('xAngle_'))/2; + _.topCenterY=_.y-_.get(_.W)*_.get('yAngle_')/2-_.get('value_space'); + + if(_.get('valueAlign')==_.O&&_.label){ + _.label.push('textx',_.topCenterX); + _.label.push('texty',_.topCenterY); + } + + } +}); +/** + *@end + */ +/** + * @overview this component use for config sector,this is a abstract class. + * @component#$.Sector + * @extend#$.Component + */ +$.Sector = $.extend($.Component, { + configure : function() { + /** + * invoked the super class's configuration + */ + $.Sector.superclass.configure.apply(this, arguments); + + /** + * indicate the component's type + */ + this.type = 'sector'; + + this.set({ + /** + * @cfg {String} Specifies the value of this element,Normally,this will given by chart.(default to '') + */ + value : '', + /** + * @cfg {String} Specifies the name of this element,Normally,this will given by chart.(default to '') + */ + name : '', + /** + * @cfg {Boolean} True will not darw.(default to false) + */ + ignored : false, + /** + * @inner {Boolean} True to make sector counterclockwise.(default to false) + */ + counterclockwise : false, + /** + * @cfg {Number} Specifies the start angle of this sector.Normally,this will given by chart.(default to 0) + */ + startAngle : 0, + /** + * @cfg {Number} middleAngle = (endAngle - startAngle)/2.Normally,this will given by chart.(default to 0) + */ + middleAngle : 0, + /** + * @cfg {Number} Specifies the end angle of this sector.Normally,this will given by chart.(default to 0) + */ + endAngle : 0, + /** + * @cfg {Number} Specifies total angle of this sector,totalAngle = (endAngle - startAngle).Normally,this will given by chart.(default to 0) + */ + totalAngle : 0, + /** + * @inner {String} the event's name trigger pie bound(default to 'click'). + */ + bound_event : 'click', + /** + * @cfg {Boolean} True to bound this sector.(default to false) + */ + expand : false, + /** + * @cfg {Number} Specifies the width when show a donut.only applies when it not 0.(default to 0) + */ + donutwidth : 0, + /** + * @inner {Boolean} If true means just one piece could bound at same time.(default to false) + */ + mutex : false, + /** + * @inner {Number} Specifies the offset when bounded.Normally,this will given by chart.(default to undefined) + */ + increment : undefined, + label_length : undefined, + /** + * @cfg {String} Specifies the gradient mode of background.(defaults to 'RadialGradientOutIn') + * @Option 'RadialGradientOutIn' + * @Option 'RadialGradientInOut' + */ + gradient_mode : 'RadialGradientOutIn', + /** + * @cfg {Number} Specifies the threshold value in angle that applies mini_label.(default to 15) + */ + mini_label_threshold_angle : 15, + /** + * @cfg {$.Text} Specifies the config of label.when mini_label is a object,there will as a $.Text.(default to false) note:set false to make minilabel disabled. + */ + mini_label : false, + /** + * @cfg {$.Label} Specifies the config of label.when mini_label is unavailable,there will as a $.Label. note:set false to make label disabled. + */ + label : {}, + rounded:false + }); + + /** + * this element support boxMode + */ + this.atomic = true; + + this.registerEvent('changed', + /** + * @event Fires when parse this label's data.Return value will override existing. Only valid when label is available + * @paramter $.Sector#sector the sector object + * @paramter string#text the current label's text + */ + 'parseText'); + + this.label = null; + this.tip = null; + }, + bound : function() { + if (!this.expanded) + this.toggle(); + }, + rebound : function() { + if (this.expanded) + this.toggle(); + }, + toggle : function() { + this.fireEvent(this, this.get('bound_event'), [this]); + }, + /** + * @method get the sector's dimension,return hold following property + * @property x:the x-coordinate of the center of the sector + * @property y:the y-coordinate of the center of the sector + * @property startAngle:The starting angle, in radians (0 is at the 3 o'clock position of the arc's circle) + * @property endAngle:the ending angle, in radians + * @property middleAngle:the middle angle, in radians + * @return object + */ + getDimension : function() { + var _ = this._(); + return { + x : _.x, + x : _.y, + startAngle : _.get("startAngle"), + middleAngle : _.get("middleAngle"), + endAngle : _.get("endAngle") + } + }, + doDraw : function(_) { + if (!_.get('ignored')) { + if (_.label&&!_.get('mini_label')){ + _.label.draw(); + } + _.drawSector(); + if (_.label&&_.get('mini_label')){ + _.label.draw(); + } + } + }, + doText : function(_, x, y) { + _.push('label.originx', x); + _.push('label.originy', y); + _.push('label.textBaseline', 'middle'); + _.label = new $.Text(_.get('label'), _); + }, + doLabel : function(_, x, y, Q, p, x0, y0,L) { + _.push('label.originx', x); + _.push('label.originy', y); + _.push('label.quadrantd', Q); + _.push('label.line_points', p); + _.push('label.labelx', x0); + _.push('label.labely', y0); + _.push('label.smooth', L); + _.push('label.angle', _.get('middleAngle')%(Math.PI*2)); + _.label = new $.Label(_.get('label'), _); + }, + isLabel : function() { + return this.get('label') && !this.get('mini_label'); + }, + doConfig : function() { + $.Sector.superclass.doConfig.call(this); + + var _ = this._(), v = _.variable.event, f = _.get('label'),event=_.get('bound_event'),g; + + if(_.get('rounded')){ + _.push('startAngle',0); + _.push('endAngle',Math.PI*2); + return; + } + + /** + * mouseover light + */ + $.taylor.light(_,v); + + _.push('totalAngle', _.get('endAngle') - _.get('startAngle')); + + if (f) { + if (_.get('mini_label')) { + if ((_.get('mini_label_threshold_angle') * Math.PI / 180) > _.get('totalAngle')) { + _.push('mini_label', false); + } else { + $.apply(_.get('label'),_.get('mini_label')); + } + } + + _.push('label.text', _.fireString(_, 'parseText', [_,_.get('label.text')], _.get('label.text'))); + + _.pushIf('label.border.color', _.get('border.color')); + /** + * make the label's color in accord with sector + */ + _.push('label.scolor', _.get('background_color')); + } + + _.variable.event.status = _.expanded = _.get('expand'); + + if (_.get('tip.enable')) { + if (_.get('tip.showType') != 'follow') { + _.push('tip.invokeOffsetDynamic', false); + } + _.tip = new $.Tip(_.get('tip'), _); + } + + v.poped = false; + + /** + *need test profile/time + */ + _.on(event, function() { + v.poped = true; + _.expanded = !_.expanded; + _.redraw(event); + v.poped = false; + }); + + _.on('beforedraw', function(a,b) { + if(b==event){ + g = false; + _.x = _.get(_.X); + _.y = _.get(_.Y); + if (_.expanded) { + if (_.get('mutex') && !v.poped) { + _.expanded = false; + g = true; + } else { + _.x += _.get('inc_x'); + _.y -= _.get('inc_y'); + } + } + if (v.status != _.expanded) { + _.fireEvent(_, 'changed', [_, _.expanded]); + g = true; + v.status = _.expanded; + } + if (f&&g) + _.label.doLayout(_.get('inc_x') * (_.expanded ? 1 : -1), -_.get('inc_y') * (_.expanded ? 1 : -1),2,_.label); + } + return true; + }); + + } +}); +/** + * @end + */ + /** + * @overview the sector2d componment + * @component#$.Sector2D + * @extend#$.Sector + */ + $.Sector2D = $.extend($.Sector,{ + configure:function(){ + /** + * invoked the super class's configuration + */ + $.Sector2D.superclass.configure.apply(this,arguments); + + /** + * indicate the component's type + */ + this.type = 'sector2d'; + + this.set({ + /** + * @cfg {Float (0~)} Specifies the sector's radius.Normally,this will given by chart.(default to 0) + */ + radius:0 + }); + + }, + drawSector:function(){ + this.T.sector( + this.x, + this.y, + this.r, + this.get('donutwidth'), + this.get('startAngle'), + this.get('endAngle'), + this.get('f_color'), + this.get('border.enable'), + this.get('border.width'), + this.get('border.color'), + this.get('shadow'), + this.get('counterclockwise')); + }, + isEventValid:function(e,_){ + if(!_.get('ignored')){ + if(_.isLabel()&&_.label.isEventValid(e,_.label).valid){ + return {valid:true}; + } + + var r = $.distanceP2P(_.x,_.y,e.x,e.y),b=_.get('donutwidth'); + if(_.rr)){ + return {valid:false}; + } + if($.angleInRange(_.get('startAngle'),_.get('endAngle'),$.atan2Radian(_.x,_.y,e.x,e.y))){ + return {valid:true}; + } + } + return {valid:false}; + }, + tipInvoke:function(){ + var _ = this,A = _.get('middleAngle'),Q = $.quadrantd(A); + return function(w,h){ + var P = $.p2Point(_.x,_.y,A,_.r*0.8) + return { + left:(Q>=1&&Q<=2)?(P.x - w):P.x, + top:Q>=2?(P.y - h):P.y + } + } + }, + doConfig:function(){ + $.Sector2D.superclass.doConfig.call(this); + var _ = this._(); + _.r = _.get('radius'); + + if(_.get('donutwidth')>_.r){ + _.push('donutwidth',0); + } + + _.applyGradient(_.x-_.r,_.y-_.r,2*_.r*0.9,2*_.r*0.9); + + var A = _.get('middleAngle'),L = _.pushIf('increment',$.lowTo(5,_.r/10)),p2; + _.push('inc_x',L * Math.cos(2 * Math.PI -A)); + _.push('inc_y',L * Math.sin(2 * Math.PI - A)); + L *=2; + if(_.get('label')){ + if(_.get('mini_label')){ + P2 = $.p2Point(_.x,_.y,A,_.get('donutwidth')?_.r - _.get('donutwidth')/2:_.r*5/8); + _.doText(_,P2.x,P2.y); + }else{ + var Q = $.quadrantd(A), + P = $.p2Point(_.x,_.y,A,_.r + L), + C1 = $.p2Point(_.x,_.y,A,_.r + L*0.6); + P2 = $.p2Point(_.x,_.y,A,_.r); + _.doLabel(_,P2.x,P2.y,Q,[{x:P2.x,y:P2.y},{x:C1.x,y:C1.y},{x:P.x,y:P.y}],P.x,P.y,L*0.4); + } + } + } +}); +/** + * @end + */ + /** + * @overview the sector3d componment + * @component#$.Sector3D + * @extend#$.Sector + */ + $.Sector3D = $.extend($.Sector,{ + configure:function(){ + /** + * invoked the super class's configuration + */ + $.Sector3D.superclass.configure.apply(this,arguments); + + /** + * indicate the component's type + */ + this.type = 'sector3d'; + this.dimension = $._3D; + + this.set({ + /** + * @cfg {Number} Specifies major semiaxis of ellipse.Normally,this will given by chart.(default to 0) + */ + semi_major_axis:0, + /** + * @cfg {Number} Specifies minor semiaxis of ellipse.Normally,this will given by chart.(default to 0) + */ + semi_minor_axis:0, + /** + * @cfg {Float (0~)} Specifies the sector's height(thickness).Normally,this will given by chart.(default to 0) + */ + cylinder_height:0 + }); + + this.proxy = true; + }, + isEventValid:function(e,_){ + if(!_.get('ignored')){ + if(_.isLabel()&&_.label.isEventValid(e,_.label).valid){ + return {valid:true}; + } + if(!$.inEllipse(e.x - _.x,e.y-_.y,_.a,_.b)){ + return {valid:false}; + } + if($.angleZInRange(_.sA,_.eA,$.atan2Radian(_.x,_.y,e.x,e.y))){ + return {valid:true}; + } + } + return {valid:false}; + }, + p2p:function(x,y,a,z){ + return { + x:x+this.a*Math.cos(a)*z, + y:y+this.b*Math.sin(a)*z + }; + }, + tipInvoke:function(){ + var _ = this,A = _.get('middleAngle'),Q = $.quadrantd(A); + return function(w,h){ + var P = _.p2p(_.x,_.y,A,0.6); + return { + left:(Q>=2&&Q<=3)?(P.x - w):P.x, + top:Q>=3?(P.y - h):P.y + } + } + }, + doConfig:function(){ + $.Sector3D.superclass.doConfig.call(this); + var _ = this._(),ccw = _.get('counterclockwise'),mA = _.get('middleAngle'); + + _.a = _.get('semi_major_axis'); + _.b = _.get('semi_minor_axis'); + _.h = _.get('cylinder_height'); + + $.Assert.isTrue(_.a*_.b>=0,'major&minor'); + + var pi2 = 2 * Math.PI,toAngle = function(A){ + while(A<0)A+=pi2; + return Math.abs($.atan2Radian(0,0,_.a*Math.cos(A),ccw?(-_.b*Math.sin(A)):(_.b*Math.sin(A)))); + }, + L = _.pushIf('increment',$.lowTo(5,_.a/10)); + _.sA = toAngle.call(_,_.get('startAngle')); + _.eA = toAngle.call(_,_.get('endAngle')); + _.mA = toAngle.call(_,mA); + + _.push('inc_x',L * Math.cos(pi2 -_.mA)); + _.push('inc_y',L * Math.sin(pi2 - _.mA)); + L *=2; + if(_.get('label')){ + if(_.get('mini_label')){ + var P3 = _.p2p(_.x,_.y,mA,0.5); + _.doText(_,P3.x,P3.y); + }else{ + var Q = $.quadrantd(mA), + P = _.p2p(_.x,_.y,mA,L/_.a+1), + C1 = _.p2p(_.x,_.y,mA,L*0.6/_.a+1), + P2 = _.p2p(_.x,_.y,mA,1); + _.doLabel(_,P2.x,P2.y,Q,[{x:P2.x,y:P2.y},{x:C1.x,y:C1.y},{x:P.x,y:P.y}],P.x,P.y,L*0.4); + + } + } + } +}); +/** + *@end + */ +/** + * @overview the base class of pie chart + * @component#$.Pie + * @extend#$.Chart + */ +$.Pie = $.extend($.Chart, { + /** + * initialize the context for the pie + */ + configure : function() { + /** + * invoked the super class's configuration + */ + $.Pie.superclass.configure.call(this); + + this.type = 'pie'; + + this.set({ + /** + * @cfg {Float/String} Specifies the pie's radius.If given a percentage,it will relative to minDistance.(default to '100%') + */ + radius : '100%', + /** + * @cfg {Number} initial angle for first sector.(default to 0) + */ + offset_angle : 0, + /** + * @cfg {Number(0~90)} separate angle of all sector.(default to 0) + */ + separate_angle:0, + /** + * @cfg {String} the event's name trigger pie pop(default to 'click') + */ + bound_event : 'click', + /** + * @inner {Boolean} True to make sector counterclockwise.(default to false) + */ + counterclockwise : false, + /** + * @cfg {Boolean} when label's position in conflict.auto layout.(default to true). + */ + intellectLayout : true, + /** + * @cfg {Number} Specifies the distance in pixels when two label is incompatible with each other.(default 4), + */ + layout_distance : 4, + /** + * @inner {Boolean} if it has animate when a piece popd (default to false) + */ + pop_animate : false, + /** + * @cfg {Boolean} Specifies as true it means just one piece could pop (default to false) + */ + mutex : false, + /** + * @cfg {Number} Specifies the length when sector bounded.(default to 1/8 radius,and minimum is 5), + */ + increment : undefined, + /** + * @cfg {$.Sector} option of sector.Note,Pie2d depend on Sector2d and pie3d depend on Sector3d.For details see $.Sector + */ + sub_option : { + label : {} + } + }); + + this.registerEvent( + /** + * @event Fires when this element' sector bounded + * @paramter $.Sector2d#sector + * @paramter string#name + * @paramter int#index + */ + 'bound', + /** + * @event Fires when this element' sector rebounded + * @paramter $.Sector2d#sector + * @paramter string#name + * @paramter int#index + */ + 'rebound'); + this.sectors = []; + this.components.push(this.sectors); + this.ILLUSIVE_COO = true; + }, + /** + * @method Toggle sector bound or rebound by a specific index. + * @paramter int#i the index of sector + * @return void + */ + toggle : function(i) { + this.sectors[i || 0].toggle(); + }, + /** + * @method bound sector by a specific index. + * @paramter int#i the index of sector + * @return void + */ + bound : function(i) { + this.sectors[i || 0].bound(); + }, + /** + * @method rebound sector by a specific index. + * @paramter int#i the index of sector + * @return void + */ + rebound : function(i) { + this.sectors[i || 0].rebound(); + }, + /** + * @method Returns an array containing all sectors of this pie + * @return Array#the collection of sectors + */ + getSectors : function() { + return this.sectors; + }, + doAnimation : function(t, d,_) { + var si = 0, cs = _.oA; + _.sectors.each(function(s, i) { + si = _.animationArithmetic(t, 0, s.get('totalAngle'), d); + s.push('startAngle', cs); + s.push('endAngle', cs+=si); + if (!_.is3D()) + s.drawSector(); + }); + + if (_.is3D()) { + _.proxy.drawSector(); + } + }, + parse : function(_) { + _.data.each(function(d,i){ + _.doParse(_,d,i); + },_); + /** + * layout the label + */ + _.localizer(_); + }, + doParse : function(_,d, i) { + var t = d.name + ' ' +_.getPercent(d.value); + + _.doActing(_,d,null,i,t); + + _.push('sub_option.id', i); + + if(_.get('sub_option.label')) + _.push('sub_option.label.text', t); + + _.push('sub_option.listeners.changed', function(se, st, i) { + _.fireEvent(_, st ? 'bound' : 'rebound', [_, se.get('name')]); + }); + + _.sectors.push(_.doSector(_,d)); + }, + doSector:function(_){ + return new $[_.sub](_.get('sub_option'), _); + }, + dolayout : function(_,x,y,l,d,Q) { + if(_.is3D()?$.inEllipse(_.get(_.X) - x,_.topY-y,_.a,_.b):$.distanceP2P(_.get(_.X),_.topY,x,y)<_.r){ + y=_.topY-y; + l.push('labelx',_.get(_.X)+(Math.sqrt(_.r*_.r-y*y)*2+d)*(Q==0||Q==3?1:-1)); + l.localizer(l); + } + }, + localizer:function(_){ + if (_.get('intellectLayout')) { + var unlayout = [],layouted = [],d = _.get('layout_distance'),Q,x,y; + + _.sectors.each(function(f, i) { + if(f.isLabel()) + unlayout.push(f.label); + }); + + unlayout.sor(function(p, q) { + return Math.abs(Math.sin(p.get('angle'))) - Math.abs(Math.sin(q.get('angle')))>0; + }); + + unlayout.each(function(la) { + layouted.each(function(l) { + x = l.labelx, y = l.labely; + if ((la.labely <= y && (y - la.labely-1) < la.get(_.H)) || (la.labely > y && (la.labely - y-1) < l.get(_.H))) { + if ((la.labelx <= x && (x - la.labelx) < la.get(_.W)) || (la.labelx > x && (la.labelx - x) < l.get(_.W))) { + Q = la.get('quadrantd'); + la.push('labely', (la.get('labely')+ y - la.labely) + (la.get(_.H) + d)*(Q>1?-1:1)); + la.localizer(la); + _.dolayout(_,la.get('labelx'),la.get('labely')+la.get(_.H)/2*(Q<2?-1:1),la,d,Q); + } + } + }, _); + layouted.push(la); + }); + } + }, + doConfig : function() { + $.Pie.superclass.doConfig.call(this); + var _ = this._(),V,r = _.get('radius'), f = _.get('sub_option.label') ? 0.35 : 0.44,pi2=Math.PI*2; + _.sub = _.is3D()?'Sector3D':'Sector2D'; + _.sectors.zIndex = _.get('z_index'); + _.sectors.length = 0; + + _.oA = $.angle2Radian(_.get('offset_angle'))%pi2; + //If 3D,let it bigger + if (_.is3D()) + f += 0.06; + + var L = _.data.length,sepa = $.angle2Radian($.between(0,90,_.get('separate_angle'))),PI = pi2-sepa,sepa=sepa/L,eA = _.oA+sepa, sA = eA; + if(_.total==0){ + V = 1/L; + } + _.data.each(function(d, i) { + eA += (V||(d.value / _.total)) * PI; + if (i == (L - 1)) { + eA = pi2 + _.oA; + } + d.startAngle = sA; + d.endAngle = eA; + d.totalAngle = eA - sA; + d.middleAngle = (sA + eA) / 2; + sA = eA+sepa; + }, _); + + _.r = r = $.parsePercent(r,Math.floor(_.get('minDistance') * f)); + + _.topY = _.originXY(_,[r + _.get('l_originx'),_.get('r_originx') - r,_.get('centerx')],[_.get('centery')]).y; + + $.apply(_.get('sub_option'),$.clone([_.X, _.Y, 'bound_event','mutex','increment'], _.options)); + + } +}); +/** @end */ + +/** + * @overview the pie2d componment + * @component#@chart#$.Pie2D + * @extend#$.Pie + */ +$.Pie2D = $.extend($.Pie, { + /** + * initialize the context for the pie2d + */ + configure : function() { + /** + * invoked the super class's configuration + */ + $.Pie2D.superclass.configure.call(this); + + this.type = 'pie2d'; + + }, + doConfig : function() { + $.Pie2D.superclass.doConfig.call(this); + var _ = this._(); + /** + * quick config to all rectangle + */ + _.push('sub_option.radius',_.r) + _.parse(_); + + + } +}); +$.register('Pie2D'); +/** + * @end + */ +/** + * @overview the pie3d componment + * @component#@chart#$.Pie3D + * @extend#$.Pie + */ +$.Pie3D = $.extend($.Pie, { + configure : function() { + /** + * invoked the super class's configuration + */ + $.Pie3D.superclass.configure.apply(this, arguments); + + this.type = 'pie3d'; + this.dimension = $._3D; + + this.set({ + /** + * @cfg {Number} Three-dimensional rotation Z in degree(angle).socpe{0-90}.(default to 45) + */ + zRotate : 45, + /** + * @cfg {Number} Specifies the pie's thickness in pixels.(default to 30) + */ + yHeight : 30 + }); + this.positive = true; + }, + doSector : function(_,d) { + _.push('sub_option.cylinder_height', (d.cylinder_height ? d.cylinder_height * _.get('zRotate_') : _.get('cylinder_height'))); + return new $[_.sub](_.get('sub_option'), _); + }, + one:function(_){ + var layer,spaint,L = [],c = _.get('counterclockwise'), abs = function(n,M) { + /** + * If M,close to pi/2,else pi*3/2 + */ + return 1 + Math.sin(M?(n+Math.PI):n); + }, t = 'startAngle', d = 'endAngle',Q,s,e + /** + * If the inside layer visibile + */ + lay =function(C,g,z,f){ + Q = $.quadrantd(g); + if (C &&(Q ==0 || Q ==3) || (!C && (Q ==2 || Q ==1))) { + layer.push({ + g : g, + z : g==z, + x : f.x, + y : f.y, + a : f.a, + b : f.b, + color : $.dark(f.get('background_color')), + h : f.h, + F : f + }); + } + }; + + _.proxy = new $.Custom({ + z_index : _.get('z_index') + 1, + drawFn : function() { + this.drawSector(); + L = []; + _.sectors.each(function(s) { + if (s.get('label')) { + if (s.expanded) + L.push(s.label); + else + s.label.draw(); + } + }); + L.each(function(l) { + l.draw() + }); + } + }); + _.proxy.drawSector = function() { + /** + * paint bottom layer + */ + _.sectors.each(function(s, i) { + _.T.ellipse(s.x, s.y + s.h, s.a, s.b, s.get(t), s.get(d), 0, s.get('border.enable'), s.get('border.width'), s.get('border.color'), s.get('shadow'), c, true); + }, _); + layer = []; + spaint = []; + /** + * sort layer + */ + _.sectors.each(function(f) { + lay(c,f.get(t),f.get(d),f); + lay(!c,f.get(d),f.get(t),f); + spaint = spaint.concat($.visible(f.get(t),f.get(d),f)); + }, _); + + /** + * realtime sort + */ + layer.sor(function(p, q) { + var r = abs(p.g) - abs(q.g); + return r==0?p.z:r > 0; + }); + + /** + * paint inside layer + */ + layer.each(function(f, i) { + _.T.sector3D.layerDraw.call(_.T, f.x, f.y, f.a + 0.5, f.b + 0.5, c, f.h, f.g, f.color); + }, _); + + if(!_.processAnimation){ + /** + * realtime sort + */ + spaint.sor(function(p, q) { + return abs((p.s+p.e)/2,1) - abs((q.s+q.e)/2,1)<0; + }); + } + /** + * paint outside layer + */ + spaint.each(function(s, i) { + _.T.sector3D.sPaint.call(_.T, s.f.x, s.f.y, s.f.a, s.f.b, s.s, s.e, c, s.f.h, s.f.get('f_color')); + }, _); + + /** + * paint top layer + */ + _.sectors.each(function(s, i) { + _.T.ellipse(s.x, s.y, s.a, s.b, s.get(t), s.get(d), s.get('f_color'), s.get('border.enable'), s.get('border.width'), s.get('border.color'), false, false, true); + }, _); + } + _.one = $.emptyFn; + }, + doConfig : function() { + $.Pie3D.superclass.doConfig.call(this); + var _ = this._(), z = $.angle2Radian(_.get('zRotate')); + + _.push('cylinder_height', _.get('yHeight') * _.push('zRotate_',Math.abs(Math.cos(z)))); + + _.a = _.push('sub_option.semi_major_axis', _.r); + _.b = _.push('sub_option.semi_minor_axis', _.r * Math.abs(Math.sin(z))); + + _.topY = _.push('sub_option.originy', _.get(_.Y) - _.get('yHeight') / 2); + + _.parse(_); + + _.one(_); + + _.components.push(_.proxy); + } +}); +$.register('Pie3D'); +/** + * @end + */ + +/** + * @overview this component use for show a donut chart + * @component#@chart#$.Donut2D + * @extend#$.Pie + */ +$.Donut2D = $.extend($.Pie, { + /** + * initialize the context for the pie2d + */ + configure : function() { + /** + * invoked the super class's configuration + */ + $.Donut2D.superclass.configure.call(this); + + this.type = 'donut2d'; + + this.set({ + /** + * @cfg {Number} Specifies the width when show a donut.If the value lt 1,It will be as a percentage,value will be radius*donutwidth.only applies when it not 0.(default to 0.3) + */ + donutwidth : 0.3, + /** + * @cfg {Object/String} Specifies the config of Center Text details see $.Text,If given a string,it will only apply the text.note:If the text is empty,then will not display + */ + center : { + text:'', + line_height:24, + fontweight : 'bold', + /** + * Specifies the font-size in pixels of center text.(default to 24) + */ + fontsize : 24 + } + }); + }, + doConfig : function() { + $.Donut2D.superclass.doConfig.call(this); + + var _ = this._(),d='donutwidth',r = _.r; + /** + * quick config to all rectangle + */ + _.push('sub_option.radius',r) + if(_.get(d)>0){ + if(_.get(d)<1){ + _.push(d,Math.floor(r*_.get(d))); + }else if(_.get(d)>=r){ + _.push(d,0); + } + _.push('sub_option.donutwidth',_.get(d)); + } + if ($.isString(_.get('center'))) { + _.push('center', $.applyIf({ + text : _.get('center') + }, _.default_.center)); + } + + if (_.get('center.text') != '') { + _.push('center.originx',_.get(_.X)); + _.push('center.originy',_.get(_.Y)); + _.push('center.textBaseline','middle'); + _.center = new $.Text(_.get('center'), _); + _.components.push(_.center); + } + + _.parse(_); + } +}); +$.register('Donut2D'); +/** + * @end + */ +/** + * @overview this class is abstract,use for config column + * @component#$.Column + * @extend#$.Chart + */ +$.Column = $.extend($.Chart, { + /** + * initialize the context for the Column + */ + configure : function(config) { + /** + * invoked the super class's configuration + */ + $.Column.superclass.configure.call(this); + + this.type = 'column'; + + this.set({ + /** + * @cfg {$.Coordinate2D} the option for coordinate. + */ + coordinate : {}, + /** + * @cfg {Number} By default,if a width is not specified the chart will attempt to distribution in horizontally.(default to undefined) + */ + column_width : undefined, + /** + * @cfg {Number} the space of each column.this option is readOnly.(default to undefined) + */ + column_space : undefined, + /** + * @cfg {Number} the distance of column's bottom and text(default to 6) + */ + text_space : 6, + /** + * @cfg {String} the align of scale(default to 'left') Available value are: + * @Option 'left' + * @Option 'right' + */ + scaleAlign : 'left', + /** + * @cfg {$.Rectangle} Specifies option of rectangle. + */ + sub_option : {}, + /** + * @cfg {$.Text} Specifies option of label at bottom. + */ + label:{} + }); + + this.registerEvent(); + this.rectangles = []; + this.labels = []; + this.components.push(this.labels); + this.components.push(this.rectangles); + }, + doAnimation : function(t, d,_) { + var h; + _.labels.each(function(l){ + l.draw(); + }); + _.rectangles.each(function(r){ + h = Math.ceil(_.animationArithmetic(t, 0, r.height, d)); + r.push(_.Y, r.y + (r.height - h)); + r.push(_.H, h); + r.drawRectangle(); + }); + }, + /** + * @method Returns the coordinate of this element. + * @return $.Coordinate2D + */ + getCoordinate:function(){ + return this.coo; + }, + doLabel:function(_,id,text,x, y){ + _.labels.push(new $.Text($.apply(_.get('label'),{ + id : id, + text : text, + originx : x, + originy : y + }), _)); + }, + doParse : function(_,d, i, o) { + _.doActing(_,d,o,i); + }, + engine:function(_){ + var cw = _.get('column_width'), + s = _.get('column_space'), + S = _.coo.getScale(_.get('scaleAlign')), + H = _.coo.valid_height, + w2 = cw / 2, + q = cw * (_.get('group_fator') || 0), + gw = _.dataType != 'complex'?(cw + s):(_.data.length * cw + s + (_.is3D() ? (_.data.length - 1) * q : 0)), + y0 = _.coo.get('y_end'), + y = y0 - S.basic*H - (_.is3D()?(_.get('zHeight') * (_.get('bottom_scale') - 1) / 2 * _.get('yAngle_')):0), + x = s+_.coo.get('x_start'); + y0 = y0 + _.get('text_space') + _.coo.get('axis.width')[2]; + /** + * applies paramters to subClass + */ + _.doEngine(_,cw,s,S,H,w2,q,gw,x,y,y0); + }, + doConfig : function() { + $.Column.superclass.doConfig.call(this); + + var _ = this._(),c = 'column_width',z = 'z_index'; + _.sub = _.is3D()?'Rectangle3D':'Rectangle2D'; + _.rectangles.length = 0; + _.labels.length = 0; + _.rectangles.zIndex = _.get(z); + _.labels.zIndex = _.get(z) + 1; + + /** + * use option create a coordinate + */ + _.coo = $.Coordinate.coordinate_.call(_,function(){ + var L = _.data.length, W = _.get('coordinate.valid_width_value'),w_,hw,KL; + if (_.dataType == 'complex') { + KL = _.get('labels').length; + L = KL * L + (_.is3D()?(L-1)*KL*_.get('group_fator'):0); + w_= Math.floor(W / (KL + 1 + L)); + hw = _.pushIf(c,w_); + KL +=1; + }else{ + if(_.dataType == 'stacked'){ + L = _.get('labels').length; + } + w_= Math.floor(W*2 / (L * 3 + 1)); + hw = _.pushIf(c, w_); + KL = L+1; + } + + if(hw * L > W){ + hw = _.push(c, w_); + } + + /** + * the space of two column + */ + _.push('column_space', (W - hw * L) / KL); + + if (_.is3D()) { + _.push('zHeight', _.get(c) * _.get('zScale')); + _.push('sub_option.zHeight', _.get('zHeight')); + _.push('sub_option.xAngle_', _.get('xAngle_')); + _.push('sub_option.yAngle_', _.get('yAngle_')); + } + }); + _.push('sub_option.width', _.get(c)); + } + +}); +/** + * @end + */ +/** + * @overview the column2d componment + * @component#@chart#$.Column2D + * @extend#$.Column + */ +$.Column2D = $.extend($.Column, { + /** + * initialize the context for the Column2D + */ + configure : function() { + /** + * invoked the super class's configuration + */ + $.Column2D.superclass.configure.call(this); + + this.type = 'column2d'; + }, + doEngine:function(_,cw,s,S,H,w2,q,gw,x,y,y0){ + var h; + _.data.each(function(d, i) { + h = (d.value - S.start) * H / S.distance; + _.doParse(_,d, i, { + id : i, + originx :x + i * gw, + originy : y - (h>0? h :0), + height : Math.abs(h) + }); + _.rectangles.push(new $[_.sub](_.get('sub_option'), _)); + _.doLabel(_,i, d.name, x + gw * i + w2, y0); + }, _); + }, + doConfig : function() { + $.Column2D.superclass.doConfig.call(this); + + /** + * start up engine + */ + this.engine(this); + + } +}); +$.register('Column2D'); +/** + *@end + */ +/** + * @overview the column3d componment + * @component#@chart#$.Column3D + * @extend#$.Column2D + */ +$.Column3D = $.extend($.Column2D, { + /** + * initialize the context for the Column3D + */ + configure : function() { + /** + * invoked the super class's configuration + */ + $.Column3D.superclass.configure.call(this); + + this.type = 'column3d'; + this.dimension = $._3D; + + this.set({ + /** + * @cfg {$.Coordinate3D} the option for coordinate. + */ + coordinate : {}, + /** + * @cfg {Number(0~90)} Three-dimensional rotation X in degree(angle).(default to 60) + */ + xAngle : 60, + /** + * @cfg {Number(0~90)} Three-dimensional rotation Y in degree(angle).(default to 20) + */ + yAngle : 20, + /** + * @cfg {Number} Three-dimensional z-axis deep factor.frame of reference is width.(default to 1) + */ + zScale : 1, + /** + * @cfg {Number(1~)} Three-dimensional z-axis deep factor of pedestal.frame of reference is width.(default to 1.4) + */ + bottom_scale : 1.4 + }); + }, + doConfig : function() { + $.Column3D.superclass.doConfig.call(this); + } +}); +$.register('Column3D'); +/** + *@end + */ + +/** + * @overview this component will draw a cluster column2d chart. + * @component#@chart#$.ColumnMulti2D + * @extend#$.Column + */ +$.ColumnMulti2D = $.extend($.Column, { + /** + * initialize the context for the ColumnMulti2D + */ + configure : function() { + /** + * invoked the super class's configuration + */ + $.ColumnMulti2D.superclass.configure.call(this); + + this.type = 'columnmulti2d'; + this.dataType = 'complex'; + + this.set({ + /** + * @cfg {Array} the array of labels close to the axis + */ + labels : [] + }); + + }, + doEngine:function(_,cw,s,S,H,w2,q,gw,x,y,y0){ + var h; + _.columns.each(function(c, i) { + c.item.each(function(d, j) { + h = (d.value - S.start) * H / S.distance; + _.doParse(_, d, j, { + id : i + '_' + j, + originx : x + j * (cw + q) + i * gw, + originy : y - (h > 0 ? h : 0), + height : Math.abs(h) + }); + _.rectangles.push(new $[_.sub](_.get('sub_option'), _)); + }, _); + + _.doLabel(_, i, c.name, x - s * 0.5 + (i + 0.5) * gw, y0); + }, _); + }, + doConfig : function() { + $.ColumnMulti2D.superclass.doConfig.call(this); + + /** + * start up engine + */ + this.engine(this); + } +}); +$.register('ColumnMulti2D'); +/** + * @end + */ + +/** + * @overview this component will draw a cluster column3d chart. + * @component#@chart#$.ColumnMulti3D + * @extend#$.ColumnMulti2D + */ +$.ColumnMulti3D = $.extend($.ColumnMulti2D, { + /** + * initialize the context for the ColumnMulti3D + */ + configure : function() { + /** + * invoked the super class's configuration + */ + $.ColumnMulti3D.superclass.configure.call(this); + + this.type = 'columnmulti3d'; + this.dataType = 'complex'; + this.dimension = $._3D; + + this.set({ + /** + * @cfg {Number(0~90)} Three-dimensional rotation X in degree(angle).(default to 60) + */ + xAngle : 60, + /** + * @cfg {Number(0~90)} Three-dimensional rotation Y in degree(angle).(default to 20) + */ + yAngle : 20, + /** + * @cfg {Number} Three-dimensional z-axis deep factor.frame of reference is width.(default to 1) + */ + zScale : 1, + group_fator : 0.3, + /** + * @cfg {Number(1~)} Three-dimensional z-axis deep factor of pedestal.frame of reference is width.(default to 1.4) + */ + bottom_scale : 1.4 + }); + }, + doConfig : function() { + $.ColumnMulti3D.superclass.doConfig.call(this); + + + } +}); +$.register('ColumnMulti3D'); +/** + * @end + */ + +/** + * @overview the stacked column2d componment + * @component#@chart#$.ColumnStacked2D + * @extend#$.Column + */ +$.ColumnStacked2D = $.extend($.Column, { + /** + * initialize the context for the ColumnStacked2D + */ + configure : function() { + /** + * invoked the super class's configuration + */ + $.ColumnStacked2D.superclass.configure.call(this); + + this.type = 'columnstacked2d'; + /** + * indicate the data structure + */ + this.dataType = 'stacked'; + + this.set({ + /** + * @cfg {Boolean} Specifies as true to display with percent.(default to false) + */ + percent : false, + /** + * @cfg {Array} the array of labels close to the axis + */ + labels : [], + sub_option:{ + label:{color:'#ffffff'}, + valueAlign:'middle' + } + }); + + }, + doEngine:function(_,cw,s,S,H,w2,q,gw,x,y,y0){ + var h0,h,v,p = _.get('percent'); + _.columns.each(function(c, i) { + h0 = 0; + v = p?100/c.total:1; + c.item.each(function(d, j) { + h = (d.value*v - S.start) * H / S.distance; + d.total = c.total; + _.doParse(_, d, j, { + id : i + '_' + j, + originx : x + i * gw, + originy : y - (h > 0 ? h : 0)-h0, + height : Math.abs(h) + }); + h0 += h; + _.rectangles.push(new $[_.sub](_.get('sub_option'), _)); + }, _); + _.doLabel(_, i, c.name, x - s * 0.5 + (i + 0.5) * gw, y0); + }, _); + }, + doConfig : function() { + $.ColumnStacked2D.superclass.doConfig.call(this); + /** + * start up engine + */ + this.engine(this); + } +}); +$.register('ColumnStacked2D'); +/** + *@end + */ +/** + * @overview the stacked column2d componment + * @component#@chart#$.ColumnStacked3D + * @extend#$.ColumnStacked2D + */ +$.ColumnStacked3D = $.extend($.ColumnStacked2D, { + /** + * initialize the context for the ColumnStacked2D + */ + configure : function() { + /** + * invoked the super class's configuration + */ + $.ColumnStacked3D.superclass.configure.call(this); + + this.type = 'columnstacked3d'; + /** + * indicate the data structure + */ + this.dataType = 'stacked'; + + this.dimension = $._3D; + + this.set({ + /** + * @cfg {Boolean} Specifies as true to display with percent.(default to false) + */ + percent : false, + sub_option:{ + label:{color:'#ffffff'}, + valueAlign:'middle' + }, + /** + * @cfg {$.Coordinate3D} the option for coordinate. + */ + coordinate : {}, + /** + * @cfg {Number(0~90)} Three-dimensional rotation X in degree(angle).(default to 60) + */ + xAngle : 60, + /** + * @cfg {Number(0~90)} Three-dimensional rotation Y in degree(angle).(default to 20) + */ + yAngle : 20, + /** + * @cfg {Number} Three-dimensional z-axis deep factor.frame of reference is width.(default to 1) + */ + zScale : 1, + /** + * @cfg {Number(1~)} Three-dimensional z-axis deep factor of pedestal.frame of reference is width.(default to 1.4) + */ + bottom_scale : 1.4 + }); + + + }, + doConfig : function() { + $.ColumnStacked3D.superclass.doConfig.call(this); + } +}); +$.register('ColumnStacked3D'); +/** + *@end + */ +/** + * @overview this class is abstract,use for config bar + * @component#$.Bar + * @extend#$.Chart + */ +$.Bar = $.extend($.Chart, { + /** + * initialize the context for the bar + */ + configure : function() { + /** + * invoked the super class's configuration + */ + $.Bar.superclass.configure.call(this); + + this.type = 'bar'; + this.set({ + /** + * @cfg {$.Coordinate2D} the option for coordinate. + */ + coordinate : { + striped_direction : 'h' + }, + /** + * @cfg {Number} Specifies the width of each bar(default to calculate according to coordinate's height) + */ + bar_height : undefined, + /** + * @cfg {Number} the space of each column.this option is readOnly.(default to undefined) + */ + bar_space : undefined, + /** + * @cfg {Number} Specifies the distance of bar's bottom and text(default to 6) + */ + text_space : 6, + /** + * @cfg {String} Specifies the align of scale(default to 'bottom') Available value are: + * @Option 'bottom' + */ + scaleAlign : 'bottom', + /** + * @cfg {$.Rectangle} Specifies option of rectangle. + */ + sub_option : {}, + /** + * @cfg {$.Text} Specifies option of label at left. + */ + label : {} + }); + }, + /** + * @method Returns the coordinate of this element. + * @return $.Coordinate2D + */ + getCoordinate : function() { + return this.coo; + }, + doLabel : function(_,id, text, x, y) { + _.labels.push(new $.Text($.apply(_.get('label'), { + id : id, + text : text, + textAlign : 'right', + textBaseline : 'middle', + originx : x, + originy : y + }), _)); + }, + doParse : function(_, d, i, o) { + _.doActing(_, d, o,i); + }, + engine:function(_){ + var bh = _.get('bar_height'), + s = _.get('bar_space'), + S = _.coo.getScale(_.get('scaleAlign')), + W = _.coo.valid_width, + h2 = bh / 2, + gw = _.dataType != 'complex'?bh + s:_.data.length * bh + s, + x = _.coo.get('x_start')+ S.basic * W, + x0 = _.coo.get(_.X) - _.get('text_space')-_.coo.get('axis.width')[3], + y0 = _.coo.get('y_start')+ s; + + _.doEngine(_,bh,s,S,W,h2,gw,x,x0,y0); + }, + doAnimation : function(t, d,_) { + _.labels.each(function(l) { + l.draw(); + }); + _.rectangles.each(function(r) { + r.push(_.W, Math.ceil(_.animationArithmetic(t, 0, r.width, d))); + r.drawRectangle(); + }); + }, + doConfig : function() { + $.Bar.superclass.doConfig.call(this); + + var _ = this._(), b = 'bar_height', z = 'z_index'; + + _.rectangles = []; + _.labels = []; + _.rectangles.zIndex = _.get(z); + _.labels.zIndex = _.get(z) + 1; + _.components.push(_.labels); + _.components.push(_.rectangles); + + /** + * use option create a coordinate + */ + _.coo = $.Coordinate.coordinate_.call(_,function(){ + var L = _.data.length, H = _.get('coordinate.valid_height_value'),h_,bh,KL; + + if (_.dataType == 'complex') { + KL = _.get('labels').length; + L = KL * L + (_.is3D()?(L-1)*KL*_.get('group_fator'):0); + h_= Math.floor(H / (KL + 1 + L)); + bh = _.pushIf(b,h_); + KL +=1; + }else{ + if(_.dataType == 'stacked'){ + L = _.get('labels').length; + } + h_= Math.floor(H*2 / (L * 3 + 1)); + bh = _.pushIf(b, h_); + KL = L+1; + } + + if (bh * L > H) { + bh = _.push(b, h_); + } + /** + * the space of two bar + */ + _.push('bar_space', (H - bh * L) / KL); + + }); + + /** + * quick config to all rectangle + */ + _.push('sub_option.height', _.get(b)); + _.push('sub_option.valueAlign', _.R); + _.push('sub_option.tipAlign', _.R); + } + +}); +/** + * @end + */ + +/** + * @overview this component will draw a bar2d chart. + * @component#@chart#$.Bar2D + * @extend#$.Bar + */ +$.Bar2D = $.extend($.Bar, { + /** + * initialize the context for the pie + */ + configure : function() { + /** + * invoked the super class's configuration + */ + $.Bar2D.superclass.configure.call(this); + + this.type = 'bar2d'; + + }, + doEngine:function(_,bh,s,S,W,h2,gw,x,x0,y0){ + var w; + _.data.each(function(d, i) { + w = (d.value - S.start) * W / S.distance; + _.doParse(_, d, i, { + id : i, + originy : y0 + i * gw, + width : Math.abs(w), + originx : x + (w > 0 ? 0 : -Math.abs(w)) + }); + + _.rectangles.push(new $.Rectangle2D(_.get('sub_option'), _)); + _.doLabel(_,i, d.name, x0, y0 + i * gw + h2); + }, _); + }, + doConfig : function() { + $.Bar2D.superclass.doConfig.call(this); + /** + * start up engine + */ + this.engine(this); + } +}); +$.register('Bar2D'); +/** + * @end + */ + +/** + * @overview this component will draw a cluster bar2d chart. + * @component#@chart#$.BarMulti2D + * @extend#$.Bar + */ +$.BarMulti2D = $.extend($.Bar, { + /** + * initialize the context for the BarMulti2D + */ + configure : function() { + /** + * invoked the super class's configuration + */ + $.BarMulti2D.superclass.configure.call(this); + + this.type = 'barmulti2d'; + this.dataType = 'complex'; + + this.set({ + /** + * @cfg {Array} the array of labels close to the axis + */ + labels : [] + }); + }, + doEngine:function(_,bh,s,S,W,h2,gw,x,x0,y0){ + var w; + _.columns.each(function(c, i) { + c.item.each(function(d, j) { + w = (d.value - S.start) * W / S.distance; + _.doParse(_, d, j, { + id : i + '_' + j, + originy : y0 + j * bh + i * gw, + width : Math.abs(w), + originx: x+(w>0?0:-Math.abs(w)) + }); + _.rectangles.push(new $.Rectangle2D(_.get('sub_option'), _)); + }, _); + _.doLabel(_,i, c.name, x0, y0 - s * 0.5 + (i + 0.5) * gw); + }, _); + }, + doConfig : function() { + $.BarMulti2D.superclass.doConfig.call(this); + /** + * start up engine + */ + this.engine(this); + } +}); +$.register('BarMulti2D'); +/** + * @end + */ + +/** + * @overview the stacked bar2d componment + * @component#@chart#$.BarStacked2D + * @extend#$.Bar + */ +$.BarStacked2D = $.extend($.Bar, { + /** + * initialize the context for the BarStacked2D + */ + configure : function() { + /** + * invoked the super class's configuration + */ + $.BarStacked2D.superclass.configure.call(this); + + this.type = 'barstacked2d'; + /** + * indicate the data structure + */ + this.dataType = 'stacked'; + + this.set({ + /** + * @cfg {Boolean} Specifies as true to display with percent.(default to false) + */ + percent : false, + /** + * @cfg {Array} the array of labels close to the axis + */ + labels : [], + sub_option:{ + label:{color:'#ffffff'}, + valueAlign:'middle' + } + }); + + }, + doEngine:function(_,bh,s,S,W,h2,gw,x,x0,y0){ + var w0,w,v,p = _.get('percent'); + _.columns.each(function(c, i) { + w0 = 0; + v = p?100/c.total:1; + c.item.each(function(d, j) { + w = (d.value*v - S.start) * W / S.distance; + d.total = c.total; + _.doParse(_, d, j, { + id : i + '_' + j, + originy : y0 + i * gw, + originx : x + (w > 0 ? 0 : -Math.abs(w))+w0, + width : Math.abs(w) + }); + w0 += w; + _.rectangles.push(new $.Rectangle2D(_.get('sub_option'), _)); + }, _); + _.doLabel(_, i, c.name,x0, y0 - s * 0.5 + (i + 0.5) * gw); + }, _); + }, + doConfig : function() { + $.BarStacked2D.superclass.doConfig.call(this); + + this.push('sub_option.valueAlign', this.C); + /** + * start up engine + */ + this.engine(this); + } +}); +$.register('BarStacked2D'); +/** + *@end + */ +/** + * @overview the line segment componment + * @component#$.LineSegment + * @extend#$.Component + */ +$.LineSegment = $.extend($.Component, { + configure : function() { + /** + * invoked the super class's configuration + */ + $.LineSegment.superclass.configure.apply(this, arguments); + + /** + * indicate the component's type + */ + this.type = 'linesegment'; + + this.set({ + /** + * @cfg {Number} Specifies the default linewidth of the canvas's context in this element.(defaults to 1) + */ + brushsize : 1, + /** + * @cfg {Boolean} If true there show a point when Line-line intersection(default to true) + */ + intersection : true, + /** + * @cfg {$.Text} Specifies the config of label,set false to make label disabled. + */ + label : {}, + /** + * @cfg {String} Specifies the shape of two line segment' point(default to 'round').Only applies when intersection is true Available value are: + * @Option 'round' + */ + sign : 'round', + /** + * @cfg {String} Specifies the bgcolor when applies a Area.If not given,use lighter bgcolor of line.(default to null) + */ + area_color:null, + /** + * @cfg {Boolean} If true the centre of point will be hollow.(default to true) + */ + hollow : true, + /** + * @cfg {Boolean} If true the color of the centre of point will be hollow_color.else will be background_color.(default to true) + */ + hollow_inside:true, + /** + * @cfg {String} Specifies the bgcolor when hollow applies true.(default to '#FEFEFE') + */ + hollow_color : '#FEFEFE', + /** + * @cfg {Boolean} If true Line will smooth.(default to false) + */ + smooth : false, + /** + * @cfg {Number} Specifies smoothness of line will be.(default to 1.5) + * 1 means control points midway between points, 2 means 1/3 from the point,formula is 1/(smoothing + 1) from the point + */ + smoothing : 1.5, + /** + * @cfg {Number} Specifies the size of point.(default size 6).Only applies when intersection is true + */ + point_size : 6, + /** + * @inner {Array} the set of points to compose line segment + */ + points : [], + /** + * @inner {Boolean} If true the event accord width coordinate.(default to false) + */ + keep_with_coordinate : false, + /** + * @cfg {Number} Override the default as 1 + */ + shadow_blur : 1, + /** + * @cfg {Number} Override the default as 1 + */ + shadow_offsety : 1, + /** + * @inner {Number} Specifies the space between two point + */ + point_space : 0, + /** + * @inner {Object} reference of coordinate + */ + coordinate : null, + /** + * @cfg {Number} Specifies the valid range of x-direction.(default to 0) + */ + event_range_x : 0, + /** + * @cfg {Boolean} If true tip show when the mouse must enter the valid distance of axis y.(default to false) + */ + limit_y : false, + /** + * @cfg {Number} Specifies the space between the tip and point.(default to 2) + */ + tip_offset : 2, + /** + * @cfg {Number} Specifies the valid range of y-direction.(default to 0) + */ + event_range_y : 0 + }); + + this.registerEvent( + /** + * @event Fires when parse this label's data.Return value will override existing. + * @paramter $.LineSegment#seg + * @paramter string#text the current label's text + */ + 'parseText'); + + this.tip = null; + }, + drawSegment : function() { + var _ = this._(); + + _.polygons.each(function(P){ + _.T.polygon.apply(_.T,P); + }); + + _.T.shadowOn(_.get('shadow')); + + _.lines.each(function(L){ + _.T.lineArray.apply(_.T,L); + }); + + _.intersections.each(function(I){ + if(_.sign_plugin){ + _.sign_plugin_fn.apply(_,I); + }else{ + _.T.round0.apply(_.T,I); + } + }); + + if (_.get('shadow')) { + _.T.shadowOff(); + } + }, + doDraw : function(_) { + _.drawSegment(); + if (_.get('label')) { + _.labels.each(function(l){ + l.draw(); + }); + } + }, + isEventValid : function() {}, + tipInvoke : function() { + var x = this.x, y = this.y, o = this.get('tip_offset'), s = this.get('point_size') + o, _ = this; + return function(w, h, m) { + var l = m.left, t = m.top; + l = ((_.tipPosition < 3 && (l - w - x - o > 0)) || (_.tipPosition > 2 && (l - w - x - o < 0))) ? l - (w + o) : l + o; + t = _.tipPosition % 2 == 0 ? t + s : t - h - s; + return { + left : l, + top : t + } + } + }, + PP:function(_,p,x1,y1,x2,y2){ + if(_.get('area')){ + _.polygons.push([_.get('area_color')||_.get('light_color2'),0,_.get('brushsize'),0,0,_.get('area_opacity'),_.get('smooth')?p:[{x:x1,y:y1}].concat(p.concat([{x:x2,y:y2}])),_.get('smooth'),_.get('smoothing') || 1.5,[{x:x1,y:y1},{x:x2,y:y2}]]); + } + }, + parse:function(_){ + _.polygons = []; + _.lines = []; + _.intersections = []; + _.labels = []; + + var p = _.get('points'),I = _.get('intersection'),L = !!_.get('label'), T = [],Q = false,s = _.get('smooth'), sm = _.get('smoothing') || 1.5, b = _.get('f_color'), h = _.get('brushsize'),ps=_.get('point_size'); + + if (I) { + var f = _.getPlugin('sign'),g=b,j = _.get('hollow_color'); + _.sign_plugin = $.isFunction(f); + _.sign_plugin_fn = f; + if(_.get('hollow_inside')){ + g = j; + j = b; + } + } + + p.each(function(q){ + q.x_ = q.x; + q.y_ = q.y; + if(!q.ignored&&L){ + _.push('label.originx', q.x); + _.push('label.originy', q.y-ps/2-1); + _.push('label.text',_.fireString(_, 'parseText', [_, q.value],q.value)); + $.applyIf(_.get('label'),{ + textBaseline : 'bottom', + color:_.get('f_color') + }); + _.labels.push(new $.Text(_.get('label'), _)) + } + if(q.ignored&&Q){ + _.lines.push([T, h, b, s, sm]); + _.PP(_,T,T[0].x,_.y,T[T.length-1].x,_.y); + T = []; + Q = false; + }else if(!q.ignored){ + T.push(q); + Q = true; + } + + if(I&&!q.ignored){ + _.intersections.push(_.sign_plugin?[_.T,_.get('sign'),q,ps,q.color||g,q.hollow_color||j]:_.get('hollow')?[q, ps/2-h+1,q.color||g,h+1,q.hollow_color||j]:[q,ps/2,q.color||g]); + } + + }); + + if(T.length){ + _.lines.push([T, h, b, s, sm]); + _.PP(_,T,T[0].x,_.y,T[T.length-1].x,_.y); + } + }, + doConfig : function() { + $.LineSegment.superclass.doConfig.call(this); + $.Assert.isTrue(this.get('point_space')>0,'point_space'); + + var _ = this._(), ps = _.get('point_size') * 3 / 2, sp = _.get('point_space'), ry = _.get('event_range_y'), rx = _ + .get('event_range_x'), heap = _.get('tipInvokeHeap'), p = _.get('points'), N = _.get('name'); + + _.parse(_); + + if (rx <= 0||rx > sp / 2) { + rx = _.push('event_range_x', sp / 2); + } + + if (ry == 0) { + ry = _.push('event_range_y', ps/2); + } + + if (_.get('tip.enable')) { + /** + * _ use for tip coincidence + */ + _.on('mouseover', function(c,e, m) { + heap.push(_); + _.tipPosition = heap.length; + }).on('mouseout', function(c,e, m) { + heap.pop(); + }); + _.push('tip.invokeOffsetDynamic', true); + _.tip = new $.Tip(_.get('tip'), _); + } + + var c = _.get('coordinate'), ly = _.get('limit_y'), k = _.get('keep_with_coordinate'), valid = function(p0, x, y) { + if (!p0.ignored&&Math.abs(x - (p0.x)) < rx && (!ly || (ly && Math.abs(y - (p0.y)) < ry))) { + return true; + } + return false; + }, to = function(i) { + return { + valid : true, + name : N, + value : p[i].value, + text : p[i].text, + top : p[i].y, + left : p[i].x, + i:i, + hit : true + }; + }; + + /** + * override the default method + */ + _.isEventValid = function(e) { + if (c && !c.isEventValid(e,c).valid) { + return { + valid : false + }; + } + + var ii = Math.floor((e.x - _.x) / sp); + + if (ii < 0 || ii >= (p.length - 1)) { + ii = $.between(0, p.length - 1, ii); + if (valid(p[ii], e.x, e.y)) + return to(ii); + else + return { + valid : k + }; + } + + /** + * calculate the pointer's position will between which two point?this function can improve location speed + */ + for ( var i = ii; i <= ii + 1; i++) { + if (valid(p[i], e.x, e.y)) + return to(i); + } + return { + valid : k + }; + } + + } +}); +/** + *@end + */ + +/** + * @overview this class is abstract,use for config line + * @component#$.Line + * @extend#$.Chart + */ +$.Line = $.extend($.Chart, { + /** + * initialize the context for the line + */ + configure : function() { + /** + * invoked the super class's configuration + */ + $.Line.superclass.configure.call(this); + + this.type = 'line'; + + this.set({ + /** + * @cfg {Number} Specifies the default linewidth of the canvas's context in this element.(defaults to 1) + */ + brushsize : 1, + /** + * @cfg {Object} the option for coordinate + */ + coordinate : { + axis : { + width : [0, 0, 2, 2] + } + }, + /** + * @cfg {Object} Specifies config crosshair.(default enable to false).For details see $.CrossHair Note:this has a extra property named 'enable',indicate whether crosshair available(default to false) + */ + crosshair : { + enable : false + }, + /** + * @cfg {Function} when there has more than one linesegment,you can use tipMocker make them as a tip.(default to null) + * @paramter Array tips the array of linesegment's tip + * @paramter int the index of data + * @return String + */ + tipMocker:null, + /** + * @cfg {Number(0.0~1.0)} If null,the position there will follow the points.If given a number,there has a fixed postion,0 is top,and 1 to bottom.(default to null) + */ + tipMockerOffset:null, + /** + * @cfg {String} the align of scale.(default to 'left') Available value are: + * @Option 'left' + * @Option 'right' + */ + scaleAlign : 'left', + /** + * @cfg {String} the align of label.(default to 'bottom') Available value are: + * @Option 'top,'bottom' + */ + labelAlign : 'bottom', + /** + * @cfg {Array} the array of labels close to the axis + */ + labels : [], + /** + * @inner {Number} the distance of column's bottom and text.(default to 6) + */ + label_space : 6, + /** + * @inner {Boolean} if the point are proportional space.(default to true) + */ + proportional_spacing : true, + /** + * @cfg {$.LineSegment} the option for linesegment. + */ + sub_option : {}, + /** + * {Object} the option for legend. + */ + legend : { + sign : 'bar' + }, + /** + * @cfg {$.Text} Specifies option of label at bottom. + */ + label:{} + }); + + this.registerEvent( + /** + * @event Fires when parse this element'data.Return value will override existing. + * @paramter object#data the data of one linesegment + * @paramter object#v the point's value + * @paramter int#x coordinate-x of point + * @paramter int#y coordinate-y of point + * @paramter int#index the index of point + * @return Object object Detail: + * @property text the text of point + * @property x coordinate-x of point + * @property y coordinate-y of point + */ + 'parsePoint'); + + this.lines = []; + this.components.push(this.lines); + }, + /** + * @method Returns the coordinate of this element. + * @return $.Coordinate2D + */ + getCoordinate : function() { + return this.coo; + }, + doConfig : function() { + $.Line.superclass.doConfig.call(this); + var _ = this._(), s = _.data.length == 1; + + _.lines.length = 0; + _.lines.zIndex = _.get('z_index'); + + var k = _.pushIf('sub_option.keep_with_coordinate',s); + if (_.get('crosshair.enable')) { + _.pushIf('crosshair.hcross', s); + _.push('crosshair.invokeOffset', function(e, m) { + /** + * TODO how fire muti line?now fire by first line + */ + var r = _.lines[0].isEventValid(e); + return r.valid ? r : k; + }); + } + + if(!_.Combination){ + _.push('coordinate.crosshair', _.get('crosshair')); + _.pushIf('coordinate.scale',[{ + position : _.get('scaleAlign'), + max_scale : _.get('maxValue') + }, { + position : _.get('labelAlign'), + start_scale : 1, + scale : 1, + end_scale : _.get('maxItemSize'), + labels : _.get('labels'), + label:_.get('label') + }]); + } + + /** + * use option create a coordinate + */ + _.coo = $.Coordinate.coordinate_.call(_); + + if(_.Combination){ + _.coo.push('crosshair', _.get('crosshair')); + _.coo.doCrosshair(_.coo); + } + + var vw = _.coo.valid_width,nw=vw,size=_.get('maxItemSize') - 1,M=vw / (size),ps=_.get('point_space'); + + if (_.get('proportional_spacing')){ + if(ps&&ps1?1:f)):null; + _.push('tip.invokeOffset',function(w,h,m){ + if(f!=null){ + m.top = y+(H-h)*f; + }else{ + m.top = m.maxTop-(m.maxTop-m.minTop)/3-h; + if(h>H||y>m.top){ + m.top = y; + } + } + return { + left:(m.left - w - x > 5)?m.left-w-5:m.left+5, + top:m.top + } + }); + /** + * proxy the event parseText + */ + var p = _.get('tip.listeners.parseText'); + if(p) + delete _.get('tip.listeners').parseText; + _.mocker = new $.Custom({ + eventValid:function(e){ + r = _.lines[0].isEventValid(e); + r.hit = r0 != r.i; + if(r.valid){ + r0 = r.i; + U = []; + _.lines.each(function(l,i){ + r1 = l.isEventValid(e); + if(i==0){ + r.minTop = r.maxTop = r1.top; + }else{ + r.minTop = Math.min(r.minTop,r1.top); + r.maxTop = Math.max(r.maxTop,r1.top); + } + U.push(p?p(null,r1.name,r1.value,r1.text,r1.i):(r1.name+' '+r1.value)); + }); + r.text = _.get('tipMocker').call(_,U,r.i)||'tipMocker not return'; + } + return r.valid ? r : false; + } + }); + new $.Tip(_.get('tip'),_.mocker); + _.register(_.mocker); + } + } + _.pushIf('sub_option.area_opacity',_.get('area_opacity')); + } + +}); +/** + * @end + */ + +/** + * @overview this component will draw a line2d chart. + * @component#@chart#$.LineBasic2D + * @extend#$.Line + */ +$.LineBasic2D = $.extend($.Line, { + /** + * initialize the context for the LineBasic2D + */ + configure : function() { + /** + * invoked the super class's configuration + */ + $.LineBasic2D.superclass.configure.call(this); + + this.type = 'basicline2d'; + + this.tipInvokeHeap = []; + }, + doAnimation : function(t, d,_) { + _.lines.each(function(l){ + l.get('points').each(function(p){ + p.y = l.y - Math.ceil(_.animationArithmetic(t, 0, l.y - p.y_, d)); + }); + l.drawSegment(); + }); + }, + doConfig : function() { + $.LineBasic2D.superclass.doConfig.call(this); + var _ = this._(); + + /** + * get the max/min scale of this coordinate for calculated the height + */ + var S, H = _.coo.valid_height, sp = _.get('point_space'), points, x, y, + ox = _.get('sub_option.originx'), oy, p; + + _.push('sub_option.tip.showType', 'follow'); + _.push('sub_option.coordinate', _.coo); + _.push('sub_option.tipInvokeHeap', _.tipInvokeHeap); + _.push('sub_option.point_space', sp); + _.data.each(function(d, i) { + S = _.coo.getScale(d.scaleAlign||_.get('scaleAlign')); + oy = _.get('sub_option.originy')- S.basic*H; + points = []; + d.value.each(function(v, j) { + x = sp * j; + y = (v - S.start) * H / S.distance; + p = { + x : ox + x, + y : oy - y, + value : v, + text : d.name+' '+v + }; + $.merge(p, _.fireEvent(_, 'parsePoint', [d, v, x, y, j,S])); + points.push(p); + }, _); + /** + * merge the option + */ + $.merge(_.get('sub_option'),d); + + _.push('sub_option.points', points); + _.push('sub_option.brushsize', d.linewidth || d.line_width); + _.lines.push(new $.LineSegment(_.get('sub_option'), _)); + }, this); + } +}); +$.register('LineBasic2D'); +/** + * @end + */ + +/** + * @overview the area2d componment + * @component#@chart#$.Area2D + * @extend#$.LineBasic2D + */ +$.Area2D = $.extend($.LineBasic2D, { + /** + * initialize the context for the area2d + */ + configure : function() { + /** + * invoked the super class's configuration + */ + $.Area2D.superclass.configure.call(this); + + this.type = 'area2d'; + + this.set({ + /** + * @cfg {Float} Specifies the opacity of this area.(default to 0.3) + */ + area_opacity : 0.3 + }); + + }, + doConfig : function() { + /** + * must apply the area's config before + */ + this.push('sub_option.area', true); + $.Area2D.superclass.doConfig.call(this); + } +}); +$.register('Area2D'); +/** + * @end + */ + +})(iChart); diff --git a/src/main/webapp/js/jslib.js b/src/main/webapp/js/jslib.js index e8854c0..49a8f8f 100644 --- a/src/main/webapp/js/jslib.js +++ b/src/main/webapp/js/jslib.js @@ -1,617 +1,617 @@ -/** - * 说明:JavaScript 函数库 - * 日期:2004-06-02 - * 修改:2004-12-11 文本框验证同时支持多行文本框 - */ - -var JSLib_RegExp_Mobile=/^(13|15|18|14)[0-9]{9}$/; //手机号码 -var JSLib_RegExp_Trim = /(^\s+)|(\s+$)/g; // 实现Trim的正则表达式 -var JSLib_RegExp_Int = /^(\+|-)?\d+$/; // 整数 -var JSLib_RegExp_Float = /^(\+|-)?\d+\.\d+$/; // 浮点数(必须有小数点和小数) -var JSLib_RegExp_Date = /^([12]\d{3})([-\/\.])([01]?\d)\2([0-3]?\d)$/; // 日期 - -var JSLib_RegExp_Num = /^\d+$/; // 无符号整数 -var JSLib_RegExp_StrNum = /^[A-Za-z0-9]+$/; // 字符或数字 -var JSLib_RegExp_Email = /^[\w-]+@[\w-]+\.[\w-]+\.?[\w-]*$/; // email - - - -JSLib_RegExp_Trim.compile(JSLib_RegExp_Trim); -JSLib_RegExp_Int.compile(JSLib_RegExp_Int); -JSLib_RegExp_Float.compile(JSLib_RegExp_Float); -JSLib_RegExp_Date.compile(JSLib_RegExp_Date); -JSLib_RegExp_Num.compile(JSLib_RegExp_Num); -JSLib_RegExp_StrNum.compile(JSLib_RegExp_StrNum); -JSLib_RegExp_Email.compile(JSLib_RegExp_Email); - - -//是否是合法的手机号码 -String.prototype.isMobile = function() { - return JSLib_RegExp_Mobile.test(this); -} - -// 字符串全有数字组成 -String.prototype.isNumStr = function() { - return JSLib_RegExp_Num.test(this); -} - -// 字符串全有数字、字母组成 -String.prototype.isNumCharStr = function() { - return JSLib_RegExp_StrNum.test(this); -} - -// 是否email地址 -String.prototype.isEmail = function() { - return JSLib_RegExp_Email.test(this); -} - -// 删除字符串前后空格 -String.prototype.trim = function() { - return this.replace(JSLib_RegExp_Trim, ""); -} - -// 计算字符串的长度(一个中文算2个字符) -String.prototype.size = function() { - var size = 0; - var length = this.length; - var c; - for (var i = 0; i < length; i ++) { - c = this.charCodeAt(i); - if (c < 127) { - size ++; - } else { - size += 2; - } - } - return size; -} - -// 字符串是否整数(可前导正负号) -String.prototype.isInt = function() { - return JSLib_RegExp_Int.test(this); -} - -// 字符串是否浮点数(可前导正负号,必须有小数点) -String.prototype.isFloat = function() { - return JSLib_RegExp_Float.test(this); -} - -// 字符串是否数字(可前导正负号,可有小数点,如果有小数点,则小数点后应该有数字) -String.prototype.isNum = function() { - return (this.isInt() || this.isFloat()); -} - -// 字符串是否合法日期(合法日期:yyyy-mm-dd,分隔符可以为-/.) -String.prototype.isDate = function() { - var year,month,date,day; - - if (!JSLib_RegExp_Date.test(this)) return false; - - year = parseInt(RegExp.$1,10); - month = parseInt(RegExp.$3,10) - 1; - date = parseInt(RegExp.$4,10); - day = new Date(year,month,date); - - return ((date == day.getDate()) && (month == day.getMonth())); -} - -// 返回两个日期之间的时间间隔,以天为单位(date1-date2=?) -function dateDiff(date1,date2) { - var year,month,date,day1,day2; - - JSLib_RegExp_Date.test(date1); - year = parseInt(RegExp.$1,10); - month = parseInt(RegExp.$3,10) - 1; - date = parseInt(RegExp.$4,10); - day1 = new Date(year,month,date); - - JSLib_RegExp_Date.test(date2); - year = parseInt(RegExp.$1,10); - month = parseInt(RegExp.$3,10) - 1; - date = parseInt(RegExp.$4,10); - day2 = new Date(year,month,date); - - return (day1.getTime() - day2.getTime()) / 86400000; -} - -// 对一组复选框作反向选择操作(特别说明:如果checkbox只有一个,那么length为null) -function reverseSelect(checkboxs) { - if (checkboxs != null) { - var length = checkboxs.length; - if (length == null) { - if (!checkboxs.disabled) checkboxs.checked = !checkboxs.checked; - } else { - var checkbox; - for (var i = 0; i < length; i ++) { - checkbox = checkboxs[i]; - if (!checkbox.disabled) checkbox.checked = !checkbox.checked; - } - } - } -} - -// 一组单选钮或复选钮是否被选中至少一个 -function isChecked(os) { - if (os == null) return false; - var length = os.length; - if (length == null) return os.checked; - for (var i = 0; i < length; i ++) { - if (os[i].checked) return true; - } - return false; -} - -// 返回被选中的单/复选钮(复选钮只返回第一个被选中的) -function getChecked(os) { - var o = null; - if (os != null) { - var length = os.length; - if (length == null) { - if (os.checked) o = os; - } else { - for (var i = 0; i < length; i ++) { - if (os[i].checked) { - o = os[i]; - break; - } - } - } - } - return o; -} - -// 返回列表被选择的选项(option) -function getSelectedOption(select) { - var index = select.selectedIndex; - if (index == -1) { - return null; - } else { - return select.options[index]; - } -} - -// 检查检查框(单/复)是否被选中 -function validateCheck(os,label) { - if (os == null) { - alert(label + "没有可供选择的选项。"); - return false; - } - if (!isChecked(os)) { - alert("请选择" + label + "。"); - if (os.length == null) { - if (!os.disabled) os.focus(); - } else { - if (!os[0].disabled) os[0].focus(); - } - return false; - } - return true; -} - -// 检查列表是否被选择 -function validateSelect(select,label,begin) { - if (select.selectedIndex == -1) { - alert(label + "没有可供选择的选项。"); - return false; - } else { - if (select.selectedIndex < begin) { - alert("请选择" + label); - return false; - } else { - return true; - } - } -} - -/** - * 检查用户输入文本是否合法,返回值为true/fasle - * arg[0] 要检查的文本框对象 Object.type = text - * arg[1] 文本框标题 String - * arg[2] 是否必须输入 boolean - * arg[3] 最大长度(为零表示不限) int - * arg[4] 指定长度(为零表示不限) int - */ -function validateStr() { - - if (arguments.length == 0) { - alert("错误:参数不足,至少需要一个参数。"); - return false; - } - - var textbox = arguments[0]; - if (textbox == null || textbox.type.indexOf("text") == -1) { - alert("错误:参数错误,第一个参数必须是文本框对象。" + arguments[1]); - return false; - } - - var label = arguments[1]; - if (label == null) label = "输入"; - - var mandatory = arguments[2]; - if (mandatory == null) mandatory = true; - - var maxLength = arguments[3]; - if (maxLength == null) maxLength = 0; - - var speLength = arguments[4]; - if (speLength == null) speLength = 0; - - textbox.value = textbox.value.trim(); - var value = textbox.value; - if (mandatory && (value == "")) { - alert(label + "不能为空,请重新输入。"); - textbox.focus(); - return false; - } - - if ((maxLength > 0) && (value.size() > maxLength)) { - alert(label + "长度过大,最多为" + maxLength + "个字符。"); - textbox.focus(); - return false; - } - - if ((speLength > 0) && (value.size() != speLength)) { - alert(label + "长度错误,应该为" + speLength + "个字符。"); - textbox.focus(); - return false; - } - - return true; -} -/** - * 检查用户输入文本是否合法(two),返回值为true/fasle - * arg[0] 要检查的文本框对象 Object.type = text - * arg[1] 文本框标题 String - * arg[2] 是否必须输入 boolean - * arg[3] 最大长度(为零表示不限) int - * arg[4] 最小长度 int - */ -function validateStrTwo() { - - if (arguments.length == 0) { - alert("错误:参数不足,至少需要一个参数。"); - return false; - } - - var textbox = arguments[0]; - if (textbox == null || textbox.type.indexOf("text") == -1) { - alert("错误:参数错误,第一个参数必须是文本框对象。" + arguments[1]); - return false; - } - - var label = arguments[1]; - if (label == null) label = "输入"; - - var mandatory = arguments[2]; - if (mandatory == null) mandatory = true; - - var maxLength = arguments[3]; - if (maxLength == null) maxLength = 0; - - var speLength = arguments[4]; - if (speLength == null) speLength = 0; - - textbox.value = textbox.value.trim(); - var value = textbox.value; - if (mandatory && (value == "")) { - alert(label + "不能为空,请重新输入。"); - textbox.focus(); - return false; - } - - if ((maxLength > 0) && (value.size() > maxLength)) { - alert(label + "长度过大,最多为" + maxLength + "个字符。"); - textbox.focus(); - return false; - } - - if ((speLength > 0) && (value.size() < speLength)) { - alert(label + "长度错误,应该为" + speLength + "(包含)个字符以上。"); - textbox.focus(); - return false; - } - - return true; -} -/** - * 检查用户输入是否整数 - * arg[0] 要检查的文本框对象 Object.type = text - * arg[1] 文本框标题 String - * arg[2] 是否必须输入 boolean - * arg[3] 输入的最小值(null表示不限) int - * arg[4] 输入的最大值(null表示不限) int - */ -function validateInt() { - if (arguments.length == 0) { - alert("错误:参数不足,至少需要一个参数。"); - return false; - } - - var textbox = arguments[0]; - if (textbox == null || textbox.type != "text") { - alert("错误:参数错误,第一个参数必须是文本框对象。"); - return false; - } - - var label = arguments[1]; - if (label == null) label = "输入"; - - var mandatory = arguments[2]; - if (mandatory == null) mandatory = true; - - var min = arguments[3]; - var max = arguments[4]; - - textbox.value = textbox.value.trim(); - var value = textbox.value; - if (mandatory || (value != "")) { - if (!value.isInt()) { - alert(label + "应该是一个整数,请重新输入。"); - textbox.select(); - textbox.focus(); - return false; - } - } - - if (min != null && (min > parseInt(value,10))) { - alert(label + "不能小于" + min + ",请重新输入。"); - textbox.select(); - textbox.focus(); - return false; - } - - if (max != null && (max < parseInt(value,10))) { - alert(label + "不能大于" + max + ",请重新输入。"); - textbox.select(); - textbox.focus(); - return false; - } - - return true; -} - -/** - * 检查用户输入是否数字 - * arg[0] 要检查的文本框对象 Object.type = text - * arg[1] 文本框标题 String - * arg[2] 是否必须输入 boolean - * arg[3] 输入的最小值(null表示不限) int - * arg[4] 输入的最大值(null表示不限) int - */ -function validateNum() { - if (arguments.length == 0) { - alert("错误:参数不足,至少需要一个参数。"); - return false; - } - - var textbox = arguments[0]; - if (textbox == null || textbox.type != "text") { - alert("错误:参数错误,第一个参数必须是文本框对象。"); - return false; - } - - var label = arguments[1]; - if (label == null) label = "输入"; - - var mandatory = arguments[2]; - if (mandatory == null) mandatory = true; - - var min = arguments[3]; - var max = arguments[4]; - - textbox.value = textbox.value.trim(); - var value = textbox.value; - if (mandatory || (value != "")) { - if (!value.isNum()) { - alert(label + "应该是一个数字,请重新输入。"); - textbox.select(); - textbox.focus(); - return false; - } - } - - if (min != null && (min > parseFloat(value))) { - alert(label + "不能小于" + min + ",请重新输入。"); - textbox.select(); - textbox.focus(); - return false; - } - - if (max != null && (max < parseFloat(value))) { - alert(label + "不能大于" + max + ",请重新输入。"); - textbox.select(); - textbox.focus(); - return false; - } - - return true; -} - -/** - * 检查用户输入是否合法日期 - * arg[0] 要检查的文本框对象 Object.type = text - * arg[1] 文本框标题 String - * arg[2] 是否必须输入 boolean - */ -function validateDate() { - if (arguments.length == 0) { - alert("错误:参数不足,至少需要一个参数。"); - return false; - } - - var textbox = arguments[0]; - if (textbox == null || textbox.type != "text") { - alert("错误:参数错误,第一个参数必须是文本框对象。"); - return false; - } - - var label = arguments[1]; - if (label == null) label = "输入"; - - var mandatory = arguments[2]; - if (mandatory == null) mandatory = true; - - textbox.value = textbox.value.trim(); - var value = textbox.value; - if (mandatory || (value != "")) { - if (!value.isDate()) { - alert(label + "不是一个合法的日期,正确的日期格式是YYYY-MM-DD,请重新输入。"); - textbox.select(); - textbox.focus(); - return false; - } - } - return true; -} - -/** - * 检查用户输入的2个日期大小关系(第一个日期小于第二个日期,返回真,否则返回假并弹出警告框) - * arg[0] 第一个文本框对象 Object.type = text - * arg[1] 第二个文本框对象 Object.type = text - * arg[2] 第一个日期提示 String - * arg[2\3] 第二个日期提示 String - */ -function validateDateDiff() { - if (arguments.length < 2) { - alert("错误:参数不足,至少需要二个参数。"); - return false; - } - - var textbox1 = arguments[0],textbox2 = arguments[1]; - - if (textbox1 == null || textbox1.type != "text") { - alert("错误:参数错误,第一个参数必须是文本框对象。"); - return false; - } - - if (textbox2 == null || textbox2.type != "text") { - alert("错误:参数错误,第二个参数必须是文本框对象。"); - return false; - } - - var label1 = arguments[2],label2 = arguments[3]; - - if (dateDiff(textbox1.value,textbox2.value) > 0) { - if (label1 == null || label2 == null) { - alert("错误:日期大小不符。"); - } else { - alert(label1 + "应该小于" + label2 + "。"); - } - textbox1.select(); - textbox1.focus(); - return false; - } else { - return true; - } -} - -/** - * 写cookie - * name cookie名称 - * value cookie值 - * expireDays 过期天数(和当天比较),若设为负数,则可以删除cookie - */ -function setCookie(name,value,expireDays) { - var date = new Date(); - date.setTime(date.getTime() + 86400000 * expireDays); - document.cookie = name + "=" + escape(value) + ";expires=" + date.toGMTString(); -} - -// 取得cookie值 -function getCookie(name) { - var search = name + "="; - var cookies = document.cookie; - if (cookies.length > 0) { - var offset = cookies.indexOf(search); - if (offset != -1) { - offset += search.length; - end = cookies.indexOf(";", offset); - if (end == -1) end = cookies.length; - return unescape(cookies.substring(offset, end)); - } - } - return ""; -} - - -// 检查文本框输入是否只由字母数字组成 -function validateNumCharStr() { - if (arguments.length == 0) { - alert("错误:参数不足,至少需要一个参数。"); - return false; - } - - var textbox = arguments[0]; - if (textbox == null || textbox.type.indexOf("text") == -1) { - alert("错误:参数错误,第一个参数必须是文本框对象。"); - return false; - } - - var label = arguments[1]; - if (label == null) label = "输入"; - - if (!textbox.value.isNumCharStr()) { - alert(label + "只能由字母和数字组成。"); - textbox.focus(); - return false; - } - - return true; -} - - - -// 检查文本框输入是否只由数字组成 -function validateNumStr() { - if (arguments.length == 0) { - alert("错误:参数不足,至少需要一个参数。"); - return false; - } - - var textbox = arguments[0]; - if (textbox == null || textbox.type.indexOf("text") == -1) { - alert("错误:参数错误,第一个参数必须是文本框对象。"); - return false; - } - - var label = arguments[1]; - if (label == null) label = "输入"; - if (!textbox.value.isNumStr()) { - alert(label + "只能由数字组成。"); - textbox.focus(); - return false; - } - - return true; -} - -// 检查文本框输入是否email -function validateEmailStr(textbox) { - if (textbox.value != "") { - if (!textbox.value.isEmail()) { - alert("请输入正确有效的EMAIL地址。"); - textbox.focus(); - return false; - } - } - - return true; -} - - - -/** - * 给pub.js的方法加壳 - */ -var pub = {}; - - -/** - * 判断是否为空 - */ -pub.isEmpty = function(obj){ - if(typeof obj != undefined && obj != '' && obj != null){ - return false; - } - return true; -} +/** + * 说明:JavaScript 函数库 + * 日期:2004-06-02 + * 修改:2004-12-11 文本框验证同时支持多行文本框 + */ + +var JSLib_RegExp_Mobile=/^(13|15|18|14)[0-9]{9}$/; //手机号码 +var JSLib_RegExp_Trim = /(^\s+)|(\s+$)/g; // 实现Trim的正则表达式 +var JSLib_RegExp_Int = /^(\+|-)?\d+$/; // 整数 +var JSLib_RegExp_Float = /^(\+|-)?\d+\.\d+$/; // 浮点数(必须有小数点和小数) +var JSLib_RegExp_Date = /^([12]\d{3})([-\/\.])([01]?\d)\2([0-3]?\d)$/; // 日期 + +var JSLib_RegExp_Num = /^\d+$/; // 无符号整数 +var JSLib_RegExp_StrNum = /^[A-Za-z0-9]+$/; // 字符或数字 +var JSLib_RegExp_Email = /^[\w-]+@[\w-]+\.[\w-]+\.?[\w-]*$/; // email + + + +JSLib_RegExp_Trim.compile(JSLib_RegExp_Trim); +JSLib_RegExp_Int.compile(JSLib_RegExp_Int); +JSLib_RegExp_Float.compile(JSLib_RegExp_Float); +JSLib_RegExp_Date.compile(JSLib_RegExp_Date); +JSLib_RegExp_Num.compile(JSLib_RegExp_Num); +JSLib_RegExp_StrNum.compile(JSLib_RegExp_StrNum); +JSLib_RegExp_Email.compile(JSLib_RegExp_Email); + + +//是否是合法的手机号码 +String.prototype.isMobile = function() { + return JSLib_RegExp_Mobile.test(this); +} + +// 字符串全有数字组成 +String.prototype.isNumStr = function() { + return JSLib_RegExp_Num.test(this); +} + +// 字符串全有数字、字母组成 +String.prototype.isNumCharStr = function() { + return JSLib_RegExp_StrNum.test(this); +} + +// 是否email地址 +String.prototype.isEmail = function() { + return JSLib_RegExp_Email.test(this); +} + +// 删除字符串前后空格 +String.prototype.trim = function() { + return this.replace(JSLib_RegExp_Trim, ""); +} + +// 计算字符串的长度(一个中文算2个字符) +String.prototype.size = function() { + var size = 0; + var length = this.length; + var c; + for (var i = 0; i < length; i ++) { + c = this.charCodeAt(i); + if (c < 127) { + size ++; + } else { + size += 2; + } + } + return size; +} + +// 字符串是否整数(可前导正负号) +String.prototype.isInt = function() { + return JSLib_RegExp_Int.test(this); +} + +// 字符串是否浮点数(可前导正负号,必须有小数点) +String.prototype.isFloat = function() { + return JSLib_RegExp_Float.test(this); +} + +// 字符串是否数字(可前导正负号,可有小数点,如果有小数点,则小数点后应该有数字) +String.prototype.isNum = function() { + return (this.isInt() || this.isFloat()); +} + +// 字符串是否合法日期(合法日期:yyyy-mm-dd,分隔符可以为-/.) +String.prototype.isDate = function() { + var year,month,date,day; + + if (!JSLib_RegExp_Date.test(this)) return false; + + year = parseInt(RegExp.$1,10); + month = parseInt(RegExp.$3,10) - 1; + date = parseInt(RegExp.$4,10); + day = new Date(year,month,date); + + return ((date == day.getDate()) && (month == day.getMonth())); +} + +// 返回两个日期之间的时间间隔,以天为单位(date1-date2=?) +function dateDiff(date1,date2) { + var year,month,date,day1,day2; + + JSLib_RegExp_Date.test(date1); + year = parseInt(RegExp.$1,10); + month = parseInt(RegExp.$3,10) - 1; + date = parseInt(RegExp.$4,10); + day1 = new Date(year,month,date); + + JSLib_RegExp_Date.test(date2); + year = parseInt(RegExp.$1,10); + month = parseInt(RegExp.$3,10) - 1; + date = parseInt(RegExp.$4,10); + day2 = new Date(year,month,date); + + return (day1.getTime() - day2.getTime()) / 86400000; +} + +// 对一组复选框作反向选择操作(特别说明:如果checkbox只有一个,那么length为null) +function reverseSelect(checkboxs) { + if (checkboxs != null) { + var length = checkboxs.length; + if (length == null) { + if (!checkboxs.disabled) checkboxs.checked = !checkboxs.checked; + } else { + var checkbox; + for (var i = 0; i < length; i ++) { + checkbox = checkboxs[i]; + if (!checkbox.disabled) checkbox.checked = !checkbox.checked; + } + } + } +} + +// 一组单选钮或复选钮是否被选中至少一个 +function isChecked(os) { + if (os == null) return false; + var length = os.length; + if (length == null) return os.checked; + for (var i = 0; i < length; i ++) { + if (os[i].checked) return true; + } + return false; +} + +// 返回被选中的单/复选钮(复选钮只返回第一个被选中的) +function getChecked(os) { + var o = null; + if (os != null) { + var length = os.length; + if (length == null) { + if (os.checked) o = os; + } else { + for (var i = 0; i < length; i ++) { + if (os[i].checked) { + o = os[i]; + break; + } + } + } + } + return o; +} + +// 返回列表被选择的选项(option) +function getSelectedOption(select) { + var index = select.selectedIndex; + if (index == -1) { + return null; + } else { + return select.options[index]; + } +} + +// 检查检查框(单/复)是否被选中 +function validateCheck(os,label) { + if (os == null) { + alert(label + "没有可供选择的选项。"); + return false; + } + if (!isChecked(os)) { + alert("请选择" + label + "。"); + if (os.length == null) { + if (!os.disabled) os.focus(); + } else { + if (!os[0].disabled) os[0].focus(); + } + return false; + } + return true; +} + +// 检查列表是否被选择 +function validateSelect(select,label,begin) { + if (select.selectedIndex == -1) { + alert(label + "没有可供选择的选项。"); + return false; + } else { + if (select.selectedIndex < begin) { + alert("请选择" + label); + return false; + } else { + return true; + } + } +} + +/** + * 检查用户输入文本是否合法,返回值为true/fasle + * arg[0] 要检查的文本框对象 Object.type = text + * arg[1] 文本框标题 String + * arg[2] 是否必须输入 boolean + * arg[3] 最大长度(为零表示不限) int + * arg[4] 指定长度(为零表示不限) int + */ +function validateStr() { + + if (arguments.length == 0) { + alert("错误:参数不足,至少需要一个参数。"); + return false; + } + + var textbox = arguments[0]; + if (textbox == null || textbox.type.indexOf("text") == -1) { + alert("错误:参数错误,第一个参数必须是文本框对象。" + arguments[1]); + return false; + } + + var label = arguments[1]; + if (label == null) label = "输入"; + + var mandatory = arguments[2]; + if (mandatory == null) mandatory = true; + + var maxLength = arguments[3]; + if (maxLength == null) maxLength = 0; + + var speLength = arguments[4]; + if (speLength == null) speLength = 0; + + textbox.value = textbox.value.trim(); + var value = textbox.value; + if (mandatory && (value == "")) { + alert(label + "不能为空,请重新输入。"); + textbox.focus(); + return false; + } + + if ((maxLength > 0) && (value.size() > maxLength)) { + alert(label + "长度过大,最多为" + maxLength + "个字符。"); + textbox.focus(); + return false; + } + + if ((speLength > 0) && (value.size() != speLength)) { + alert(label + "长度错误,应该为" + speLength + "个字符。"); + textbox.focus(); + return false; + } + + return true; +} +/** + * 检查用户输入文本是否合法(two),返回值为true/fasle + * arg[0] 要检查的文本框对象 Object.type = text + * arg[1] 文本框标题 String + * arg[2] 是否必须输入 boolean + * arg[3] 最大长度(为零表示不限) int + * arg[4] 最小长度 int + */ +function validateStrTwo() { + + if (arguments.length == 0) { + alert("错误:参数不足,至少需要一个参数。"); + return false; + } + + var textbox = arguments[0]; + if (textbox == null || textbox.type.indexOf("text") == -1) { + alert("错误:参数错误,第一个参数必须是文本框对象。" + arguments[1]); + return false; + } + + var label = arguments[1]; + if (label == null) label = "输入"; + + var mandatory = arguments[2]; + if (mandatory == null) mandatory = true; + + var maxLength = arguments[3]; + if (maxLength == null) maxLength = 0; + + var speLength = arguments[4]; + if (speLength == null) speLength = 0; + + textbox.value = textbox.value.trim(); + var value = textbox.value; + if (mandatory && (value == "")) { + alert(label + "不能为空,请重新输入。"); + textbox.focus(); + return false; + } + + if ((maxLength > 0) && (value.size() > maxLength)) { + alert(label + "长度过大,最多为" + maxLength + "个字符。"); + textbox.focus(); + return false; + } + + if ((speLength > 0) && (value.size() < speLength)) { + alert(label + "长度错误,应该为" + speLength + "(包含)个字符以上。"); + textbox.focus(); + return false; + } + + return true; +} +/** + * 检查用户输入是否整数 + * arg[0] 要检查的文本框对象 Object.type = text + * arg[1] 文本框标题 String + * arg[2] 是否必须输入 boolean + * arg[3] 输入的最小值(null表示不限) int + * arg[4] 输入的最大值(null表示不限) int + */ +function validateInt() { + if (arguments.length == 0) { + alert("错误:参数不足,至少需要一个参数。"); + return false; + } + + var textbox = arguments[0]; + if (textbox == null || textbox.type != "text") { + alert("错误:参数错误,第一个参数必须是文本框对象。"); + return false; + } + + var label = arguments[1]; + if (label == null) label = "输入"; + + var mandatory = arguments[2]; + if (mandatory == null) mandatory = true; + + var min = arguments[3]; + var max = arguments[4]; + + textbox.value = textbox.value.trim(); + var value = textbox.value; + if (mandatory || (value != "")) { + if (!value.isInt()) { + alert(label + "应该是一个整数,请重新输入。"); + textbox.select(); + textbox.focus(); + return false; + } + } + + if (min != null && (min > parseInt(value,10))) { + alert(label + "不能小于" + min + ",请重新输入。"); + textbox.select(); + textbox.focus(); + return false; + } + + if (max != null && (max < parseInt(value,10))) { + alert(label + "不能大于" + max + ",请重新输入。"); + textbox.select(); + textbox.focus(); + return false; + } + + return true; +} + +/** + * 检查用户输入是否数字 + * arg[0] 要检查的文本框对象 Object.type = text + * arg[1] 文本框标题 String + * arg[2] 是否必须输入 boolean + * arg[3] 输入的最小值(null表示不限) int + * arg[4] 输入的最大值(null表示不限) int + */ +function validateNum() { + if (arguments.length == 0) { + alert("错误:参数不足,至少需要一个参数。"); + return false; + } + + var textbox = arguments[0]; + if (textbox == null || textbox.type != "text") { + alert("错误:参数错误,第一个参数必须是文本框对象。"); + return false; + } + + var label = arguments[1]; + if (label == null) label = "输入"; + + var mandatory = arguments[2]; + if (mandatory == null) mandatory = true; + + var min = arguments[3]; + var max = arguments[4]; + + textbox.value = textbox.value.trim(); + var value = textbox.value; + if (mandatory || (value != "")) { + if (!value.isNum()) { + alert(label + "应该是一个数字,请重新输入。"); + textbox.select(); + textbox.focus(); + return false; + } + } + + if (min != null && (min > parseFloat(value))) { + alert(label + "不能小于" + min + ",请重新输入。"); + textbox.select(); + textbox.focus(); + return false; + } + + if (max != null && (max < parseFloat(value))) { + alert(label + "不能大于" + max + ",请重新输入。"); + textbox.select(); + textbox.focus(); + return false; + } + + return true; +} + +/** + * 检查用户输入是否合法日期 + * arg[0] 要检查的文本框对象 Object.type = text + * arg[1] 文本框标题 String + * arg[2] 是否必须输入 boolean + */ +function validateDate() { + if (arguments.length == 0) { + alert("错误:参数不足,至少需要一个参数。"); + return false; + } + + var textbox = arguments[0]; + if (textbox == null || textbox.type != "text") { + alert("错误:参数错误,第一个参数必须是文本框对象。"); + return false; + } + + var label = arguments[1]; + if (label == null) label = "输入"; + + var mandatory = arguments[2]; + if (mandatory == null) mandatory = true; + + textbox.value = textbox.value.trim(); + var value = textbox.value; + if (mandatory || (value != "")) { + if (!value.isDate()) { + alert(label + "不是一个合法的日期,正确的日期格式是YYYY-MM-DD,请重新输入。"); + textbox.select(); + textbox.focus(); + return false; + } + } + return true; +} + +/** + * 检查用户输入的2个日期大小关系(第一个日期小于第二个日期,返回真,否则返回假并弹出警告框) + * arg[0] 第一个文本框对象 Object.type = text + * arg[1] 第二个文本框对象 Object.type = text + * arg[2] 第一个日期提示 String + * arg[2\3] 第二个日期提示 String + */ +function validateDateDiff() { + if (arguments.length < 2) { + alert("错误:参数不足,至少需要二个参数。"); + return false; + } + + var textbox1 = arguments[0],textbox2 = arguments[1]; + + if (textbox1 == null || textbox1.type != "text") { + alert("错误:参数错误,第一个参数必须是文本框对象。"); + return false; + } + + if (textbox2 == null || textbox2.type != "text") { + alert("错误:参数错误,第二个参数必须是文本框对象。"); + return false; + } + + var label1 = arguments[2],label2 = arguments[3]; + + if (dateDiff(textbox1.value,textbox2.value) > 0) { + if (label1 == null || label2 == null) { + alert("错误:日期大小不符。"); + } else { + alert(label1 + "应该小于" + label2 + "。"); + } + textbox1.select(); + textbox1.focus(); + return false; + } else { + return true; + } +} + +/** + * 写cookie + * name cookie名称 + * value cookie值 + * expireDays 过期天数(和当天比较),若设为负数,则可以删除cookie + */ +function setCookie(name,value,expireDays) { + var date = new Date(); + date.setTime(date.getTime() + 86400000 * expireDays); + document.cookie = name + "=" + escape(value) + ";expires=" + date.toGMTString(); +} + +// 取得cookie值 +function getCookie(name) { + var search = name + "="; + var cookies = document.cookie; + if (cookies.length > 0) { + var offset = cookies.indexOf(search); + if (offset != -1) { + offset += search.length; + end = cookies.indexOf(";", offset); + if (end == -1) end = cookies.length; + return unescape(cookies.substring(offset, end)); + } + } + return ""; +} + + +// 检查文本框输入是否只由字母数字组成 +function validateNumCharStr() { + if (arguments.length == 0) { + alert("错误:参数不足,至少需要一个参数。"); + return false; + } + + var textbox = arguments[0]; + if (textbox == null || textbox.type.indexOf("text") == -1) { + alert("错误:参数错误,第一个参数必须是文本框对象。"); + return false; + } + + var label = arguments[1]; + if (label == null) label = "输入"; + + if (!textbox.value.isNumCharStr()) { + alert(label + "只能由字母和数字组成。"); + textbox.focus(); + return false; + } + + return true; +} + + + +// 检查文本框输入是否只由数字组成 +function validateNumStr() { + if (arguments.length == 0) { + alert("错误:参数不足,至少需要一个参数。"); + return false; + } + + var textbox = arguments[0]; + if (textbox == null || textbox.type.indexOf("text") == -1) { + alert("错误:参数错误,第一个参数必须是文本框对象。"); + return false; + } + + var label = arguments[1]; + if (label == null) label = "输入"; + if (!textbox.value.isNumStr()) { + alert(label + "只能由数字组成。"); + textbox.focus(); + return false; + } + + return true; +} + +// 检查文本框输入是否email +function validateEmailStr(textbox) { + if (textbox.value != "") { + if (!textbox.value.isEmail()) { + alert("请输入正确有效的EMAIL地址。"); + textbox.focus(); + return false; + } + } + + return true; +} + + + +/** + * 给pub.js的方法加壳 + */ +var pub = {}; + + +/** + * 判断是否为空 + */ +pub.isEmpty = function(obj){ + if(typeof obj != undefined && obj != '' && obj != null){ + return false; + } + return true; +} diff --git a/src/main/webapp/jsp/accident/acc_upload.jsp b/src/main/webapp/jsp/accident/acc_upload.jsp index 77763d1..494720a 100644 --- a/src/main/webapp/jsp/accident/acc_upload.jsp +++ b/src/main/webapp/jsp/accident/acc_upload.jsp @@ -1,74 +1,74 @@ -<%@ page contentType="text/html; charset=utf-8" language="java" - import="java.sql.*" errorPage=""%> -<%@ taglib prefix="sf" uri="http://www.springframework.org/tags/form"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> - - - - - - - - - - - -
                                                                      - <%@ include file="/head.jsp" %> -
                                                                      - - -
                                                                      - - -
                                                                      - -
                                                                      - - -
                                                                      - - - - - - - - - -
                                                                      请选择文件(只支持word或是pdf的文件!)
                                                                        - - - - -
                                                                       
                                                                      -
                                                                      -

                                                                       

                                                                      -
                                                                      -
                                                                      -
                                                                      - - - - +<%@ page contentType="text/html; charset=utf-8" language="java" + import="java.sql.*" errorPage=""%> +<%@ taglib prefix="sf" uri="http://www.springframework.org/tags/form"%> +<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> + + + + + + + + + + + +
                                                                      + <%@ include file="/head.jsp" %> +
                                                                      + + +
                                                                      + + +
                                                                      + +
                                                                      + + +
                                                                      + + + + + + + + + +
                                                                      请选择文件(只支持word或是pdf的文件!)
                                                                        + + + + +
                                                                       
                                                                      +
                                                                      +

                                                                       

                                                                      +
                                                                      +
                                                                      +
                                                                      + + + + diff --git a/src/main/webapp/jsp/accident/accident.jsp b/src/main/webapp/jsp/accident/accident.jsp index daa3c80..822b753 100644 --- a/src/main/webapp/jsp/accident/accident.jsp +++ b/src/main/webapp/jsp/accident/accident.jsp @@ -1,512 +1,512 @@ -<%@ page contentType="text/html; charset=utf-8" language="java" - import="java.sql.*" errorPage=""%> -<%@ taglib prefix="sf" uri="http://www.springframework.org/tags/form"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> - - - - - -生产故障信息 - - - -
                                                                      - <%@ include file="/head.jsp"%> -
                                                                      - - - - -
                                                                      - - -
                                                                      - -
                                                                      - - -
                                                                      -
                                                                      -
                                                                      查询条件
                                                                      -
                                                                      -
                                                                      - -
                                                                      - -
                                                                      - - -
                                                                      - -
                                                                      - - -
                                                                      - - - - - -
                                                                      -
                                                                      -
                                                                      -
                                                                      - -
                                                                      - - - - - - -
                                                                      -
                                                                      - - - - -
                                                                      -
                                                                      -
                                                                      -
                                                                      - - - +<%@ page contentType="text/html; charset=utf-8" language="java" + import="java.sql.*" errorPage=""%> +<%@ taglib prefix="sf" uri="http://www.springframework.org/tags/form"%> +<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> + + + + + +生产故障信息 + + + +
                                                                      + <%@ include file="/head.jsp"%> +
                                                                      + + + + +
                                                                      + + +
                                                                      + +
                                                                      + + +
                                                                      +
                                                                      +
                                                                      查询条件
                                                                      +
                                                                      +
                                                                      + +
                                                                      + +
                                                                      + + +
                                                                      + +
                                                                      + + +
                                                                      + + + + + +
                                                                      +
                                                                      +
                                                                      +
                                                                      + +
                                                                      + + + + + + +
                                                                      +
                                                                      + + + + +
                                                                      +
                                                                      +
                                                                      +
                                                                      + + + \ No newline at end of file diff --git a/src/main/webapp/jsp/accident/accident_add.jsp b/src/main/webapp/jsp/accident/accident_add.jsp index 6cb1d1a..5ed9c6f 100644 --- a/src/main/webapp/jsp/accident/accident_add.jsp +++ b/src/main/webapp/jsp/accident/accident_add.jsp @@ -1,328 +1,328 @@ -<%@ page contentType="text/html; charset=utf-8" language="java" - import="java.sql.*" errorPage=""%> -<%@ taglib prefix="sf" uri="http://www.springframework.org/tags/form"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> - - - - -增加生产故障信息 - - - - - - - - - - - - - - -
                                                                      - <%@ include file="/head.jsp" %> -
                                                                      - - - - -
                                                                      - - -
                                                                      - -
                                                                      - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -<%-- - - - --%> - - - - - - - - - - - - - - -<%-- - --%> - - - - -<%-- - - - - - - - - - - - - - --%> - - - - - - - - - - - - - - - - - -
                                                                      所属项目 - - 请选择 - - ${p.projectname} - - 事故等级 - - 五级及以下事故 - 四级事故 - 三级事故 - 二级事故 - 一级事故 - -
                                                                      目前状态 - - 已发生-初始状态 - 已发生-跟踪中-未处理 - 已发生-跟踪中-处理中 - 跟踪处理完成 - - 事故报告人
                                                                      事故发生时间 事故原因类型 - - 请选择 - 测试漏测 - 紧急上线-未测试 - 紧急上线-漏测 - 开发私自上线-未测试 - 转测试-风险分析建议(文档)不全 - 生产数据人工处理 - 原因未知 - 需求或设计不合理 - 无法测试 - 系统配置异常 - 数据库异常 - 网络异常 - 服务器硬件异常 - 渠道或外部网关异常 - 其它异常 - -
                                                                      异常情况描述  - -
                                                                      事故报告时间
                                                                      受影响范围 
                                                                      事故原因分析 
                                                                      纠正处理过程
                                                                      (需点名责任人)
                                                                       
                                                                      解决人员  纠正处理完成时间
                                                                      预防措施责任人  故障影响时间  请按分钟(单位)填写
                                                                      预防措施计划完成时间 预防措施实际完成时间
                                                                      整改措施方案:
                                                                      (需点名责任人)
                                                                       
                                                                      ${message}
                                                                       返 回
                                                                      -

                                                                      -
                                                                      -

                                                                       

                                                                      -
                                                                      -
                                                                      -
                                                                      - - - - +<%@ page contentType="text/html; charset=utf-8" language="java" + import="java.sql.*" errorPage=""%> +<%@ taglib prefix="sf" uri="http://www.springframework.org/tags/form"%> +<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> + + + + +增加生产故障信息 + + + + + + + + + + + + + + +
                                                                      + <%@ include file="/head.jsp" %> +
                                                                      + + + + +
                                                                      + + +
                                                                      + +
                                                                      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +<%-- + + + --%> + + + + + + + + + + + + + + +<%-- + --%> + + + + +<%-- + + + + + + + + + + + + + --%> + + + + + + + + + + + + + + + + + +
                                                                      所属项目 + + 请选择 + + ${p.projectname} + + 事故等级 + + 五级及以下事故 + 四级事故 + 三级事故 + 二级事故 + 一级事故 + +
                                                                      目前状态 + + 已发生-初始状态 + 已发生-跟踪中-未处理 + 已发生-跟踪中-处理中 + 跟踪处理完成 + + 事故报告人
                                                                      事故发生时间 事故原因类型 + + 请选择 + 测试漏测 + 紧急上线-未测试 + 紧急上线-漏测 + 开发私自上线-未测试 + 转测试-风险分析建议(文档)不全 + 生产数据人工处理 + 原因未知 + 需求或设计不合理 + 无法测试 + 系统配置异常 + 数据库异常 + 网络异常 + 服务器硬件异常 + 渠道或外部网关异常 + 其它异常 + +
                                                                      异常情况描述  + +
                                                                      事故报告时间
                                                                      受影响范围 
                                                                      事故原因分析 
                                                                      纠正处理过程
                                                                      (需点名责任人)
                                                                       
                                                                      解决人员  纠正处理完成时间
                                                                      预防措施责任人  故障影响时间  请按分钟(单位)填写
                                                                      预防措施计划完成时间 预防措施实际完成时间
                                                                      整改措施方案:
                                                                      (需点名责任人)
                                                                       
                                                                      ${message}
                                                                       返 回
                                                                      +

                                                                      +
                                                                      +

                                                                       

                                                                      +
                                                                      +
                                                                      +
                                                                      + + + + diff --git a/src/main/webapp/jsp/accident/accident_show.jsp b/src/main/webapp/jsp/accident/accident_show.jsp index 39f6157..8e1ccab 100644 --- a/src/main/webapp/jsp/accident/accident_show.jsp +++ b/src/main/webapp/jsp/accident/accident_show.jsp @@ -1,230 +1,230 @@ -<%@ page contentType="text/html; charset=utf-8" language="java" import="java.sql.*" errorPage="" %> -<%@ taglib prefix="sf" uri="http://www.springframework.org/tags/form" %> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> - - - - -生产事故详情 - - - - - - - - - - - - -
                                                                      - <%@ include file="/head.jsp" %> -
                                                                      - - - -
                                                                      - - -
                                                                      - -
                                                                      - - - - - -
                                                                      - - - - - - - - - - - - - - - - - - -<%-- - --%> - -<%-- - - - - - --%> - - - - - - - - - - - - - - - - - - - - - - -<%-- - --%> - - - - <%-- - - - - - - - - - --%> - - - - - - - -
                                                                      所属项目:${accident.sectorProjects.projectname}事故等级:${accident.acclevel}           - 查看事故级别定义
                                                                      目前状态:${accident.accstatus}事故报告人:${accident.reporter}
                                                                      事故发生时间:${accident.eventtime}事故报告时间:${accident.reporttime}
                                                                      事故持续时间:${accident.strtrouble_duration}事故影响时间:${accident.strimpact_time}
                                                                      事故描述:${accident.accdescription}
                                                                      事故原因类型:${accident.causaltype}
                                                                      异常情况描述:${accident.causalanalysis}
                                                                      受影响范围:${accident.consequenceanalysis}
                                                                      纠正处理过程:${accident.correctiveaction}
                                                                      解决人员:${accident.resolutioner}解决时间:${accident.resolutiontime}
                                                                      预防措施实施人:${accident.preventiver}
                                                                      预防措施计划完成时间:${accident.preventiveplandate}预防措施实际完成时间:${accident.preventiveaccdate}
                                                                      预防措施:${accident.preventiveaction}
                                                                      - 返 回 - -       - 下载事故报告 - -
                                                                      - -
                                                                      -

                                                                       

                                                                      -
                                                                      -
                                                                      -
                                                                      - - - - +<%@ page contentType="text/html; charset=utf-8" language="java" import="java.sql.*" errorPage="" %> +<%@ taglib prefix="sf" uri="http://www.springframework.org/tags/form" %> +<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> + + + + +生产事故详情 + + + + + + + + + + + + +
                                                                      + <%@ include file="/head.jsp" %> +
                                                                      + + + +
                                                                      + + +
                                                                      + +
                                                                      + + + + + +
                                                                      + + + + + + + + + + + + + + + + + + +<%-- + --%> + +<%-- + + + + + --%> + + + + + + + + + + + + + + + + + + + + + + +<%-- + --%> + + + + <%-- + + + + + + + + + --%> + + + + + + + +
                                                                      所属项目:${accident.sectorProjects.projectname}事故等级:${accident.acclevel}           + 查看事故级别定义
                                                                      目前状态:${accident.accstatus}事故报告人:${accident.reporter}
                                                                      事故发生时间:${accident.eventtime}事故报告时间:${accident.reporttime}
                                                                      事故持续时间:${accident.strtrouble_duration}事故影响时间:${accident.strimpact_time}
                                                                      事故描述:${accident.accdescription}
                                                                      事故原因类型:${accident.causaltype}
                                                                      异常情况描述:${accident.causalanalysis}
                                                                      受影响范围:${accident.consequenceanalysis}
                                                                      纠正处理过程:${accident.correctiveaction}
                                                                      解决人员:${accident.resolutioner}解决时间:${accident.resolutiontime}
                                                                      预防措施实施人:${accident.preventiver}
                                                                      预防措施计划完成时间:${accident.preventiveplandate}预防措施实际完成时间:${accident.preventiveaccdate}
                                                                      预防措施:${accident.preventiveaction}
                                                                      + 返 回 + +       + 下载事故报告 + +
                                                                      + +
                                                                      +

                                                                       

                                                                      +
                                                                      +
                                                                      +
                                                                      + + + + diff --git a/src/main/webapp/jsp/accident/accident_update.jsp b/src/main/webapp/jsp/accident/accident_update.jsp index cf5d08f..1033702 100644 --- a/src/main/webapp/jsp/accident/accident_update.jsp +++ b/src/main/webapp/jsp/accident/accident_update.jsp @@ -1,317 +1,317 @@ -<%@ page contentType="text/html; charset=utf-8" language="java" - import="java.sql.*" errorPage=""%> -<%@ taglib prefix="sf" uri="http://www.springframework.org/tags/form"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> - - - - -修改生产故障信息 - - - - - - - - - - - - - - -
                                                                      - <%@ include file="/head.jsp" %> -
                                                                      - - - - -
                                                                      - - -
                                                                      - -
                                                                      - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -<%-- - --%> - - - - -<%-- - - - - - - - - - - - - - --%> - - - - - - - - - - - - - - - - - -
                                                                      所属项目 - - 请选择 - - ${p.projectname} - - 事故等级 - - 五级及以下事故 - 四级事故 - 三级事故 - 二级事故 - 一级事故 - -
                                                                      目前状态 - - 已发生-初始状态 - 已发生-跟踪中-未处理 - 已发生-跟踪中-处理中 - 跟踪处理完成 - - 事故报告人
                                                                      事故发生时间 事故原因类型 - - 请选择 - 测试漏测 - 紧急上线-未测试 - 紧急上线-漏测 - 开发私自上线-未测试 - 转测试-风险分析建议(文档)不全 - 生产数据人工处理 - 原因未知 - 需求或设计不合理 - 无法测试 - 系统配置异常 - 数据库异常 - 网络异常 - 服务器硬件异常 - 渠道或外部网关异常 - 其它异常 - -
                                                                      异常情况描述 
                                                                      受影响范围 
                                                                      事故原因分析 
                                                                      纠正处理过程
                                                                      (需点名责任人)
                                                                       
                                                                      解决人员  纠正处理完成时间
                                                                      预防措施责任人  故障影响时间  请按分钟(单位)填写
                                                                      预防措施计划完成时间 预防措施实际完成时间
                                                                      整改措施方案:
                                                                      (需点名责任人)
                                                                       
                                                                      ${message}
                                                                       返 回
                                                                      -

                                                                      -
                                                                      -

                                                                       

                                                                      -
                                                                      -
                                                                      -
                                                                      - - - - +<%@ page contentType="text/html; charset=utf-8" language="java" + import="java.sql.*" errorPage=""%> +<%@ taglib prefix="sf" uri="http://www.springframework.org/tags/form"%> +<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> + + + + +修改生产故障信息 + + + + + + + + + + + + + + +
                                                                      + <%@ include file="/head.jsp" %> +
                                                                      + + + + +
                                                                      + + +
                                                                      + +
                                                                      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +<%-- + --%> + + + + +<%-- + + + + + + + + + + + + + --%> + + + + + + + + + + + + + + + + + +
                                                                      所属项目 + + 请选择 + + ${p.projectname} + + 事故等级 + + 五级及以下事故 + 四级事故 + 三级事故 + 二级事故 + 一级事故 + +
                                                                      目前状态 + + 已发生-初始状态 + 已发生-跟踪中-未处理 + 已发生-跟踪中-处理中 + 跟踪处理完成 + + 事故报告人
                                                                      事故发生时间 事故原因类型 + + 请选择 + 测试漏测 + 紧急上线-未测试 + 紧急上线-漏测 + 开发私自上线-未测试 + 转测试-风险分析建议(文档)不全 + 生产数据人工处理 + 原因未知 + 需求或设计不合理 + 无法测试 + 系统配置异常 + 数据库异常 + 网络异常 + 服务器硬件异常 + 渠道或外部网关异常 + 其它异常 + +
                                                                      异常情况描述 
                                                                      受影响范围 
                                                                      事故原因分析 
                                                                      纠正处理过程
                                                                      (需点名责任人)
                                                                       
                                                                      解决人员  纠正处理完成时间
                                                                      预防措施责任人  故障影响时间  请按分钟(单位)填写
                                                                      预防措施计划完成时间 预防措施实际完成时间
                                                                      整改措施方案:
                                                                      (需点名责任人)
                                                                       
                                                                      ${message}
                                                                       返 回
                                                                      +

                                                                      +
                                                                      +

                                                                       

                                                                      +
                                                                      +
                                                                      +
                                                                      + + + + diff --git a/src/main/webapp/jsp/base/operationlog.jsp b/src/main/webapp/jsp/base/operationlog.jsp index a1ba9d9..1f253fb 100644 --- a/src/main/webapp/jsp/base/operationlog.jsp +++ b/src/main/webapp/jsp/base/operationlog.jsp @@ -1,214 +1,214 @@ -<%@ page contentType="text/html; charset=utf-8" language="java" - import="java.sql.*" errorPage=""%> -<%@ taglib prefix="sf" uri="http://www.springframework.org/tags/form"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> - - - - -平台操作日志 - - - -
                                                                      - <%@ include file="/head.jsp"%> -
                                                                      - - - - -
                                                                      - - -
                                                                      - -
                                                                      - - -
                                                                      -
                                                                      -
                                                                      查询条件
                                                                      -
                                                                      -
                                                                      - -
                                                                      - -
                                                                      - -
                                                                      - - -
                                                                      - - - - - -
                                                                      - -
                                                                      - - -
                                                                      -
                                                                      -
                                                                      - -
                                                                      - -
                                                                      -
                                                                      - -
                                                                      -
                                                                      -
                                                                      -
                                                                      - - - +<%@ page contentType="text/html; charset=utf-8" language="java" + import="java.sql.*" errorPage=""%> +<%@ taglib prefix="sf" uri="http://www.springframework.org/tags/form"%> +<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> + + + + +平台操作日志 + + + +
                                                                      + <%@ include file="/head.jsp"%> +
                                                                      + + + + +
                                                                      + + +
                                                                      + +
                                                                      + + +
                                                                      +
                                                                      +
                                                                      查询条件
                                                                      +
                                                                      +
                                                                      + +
                                                                      + +
                                                                      + +
                                                                      + + +
                                                                      + + + + + +
                                                                      + +
                                                                      + + +
                                                                      +
                                                                      +
                                                                      + +
                                                                      + +
                                                                      +
                                                                      + +
                                                                      +
                                                                      +
                                                                      +
                                                                      + + + \ No newline at end of file diff --git a/src/main/webapp/jsp/base/secondarysector.jsp b/src/main/webapp/jsp/base/secondarysector.jsp index ccb0651..cb88747 100644 --- a/src/main/webapp/jsp/base/secondarysector.jsp +++ b/src/main/webapp/jsp/base/secondarysector.jsp @@ -1,389 +1,389 @@ -<%@ page contentType="text/html; charset=utf-8" language="java" - import="java.sql.*" errorPage=""%> -<%@ taglib prefix="sf" uri="http://www.springframework.org/tags/form"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> - - - - - -部门管理 - - - -
                                                                      - <%@ include file="/head.jsp"%> -
                                                                      - - - - -
                                                                      - - -
                                                                      - -
                                                                      - - -
                                                                      - -
                                                                      - - -
                                                                      -
                                                                      - - -
                                                                      -
                                                                      - - -
                                                                      -
                                                                      -
                                                                      -
                                                                      - - - +<%@ page contentType="text/html; charset=utf-8" language="java" + import="java.sql.*" errorPage=""%> +<%@ taglib prefix="sf" uri="http://www.springframework.org/tags/form"%> +<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> + + + + + +部门管理 + + + +
                                                                      + <%@ include file="/head.jsp"%> +
                                                                      + + + + +
                                                                      + + +
                                                                      + +
                                                                      + + +
                                                                      + +
                                                                      + + +
                                                                      +
                                                                      + + +
                                                                      +
                                                                      + + +
                                                                      +
                                                                      +
                                                                      +
                                                                      + + + \ No newline at end of file diff --git a/src/main/webapp/jsp/base/sectorprojects.jsp b/src/main/webapp/jsp/base/sectorprojects.jsp index cd24a30..c0011a7 100644 --- a/src/main/webapp/jsp/base/sectorprojects.jsp +++ b/src/main/webapp/jsp/base/sectorprojects.jsp @@ -1,489 +1,489 @@ -<%@ page contentType="text/html; charset=utf-8" language="java" - import="java.sql.*" errorPage=""%> -<%@ taglib prefix="sf" uri="http://www.springframework.org/tags/form"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> - - - - - -项目管理 - - - -
                                                                      - <%@ include file="/head.jsp"%> -
                                                                      - - - - -
                                                                      - - -
                                                                      - -
                                                                      - - -
                                                                      - -
                                                                      - - -
                                                                      -
                                                                      - - -
                                                                      -
                                                                      - - -
                                                                      -
                                                                      -
                                                                      -
                                                                      - - - +<%@ page contentType="text/html; charset=utf-8" language="java" + import="java.sql.*" errorPage=""%> +<%@ taglib prefix="sf" uri="http://www.springframework.org/tags/form"%> +<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> + + + + + +项目管理 + + + +
                                                                      + <%@ include file="/head.jsp"%> +
                                                                      + + + + +
                                                                      + + +
                                                                      + +
                                                                      + + +
                                                                      + +
                                                                      + + +
                                                                      +
                                                                      + + +
                                                                      +
                                                                      + + +
                                                                      +
                                                                      +
                                                                      +
                                                                      + + + \ No newline at end of file diff --git a/src/main/webapp/jsp/base/testclient.jsp b/src/main/webapp/jsp/base/testclient.jsp index eec7013..08cba58 100644 --- a/src/main/webapp/jsp/base/testclient.jsp +++ b/src/main/webapp/jsp/base/testclient.jsp @@ -1,473 +1,473 @@ -<%@ page contentType="text/html; charset=utf-8" language="java" - import="java.sql.*" errorPage=""%> -<%@ taglib prefix="sf" uri="http://www.springframework.org/tags/form"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> - - - - - -客户端管理 - - - -
                                                                      - <%@ include file="/head.jsp"%> -
                                                                      - - - - -
                                                                      - - -
                                                                      - -
                                                                      - - -
                                                                      - -
                                                                      - - - -
                                                                      -
                                                                      - - -
                                                                      -
                                                                      - - -
                                                                      -
                                                                      -
                                                                      -
                                                                      - - - +<%@ page contentType="text/html; charset=utf-8" language="java" + import="java.sql.*" errorPage=""%> +<%@ taglib prefix="sf" uri="http://www.springframework.org/tags/form"%> +<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> + + + + + +客户端管理 + + + +
                                                                      + <%@ include file="/head.jsp"%> +
                                                                      + + + + +
                                                                      + + +
                                                                      + +
                                                                      + + +
                                                                      + +
                                                                      + + + +
                                                                      +
                                                                      + + +
                                                                      +
                                                                      + + +
                                                                      +
                                                                      +
                                                                      +
                                                                      + + + \ No newline at end of file diff --git a/src/main/webapp/jsp/echart/echarts_bar1.jsp b/src/main/webapp/jsp/echart/echarts_bar1.jsp index 77f87e9..13b6212 100644 --- a/src/main/webapp/jsp/echart/echarts_bar1.jsp +++ b/src/main/webapp/jsp/echart/echarts_bar1.jsp @@ -1,108 +1,108 @@ -<%@ page contentType="text/html; charset=utf-8" language="java" - import="java.sql.*" errorPage=""%> -<%@ taglib prefix="sf" uri="http://www.springframework.org/tags/form"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> - - - - -图形数据展示 - - - -
                                                                      - <%@ include file="/head.jsp" %> -
                                                                      - - - -
                                                                      -
                                                                      - -
                                                                      - - - - +<%@ page contentType="text/html; charset=utf-8" language="java" + import="java.sql.*" errorPage=""%> +<%@ taglib prefix="sf" uri="http://www.springframework.org/tags/form"%> +<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> + + + + +图形数据展示 + + + +
                                                                      + <%@ include file="/head.jsp" %> +
                                                                      + + + +
                                                                      +
                                                                      + +
                                                                      + + + + \ No newline at end of file diff --git a/src/main/webapp/jsp/echart/echarts_bar3.jsp b/src/main/webapp/jsp/echart/echarts_bar3.jsp index 9020bb0..d2ddaf9 100644 --- a/src/main/webapp/jsp/echart/echarts_bar3.jsp +++ b/src/main/webapp/jsp/echart/echarts_bar3.jsp @@ -1,104 +1,104 @@ -<%@ page contentType="text/html; charset=utf-8" language="java" - import="java.sql.*" errorPage=""%> -<%@ taglib prefix="sf" uri="http://www.springframework.org/tags/form"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> - - - - -图形数据展示 - - - -
                                                                      - <%@ include file="/head.jsp" %> -
                                                                      - - - -
                                                                      -
                                                                      - -
                                                                      - - - - +<%@ page contentType="text/html; charset=utf-8" language="java" + import="java.sql.*" errorPage=""%> +<%@ taglib prefix="sf" uri="http://www.springframework.org/tags/form"%> +<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> + + + + +图形数据展示 + + + +
                                                                      + <%@ include file="/head.jsp" %> +
                                                                      + + + +
                                                                      +
                                                                      + +
                                                                      + + + + \ No newline at end of file diff --git a/src/main/webapp/jsp/echart/echarts_bar4.jsp b/src/main/webapp/jsp/echart/echarts_bar4.jsp index 4280f16..01f6dd2 100644 --- a/src/main/webapp/jsp/echart/echarts_bar4.jsp +++ b/src/main/webapp/jsp/echart/echarts_bar4.jsp @@ -1,111 +1,111 @@ -<%@ page contentType="text/html; charset=utf-8" language="java" - import="java.sql.*" errorPage=""%> -<%@ taglib prefix="sf" uri="http://www.springframework.org/tags/form"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> - - - - -图形数据展示 - - - -
                                                                      - <%@ include file="/head.jsp" %> -
                                                                      - - - -
                                                                      -
                                                                      - -
                                                                      - - - - +<%@ page contentType="text/html; charset=utf-8" language="java" + import="java.sql.*" errorPage=""%> +<%@ taglib prefix="sf" uri="http://www.springframework.org/tags/form"%> +<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> + + + + +图形数据展示 + + + +
                                                                      + <%@ include file="/head.jsp" %> +
                                                                      + + + +
                                                                      +
                                                                      + +
                                                                      + + + + \ No newline at end of file diff --git a/src/main/webapp/jsp/echart/echarts_lasagna.jsp b/src/main/webapp/jsp/echart/echarts_lasagna.jsp index 8857c96..193149f 100644 --- a/src/main/webapp/jsp/echart/echarts_lasagna.jsp +++ b/src/main/webapp/jsp/echart/echarts_lasagna.jsp @@ -1,155 +1,155 @@ -<%@ page contentType="text/html; charset=utf-8" language="java" - import="java.sql.*" errorPage=""%> -<%@ taglib prefix="sf" uri="http://www.springframework.org/tags/form"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> - - - - -图形数据展示 - - - - -
                                                                      - <%@ include file="/head.jsp" %> -
                                                                      - - - -
                                                                      -
                                                                      - - - - -
                                                                      - - - - +<%@ page contentType="text/html; charset=utf-8" language="java" + import="java.sql.*" errorPage=""%> +<%@ taglib prefix="sf" uri="http://www.springframework.org/tags/form"%> +<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> + + + + +图形数据展示 + + + + +
                                                                      + <%@ include file="/head.jsp" %> +
                                                                      + + + +
                                                                      +
                                                                      + + + + +
                                                                      + + + + \ No newline at end of file diff --git a/src/main/webapp/jsp/echart/echarts_line1.jsp b/src/main/webapp/jsp/echart/echarts_line1.jsp index db744ac..d9de1a7 100644 --- a/src/main/webapp/jsp/echart/echarts_line1.jsp +++ b/src/main/webapp/jsp/echart/echarts_line1.jsp @@ -1,110 +1,110 @@ -<%@ page contentType="text/html; charset=utf-8" language="java" - import="java.sql.*" errorPage=""%> -<%@ taglib prefix="sf" uri="http://www.springframework.org/tags/form"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> - - - - -图形数据展示 - - - -
                                                                      - <%@ include file="/head.jsp" %> -
                                                                      - - - - -
                                                                      -
                                                                      - -
                                                                      - - - - +<%@ page contentType="text/html; charset=utf-8" language="java" + import="java.sql.*" errorPage=""%> +<%@ taglib prefix="sf" uri="http://www.springframework.org/tags/form"%> +<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> + + + + +图形数据展示 + + + +
                                                                      + <%@ include file="/head.jsp" %> +
                                                                      + + + + +
                                                                      +
                                                                      + +
                                                                      + + + + \ No newline at end of file diff --git a/src/main/webapp/jsp/echart/echarts_pie5.jsp b/src/main/webapp/jsp/echart/echarts_pie5.jsp index b19ec64..aa7caed 100644 --- a/src/main/webapp/jsp/echart/echarts_pie5.jsp +++ b/src/main/webapp/jsp/echart/echarts_pie5.jsp @@ -1,652 +1,652 @@ -<%@ page contentType="text/html; charset=utf-8" language="java" - import="java.sql.*" errorPage=""%> -<%@ taglib prefix="sf" uri="http://www.springframework.org/tags/form"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> - - - - - -任务概况图表 - - - -
                                                                      - <%@ include file="/head.jsp" %> -
                                                                      - - - - -
                                                                      -
                                                                      - -
                                                                      - - - - - +<%@ page contentType="text/html; charset=utf-8" language="java" + import="java.sql.*" errorPage=""%> +<%@ taglib prefix="sf" uri="http://www.springframework.org/tags/form"%> +<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> + + + + + +任务概况图表 + + + +
                                                                      + <%@ include file="/head.jsp" %> +
                                                                      + + + + +
                                                                      +
                                                                      + +
                                                                      + + + + + \ No newline at end of file diff --git a/src/main/webapp/jsp/flowcheck/flowcheck.jsp b/src/main/webapp/jsp/flowcheck/flowcheck.jsp index f21871b..524f948 100644 --- a/src/main/webapp/jsp/flowcheck/flowcheck.jsp +++ b/src/main/webapp/jsp/flowcheck/flowcheck.jsp @@ -1,417 +1,417 @@ -<%@ page contentType="text/html; charset=utf-8" language="java" - import="java.sql.*" errorPage=""%> -<%@ taglib prefix="sf" uri="http://www.springframework.org/tags/form"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> - - - - - -项目流程检查信息 - - - -
                                                                      - <%@ include file="/head.jsp"%> -
                                                                      - - - - -
                                                                      - - -
                                                                      - -
                                                                      - - -
                                                                      -
                                                                      -
                                                                      查询条件
                                                                      -
                                                                      -
                                                                      - -
                                                                      - -
                                                                      - - -
                                                                      - - - - - -
                                                                      -
                                                                      -
                                                                      -
                                                                      - -
                                                                      - - - -
                                                                      -
                                                                      - - - - -
                                                                      -
                                                                      -
                                                                      -
                                                                      - - - +<%@ page contentType="text/html; charset=utf-8" language="java" + import="java.sql.*" errorPage=""%> +<%@ taglib prefix="sf" uri="http://www.springframework.org/tags/form"%> +<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> + + + + + +项目流程检查信息 + + + +
                                                                      + <%@ include file="/head.jsp"%> +
                                                                      + + + + +
                                                                      + + +
                                                                      + +
                                                                      + + +
                                                                      +
                                                                      +
                                                                      查询条件
                                                                      +
                                                                      +
                                                                      + +
                                                                      + +
                                                                      + + +
                                                                      + + + + + +
                                                                      +
                                                                      +
                                                                      +
                                                                      + +
                                                                      + + + +
                                                                      +
                                                                      + + + + +
                                                                      +
                                                                      +
                                                                      +
                                                                      + + + \ No newline at end of file diff --git a/src/main/webapp/jsp/flowcheck/flowcheck_add.jsp b/src/main/webapp/jsp/flowcheck/flowcheck_add.jsp index 774156e..ca22354 100644 --- a/src/main/webapp/jsp/flowcheck/flowcheck_add.jsp +++ b/src/main/webapp/jsp/flowcheck/flowcheck_add.jsp @@ -1,358 +1,358 @@ -<%@ page contentType="text/html; charset=utf-8" language="java" - import="java.sql.*" errorPage=""%> -<%@ taglib prefix="sf" uri="http://www.springframework.org/tags/form"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> - - - - -增加检查流程信息 - - - - - - - - - - - - - -
                                                                      - <%@ include file="/head.jsp" %> -
                                                                      - - - - -
                                                                      - - -
                                                                      - -
                                                                      - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                                      项目名称   - - 请选择 - - ${p.projectname} - - 版本号 
                                                                      项目检查阶段   - - 请选择项目阶段... - - ${p[1]} - - - -   - 请选择阶段节点... - - -   - 请选择检查内容... - -
                                                                      检查结果   - - 通过 - 未通过 -<%-- 部分通过 --%> - - 检查日期   -    -
                                                                      检查描述   -  
                                                                      备注   -  
                                                                       返 回
                                                                      -
                                                                      -

                                                                       

                                                                      -
                                                                      -
                                                                      -
                                                                      - - - - - +<%@ page contentType="text/html; charset=utf-8" language="java" + import="java.sql.*" errorPage=""%> +<%@ taglib prefix="sf" uri="http://www.springframework.org/tags/form"%> +<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> + + + + +增加检查流程信息 + + + + + + + + + + + + + +
                                                                      + <%@ include file="/head.jsp" %> +
                                                                      + + + + +
                                                                      + + +
                                                                      + +
                                                                      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                                                                      项目名称   + + 请选择 + + ${p.projectname} + + 版本号 
                                                                      项目检查阶段   + + 请选择项目阶段... + + ${p[1]} + + + +   + 请选择阶段节点... + + +   + 请选择检查内容... + +
                                                                      检查结果   + + 通过 + 未通过 +<%-- 部分通过 --%> + + 检查日期   +    +
                                                                      检查描述   +  
                                                                      备注   +  
                                                                       返 回
                                                                      +
                                                                      +

                                                                       

                                                                      +
                                                                      +
                                                                      +
                                                                      + + + + + diff --git a/src/main/webapp/jsp/flowcheck/flowcheck_report.jsp b/src/main/webapp/jsp/flowcheck/flowcheck_report.jsp index 8ac5d36..8285268 100644 --- a/src/main/webapp/jsp/flowcheck/flowcheck_report.jsp +++ b/src/main/webapp/jsp/flowcheck/flowcheck_report.jsp @@ -1,136 +1,136 @@ -<%@ page contentType="text/html; charset=utf-8" language="java" - import="java.sql.*" errorPage=""%> -<%@ taglib prefix="sf" uri="http://www.springframework.org/tags/form"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> - - - - - - - -流程检查统计 - - - - - - -
                                                                      - <%@ include file="/head.jsp" %> -
                                                                      - - - - -
                                                                      - - - - -
                                                                      - -
                                                                      - - - - - - - - - - - - - - - - - - - -
                                                                      项目名称检查总次数通过次数不通过次数检查通过率
                                                                      ${t[4] } ${t[1] } ${t[2] } ${t[3] } ${t[5] }% 
                                                                      -
                                                                      -
                                                                      - - - - - 没有记录! -
                                                                      -

                                                                      -
                                                                      -

                                                                       

                                                                      -
                                                                      -
                                                                      -
                                                                      - - - +<%@ page contentType="text/html; charset=utf-8" language="java" + import="java.sql.*" errorPage=""%> +<%@ taglib prefix="sf" uri="http://www.springframework.org/tags/form"%> +<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> +<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> + + + + + + + +流程检查统计 + + + + + + +
                                                                      + <%@ include file="/head.jsp" %> +
                                                                      + + + + +
                                                                      + + + + +
                                                                      + +
                                                                      + + + + + + + + + + + + + + + + + + + +
                                                                      项目名称检查总次数通过次数不通过次数检查通过率
                                                                      ${t[4] } ${t[1] } ${t[2] } ${t[3] } ${t[5] }% 
                                                                      +
                                                                      +
                                                                      + + + + + 没有记录! +
                                                                      +

                                                                      +
                                                                      +

                                                                       

                                                                      +
                                                                      +
                                                                      +
                                                                      + + + \ No newline at end of file diff --git a/src/main/webapp/jsp/flowcheck/flowcheck_update.jsp b/src/main/webapp/jsp/flowcheck/flowcheck_update.jsp index 2a49f4b..a47fb72 100644 --- a/src/main/webapp/jsp/flowcheck/flowcheck_update.jsp +++ b/src/main/webapp/jsp/flowcheck/flowcheck_update.jsp @@ -1,367 +1,367 @@ -<%@ page contentType="text/html; charset=utf-8" language="java" - import="java.sql.*" errorPage=""%> -<%@ taglib prefix="sf" uri="http://www.springframework.org/tags/form"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> - - - - -项目版本添加 - - - - - - - - - - - - - - - -
                                                                      - <%@ include file="/head.jsp" %> -
                                                                      - - - - -
                                                                      - - - - -
                                                                      - -
                                                                      - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                                      项目检查阶段   - - - ${p[1]} - - - -   - - ${p[1]} - - - -   - - ${p[1]} - - -
                                                                      检查结果   - - 通过 - 未通过 -<%-- 部分通过 --%> - - 检查日期   -    -
                                                                      更新二次检查结果   - - 未进行 - 通过 - 未通过 -<%-- 部分通过 --%> - - 更新二次检查日期   -    -
                                                                      检查描述   -  
                                                                      备注   -  
                                                                       返 回
                                                                      -
                                                                      -

                                                                       

                                                                      -
                                                                      -
                                                                      -
                                                                      - - - - +<%@ page contentType="text/html; charset=utf-8" language="java" + import="java.sql.*" errorPage=""%> +<%@ taglib prefix="sf" uri="http://www.springframework.org/tags/form"%> +<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> + + + + +项目版本添加 + + + + + + + + + + + + + + + +
                                                                      + <%@ include file="/head.jsp" %> +
                                                                      + + + + +
                                                                      + + + + +
                                                                      + +
                                                                      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                                                                      项目检查阶段   + + + ${p[1]} + + + +   + + ${p[1]} + + + +   + + ${p[1]} + + +
                                                                      检查结果   + + 通过 + 未通过 +<%-- 部分通过 --%> + + 检查日期   +    +
                                                                      更新二次检查结果   + + 未进行 + 通过 + 未通过 +<%-- 部分通过 --%> + + 更新二次检查日期   +    +
                                                                      检查描述   +  
                                                                      备注   +  
                                                                       返 回
                                                                      +
                                                                      +

                                                                       

                                                                      +
                                                                      +
                                                                      +
                                                                      + + + + diff --git a/src/main/webapp/jsp/flowcheck/flowcheckinfo.jsp b/src/main/webapp/jsp/flowcheck/flowcheckinfo.jsp index 5165763..1895d7b 100644 --- a/src/main/webapp/jsp/flowcheck/flowcheckinfo.jsp +++ b/src/main/webapp/jsp/flowcheck/flowcheckinfo.jsp @@ -1,572 +1,572 @@ -<%@ page contentType="text/html; charset=utf-8" language="java" - import="java.sql.*" errorPage=""%> -<%@ taglib prefix="sf" uri="http://www.springframework.org/tags/form"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> - - - - - -项目流程检查详情 - - - -
                                                                      - <%@ include file="/head.jsp"%> -
                                                                      - - - - -
                                                                      - - -
                                                                      - -
                                                                      - - -
                                                                      - -
                                                                      - - - -
                                                                      -
                                                                      - - -
                                                                      -
                                                                      - - -
                                                                      -
                                                                      -
                                                                      -
                                                                      - - - +<%@ page contentType="text/html; charset=utf-8" language="java" + import="java.sql.*" errorPage=""%> +<%@ taglib prefix="sf" uri="http://www.springframework.org/tags/form"%> +<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> + + + + + +项目流程检查详情 + + + +
                                                                      + <%@ include file="/head.jsp"%> +
                                                                      + + + + +
                                                                      + + +
                                                                      + +
                                                                      + + +
                                                                      + +
                                                                      + + + +
                                                                      +
                                                                      + + +
                                                                      +
                                                                      + + +
                                                                      +
                                                                      +
                                                                      +
                                                                      + + + \ No newline at end of file diff --git a/src/main/webapp/jsp/flowcheck/planflowcheck.jsp b/src/main/webapp/jsp/flowcheck/planflowcheck.jsp index bbe4a54..eb9d687 100644 --- a/src/main/webapp/jsp/flowcheck/planflowcheck.jsp +++ b/src/main/webapp/jsp/flowcheck/planflowcheck.jsp @@ -1,306 +1,306 @@ -<%@ page contentType="text/html; charset=utf-8" language="java" - import="java.sql.*" errorPage=""%> -<%@ taglib prefix="sf" uri="http://www.springframework.org/tags/form"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> - - - - - -流程检查计划 - - - -
                                                                      - <%@ include file="/head.jsp"%> -
                                                                      - - - - -
                                                                      - - - -
                                                                      - -
                                                                      - - -
                                                                      - -
                                                                      - - - - -
                                                                      -
                                                                      - - - - -
                                                                      -
                                                                      -
                                                                      -
                                                                      - - - +<%@ page contentType="text/html; charset=utf-8" language="java" + import="java.sql.*" errorPage=""%> +<%@ taglib prefix="sf" uri="http://www.springframework.org/tags/form"%> +<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> + + + + + +流程检查计划 + + + +
                                                                      + <%@ include file="/head.jsp"%> +
                                                                      + + + + +
                                                                      + + + +
                                                                      + +
                                                                      + + +
                                                                      + +
                                                                      + + + + +
                                                                      +
                                                                      + + + + +
                                                                      +
                                                                      +
                                                                      +
                                                                      + + + \ No newline at end of file diff --git a/src/main/webapp/jsp/flowcheck/planflowcheck_add.jsp b/src/main/webapp/jsp/flowcheck/planflowcheck_add.jsp index 238427e..f899f69 100644 --- a/src/main/webapp/jsp/flowcheck/planflowcheck_add.jsp +++ b/src/main/webapp/jsp/flowcheck/planflowcheck_add.jsp @@ -1,279 +1,279 @@ -<%@ page contentType="text/html; charset=utf-8" language="java" - import="java.sql.*" errorPage=""%> -<%@ taglib prefix="sf" uri="http://www.springframework.org/tags/form"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> - - - - -流程检查计划添加 - - - - - - - - - - - - - -
                                                                      - <%@ include file="/head.jsp" %> -
                                                                      - - - -
                                                                      - - - - -
                                                                      - -
                                                                      - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                                      项目名称   - - 请选择 - - ${p.projectname} - - 版本号   
                                                                      项目检查阶段   - - 请选择项目阶段... - - ${p[1]} - - - -   - 请选择阶段节点... - - -   - 请选择检查内容... - -
                                                                      计划检查日期   -    -
                                                                      ${message}
                                                                       返 回
                                                                      -

                                                                      -
                                                                      -

                                                                       

                                                                      -
                                                                      -
                                                                      -
                                                                      - - - - +<%@ page contentType="text/html; charset=utf-8" language="java" + import="java.sql.*" errorPage=""%> +<%@ taglib prefix="sf" uri="http://www.springframework.org/tags/form"%> +<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> + + + + +流程检查计划添加 + + + + + + + + + + + + + +
                                                                      + <%@ include file="/head.jsp" %> +
                                                                      + + + +
                                                                      + + + + +
                                                                      + +
                                                                      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                                                                      项目名称   + + 请选择 + + ${p.projectname} + + 版本号   
                                                                      项目检查阶段   + + 请选择项目阶段... + + ${p[1]} + + + +   + 请选择阶段节点... + + +   + 请选择检查内容... + +
                                                                      计划检查日期   +    +
                                                                      ${message}
                                                                       返 回
                                                                      +

                                                                      +
                                                                      +

                                                                       

                                                                      +
                                                                      +
                                                                      +
                                                                      + + + + diff --git a/src/main/webapp/jsp/flowcheck/planflowcheck_tocheck.jsp b/src/main/webapp/jsp/flowcheck/planflowcheck_tocheck.jsp index 8de013b..e08a42a 100644 --- a/src/main/webapp/jsp/flowcheck/planflowcheck_tocheck.jsp +++ b/src/main/webapp/jsp/flowcheck/planflowcheck_tocheck.jsp @@ -1,365 +1,365 @@ -<%@ page contentType="text/html; charset=utf-8" language="java" - import="java.sql.*" errorPage=""%> -<%@ taglib prefix="sf" uri="http://www.springframework.org/tags/form"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> - - - - -检查计划转成检查结果 - - - - - - - - - - - - - - - -
                                                                      - <%@ include file="/head.jsp" %> -
                                                                      - - - - -
                                                                      - - - - -
                                                                      - -
                                                                      - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                                      项目名称   - - 请选择 - - ${p.projectname} - - 版本号 
                                                                      项目检查阶段   - - - ${p[1]} - - - -   - - ${p[1]} - - - -   - - ${p[1]} - - -
                                                                      检查结果   - - 通过 - 未通过 -<%-- 部分通过 --%> - - 检查日期   -    -
                                                                      检查描述   -  
                                                                      备注   -  
                                                                       返 回
                                                                      -
                                                                      -

                                                                       

                                                                      -
                                                                      -
                                                                      -
                                                                      - - - - +<%@ page contentType="text/html; charset=utf-8" language="java" + import="java.sql.*" errorPage=""%> +<%@ taglib prefix="sf" uri="http://www.springframework.org/tags/form"%> +<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> + + + + +检查计划转成检查结果 + + + + + + + + + + + + + + + +
                                                                      + <%@ include file="/head.jsp" %> +
                                                                      + + + + +
                                                                      + + + + +
                                                                      + +
                                                                      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                                                                      项目名称   + + 请选择 + + ${p.projectname} + + 版本号 
                                                                      项目检查阶段   + + + ${p[1]} + + + +   + + ${p[1]} + + + +   + + ${p[1]} + + +
                                                                      检查结果   + + 通过 + 未通过 +<%-- 部分通过 --%> + + 检查日期   +    +
                                                                      检查描述   +  
                                                                      备注   +  
                                                                       返 回
                                                                      +
                                                                      +

                                                                       

                                                                      +
                                                                      +
                                                                      +
                                                                      + + + + diff --git a/src/main/webapp/jsp/flowcheck/planflowcheck_update.jsp b/src/main/webapp/jsp/flowcheck/planflowcheck_update.jsp index 32bf83b..c204040 100644 --- a/src/main/webapp/jsp/flowcheck/planflowcheck_update.jsp +++ b/src/main/webapp/jsp/flowcheck/planflowcheck_update.jsp @@ -1,229 +1,229 @@ -<%@ page contentType="text/html; charset=utf-8" language="java" - import="java.sql.*" errorPage=""%> -<%@ taglib prefix="sf" uri="http://www.springframework.org/tags/form"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> - - - - -流程检查计划修改 - - - - - - - - - - - - -
                                                                      - <%@ include file="/head.jsp" %> -
                                                                      - - - - -
                                                                      - - - - -
                                                                      - -
                                                                      - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                                      项目名称   - - 请选择 - - ${p.projectname} - - 版本号   
                                                                      项目检查阶段   - - - ${p[1]} - - - -   - - ${p[1]} - - - -   - - ${p[1]} - - -
                                                                      计划检查日期   -    -
                                                                      ${message}
                                                                       返 回
                                                                      -

                                                                      -
                                                                      -

                                                                       

                                                                      -
                                                                      -
                                                                      -
                                                                      - - - - +<%@ page contentType="text/html; charset=utf-8" language="java" + import="java.sql.*" errorPage=""%> +<%@ taglib prefix="sf" uri="http://www.springframework.org/tags/form"%> +<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> + + + + +流程检查计划修改 + + + + + + + + + + + + +
                                                                      + <%@ include file="/head.jsp" %> +
                                                                      + + + + +
                                                                      + + + + +
                                                                      + +
                                                                      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                                                                      项目名称   + + 请选择 + + ${p.projectname} + + 版本号   
                                                                      项目检查阶段   + + + ${p[1]} + + + +   + + ${p[1]} + + + +   + + ${p[1]} + + +
                                                                      计划检查日期   +    +
                                                                      ${message}
                                                                       返 回
                                                                      +

                                                                      +
                                                                      +

                                                                       

                                                                      +
                                                                      +
                                                                      +
                                                                      + + + + diff --git a/src/main/webapp/jsp/plancase/projectcase.jsp b/src/main/webapp/jsp/plancase/projectcase.jsp index bc9bc4a..ffff070 100644 --- a/src/main/webapp/jsp/plancase/projectcase.jsp +++ b/src/main/webapp/jsp/plancase/projectcase.jsp @@ -1,1056 +1,1056 @@ -<%@ page contentType="text/html; charset=utf-8" language="java" - import="java.sql.*" errorPage=""%> -<%@ taglib prefix="sf" uri="http://www.springframework.org/tags/form"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> - - - - - -用例管理 - - - -
                                                                      - <%@ include file="/head.jsp"%> -
                                                                      - - - - -
                                                                      - - -
                                                                      - -
                                                                      - - -
                                                                      -
                                                                      -
                                                                      查询条件
                                                                      -
                                                                      -
                                                                      - -
                                                                      - -
                                                                      -
                                                                      - -
                                                                      - -
                                                                      - - - -
                                                                      -
                                                                      - -
                                                                      -
                                                                      - -
                                                                      - - - - -
                                                                      -
                                                                      - - -
                                                                      -
                                                                      - - -
                                                                      -
                                                                      -
                                                                      -
                                                                      - - - +<%@ page contentType="text/html; charset=utf-8" language="java" + import="java.sql.*" errorPage=""%> +<%@ taglib prefix="sf" uri="http://www.springframework.org/tags/form"%> +<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> + + + + + +用例管理 + + + +
                                                                      + <%@ include file="/head.jsp"%> +
                                                                      + + + + +
                                                                      + + +
                                                                      + +
                                                                      + + +
                                                                      +
                                                                      +
                                                                      查询条件
                                                                      +
                                                                      +
                                                                      + +
                                                                      + +
                                                                      +
                                                                      + +
                                                                      + +
                                                                      + + + +
                                                                      +
                                                                      + +
                                                                      +
                                                                      + +
                                                                      + + + + +
                                                                      +
                                                                      + + +
                                                                      +
                                                                      + + +
                                                                      +
                                                                      +
                                                                      +
                                                                      + + + \ No newline at end of file diff --git a/src/main/webapp/jsp/plancase/projectplan.jsp b/src/main/webapp/jsp/plancase/projectplan.jsp index 18b9840..45049ad 100644 --- a/src/main/webapp/jsp/plancase/projectplan.jsp +++ b/src/main/webapp/jsp/plancase/projectplan.jsp @@ -1,469 +1,469 @@ -<%@ page contentType="text/html; charset=utf-8" language="java" - import="java.sql.*" errorPage=""%> -<%@ taglib prefix="sf" uri="http://www.springframework.org/tags/form"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> - - - - - -测试计划 - - - -
                                                                      - <%@ include file="/head.jsp"%> -
                                                                      - - - - -
                                                                      - - -
                                                                      - -
                                                                      - - -
                                                                      -
                                                                      -
                                                                      查询条件
                                                                      -
                                                                      -
                                                                      - -
                                                                      - -
                                                                      -
                                                                      -
                                                                      -
                                                                      - -
                                                                      - - - -
                                                                      -
                                                                      - - -
                                                                      -
                                                                      - - -
                                                                      -
                                                                      -
                                                                      -
                                                                      - - - +<%@ page contentType="text/html; charset=utf-8" language="java" + import="java.sql.*" errorPage=""%> +<%@ taglib prefix="sf" uri="http://www.springframework.org/tags/form"%> +<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> + + + + + +测试计划 + + + +
                                                                      + <%@ include file="/head.jsp"%> +
                                                                      + + + + +
                                                                      + + +
                                                                      + +
                                                                      + + +
                                                                      +
                                                                      +
                                                                      查询条件
                                                                      +
                                                                      +
                                                                      + +
                                                                      + +
                                                                      +
                                                                      +
                                                                      +
                                                                      + +
                                                                      + + + +
                                                                      +
                                                                      + + +
                                                                      +
                                                                      + + +
                                                                      +
                                                                      +
                                                                      +
                                                                      + + + \ No newline at end of file diff --git a/src/main/webapp/jsp/plancase/projectplancase.jsp b/src/main/webapp/jsp/plancase/projectplancase.jsp index f6c0b62..e0f352c 100644 --- a/src/main/webapp/jsp/plancase/projectplancase.jsp +++ b/src/main/webapp/jsp/plancase/projectplancase.jsp @@ -1,374 +1,374 @@ -<%@ page contentType="text/html; charset=utf-8" language="java" - import="java.sql.*" errorPage=""%> -<%@ taglib prefix="sf" uri="http://www.springframework.org/tags/form"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> - - - - - -计划用例管理 - - - -
                                                                      - <%@ include file="/head.jsp"%> -
                                                                      - - - - -
                                                                      - - -
                                                                      - -
                                                                      - - -
                                                                      -
                                                                      -
                                                                      查询条件
                                                                      -
                                                                      -
                                                                      - -
                                                                      - - - - -
                                                                      -
                                                                      - -
                                                                      - -
                                                                      - -
                                                                      -
                                                                      - -
                                                                      - -
                                                                      -
                                                                      - -
                                                                      -
                                                                      -
                                                                      -
                                                                      - - - +<%@ page contentType="text/html; charset=utf-8" language="java" + import="java.sql.*" errorPage=""%> +<%@ taglib prefix="sf" uri="http://www.springframework.org/tags/form"%> +<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> + + + + + +计划用例管理 + + + +
                                                                      + <%@ include file="/head.jsp"%> +
                                                                      + + + + +
                                                                      + + +
                                                                      + +
                                                                      + + +
                                                                      +
                                                                      +
                                                                      查询条件
                                                                      +
                                                                      +
                                                                      + +
                                                                      + + + + +
                                                                      +
                                                                      + +
                                                                      + +
                                                                      + +
                                                                      +
                                                                      + +
                                                                      + +
                                                                      +
                                                                      + +
                                                                      +
                                                                      +
                                                                      +
                                                                      + + + \ No newline at end of file diff --git a/src/main/webapp/jsp/plancase/ptctemplate.jsp b/src/main/webapp/jsp/plancase/ptctemplate.jsp index 4930f25..4061017 100644 --- a/src/main/webapp/jsp/plancase/ptctemplate.jsp +++ b/src/main/webapp/jsp/plancase/ptctemplate.jsp @@ -1,540 +1,540 @@ -<%@ page contentType="text/html; charset=utf-8" language="java" - import="java.sql.*" errorPage=""%> -<%@ taglib prefix="sf" uri="http://www.springframework.org/tags/form"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> - - - - - -测试协议模板 - - - -
                                                                      - <%@ include file="/head.jsp"%> -
                                                                      - - - - -
                                                                      - - -
                                                                      - -
                                                                      - - -
                                                                      -
                                                                      -
                                                                      查询条件
                                                                      -
                                                                      -
                                                                      - -
                                                                      - -
                                                                      -
                                                                      -
                                                                      -
                                                                      - -
                                                                      - - - -
                                                                      -
                                                                      - - -
                                                                      -
                                                                      - - -
                                                                      -
                                                                      -
                                                                      -
                                                                      - - - +<%@ page contentType="text/html; charset=utf-8" language="java" + import="java.sql.*" errorPage=""%> +<%@ taglib prefix="sf" uri="http://www.springframework.org/tags/form"%> +<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> + + + + + +测试协议模板 + + + +
                                                                      + <%@ include file="/head.jsp"%> +
                                                                      + + + + +
                                                                      + + +
                                                                      + +
                                                                      + + +
                                                                      +
                                                                      +
                                                                      查询条件
                                                                      +
                                                                      +
                                                                      + +
                                                                      + +
                                                                      +
                                                                      +
                                                                      +
                                                                      + +
                                                                      + + + +
                                                                      +
                                                                      + + +
                                                                      +
                                                                      + + +
                                                                      +
                                                                      +
                                                                      +
                                                                      + + + \ No newline at end of file diff --git a/src/main/webapp/jsp/plancase/step_add.jsp b/src/main/webapp/jsp/plancase/step_add.jsp index 027fb1c..e028bdd 100644 --- a/src/main/webapp/jsp/plancase/step_add.jsp +++ b/src/main/webapp/jsp/plancase/step_add.jsp @@ -1,666 +1,666 @@ -<%@ page contentType="text/html; charset=utf-8" language="java" - import="java.sql.*" errorPage=""%> -<%@ taglib prefix="sf" uri="http://www.springframework.org/tags/form"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> - - - - -编辑用例步骤 - - - - -
                                                                      - <%@ include file="/head.jsp"%> -
                                                                      - - - -
                                                                      - - -
                                                                      - -
                                                                      - - -
                                                                      -
                                                                      -
                                                                      -

                                                                      用例【${casesign}】编辑步骤

                                                                      - - - - -
                                                                      - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                                      步骤包 | 定位路径方法 | 操作参数步骤动作预期结果类型备注操作
                                                                      -
                                                                      -
                                                                      - -
                                                                      -
                                                                      -
                                                                      -
                                                                      - -
                                                                      -
                                                                      -
                                                                      -                             - - - -
                                                                      -
                                                                      -
                                                                      -
                                                                      -
                                                                      - - -
                                                                      -
                                                                      -
                                                                      -
                                                                      -
                                                                      - - - - -
                                                                      - -

                                                                       

                                                                      -
                                                                      -
                                                                      -
                                                                      - - - - + +
                                                                      + <%@ include file="/head.jsp"%> +
                                                                      + + + +
                                                                      + + +
                                                                      + +
                                                                      + + +
                                                                      +
                                                                      +
                                                                      +

                                                                      用例【${casesign}】编辑步骤

                                                                      + + + + +
                                                                      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                                                                      步骤包 | 定位路径方法 | 操作参数步骤动作预期结果类型备注操作
                                                                      +
                                                                      +
                                                                      + +
                                                                      +
                                                                      +
                                                                      +
                                                                      + +
                                                                      +
                                                                      +
                                                                      +                             + + + +
                                                                      +
                                                                      +
                                                                      +
                                                                      +
                                                                      + + +
                                                                      +
                                                                      +
                                                                      +
                                                                      +
                                                                      + + + + +
                                                                      + +

                                                                       

                                                                      +
                                                                      +
                                                                      +
                                                                      + + + + diff --git a/src/main/webapp/jsp/plancase/templateparam.jsp b/src/main/webapp/jsp/plancase/templateparam.jsp index 73521cc..6d2340d 100644 --- a/src/main/webapp/jsp/plancase/templateparam.jsp +++ b/src/main/webapp/jsp/plancase/templateparam.jsp @@ -1,255 +1,255 @@ -<%@ page contentType="text/html; charset=utf-8" language="java" - import="java.sql.*" errorPage=""%> -<%@ taglib prefix="sf" uri="http://www.springframework.org/tags/form"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> - - - - -编辑协议模板内容 - - - - - - - -
                                                                      - <%@ include file="/head.jsp"%> -
                                                                      - - - -
                                                                      - - -
                                                                      - -
                                                                      - - -
                                                                      -
                                                                      -
                                                                      -

                                                                      协议模板基本信息

                                                                      - - - - - - - - - -
                                                                      项目名称:${ptemplate.projectname}模板名称:${ptemplate.name}协议类型:${ptemplate.protocoltype}编码格式:${ptemplate.contentencoding}超时时间:${ptemplate.connecttimeout}备注:${ptemplate.remark}
                                                                      - -

                                                                      协议模板参数

                                                                      -
                                                                      -
                                                                      - - - - - - - - - - - - - - - - - - -
                                                                      参数名参数默认值
                                                                      - - - - - -
                                                                      -
                                                                      -
                                                                      -
                                                                      -
                                                                      - -
                                                                      -
                                                                      -
                                                                      -
                                                                      -
                                                                      - -
                                                                      - -

                                                                       

                                                                      -
                                                                      -
                                                                      -
                                                                      - - - - +<%@ page contentType="text/html; charset=utf-8" language="java" + import="java.sql.*" errorPage=""%> +<%@ taglib prefix="sf" uri="http://www.springframework.org/tags/form"%> +<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> + + + + +编辑协议模板内容 + + + + + + + +
                                                                      + <%@ include file="/head.jsp"%> +
                                                                      + + + +
                                                                      + + +
                                                                      + +
                                                                      + + +
                                                                      +
                                                                      +
                                                                      +

                                                                      协议模板基本信息

                                                                      + + + + + + + + + +
                                                                      项目名称:${ptemplate.projectname}模板名称:${ptemplate.name}协议类型:${ptemplate.protocoltype}编码格式:${ptemplate.contentencoding}超时时间:${ptemplate.connecttimeout}备注:${ptemplate.remark}
                                                                      + +

                                                                      协议模板参数

                                                                      +
                                                                      +
                                                                      + + + + + + + + + + + + + + + + + + +
                                                                      参数名参数默认值
                                                                      + + + + + +
                                                                      +
                                                                      +
                                                                      +
                                                                      +
                                                                      + +
                                                                      +
                                                                      +
                                                                      +
                                                                      +
                                                                      + +
                                                                      + +

                                                                       

                                                                      +
                                                                      +
                                                                      +
                                                                      + + + + diff --git a/src/main/webapp/jsp/projectversion/projectversion.jsp b/src/main/webapp/jsp/projectversion/projectversion.jsp index 17c686f..79e152f 100644 --- a/src/main/webapp/jsp/projectversion/projectversion.jsp +++ b/src/main/webapp/jsp/projectversion/projectversion.jsp @@ -1,550 +1,550 @@ -<%@ page contentType="text/html; charset=utf-8" language="java" - import="java.sql.*" errorPage=""%> -<%@ taglib prefix="sf" uri="http://www.springframework.org/tags/form"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> - - - - - -项目版本信息管理 - - - -
                                                                      - <%@ include file="/head.jsp"%> -
                                                                      - - - - -
                                                                      - - -
                                                                      - -
                                                                      - - -
                                                                      -
                                                                      -
                                                                      查询条件
                                                                      -
                                                                      -
                                                                      - -
                                                                      - -
                                                                      - - -
                                                                      - - - - - -
                                                                      -
                                                                      -
                                                                      -
                                                                      - -
                                                                      - - - - -
                                                                      -
                                                                      - - - - -
                                                                      -
                                                                      -
                                                                      -
                                                                      - - - +<%@ page contentType="text/html; charset=utf-8" language="java" + import="java.sql.*" errorPage=""%> +<%@ taglib prefix="sf" uri="http://www.springframework.org/tags/form"%> +<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> + + + + + +项目版本信息管理 + + + +
                                                                      + <%@ include file="/head.jsp"%> +
                                                                      + + + + +
                                                                      + + +
                                                                      + +
                                                                      + + +
                                                                      +
                                                                      +
                                                                      查询条件
                                                                      +
                                                                      +
                                                                      + +
                                                                      + +
                                                                      + + +
                                                                      + + + + + +
                                                                      +
                                                                      +
                                                                      +
                                                                      + +
                                                                      + + + + +
                                                                      +
                                                                      + + + + +
                                                                      +
                                                                      +
                                                                      +
                                                                      + + + \ No newline at end of file diff --git a/src/main/webapp/jsp/projectversion/projectversion_add.jsp b/src/main/webapp/jsp/projectversion/projectversion_add.jsp index b5f45cd..c23e481 100644 --- a/src/main/webapp/jsp/projectversion/projectversion_add.jsp +++ b/src/main/webapp/jsp/projectversion/projectversion_add.jsp @@ -1,376 +1,376 @@ -<%@ page contentType="text/html; charset=utf-8" language="java" - import="java.sql.*" errorPage=""%> -<%@ taglib prefix="sf" uri="http://www.springframework.org/tags/form"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> - - - - -项目版本添加 - - - - - - - - - - - - -
                                                                      - <%@ include file="/head.jsp" %> -
                                                                      - - - - -
                                                                      - - -
                                                                      - -
                                                                      - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -<%-- - - - - - - --%> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                                      项目名称 - - 请选择 - - ${p.projectname} - -
                                                                      版本号  版本链接 
                                                                      计划上线需求数  - 实际上线需求数 
                                                                      代码规范问题(阻断)  以SONAR平台统计数据为准 代码规范问题(严重)  以SONAR平台统计数据为准
                                                                      代码规范问题(主要)  以SONAR平台统计数据为准 代码变动行数 单位:千行
                                                                      测试用例数  转测试打回次数 
                                                                      投入开发人员  投入测试人员 
                                                                      致命级别问题  严重级别问题 
                                                                      一般级别问题  提示级别问题 
                                                                      计划达成日期  实际达成日期  
                                                                      计划开发开始日期  计划开发结束日期  
                                                                      实际开发开始日期  实际开发结束日期  
                                                                      计划测试开始日期  计划测试结束日期  
                                                                      实际测试开始日期  实际测试结束日期  
                                                                      版本说明 
                                                                      质量回溯结果 
                                                                      备注 
                                                                      ${message}
                                                                       返 回
                                                                      -

                                                                      -
                                                                      -

                                                                       

                                                                      -
                                                                      -
                                                                      -
                                                                      - - - - +<%@ page contentType="text/html; charset=utf-8" language="java" + import="java.sql.*" errorPage=""%> +<%@ taglib prefix="sf" uri="http://www.springframework.org/tags/form"%> +<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> + + + + +项目版本添加 + + + + + + + + + + + + +
                                                                      + <%@ include file="/head.jsp" %> +
                                                                      + + + + +
                                                                      + + +
                                                                      + +
                                                                      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +<%-- + + + + + + --%> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                                                                      项目名称 + + 请选择 + + ${p.projectname} + +
                                                                      版本号  版本链接 
                                                                      计划上线需求数  + 实际上线需求数 
                                                                      代码规范问题(阻断)  以SONAR平台统计数据为准 代码规范问题(严重)  以SONAR平台统计数据为准
                                                                      代码规范问题(主要)  以SONAR平台统计数据为准 代码变动行数 单位:千行
                                                                      测试用例数  转测试打回次数 
                                                                      投入开发人员  投入测试人员 
                                                                      致命级别问题  严重级别问题 
                                                                      一般级别问题  提示级别问题 
                                                                      计划达成日期  实际达成日期  
                                                                      计划开发开始日期  计划开发结束日期  
                                                                      实际开发开始日期  实际开发结束日期  
                                                                      计划测试开始日期  计划测试结束日期  
                                                                      实际测试开始日期  实际测试结束日期  
                                                                      版本说明 
                                                                      质量回溯结果 
                                                                      备注 
                                                                      ${message}
                                                                       返 回
                                                                      +

                                                                      +
                                                                      +

                                                                       

                                                                      +
                                                                      +
                                                                      +
                                                                      + + + + diff --git a/src/main/webapp/jsp/projectversion/projectversion_addplan.jsp b/src/main/webapp/jsp/projectversion/projectversion_addplan.jsp index 2b2a02e..88d816f 100644 --- a/src/main/webapp/jsp/projectversion/projectversion_addplan.jsp +++ b/src/main/webapp/jsp/projectversion/projectversion_addplan.jsp @@ -1,298 +1,298 @@ -<%@ page contentType="text/html; charset=utf-8" language="java" - import="java.sql.*" errorPage=""%> -<%@ taglib prefix="sf" uri="http://www.springframework.org/tags/form"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> - - - - -项目版本添加 - - - - - - - - - - - - - - -
                                                                      - <%@ include file="/head.jsp" %> -
                                                                      - - - -
                                                                      - - -
                                                                      - -
                                                                      - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -<%-- - --%> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                                      项目名称 - - 请选择 - - ${p.projectname} - -
                                                                      版本号  版本链接 
                                                                      计划上线需求数  -
                                                                      投入开发人员  投入测试人员 
                                                                      计划达成日期  实际达成日期  
                                                                      计划开发开始日期  计划开发结束日期  
                                                                      计划测试开始日期  计划测试结束日期  
                                                                      版本说明 
                                                                      备注 
                                                                      ${message}
                                                                       返 回
                                                                      -

                                                                      -
                                                                      -

                                                                       

                                                                      -
                                                                      -
                                                                      -
                                                                      - - - - +<%@ page contentType="text/html; charset=utf-8" language="java" + import="java.sql.*" errorPage=""%> +<%@ taglib prefix="sf" uri="http://www.springframework.org/tags/form"%> +<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> + + + + +项目版本添加 + + + + + + + + + + + + + + +
                                                                      + <%@ include file="/head.jsp" %> +
                                                                      + + + +
                                                                      + + +
                                                                      + +
                                                                      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +<%-- + --%> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                                                                      项目名称 + + 请选择 + + ${p.projectname} + +
                                                                      版本号  版本链接 
                                                                      计划上线需求数  +
                                                                      投入开发人员  投入测试人员 
                                                                      计划达成日期  实际达成日期  
                                                                      计划开发开始日期  计划开发结束日期  
                                                                      计划测试开始日期  计划测试结束日期  
                                                                      版本说明 
                                                                      备注 
                                                                      ${message}
                                                                       返 回
                                                                      +

                                                                      +
                                                                      +

                                                                       

                                                                      +
                                                                      +
                                                                      +
                                                                      + + + + diff --git a/src/main/webapp/jsp/projectversion/projectversion_show.jsp b/src/main/webapp/jsp/projectversion/projectversion_show.jsp index b3c5693..c744443 100644 --- a/src/main/webapp/jsp/projectversion/projectversion_show.jsp +++ b/src/main/webapp/jsp/projectversion/projectversion_show.jsp @@ -1,203 +1,203 @@ -<%@ page contentType="text/html; charset=utf-8" language="java" import="java.sql.*" errorPage="" %> -<%@ taglib prefix="sf" uri="http://www.springframework.org/tags/form" %> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> -<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %> - - - - -项目版本详情 - - - - - - - - - - -
                                                                      - <%@ include file="/head.jsp" %> -
                                                                      - - - -
                                                                      - - -
                                                                      - -
                                                                      - - -
                                                                      - - - - - - - <%-- --%> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                                      项目名称:${projectversion.sectorProjects.projectname}版本号:${projectversion.versionnumber}${projectversion.versionnumber } ${projectversion.versionnumber } 
                                                                      计划上线需求数:${projectversion.plan_demand}实际上线需求数:${projectversion.actually_demand}
                                                                      代码规范问题(阻断):${projectversion.codestandard_zd}     以SONAR平台统计数据为准代码规范问题(严重):${projectversion.codestandard_yz}     以SONAR平台统计数据为准
                                                                      代码规范问题(主要):${projectversion.codestandard_zy}     以SONAR平台统计数据为准代码变动行数:${projectversion.codeline}     单位:千行
                                                                      测试用例数:${projectversion.testcasenum}转测试打回次数:${projectversion.changetestingreturn}
                                                                      投入开发人员:${projectversion.dev_member}投入测试人员:${projectversion.test_member}
                                                                      投入人力资源:${projectversion.human_cost}     (人/天)需求达成率:${projectversion.perdemand}%     (实际需求/计划需求)
                                                                      开发平均生产率:${projectversion.per_dev}     代码千行 人/天测试平均生产率:${projectversion.per_test}     用例数(执行) 人/天
                                                                      开发工期偏差:${projectversion.devtime_deviation}% - - 暂时无法计算
                                                                      计算公式:(实际工期-计划工期)/计划工期
                                                                      开发延期天数:${projectversion.devdelay_days}  天
                                                                      计算公式:实际完成日期-计划完成日期
                                                                      测试工期偏差:${projectversion.testtime_deviation}% - - 暂时无法计算
                                                                      计算公式:(实际工期-计划工期)/计划工期
                                                                      测试延期天数:${projectversion.testdelay_days}  天
                                                                      计算公式:实际完成日期-计划完成日期
                                                                      项目进度偏差:${projectversion.protime_deviation}% - - 暂时无法计算
                                                                      计算公式:(实际上线日期-计划上线日期)/总工期
                                                                      项目上线延期天数:${projectversion.prodelay_days}  天
                                                                      计算公式:实际上线日期-计划上线日期
                                                                      致命级别问题${projectversion.bug_zm} 严重级别问题${projectversion.bug_yz}
                                                                      一般级别问题${projectversion.bug_yb} 提示级别问题${projectversion.bug_ts}
                                                                      版本缺陷DI:${projectversion.code_DI}    按千行代码计算
                                                                      计划达成日期:${projectversion.plan_launchdate}实际达成日期:${projectversion.actually_launchdate}
                                                                      计划开发开始日期:${projectversion.plan_devstart}计划开发结束日期:${projectversion.plan_devend}
                                                                      实际开发开始日期:${projectversion.actually_devstart}实际开发结束日期:${projectversion.actually_devend}
                                                                      计划测试开始日期:${projectversion.plan_teststart}计划测试结束日期:${projectversion.plan_testend}
                                                                      实际测试开始日期:${projectversion.actually_teststart}实际测试结束日期:${projectversion.actually_testend}
                                                                      版本说明:${projectversion.imprint}
                                                                      质量回溯结果:${projectversion.qualityreview}
                                                                      备注:${projectversion.remark}
                                                                      返 回
                                                                      - -
                                                                      -

                                                                       

                                                                      -
                                                                      -
                                                                      -
                                                                      - - +<%@ page contentType="text/html; charset=utf-8" language="java" import="java.sql.*" errorPage="" %> +<%@ taglib prefix="sf" uri="http://www.springframework.org/tags/form" %> +<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> +<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %> + + + + +项目版本详情 + + + + + + + + + + +
                                                                      + <%@ include file="/head.jsp" %> +
                                                                      + + + +
                                                                      + + +
                                                                      + +
                                                                      + + +
                                                                      + + + + + + + <%-- --%> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                                                                      项目名称:${projectversion.sectorProjects.projectname}版本号:${projectversion.versionnumber}${projectversion.versionnumber } ${projectversion.versionnumber } 
                                                                      计划上线需求数:${projectversion.plan_demand}实际上线需求数:${projectversion.actually_demand}
                                                                      代码规范问题(阻断):${projectversion.codestandard_zd}     以SONAR平台统计数据为准代码规范问题(严重):${projectversion.codestandard_yz}     以SONAR平台统计数据为准
                                                                      代码规范问题(主要):${projectversion.codestandard_zy}     以SONAR平台统计数据为准代码变动行数:${projectversion.codeline}     单位:千行
                                                                      测试用例数:${projectversion.testcasenum}转测试打回次数:${projectversion.changetestingreturn}
                                                                      投入开发人员:${projectversion.dev_member}投入测试人员:${projectversion.test_member}
                                                                      投入人力资源:${projectversion.human_cost}     (人/天)需求达成率:${projectversion.perdemand}%     (实际需求/计划需求)
                                                                      开发平均生产率:${projectversion.per_dev}     代码千行 人/天测试平均生产率:${projectversion.per_test}     用例数(执行) 人/天
                                                                      开发工期偏差:${projectversion.devtime_deviation}% + + 暂时无法计算
                                                                      计算公式:(实际工期-计划工期)/计划工期
                                                                      开发延期天数:${projectversion.devdelay_days}  天
                                                                      计算公式:实际完成日期-计划完成日期
                                                                      测试工期偏差:${projectversion.testtime_deviation}% + + 暂时无法计算
                                                                      计算公式:(实际工期-计划工期)/计划工期
                                                                      测试延期天数:${projectversion.testdelay_days}  天
                                                                      计算公式:实际完成日期-计划完成日期
                                                                      项目进度偏差:${projectversion.protime_deviation}% + + 暂时无法计算
                                                                      计算公式:(实际上线日期-计划上线日期)/总工期
                                                                      项目上线延期天数:${projectversion.prodelay_days}  天
                                                                      计算公式:实际上线日期-计划上线日期
                                                                      致命级别问题${projectversion.bug_zm} 严重级别问题${projectversion.bug_yz}
                                                                      一般级别问题${projectversion.bug_yb} 提示级别问题${projectversion.bug_ts}
                                                                      版本缺陷DI:${projectversion.code_DI}    按千行代码计算
                                                                      计划达成日期:${projectversion.plan_launchdate}实际达成日期:${projectversion.actually_launchdate}
                                                                      计划开发开始日期:${projectversion.plan_devstart}计划开发结束日期:${projectversion.plan_devend}
                                                                      实际开发开始日期:${projectversion.actually_devstart}实际开发结束日期:${projectversion.actually_devend}
                                                                      计划测试开始日期:${projectversion.plan_teststart}计划测试结束日期:${projectversion.plan_testend}
                                                                      实际测试开始日期:${projectversion.actually_teststart}实际测试结束日期:${projectversion.actually_testend}
                                                                      版本说明:${projectversion.imprint}
                                                                      质量回溯结果:${projectversion.qualityreview}
                                                                      备注:${projectversion.remark}
                                                                      返 回
                                                                      + +
                                                                      +

                                                                       

                                                                      +
                                                                      +
                                                                      +
                                                                      + + diff --git a/src/main/webapp/jsp/projectversion/projectversion_update.jsp b/src/main/webapp/jsp/projectversion/projectversion_update.jsp index 9da667b..bc1c66e 100644 --- a/src/main/webapp/jsp/projectversion/projectversion_update.jsp +++ b/src/main/webapp/jsp/projectversion/projectversion_update.jsp @@ -1,396 +1,396 @@ -<%@ page contentType="text/html; charset=utf-8" language="java" - import="java.sql.*" errorPage=""%> -<%@ taglib prefix="sf" uri="http://www.springframework.org/tags/form"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> - - - - -项目版本信息修改 - - - - - - - - - - - -
                                                                      - <%@ include file="/head.jsp" %> -
                                                                      - - - - -
                                                                      - - -
                                                                      - -
                                                                      - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -<%-- - - - - - - --%> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                                      项目名称 - - 请选择 - - ${p.projectname} - -                - - 生成上线版本信息      - - 编辑计划 - - -
                                                                      版本号  禅道版本ID     - 同步禅道数据
                                                                      计划上线需求数  - 实际上线需求数 
                                                                      代码规范(阻断)%  以SONAR平台统计数据为准 代码规范(严重)%  以SONAR平台统计数据为准
                                                                      代码规范(主要)%  以SONAR平台统计数据为准 代码变动行数 单位:千行
                                                                      测试用例数  转测试打回次数 
                                                                      投入开发人员  投入测试人员 
                                                                      致命级别问题  严重级别问题 
                                                                      一般级别问题  提示级别问题 
                                                                      计划达成日期  实际达成日期  
                                                                      计划开发开始日期  计划开发结束日期  
                                                                      实际开发开始日期  实际开发结束日期  
                                                                      计划测试开始日期  计划测试结束日期  
                                                                      实际测试开始日期  实际测试结束日期  
                                                                      版本说明 
                                                                      质量回溯结果 
                                                                      备注 
                                                                      ${message}
                                                                       返 回
                                                                      -

                                                                      -
                                                                      -

                                                                       

                                                                      -
                                                                      -
                                                                      -
                                                                      - - - - +<%@ page contentType="text/html; charset=utf-8" language="java" + import="java.sql.*" errorPage=""%> +<%@ taglib prefix="sf" uri="http://www.springframework.org/tags/form"%> +<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> + + + + +项目版本信息修改 + + + + + + + + + + + +
                                                                      + <%@ include file="/head.jsp" %> +
                                                                      + + + + +
                                                                      + + +
                                                                      + +
                                                                      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +<%-- + + + + + + --%> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                                                                      项目名称 + + 请选择 + + ${p.projectname} + +                + + 生成上线版本信息      + + 编辑计划 + + +
                                                                      版本号  禅道版本ID     + 同步禅道数据
                                                                      计划上线需求数  + 实际上线需求数 
                                                                      代码规范(阻断)%  以SONAR平台统计数据为准 代码规范(严重)%  以SONAR平台统计数据为准
                                                                      代码规范(主要)%  以SONAR平台统计数据为准 代码变动行数 单位:千行
                                                                      测试用例数  转测试打回次数 
                                                                      投入开发人员  投入测试人员 
                                                                      致命级别问题  严重级别问题 
                                                                      一般级别问题  提示级别问题 
                                                                      计划达成日期  实际达成日期  
                                                                      计划开发开始日期  计划开发结束日期  
                                                                      实际开发开始日期  实际开发结束日期  
                                                                      计划测试开始日期  计划测试结束日期  
                                                                      实际测试开始日期  实际测试结束日期  
                                                                      版本说明 
                                                                      质量回溯结果 
                                                                      备注 
                                                                      ${message}
                                                                       返 回
                                                                      +

                                                                      +
                                                                      +

                                                                       

                                                                      +
                                                                      +
                                                                      +
                                                                      + + + + diff --git a/src/main/webapp/jsp/projectversion/projectversionreport.jsp b/src/main/webapp/jsp/projectversion/projectversionreport.jsp index 5df1307..05ecff6 100644 --- a/src/main/webapp/jsp/projectversion/projectversionreport.jsp +++ b/src/main/webapp/jsp/projectversion/projectversionreport.jsp @@ -1,156 +1,156 @@ -<%@ page contentType="text/html; charset=utf-8" language="java" - import="java.sql.*" errorPage=""%> -<%@ taglib prefix="sf" uri="http://www.springframework.org/tags/form"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> - - - - - - - - 项目版本统计 - - - - - - -
                                                                      - <%@ include file="/head.jsp" %> -
                                                                      - - - -
                                                                      - - -
                                                                      - -
                                                                      - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                                      项目名称需求完成情况(时间段内总计)版本完成情况(时间段内总计)工作量统计(时间段内总计)测试结果(时间段内总计)
                                                                      计划完成需求数实际完成需求数需求达成率计划上线版本按时完成版本版本达成率开发工作量测试工作量转测试打回次数致命BUG严重BUG一般BUG提示BUG
                                                                      ${t[0] } ${t[1] } ${t[2] } ${t[12] }%  ${t[4] } ${t[13] }% ${t[10] } (人天)${t[11] } (人天)${t[5] } ${t[6] } ${t[7] } ${t[8] } ${t[9] } 
                                                                      -
                                                                      -
                                                                      - - - - - 没有记录! -
                                                                      -

                                                                      -
                                                                      -

                                                                       

                                                                      -
                                                                      -
                                                                      -
                                                                      - - - +<%@ page contentType="text/html; charset=utf-8" language="java" + import="java.sql.*" errorPage=""%> +<%@ taglib prefix="sf" uri="http://www.springframework.org/tags/form"%> +<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> +<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> + + + + + + + + 项目版本统计 + + + + + + +
                                                                      + <%@ include file="/head.jsp" %> +
                                                                      + + + +
                                                                      + + +
                                                                      + +
                                                                      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                                                                      项目名称需求完成情况(时间段内总计)版本完成情况(时间段内总计)工作量统计(时间段内总计)测试结果(时间段内总计)
                                                                      计划完成需求数实际完成需求数需求达成率计划上线版本按时完成版本版本达成率开发工作量测试工作量转测试打回次数致命BUG严重BUG一般BUG提示BUG
                                                                      ${t[0] } ${t[1] } ${t[2] } ${t[12] }%  ${t[4] } ${t[13] }% ${t[10] } (人天)${t[11] } (人天)${t[5] } ${t[6] } ${t[7] } ${t[8] } ${t[9] } 
                                                                      +
                                                                      +
                                                                      + + + + + 没有记录! +
                                                                      +

                                                                      +
                                                                      +

                                                                       

                                                                      +
                                                                      +
                                                                      +
                                                                      + + + \ No newline at end of file diff --git a/src/main/webapp/jsp/projectversion/zentaolist.jsp b/src/main/webapp/jsp/projectversion/zentaolist.jsp index e4785a3..b133f85 100644 --- a/src/main/webapp/jsp/projectversion/zentaolist.jsp +++ b/src/main/webapp/jsp/projectversion/zentaolist.jsp @@ -1,199 +1,199 @@ -<%@ page contentType="text/html; charset=utf-8" language="java" - import="java.sql.*" errorPage=""%> -<%@ taglib prefix="sf" uri="http://www.springframework.org/tags/form"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%> - - - - - - -禅道任务 - - - - - - - -
                                                                      - <%@ include file="/head.jsp" %> -
                                                                      - - - -
                                                                      - - -
                                                                      - -
                                                                      - - - - - - - - - - - - -
                                                                        完成日期:    至     - 版本名称:       完成人:       查询延期任务 -        -
                                                                        报表日期:   -  至     - 按完成人 - 按版本 - 报表查询
                                                                      -
                                                                      - - - - - - - - - - - - - - - - - - - - - - <%-- --%> - - - - - - - -
                                                                      版本名称任务名称任务完成时间计划完成日期计划工时实际工时完成人
                                                                      ${t.versionname } ${t.taskname } ${t.taskname }  ${t.assignedDate } ${t.deadline } ${t.estimate } ${t.consumed } ${t.finishedname } 
                                                                      -
                                                                      -
                                                                      - - - - - 没有记录! - -
                                                                      -
                                                                      -
                                                                      -
                                                                      -
                                                                      -

                                                                       

                                                                      -
                                                                      -
                                                                      -
                                                                      - - - +<%@ page contentType="text/html; charset=utf-8" language="java" + import="java.sql.*" errorPage=""%> +<%@ taglib prefix="sf" uri="http://www.springframework.org/tags/form"%> +<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> +<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%> + + + + + + +禅道任务 + + + + + + + +
                                                                      + <%@ include file="/head.jsp" %> +
                                                                      + + + +
                                                                      + + +
                                                                      + +
                                                                      + + + + + + + + + + + + +
                                                                        完成日期:    至     + 版本名称:       完成人:       查询延期任务 +        +
                                                                        报表日期:   +  至     + 按完成人 + 按版本 + 报表查询
                                                                      +
                                                                      + + + + + + + + + + + + + + + + + + + + + + <%-- --%> + + + + + + + +
                                                                      版本名称任务名称任务完成时间计划完成日期计划工时实际工时完成人
                                                                      ${t.versionname } ${t.taskname } ${t.taskname }  ${t.assignedDate } ${t.deadline } ${t.estimate } ${t.consumed } ${t.finishedname } 
                                                                      +
                                                                      +
                                                                      + + + + + 没有记录! + +
                                                                      +
                                                                      +
                                                                      +
                                                                      +
                                                                      +

                                                                       

                                                                      +
                                                                      +
                                                                      +
                                                                      + + + \ No newline at end of file diff --git a/src/main/webapp/jsp/projectversion/zentaolistfortast.jsp b/src/main/webapp/jsp/projectversion/zentaolistfortast.jsp index 8fe49b7..aa090b0 100644 --- a/src/main/webapp/jsp/projectversion/zentaolistfortast.jsp +++ b/src/main/webapp/jsp/projectversion/zentaolistfortast.jsp @@ -1,162 +1,162 @@ -<%@ page contentType="text/html; charset=utf-8" language="java" - import="java.sql.*" errorPage=""%> -<%@ taglib prefix="sf" uri="http://www.springframework.org/tags/form"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%> - - - - - - - -禅道任务 - - - - - - -
                                                                      - <%@ include file="/head.jsp" %> -
                                                                      - - - -
                                                                      - - -
                                                                      - -
                                                                      - - - - - - -
                                                                      - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                                      版本名称任务名称任务完成时间计划完成日期计划工时实际工时完成人
                                                                      ${t.versionname } ${t.taskname } ${t.taskname } ${t.assignedDate } ${t.deadline } ${t.estimate } ${t.consumed } ${t.finishedname } 
                                                                      -
                                                                      -
                                                                      - - - - - 没有记录! - -
                                                                      -
                                                                      -
                                                                      -
                                                                      -
                                                                      -

                                                                       

                                                                      -
                                                                      -
                                                                      -
                                                                      - - - +<%@ page contentType="text/html; charset=utf-8" language="java" + import="java.sql.*" errorPage=""%> +<%@ taglib prefix="sf" uri="http://www.springframework.org/tags/form"%> +<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> +<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%> + + + + + + + +禅道任务 + + + + + + +
                                                                      + <%@ include file="/head.jsp" %> +
                                                                      + + + +
                                                                      + + +
                                                                      + +
                                                                      + + + + + + +
                                                                      + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                                                                      版本名称任务名称任务完成时间计划完成日期计划工时实际工时完成人
                                                                      ${t.versionname } ${t.taskname } ${t.taskname } ${t.assignedDate } ${t.deadline } ${t.estimate } ${t.consumed } ${t.finishedname } 
                                                                      +
                                                                      +
                                                                      + + + + + 没有记录! + +
                                                                      +
                                                                      +
                                                                      +
                                                                      +
                                                                      +

                                                                       

                                                                      +
                                                                      +
                                                                      +
                                                                      + + + \ No newline at end of file diff --git a/src/main/webapp/jsp/projectversion/zentaoreport.jsp b/src/main/webapp/jsp/projectversion/zentaoreport.jsp index b3bd42b..50f67f1 100644 --- a/src/main/webapp/jsp/projectversion/zentaoreport.jsp +++ b/src/main/webapp/jsp/projectversion/zentaoreport.jsp @@ -1,150 +1,150 @@ -<%@ page contentType="text/html; charset=utf-8" language="java" - import="java.sql.*" errorPage=""%> -<%@ taglib prefix="sf" uri="http://www.springframework.org/tags/form"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> - - - - - - - - 禅道报表统计 - - - - - - -
                                                                      - <%@ include file="/head.jsp" %> -
                                                                      - - - -
                                                                      - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                                      完成人版本名称计划总工时实际总工时工时偏差未延迟任务延迟任务任务达成率
                                                                      ${t[0] } ${t[1] } ${t[2] } ${t[6] }% ${t[6] }% ${t[3] } ${t[4] } ${t[5] }% ${t[5] }% 
                                                                      -
                                                                      -
                                                                      - - - - - 没有记录! -
                                                                      -

                                                                      -
                                                                      -
                                                                      -

                                                                       

                                                                      - -
                                                                      - - - +<%@ page contentType="text/html; charset=utf-8" language="java" + import="java.sql.*" errorPage=""%> +<%@ taglib prefix="sf" uri="http://www.springframework.org/tags/form"%> +<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> +<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> + + + + + + + + 禅道报表统计 + + + + + + +
                                                                      + <%@ include file="/head.jsp" %> +
                                                                      + + + +
                                                                      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                                                                      完成人版本名称计划总工时实际总工时工时偏差未延迟任务延迟任务任务达成率
                                                                      ${t[0] } ${t[1] } ${t[2] } ${t[6] }% ${t[6] }% ${t[3] } ${t[4] } ${t[5] }% ${t[5] }% 
                                                                      +
                                                                      +
                                                                      + + + + + 没有记录! +
                                                                      +

                                                                      +
                                                                      +
                                                                      +

                                                                       

                                                                      + +
                                                                      + + + \ No newline at end of file diff --git a/src/main/webapp/jsp/review/review.jsp b/src/main/webapp/jsp/review/review.jsp index 5345d5b..6201ecb 100644 --- a/src/main/webapp/jsp/review/review.jsp +++ b/src/main/webapp/jsp/review/review.jsp @@ -1,353 +1,353 @@ -<%@ page contentType="text/html; charset=utf-8" language="java" - import="java.sql.*" errorPage=""%> -<%@ taglib prefix="sf" uri="http://www.springframework.org/tags/form"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> - - - - - -项目评审记录 - - - -
                                                                      - <%@ include file="/head.jsp"%> -
                                                                      - - - - -
                                                                      - - -
                                                                      - -
                                                                      - - -
                                                                      -
                                                                      -
                                                                      查询条件
                                                                      -
                                                                      -
                                                                      - -
                                                                      - -
                                                                      - - -
                                                                      - -
                                                                      -
                                                                      -
                                                                      -
                                                                      - -
                                                                      - - - - -
                                                                      -
                                                                      - -
                                                                      -
                                                                      -
                                                                      -
                                                                      - - - +<%@ page contentType="text/html; charset=utf-8" language="java" + import="java.sql.*" errorPage=""%> +<%@ taglib prefix="sf" uri="http://www.springframework.org/tags/form"%> +<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> + + + + + +项目评审记录 + + + +
                                                                      + <%@ include file="/head.jsp"%> +
                                                                      + + + + +
                                                                      + + +
                                                                      + +
                                                                      + + +
                                                                      +
                                                                      +
                                                                      查询条件
                                                                      +
                                                                      +
                                                                      + +
                                                                      + +
                                                                      + + +
                                                                      + +
                                                                      +
                                                                      +
                                                                      +
                                                                      + +
                                                                      + + + + +
                                                                      +
                                                                      + +
                                                                      +
                                                                      +
                                                                      +
                                                                      + + + \ No newline at end of file diff --git a/src/main/webapp/jsp/review/review_update.jsp b/src/main/webapp/jsp/review/review_update.jsp index 0b134f6..df3f792 100644 --- a/src/main/webapp/jsp/review/review_update.jsp +++ b/src/main/webapp/jsp/review/review_update.jsp @@ -1,245 +1,245 @@ -<%@ page contentType="text/html; charset=utf-8" language="java" - import="java.sql.*" errorPage=""%> -<%@ taglib prefix="sf" uri="http://www.springframework.org/tags/form"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> - - - - -评审信息修改 - - - - - - - - - - - - - - -
                                                                      - <%@ include file="/head.jsp" %> -
                                                                      - - - -
                                                                      - - -
                                                                      - -
                                                                      - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                                      项目名称 - - 请选择 - - ${p.projectname} - - 版本号 
                                                                      评审时间 评审类型 - - 代码评审 - 文档评审 - 设计评审 - 需求评审 - 用例评审 - 其他技术评审 - -
                                                                      评审对象  最后确认日期
                                                                      结论确认人  评审结论 - - 评审通过 - 待修改确认 - 待修改再评审 - -
                                                                      备注 
                                                                      ${message}
                                                                       返 回
                                                                      -

                                                                      -
                                                                      -

                                                                       

                                                                      -
                                                                      -
                                                                      -
                                                                      - - - - +<%@ page contentType="text/html; charset=utf-8" language="java" + import="java.sql.*" errorPage=""%> +<%@ taglib prefix="sf" uri="http://www.springframework.org/tags/form"%> +<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> + + + + +评审信息修改 + + + + + + + + + + + + + + +
                                                                      + <%@ include file="/head.jsp" %> +
                                                                      + + + +
                                                                      + + +
                                                                      + +
                                                                      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                                                                      项目名称 + + 请选择 + + ${p.projectname} + + 版本号 
                                                                      评审时间 评审类型 + + 代码评审 + 文档评审 + 设计评审 + 需求评审 + 用例评审 + 其他技术评审 + +
                                                                      评审对象  最后确认日期
                                                                      结论确认人  评审结论 + + 评审通过 + 待修改确认 + 待修改再评审 + +
                                                                      备注 
                                                                      ${message}
                                                                       返 回
                                                                      +

                                                                      +
                                                                      +

                                                                       

                                                                      +
                                                                      +
                                                                      +
                                                                      + + + + diff --git a/src/main/webapp/jsp/review/reviewinfo.jsp b/src/main/webapp/jsp/review/reviewinfo.jsp index 2435d9e..b756d16 100644 --- a/src/main/webapp/jsp/review/reviewinfo.jsp +++ b/src/main/webapp/jsp/review/reviewinfo.jsp @@ -1,233 +1,233 @@ -<%@ page contentType="text/html; charset=utf-8" language="java" - import="java.sql.*" errorPage=""%> -<%@ taglib prefix="sf" uri="http://www.springframework.org/tags/form"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> - - - - - -评审记录详情 - - - -
                                                                      - <%@ include file="/head.jsp"%> -
                                                                      - - - - -
                                                                      - - -
                                                                      - -
                                                                      - - -
                                                                      -
                                                                      -
                                                                      评审基本信息
                                                                      -
                                                                      -
                                                                      - - -
                                                                      - - -
                                                                      -
                                                                      -
                                                                      - -
                                                                      - - - -
                                                                      -
                                                                      - -
                                                                      -
                                                                      -
                                                                      -
                                                                      - - - +<%@ page contentType="text/html; charset=utf-8" language="java" + import="java.sql.*" errorPage=""%> +<%@ taglib prefix="sf" uri="http://www.springframework.org/tags/form"%> +<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> + + + + + +评审记录详情 + + + +
                                                                      + <%@ include file="/head.jsp"%> +
                                                                      + + + + +
                                                                      + + +
                                                                      + +
                                                                      + + +
                                                                      +
                                                                      +
                                                                      评审基本信息
                                                                      +
                                                                      +
                                                                      + + +
                                                                      + + +
                                                                      +
                                                                      +
                                                                      + +
                                                                      + + + +
                                                                      +
                                                                      + +
                                                                      +
                                                                      +
                                                                      +
                                                                      + + + \ No newline at end of file diff --git a/src/main/webapp/jsp/review/reviewinfo_add.jsp b/src/main/webapp/jsp/review/reviewinfo_add.jsp index 07bb344..20eb6c4 100644 --- a/src/main/webapp/jsp/review/reviewinfo_add.jsp +++ b/src/main/webapp/jsp/review/reviewinfo_add.jsp @@ -1,273 +1,273 @@ -<%@ page contentType="text/html; charset=utf-8" language="java" - import="java.sql.*" errorPage=""%> -<%@ taglib prefix="sf" uri="http://www.springframework.org/tags/form"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> - - - - -评审信息添加 - - - - - - - - - - - - - - -
                                                                      - <%@ include file="/head.jsp" %> -
                                                                      - - - -
                                                                      - - -
                                                                      - -
                                                                      - - - - - - - - - - - - - - - - - - - - - - - - - -<%-- - --%> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                                      项目名称 - - 请选择 - - ${p.projectname} - - 版本号 
                                                                      评审时间 评审类型 - - 代码评审 - 文档评审 - 设计评审 - 需求评审 - 用例评审 - 其他技术评审 - -
                                                                      评审对象  最后确认日期
                                                                      责任人  状态 - - 新建 - 修复中 - 已修复 - -
                                                                      结论确认人  评审结论 - - 评审通过 - 待修改确认 - 待修改再评审 - -
                                                                      问题描述 
                                                                      改正措施 
                                                                      备注 
                                                                      ${message}
                                                                       返 回
                                                                      -

                                                                      -
                                                                      -

                                                                       

                                                                      -
                                                                      -
                                                                      -
                                                                      - - - - +<%@ page contentType="text/html; charset=utf-8" language="java" + import="java.sql.*" errorPage=""%> +<%@ taglib prefix="sf" uri="http://www.springframework.org/tags/form"%> +<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> + + + + +评审信息添加 + + + + + + + + + + + + + + +
                                                                      + <%@ include file="/head.jsp" %> +
                                                                      + + + +
                                                                      + + +
                                                                      + +
                                                                      + + + + + + + + + + + + + + + + + + + + + + + + + +<%-- + --%> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                                                                      项目名称 + + 请选择 + + ${p.projectname} + + 版本号 
                                                                      评审时间 评审类型 + + 代码评审 + 文档评审 + 设计评审 + 需求评审 + 用例评审 + 其他技术评审 + +
                                                                      评审对象  最后确认日期
                                                                      责任人  状态 + + 新建 + 修复中 + 已修复 + +
                                                                      结论确认人  评审结论 + + 评审通过 + 待修改确认 + 待修改再评审 + +
                                                                      问题描述 
                                                                      改正措施 
                                                                      备注 
                                                                      ${message}
                                                                       返 回
                                                                      +

                                                                      +
                                                                      +

                                                                       

                                                                      +
                                                                      +
                                                                      +
                                                                      + + + + diff --git a/src/main/webapp/jsp/review/reviewinfo_update.jsp b/src/main/webapp/jsp/review/reviewinfo_update.jsp index aadc824..61b32d5 100644 --- a/src/main/webapp/jsp/review/reviewinfo_update.jsp +++ b/src/main/webapp/jsp/review/reviewinfo_update.jsp @@ -1,231 +1,231 @@ -<%@ page contentType="text/html; charset=utf-8" language="java" - import="java.sql.*" errorPage=""%> -<%@ taglib prefix="sf" uri="http://www.springframework.org/tags/form"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> - - - - -评审信息修改 - - - - - - - - - - - - - -
                                                                      - <%@ include file="/head.jsp" %> -
                                                                      - - - -
                                                                      - - -
                                                                      - -
                                                                      - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                                      项目名称 - ${reviewinfo.projectname}版本号${reviewinfo.version}
                                                                      评审时间${reviewinfo.review_date}评审类型${reviewinfo.review_type}
                                                                      评审对象${reviewinfo.review_object}最后确认日期
                                                                      责任人  状态 - - 新建 - 修复中 - 已修复 - -
                                                                      结论确认人${reviewinfo.result_Confirmor}评审结论${reviewinfo.review_result}
                                                                      问题描述 
                                                                      改正措施 
                                                                      备注${reviewinfo.remark}
                                                                      ${message}
                                                                       返 回
                                                                      -

                                                                      -
                                                                      -

                                                                       

                                                                      -
                                                                      -
                                                                      -
                                                                      - - - - +<%@ page contentType="text/html; charset=utf-8" language="java" + import="java.sql.*" errorPage=""%> +<%@ taglib prefix="sf" uri="http://www.springframework.org/tags/form"%> +<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> + + + + +评审信息修改 + + + + + + + + + + + + + +
                                                                      + <%@ include file="/head.jsp" %> +
                                                                      + + + +
                                                                      + + +
                                                                      + +
                                                                      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                                                                      项目名称 + ${reviewinfo.projectname}版本号${reviewinfo.version}
                                                                      评审时间${reviewinfo.review_date}评审类型${reviewinfo.review_type}
                                                                      评审对象${reviewinfo.review_object}最后确认日期
                                                                      责任人  状态 + + 新建 + 修复中 + 已修复 + +
                                                                      结论确认人${reviewinfo.result_Confirmor}评审结论${reviewinfo.review_result}
                                                                      问题描述 
                                                                      改正措施 
                                                                      备注${reviewinfo.remark}
                                                                      ${message}
                                                                       返 回
                                                                      +

                                                                      +
                                                                      +

                                                                       

                                                                      +
                                                                      +
                                                                      +
                                                                      + + + + diff --git a/src/main/webapp/jsp/task/casedetail_list.jsp b/src/main/webapp/jsp/task/casedetail_list.jsp index 0256345..6130b4d 100644 --- a/src/main/webapp/jsp/task/casedetail_list.jsp +++ b/src/main/webapp/jsp/task/casedetail_list.jsp @@ -1,521 +1,521 @@ -<%@ page contentType="text/html; charset=utf-8" language="java" - import="java.sql.*" errorPage=""%> -<%@ taglib prefix="sf" uri="http://www.springframework.org/tags/form"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> - - - - - -用例执行列表 - - - -
                                                                      - <%@ include file="/head.jsp"%> -
                                                                      - - - - -
                                                                      - - -
                                                                      - -
                                                                      - - -
                                                                      -
                                                                      -
                                                                      查询条件
                                                                      -
                                                                      -
                                                                      - -
                                                                      - -
                                                                      - -
                                                                      - -
                                                                      - - - - - -
                                                                      - -
                                                                      - -
                                                                      - - -
                                                                      - -
                                                                      -
                                                                      -
                                                                      - -
                                                                      -
                                                                      -
                                                                      - -
                                                                      - - -
                                                                      -
                                                                      - -
                                                                      - -
                                                                      - - - - +<%@ page contentType="text/html; charset=utf-8" language="java" + import="java.sql.*" errorPage=""%> +<%@ taglib prefix="sf" uri="http://www.springframework.org/tags/form"%> +<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> + + + + + +用例执行列表 + + + +
                                                                      + <%@ include file="/head.jsp"%> +
                                                                      + + + + +
                                                                      + + +
                                                                      + +
                                                                      + + +
                                                                      +
                                                                      +
                                                                      查询条件
                                                                      +
                                                                      +
                                                                      + +
                                                                      + +
                                                                      + +
                                                                      + +
                                                                      + + + + + +
                                                                      + +
                                                                      + +
                                                                      + + +
                                                                      + +
                                                                      +
                                                                      +
                                                                      + +
                                                                      +
                                                                      +
                                                                      + +
                                                                      + + +
                                                                      +
                                                                      + +
                                                                      + +
                                                                      + + + + \ No newline at end of file diff --git a/src/main/webapp/jsp/task/file_upload.jsp b/src/main/webapp/jsp/task/file_upload.jsp index 4ad38f9..99386da 100644 --- a/src/main/webapp/jsp/task/file_upload.jsp +++ b/src/main/webapp/jsp/task/file_upload.jsp @@ -1,129 +1,129 @@ -<%@ page contentType="text/html; charset=utf-8" language="java" - import="java.sql.*" errorPage=""%> -<%@ taglib prefix="sf" uri="http://www.springframework.org/tags/form"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> - - - - - -上传测试驱动桩 - - - - - - - - -
                                                                      - <%@ include file="/head.jsp"%> -
                                                                      - - - -
                                                                      - - -
                                                                      - -
                                                                      - - -
                                                                      - - - - - - - - - - - - - - - - -
                                                                      您将把测试驱动JAR包上传至 - ${clientip} 的客户端
                                                                      测试驱动桩在客户端项目的路径 -
                                                                      请选择文件 - (只能上传.jar的文件!)
                                                                        - - - - -
                                                                       
                                                                      - - - - - - - -
                                                                      温馨提示:

                                                                      1、若各自项目中的自动化驱动桩代码有更新,将项目重新打包后上传至对应的客户端IP即可,此JAR包将会自动保存至客户端的LIB目录下

                                                                      -

                                                                      2、重新运行即是最新的代码。

                                                                      -

                                                                      3、打包项目的名称最好与项目名一致。

                                                                      -

                                                                      4、如果出现方法或是类找不到,那么有可能是您的LIB目录中存在方法或是类冲突的情况,可以使用findJAR.cmd进行排除

                                                                      -

                                                                      5、打包流程如下:根据箭头的流程来打包:

                                                                      -

                                                                      - -

                                                                      -

                                                                      - -

                                                                      -

                                                                      - -

                                                                      -

                                                                      - -

                                                                      -

                                                                      - -

                                                                      -

                                                                      - -

                                                                      -

                                                                      - -

                                                                      -

                                                                       

                                                                      -
                                                                      -
                                                                      -
                                                                      -
                                                                      - - +<%@ page contentType="text/html; charset=utf-8" language="java" + import="java.sql.*" errorPage=""%> +<%@ taglib prefix="sf" uri="http://www.springframework.org/tags/form"%> +<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> + + + + + +上传测试驱动桩 + + + + + + + + +
                                                                      + <%@ include file="/head.jsp"%> +
                                                                      + + + +
                                                                      + + +
                                                                      + +
                                                                      + + +
                                                                      + + + + + + + + + + + + + + + + +
                                                                      您将把测试驱动JAR包上传至 + ${clientip} 的客户端
                                                                      测试驱动桩在客户端项目的路径 +
                                                                      请选择文件 + (只能上传.jar的文件!)
                                                                        + + + + +
                                                                       
                                                                      + + + + + + + +
                                                                      温馨提示:

                                                                      1、若各自项目中的自动化驱动桩代码有更新,将项目重新打包后上传至对应的客户端IP即可,此JAR包将会自动保存至客户端的LIB目录下

                                                                      +

                                                                      2、重新运行即是最新的代码。

                                                                      +

                                                                      3、打包项目的名称最好与项目名一致。

                                                                      +

                                                                      4、如果出现方法或是类找不到,那么有可能是您的LIB目录中存在方法或是类冲突的情况,可以使用findJAR.cmd进行排除

                                                                      +

                                                                      5、打包流程如下:根据箭头的流程来打包:

                                                                      +

                                                                      + +

                                                                      +

                                                                      + +

                                                                      +

                                                                      + +

                                                                      +

                                                                      + +

                                                                      +

                                                                      + +

                                                                      +

                                                                      + +

                                                                      +

                                                                      + +

                                                                      +

                                                                       

                                                                      +
                                                                      +
                                                                      +
                                                                      +
                                                                      + + diff --git a/src/main/webapp/jsp/task/job_list.jsp b/src/main/webapp/jsp/task/job_list.jsp index 7476304..36a8aa5 100644 --- a/src/main/webapp/jsp/task/job_list.jsp +++ b/src/main/webapp/jsp/task/job_list.jsp @@ -1,519 +1,519 @@ -<%@ page contentType="text/html; charset=utf-8" language="java" - import="java.sql.*" errorPage=""%> -<%@ taglib prefix="sf" uri="http://www.springframework.org/tags/form"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> - - - - - -测试任务调度 - - - -
                                                                      - <%@ include file="/head.jsp"%> -
                                                                      - - - - -
                                                                      - - -
                                                                      - -
                                                                      - - -
                                                                      -
                                                                      -
                                                                      查询条件
                                                                      -
                                                                      -
                                                                      - -
                                                                      - -
                                                                      -
                                                                      -
                                                                      -
                                                                      - -
                                                                      - - - -
                                                                      -
                                                                      - - - - - - - -
                                                                      -
                                                                      -
                                                                      -
                                                                      - - - +<%@ page contentType="text/html; charset=utf-8" language="java" + import="java.sql.*" errorPage=""%> +<%@ taglib prefix="sf" uri="http://www.springframework.org/tags/form"%> +<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> + + + + + +测试任务调度 + + + +
                                                                      + <%@ include file="/head.jsp"%> +
                                                                      + + + + +
                                                                      + + +
                                                                      + +
                                                                      + + +
                                                                      +
                                                                      +
                                                                      查询条件
                                                                      +
                                                                      +
                                                                      + +
                                                                      + +
                                                                      +
                                                                      +
                                                                      +
                                                                      + +
                                                                      + + + +
                                                                      +
                                                                      + + + + + + + +
                                                                      +
                                                                      +
                                                                      +
                                                                      + + + \ No newline at end of file diff --git a/src/main/webapp/jsp/task/task_add.jsp b/src/main/webapp/jsp/task/task_add.jsp index 9f918b8..18efbc8 100644 --- a/src/main/webapp/jsp/task/task_add.jsp +++ b/src/main/webapp/jsp/task/task_add.jsp @@ -1,604 +1,604 @@ -<%@ page contentType="text/html; charset=utf-8" language="java" - import="java.sql.*" errorPage=""%> -<%@ taglib prefix="sf" uri="http://www.springframework.org/tags/form"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> - - - - -调度任务添加 - - - - - - - - - - - - -
                                                                      - <%@ include file="/head.jsp" %> -
                                                                      - - - -
                                                                      - - -
                                                                      - -
                                                                      - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - <%-- --%> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                                      计划名称 
                                                                      自动化类型 - 接口自动化     - UI自动化
                                                                      项目类型 - 系统项目     - TestLink项目 -
                                                                      项目名(testlink中) - 请选择 - - ${p.projectname} - -
                                                                      计划名(testlink中)
                                                                      客户端IP - 请选择执行客户端... -
                                                                      客户端驱动桩路径 - 请选择客户端驱动桩路径... -
                                                                      调度任务描述
                                                                      执行次数一次 每天 <%-- 每小时 - 每分钟 - 每秒 - 自定义 --%> -
                                                                      每隔 -
                                                                      线程数 - (线程数控制在20以内,UI自动化默认为1,填写其他数字无效!)
                                                                      超时时间 - (超时时间控制在1-120分钟之间),针对接口测试有效
                                                                      执行结果是否发送邮件不发送 发送
                                                                      计划任务中是否自动构建项目不自动构建 自动构建
                                                                      计划任务中是否自动重启TOMCAT不自动重启 自动重启
                                                                      Cron表达式:
                                                                      (必填,Cron表达式(如"0/10 - * * ? * * *",每10秒中执行调试一次),对使用者要求比较,要会写Cron表达式) 注意hour只支持00-23点
                                                                       
                                                                      ${message}
                                                                       返 - 回
                                                                      - 字段 允许值 允许的特殊字符
                                                                      秒 0-59 , - * /
                                                                      分 0-59 , - * /
                                                                      - 小时 0-23 , - * /
                                                                      日期 1-31 , - * ? / L W C
                                                                      月份 1-12 或者 - JAN-DEC , - * /
                                                                      星期 1-7 或者 SUN-SAT , - * ? / L C #
                                                                      - 年(可选) 留空, 1970-2099 , - * /

                                                                      表达式 意义
                                                                      "0 - 0 12 * * ?" 每天中午12点触发
                                                                      "0 15 10 ? * *" - 每天上午10:15触发
                                                                      "0 15 10 * * ?" 每天上午10:15触发
                                                                      - "0 15 10 * * ? *" 每天上午10:15触发
                                                                      "0 15 10 * * - ? 2005" 2005年的每天上午10:15触发
                                                                      "0 * 14 * * ?" - 在每天下午2点到下午2:59期间的每1分钟触发
                                                                      "0 0/5 14 * * ?" - 在每天下午2点到下午2:55期间的每5分钟触发
                                                                      "0 0/5 14,18 * * ?" - 在每天下午2点到2:55期间和下午6点到6:55期间的每5分钟触发
                                                                      "0 0-5 14 * * - ?" 在每天下午2点到下午2:05期间的每1分钟触发
                                                                      "0 10,44 14 ? 3 - WED" 每年三月的星期三的下午2:10和2:44触发
                                                                      "0 15 10 ? * - MON-FRI" 周一至周五的上午10:15触发
                                                                      "0 15 10 15 * ?" - 每月15日上午10:15触发
                                                                      "0 15 10 L * ?" 每月最后一日的上午10:15触发 -
                                                                      "0 15 10 ? * 6L" 每月的最后一个星期五上午10:15触发
                                                                      - "0 15 10 ? * 6L 2002-2005" - 2002年至2005年的每月的最后一个星期五上午10:15触发
                                                                      "0 15 10 ? * - 6#3" 每月的第三个星期五上午10:15触发

                                                                      特殊字符 意义
                                                                      * - 表示所有值;
                                                                      ? 表示未说明的值,即不关心它为何值;
                                                                      - 表示一个指定的范围;
                                                                      , - 表示附加一个可能值;
                                                                      / 符号前表示开始时间,符号后表示每次递增的值;
                                                                      - L("last") ("last") "L" - 用在day-of-month字段意思是 "这个月最后一天";用在 day-of-week字段, 它简单意思是 - "7" or "SAT"。 如果在day-of-week字段里和数字联合使用,它的意思就是 - "这个月的最后一个星期几" – 例如: "6L" means - "这个月的最后一个星期五". - 当我们用“L”时,不指明一个列表值或者范围是很重要的,不然的话,我们会得到一些意想不到的结果。
                                                                      - W("weekday") - 只能用在day-of-month字段。用来描叙最接近指定天的工作日(周一到周五)。例如:在day-of-month字段用“15W”指“最接近这个 - 月第15天的工作日”,即如果这个月第15天是周六,那么触发器将会在这个月第14天即周五触发;如果这个月第15天是周日,那么触发器将会在这个月第 - 16天即周一触发;如果这个月第15天是周二,那么就在触发器这天触发。注意一点:这个用法只会在当前月计算值,不会越过当前月。“W”字符仅能在 - day-of-month指明一天,不能是一个范围或列表。也可以用“LW”来指定这个月的最后一个工作日。
                                                                      # - 只能用在day-of-week字段。用来指定这个月的第几个周几。例:在day-of-week字段用"6#3"指这个月第3个周五(6指周五,3指第3个)。如果指定的日期不存在,触发器就不会触发。 -
                                                                      C 指和calendar联系后计算过的值。例:在day-of-month - 字段用“5C”指在这个月第5天或之后包括calendar的第一天;在day-of-week字段用“1C”指在这周日或之后包括calendar的第一天。
                                                                      -
                                                                      -

                                                                      -

                                                                      -
                                                                      -

                                                                       

                                                                      -
                                                                      -
                                                                      -
                                                                      - - - - +<%@ page contentType="text/html; charset=utf-8" language="java" + import="java.sql.*" errorPage=""%> +<%@ taglib prefix="sf" uri="http://www.springframework.org/tags/form"%> +<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> + + + + +调度任务添加 + + + + + + + + + + + + +
                                                                      + <%@ include file="/head.jsp" %> +
                                                                      + + + +
                                                                      + + +
                                                                      + +
                                                                      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <%-- --%> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                                                                      计划名称 
                                                                      自动化类型 + 接口自动化     + UI自动化
                                                                      项目类型 + 系统项目     + TestLink项目 +
                                                                      项目名(testlink中) + 请选择 + + ${p.projectname} + +
                                                                      计划名(testlink中)
                                                                      客户端IP + 请选择执行客户端... +
                                                                      客户端驱动桩路径 + 请选择客户端驱动桩路径... +
                                                                      调度任务描述
                                                                      执行次数一次 每天 <%-- 每小时 + 每分钟 + 每秒 + 自定义 --%> +
                                                                      每隔 +
                                                                      线程数 + (线程数控制在20以内,UI自动化默认为1,填写其他数字无效!)
                                                                      超时时间 + (超时时间控制在1-120分钟之间),针对接口测试有效
                                                                      执行结果是否发送邮件不发送 发送
                                                                      计划任务中是否自动构建项目不自动构建 自动构建
                                                                      计划任务中是否自动重启TOMCAT不自动重启 自动重启
                                                                      Cron表达式:
                                                                      (必填,Cron表达式(如"0/10 + * * ? * * *",每10秒中执行调试一次),对使用者要求比较,要会写Cron表达式) 注意hour只支持00-23点
                                                                       
                                                                      ${message}
                                                                       返 + 回
                                                                      + 字段 允许值 允许的特殊字符
                                                                      秒 0-59 , - * /
                                                                      分 0-59 , - * /
                                                                      + 小时 0-23 , - * /
                                                                      日期 1-31 , - * ? / L W C
                                                                      月份 1-12 或者 + JAN-DEC , - * /
                                                                      星期 1-7 或者 SUN-SAT , - * ? / L C #
                                                                      + 年(可选) 留空, 1970-2099 , - * /

                                                                      表达式 意义
                                                                      "0 + 0 12 * * ?" 每天中午12点触发
                                                                      "0 15 10 ? * *" + 每天上午10:15触发
                                                                      "0 15 10 * * ?" 每天上午10:15触发
                                                                      + "0 15 10 * * ? *" 每天上午10:15触发
                                                                      "0 15 10 * * + ? 2005" 2005年的每天上午10:15触发
                                                                      "0 * 14 * * ?" + 在每天下午2点到下午2:59期间的每1分钟触发
                                                                      "0 0/5 14 * * ?" + 在每天下午2点到下午2:55期间的每5分钟触发
                                                                      "0 0/5 14,18 * * ?" + 在每天下午2点到2:55期间和下午6点到6:55期间的每5分钟触发
                                                                      "0 0-5 14 * * + ?" 在每天下午2点到下午2:05期间的每1分钟触发
                                                                      "0 10,44 14 ? 3 + WED" 每年三月的星期三的下午2:10和2:44触发
                                                                      "0 15 10 ? * + MON-FRI" 周一至周五的上午10:15触发
                                                                      "0 15 10 15 * ?" + 每月15日上午10:15触发
                                                                      "0 15 10 L * ?" 每月最后一日的上午10:15触发 +
                                                                      "0 15 10 ? * 6L" 每月的最后一个星期五上午10:15触发
                                                                      + "0 15 10 ? * 6L 2002-2005" + 2002年至2005年的每月的最后一个星期五上午10:15触发
                                                                      "0 15 10 ? * + 6#3" 每月的第三个星期五上午10:15触发

                                                                      特殊字符 意义
                                                                      * + 表示所有值;
                                                                      ? 表示未说明的值,即不关心它为何值;
                                                                      - 表示一个指定的范围;
                                                                      , + 表示附加一个可能值;
                                                                      / 符号前表示开始时间,符号后表示每次递增的值;
                                                                      + L("last") ("last") "L" + 用在day-of-month字段意思是 "这个月最后一天";用在 day-of-week字段, 它简单意思是 + "7" or "SAT"。 如果在day-of-week字段里和数字联合使用,它的意思就是 + "这个月的最后一个星期几" – 例如: "6L" means + "这个月的最后一个星期五". + 当我们用“L”时,不指明一个列表值或者范围是很重要的,不然的话,我们会得到一些意想不到的结果。
                                                                      + W("weekday") + 只能用在day-of-month字段。用来描叙最接近指定天的工作日(周一到周五)。例如:在day-of-month字段用“15W”指“最接近这个 + 月第15天的工作日”,即如果这个月第15天是周六,那么触发器将会在这个月第14天即周五触发;如果这个月第15天是周日,那么触发器将会在这个月第 + 16天即周一触发;如果这个月第15天是周二,那么就在触发器这天触发。注意一点:这个用法只会在当前月计算值,不会越过当前月。“W”字符仅能在 + day-of-month指明一天,不能是一个范围或列表。也可以用“LW”来指定这个月的最后一个工作日。
                                                                      # + 只能用在day-of-week字段。用来指定这个月的第几个周几。例:在day-of-week字段用"6#3"指这个月第3个周五(6指周五,3指第3个)。如果指定的日期不存在,触发器就不会触发。 +
                                                                      C 指和calendar联系后计算过的值。例:在day-of-month + 字段用“5C”指在这个月第5天或之后包括calendar的第一天;在day-of-week字段用“1C”指在这周日或之后包括calendar的第一天。
                                                                      +
                                                                      +

                                                                      +

                                                                      +
                                                                      +

                                                                       

                                                                      +
                                                                      +
                                                                      +
                                                                      + + + + diff --git a/src/main/webapp/jsp/task/task_show.jsp b/src/main/webapp/jsp/task/task_show.jsp index 499c6dd..5e9984f 100644 --- a/src/main/webapp/jsp/task/task_show.jsp +++ b/src/main/webapp/jsp/task/task_show.jsp @@ -1,161 +1,161 @@ -<%@ page contentType="text/html; charset=utf-8" language="java" import="java.sql.*" errorPage="" %> -<%@ taglib prefix="sf" uri="http://www.springframework.org/tags/form" %> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> - - - - -调度任务详情 - - - - - - -
                                                                      - <%@ include file="/head.jsp" %> -
                                                                      - - - -
                                                                      - - -
                                                                      - -
                                                                      - - - -
                                                                      - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - <%-- - - - - - - - - - - - - - --%> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                                      计划名称${taskjob.taskName}
                                                                      自动化类型接口自动化UI自动化
                                                                      客户端IP ${taskjob.clientip}
                                                                      项目名(testlink中)${taskjob.planproj}
                                                                      计划名(testlink中)${taskjob.testlinkname }
                                                                      计划描述${taskjob.remark}
                                                                      执行次数 - - 只执行一次 - - 每天执行
                                                                      执行日期${taskjob.date" id="date" class="Wdate" onClick="WdatePicker({isShowClear:false})">
                                                                      时间${taskjob.time" id="time3" onfocus="WdatePicker({skin:'whyGreen',dateFmt:'H:mm:ss',isShowClear:false})" class="Wdate"/>
                                                                      执行 -
                                                                      线程数${taskjob.threadCount} - (线程数控制在20以内)
                                                                      执行结果是否发送邮件 - - 不发送 - - 发送【收件人:${taskjob.emailer }】
                                                                      项目在计划任务中是否自动构建 - - 不自动构建 - - 自动构建【构建项目:${taskjob.buildname }】
                                                                      TOMCAT在计划任务中是否自动重启 - - 不自动重启 - - 自动重启【重启命令:${taskjob.restartcomm }】
                                                                      开始时间${taskjob.startDate} - - ${taskjob.startTime}
                                                                      结束时间${taskjob.endDate} - - ${taskjob.endTime}
                                                                       返 回
                                                                      - -
                                                                      -

                                                                       

                                                                      -
                                                                      -
                                                                      -
                                                                      - - +<%@ page contentType="text/html; charset=utf-8" language="java" import="java.sql.*" errorPage="" %> +<%@ taglib prefix="sf" uri="http://www.springframework.org/tags/form" %> +<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> + + + + +调度任务详情 + + + + + + +
                                                                      + <%@ include file="/head.jsp" %> +
                                                                      + + + +
                                                                      + + +
                                                                      + +
                                                                      + + + +
                                                                      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <%-- + + + + + + + + + - + + + --%> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                                                                      计划名称${taskjob.taskName}
                                                                      自动化类型接口自动化UI自动化
                                                                      客户端IP ${taskjob.clientip}
                                                                      项目名(testlink中)${taskjob.planproj}
                                                                      计划名(testlink中)${taskjob.testlinkname }
                                                                      计划描述${taskjob.remark}
                                                                      执行次数 + + 只执行一次 + + 每天执行
                                                                      执行日期${taskjob.date" id="date" class="Wdate" onClick="WdatePicker({isShowClear:false})">
                                                                      时间${taskjob.time" id="time3" onfocus="WdatePicker({skin:'whyGreen',dateFmt:'H:mm:ss',isShowClear:false})" class="Wdate"/>
                                                                      执行 +
                                                                      线程数${taskjob.threadCount} + (线程数控制在20以内)
                                                                      执行结果是否发送邮件 + + 不发送 + + 发送【收件人:${taskjob.emailer }】
                                                                      项目在计划任务中是否自动构建 + + 不自动构建 + + 自动构建【构建项目:${taskjob.buildname }】
                                                                      TOMCAT在计划任务中是否自动重启 + + 不自动重启 + + 自动重启【重启命令:${taskjob.restartcomm }】
                                                                      开始时间${taskjob.startDate} + + ${taskjob.startTime}
                                                                      结束时间${taskjob.endDate} + + ${taskjob.endTime}
                                                                       返 回
                                                                      + +
                                                                      +

                                                                       

                                                                      +
                                                                      +
                                                                      +
                                                                      + + diff --git a/src/main/webapp/jsp/task/task_update.jsp b/src/main/webapp/jsp/task/task_update.jsp index bbc84aa..b99058f 100644 --- a/src/main/webapp/jsp/task/task_update.jsp +++ b/src/main/webapp/jsp/task/task_update.jsp @@ -1,598 +1,598 @@ -<%@ page contentType="text/html; charset=utf-8" language="java" import="java.sql.*" errorPage="" %> -<%@ taglib prefix="sf" uri="http://www.springframework.org/tags/form" %> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> - - - - -调度任务修改 - - - - - - - - - - - - - - -
                                                                      - <%@ include file="/head.jsp" %> -
                                                                      - - - -
                                                                      - - -
                                                                      - -
                                                                      - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - <%-- - - - - - - - - - - - - - --%> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                                                      计划名称
                                                                      自动化类型 - 接口自动化     UI自动化
                                                                      项目类型 - 系统项目     - TestLink项目
                                                                      项目名(testlink中) - 请选择 - - ${p.projectname} - -
                                                                      计划名(testlink中)
                                                                      客户端IP - 请选择执行客户端... - - ${tc.name} - -
                                                                      客户端驱动桩路径 - 请选择客户端驱动桩路径... - - ${tcpath} - -
                                                                      调度任务描述
                                                                      执行次数一次 每天 - - <%-- - 一次 - - 每天--%>
                                                                      执行日期
                                                                      时间
                                                                      执行 -
                                                                      线程数 - (线程数控制在20以内)
                                                                      超时时间 - (超时时间控制在1-120分钟之间),针对接口测试有效
                                                                      执行结果是否发送邮件不发送 发送
                                                                      计划任务中是否自动构建项目不自动构建 自动构建
                                                                      计划任务中是否自动重启TOMCAT不自动重启 自动重启
                                                                      Cron表达式:     - (必填,Cron表达式(如"0/10 * * ? * * - *",每10秒中执行调试一次),对使用者要求比较,要会写Cron表达式) 注意hour只支持00-23点
                                                                      -      返 回
                                                                      - 字段 允许值 允许的特殊字符
                                                                      秒 0-59 , - * /
                                                                      分 0-59 , - * /
                                                                      - 小时 0-23 , - * /
                                                                      日期 1-31 , - * ? / L W C
                                                                      月份 1-12 - 或者 JAN-DEC , - * /
                                                                      星期 1-7 或者 SUN-SAT , - * ? / L C #
                                                                      - 年(可选) 留空, 1970-2099 , - * /

                                                                      表达式 意义
                                                                      - "0 0 12 * * ?" 每天中午12点触发
                                                                      "0 15 10 ? * - *" 每天上午10:15触发
                                                                      "0 15 10 * * ?" - 每天上午10:15触发
                                                                      "0 15 10 * * ? *" 每天上午10:15触发
                                                                      - "0 15 10 * * ? 2005" 2005年的每天上午10:15触发
                                                                      "0 - * 14 * * ?" 在每天下午2点到下午2:59期间的每1分钟触发
                                                                      "0 0/5 14 - * * ?" 在每天下午2点到下午2:55期间的每5分钟触发
                                                                      "0 0/5 14,18 * - * ?" 在每天下午2点到2:55期间和下午6点到6:55期间的每5分钟触发
                                                                      "0 0-5 - 14 * * ?" 在每天下午2点到下午2:05期间的每1分钟触发
                                                                      "0 10,44 14 - ? 3 WED" 每年三月的星期三的下午2:10和2:44触发
                                                                      "0 15 10 ? * - MON-FRI" 周一至周五的上午10:15触发
                                                                      "0 15 10 15 * ?" - 每月15日上午10:15触发
                                                                      "0 15 10 L * ?" - 每月最后一日的上午10:15触发
                                                                      "0 15 10 ? * 6L" - 每月的最后一个星期五上午10:15触发
                                                                      "0 15 10 ? * 6L 2002-2005" - 2002年至2005年的每月的最后一个星期五上午10:15触发
                                                                      "0 15 10 ? * - 6#3" 每月的第三个星期五上午10:15触发

                                                                      特殊字符 意义
                                                                      * - 表示所有值;
                                                                      ? 表示未说明的值,即不关心它为何值;
                                                                      - 表示一个指定的范围;
                                                                      - , 表示附加一个可能值;
                                                                      / 符号前表示开始时间,符号后表示每次递增的值;
                                                                      - L("last") ("last") "L" - 用在day-of-month字段意思是 "这个月最后一天";用在 day-of-week字段, 它简单意思是 - "7" or "SAT"。 - 如果在day-of-week字段里和数字联合使用,它的意思就是 "这个月的最后一个星期几" – 例如: - "6L" means "这个月的最后一个星期五". - 当我们用“L”时,不指明一个列表值或者范围是很重要的,不然的话,我们会得到一些意想不到的结果。
                                                                      - W("weekday") - 只能用在day-of-month字段。用来描叙最接近指定天的工作日(周一到周五)。例如:在day-of-month字段用“15W”指“最接近这个 - 月第15天的工作日”,即如果这个月第15天是周六,那么触发器将会在这个月第14天即周五触发;如果这个月第15天是周日,那么触发器将会在这个月第 - 16天即周一触发;如果这个月第15天是周二,那么就在触发器这天触发。注意一点:这个用法只会在当前月计算值,不会越过当前月。“W”字符仅能在 - day-of-month指明一天,不能是一个范围或列表。也可以用“LW”来指定这个月的最后一个工作日。
                                                                      # - 只能用在day-of-week字段。用来指定这个月的第几个周几。例:在day-of-week字段用"6#3"指这个月第3个周五(6指周五,3指第3个)。如果指定的日期不存在,触发器就不会触发。 -
                                                                      C 指和calendar联系后计算过的值。例:在day-of-month - 字段用“5C”指在这个月第5天或之后包括calendar的第一天;在day-of-week字段用“1C”指在这周日或之后包括calendar的第一天。
                                                                      -
                                                                      -
                                                                      -

                                                                       

                                                                      -
                                                                      -
                                                                      -
                                                                      - - - - +<%@ page contentType="text/html; charset=utf-8" language="java" import="java.sql.*" errorPage="" %> +<%@ taglib prefix="sf" uri="http://www.springframework.org/tags/form" %> +<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> + + + + +调度任务修改 + + + + + + + + + + + + + + +
                                                                      + <%@ include file="/head.jsp" %> +
                                                                      + + + +
                                                                      + + +
                                                                      + +
                                                                      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <%-- + + + + + + + + + - + + + --%> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                                                                      计划名称
                                                                      自动化类型 + 接口自动化     UI自动化
                                                                      项目类型 + 系统项目     + TestLink项目
                                                                      项目名(testlink中) + 请选择 + + ${p.projectname} + +
                                                                      计划名(testlink中)
                                                                      客户端IP + 请选择执行客户端... + + ${tc.name} + +
                                                                      客户端驱动桩路径 + 请选择客户端驱动桩路径... + + ${tcpath} + +
                                                                      调度任务描述
                                                                      执行次数一次 每天 + + <%-- + 一次 + + 每天--%>
                                                                      执行日期
                                                                      时间
                                                                      执行 +
                                                                      线程数 + (线程数控制在20以内)
                                                                      超时时间 + (超时时间控制在1-120分钟之间),针对接口测试有效
                                                                      执行结果是否发送邮件不发送 发送
                                                                      计划任务中是否自动构建项目不自动构建 自动构建
                                                                      计划任务中是否自动重启TOMCAT不自动重启 自动重启
                                                                      Cron表达式:     + (必填,Cron表达式(如"0/10 * * ? * * + *",每10秒中执行调试一次),对使用者要求比较,要会写Cron表达式) 注意hour只支持00-23点
                                                                      +      返 回
                                                                      + 字段 允许值 允许的特殊字符
                                                                      秒 0-59 , - * /
                                                                      分 0-59 , - * /
                                                                      + 小时 0-23 , - * /
                                                                      日期 1-31 , - * ? / L W C
                                                                      月份 1-12 + 或者 JAN-DEC , - * /
                                                                      星期 1-7 或者 SUN-SAT , - * ? / L C #
                                                                      + 年(可选) 留空, 1970-2099 , - * /

                                                                      表达式 意义
                                                                      + "0 0 12 * * ?" 每天中午12点触发
                                                                      "0 15 10 ? * + *" 每天上午10:15触发
                                                                      "0 15 10 * * ?" + 每天上午10:15触发
                                                                      "0 15 10 * * ? *" 每天上午10:15触发
                                                                      + "0 15 10 * * ? 2005" 2005年的每天上午10:15触发
                                                                      "0 + * 14 * * ?" 在每天下午2点到下午2:59期间的每1分钟触发
                                                                      "0 0/5 14 + * * ?" 在每天下午2点到下午2:55期间的每5分钟触发
                                                                      "0 0/5 14,18 * + * ?" 在每天下午2点到2:55期间和下午6点到6:55期间的每5分钟触发
                                                                      "0 0-5 + 14 * * ?" 在每天下午2点到下午2:05期间的每1分钟触发
                                                                      "0 10,44 14 + ? 3 WED" 每年三月的星期三的下午2:10和2:44触发
                                                                      "0 15 10 ? * + MON-FRI" 周一至周五的上午10:15触发
                                                                      "0 15 10 15 * ?" + 每月15日上午10:15触发
                                                                      "0 15 10 L * ?" + 每月最后一日的上午10:15触发
                                                                      "0 15 10 ? * 6L" + 每月的最后一个星期五上午10:15触发
                                                                      "0 15 10 ? * 6L 2002-2005" + 2002年至2005年的每月的最后一个星期五上午10:15触发
                                                                      "0 15 10 ? * + 6#3" 每月的第三个星期五上午10:15触发

                                                                      特殊字符 意义
                                                                      * + 表示所有值;
                                                                      ? 表示未说明的值,即不关心它为何值;
                                                                      - 表示一个指定的范围;
                                                                      + , 表示附加一个可能值;
                                                                      / 符号前表示开始时间,符号后表示每次递增的值;
                                                                      + L("last") ("last") "L" + 用在day-of-month字段意思是 "这个月最后一天";用在 day-of-week字段, 它简单意思是 + "7" or "SAT"。 + 如果在day-of-week字段里和数字联合使用,它的意思就是 "这个月的最后一个星期几" – 例如: + "6L" means "这个月的最后一个星期五". + 当我们用“L”时,不指明一个列表值或者范围是很重要的,不然的话,我们会得到一些意想不到的结果。
                                                                      + W("weekday") + 只能用在day-of-month字段。用来描叙最接近指定天的工作日(周一到周五)。例如:在day-of-month字段用“15W”指“最接近这个 + 月第15天的工作日”,即如果这个月第15天是周六,那么触发器将会在这个月第14天即周五触发;如果这个月第15天是周日,那么触发器将会在这个月第 + 16天即周一触发;如果这个月第15天是周二,那么就在触发器这天触发。注意一点:这个用法只会在当前月计算值,不会越过当前月。“W”字符仅能在 + day-of-month指明一天,不能是一个范围或列表。也可以用“LW”来指定这个月的最后一个工作日。
                                                                      # + 只能用在day-of-week字段。用来指定这个月的第几个周几。例:在day-of-week字段用"6#3"指这个月第3个周五(6指周五,3指第3个)。如果指定的日期不存在,触发器就不会触发。 +
                                                                      C 指和calendar联系后计算过的值。例:在day-of-month + 字段用“5C”指在这个月第5天或之后包括calendar的第一天;在day-of-week字段用“1C”指在这周日或之后包括calendar的第一天。
                                                                      +
                                                                      +
                                                                      +

                                                                       

                                                                      +
                                                                      +
                                                                      +
                                                                      + + + + diff --git a/src/main/webapp/jsp/task/taskexcute_list.jsp b/src/main/webapp/jsp/task/taskexcute_list.jsp index f8d01cd..c4cd3ce 100644 --- a/src/main/webapp/jsp/task/taskexcute_list.jsp +++ b/src/main/webapp/jsp/task/taskexcute_list.jsp @@ -1,405 +1,405 @@ -<%@ page contentType="text/html; charset=utf-8" language="java" - import="java.sql.*" errorPage=""%> -<%@ taglib prefix="sf" uri="http://www.springframework.org/tags/form"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> - - - - -任务执行列表 - - - -
                                                                      - <%@ include file="/head.jsp"%> -
                                                                      - - - - -
                                                                      - - -
                                                                      - -
                                                                      - - -
                                                                      -
                                                                      -
                                                                      查询条件
                                                                      -
                                                                      -
                                                                      - -
                                                                      - -
                                                                      - -
                                                                      - - -
                                                                      - - - - - -
                                                                      - - -
                                                                      - -
                                                                      -
                                                                      - - -
                                                                      -
                                                                      -
                                                                      - -
                                                                      - -
                                                                      -
                                                                      - - - -
                                                                      -
                                                                      -
                                                                      -
                                                                      - - - +<%@ page contentType="text/html; charset=utf-8" language="java" + import="java.sql.*" errorPage=""%> +<%@ taglib prefix="sf" uri="http://www.springframework.org/tags/form"%> +<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> + + + + +任务执行列表 + + + +
                                                                      + <%@ include file="/head.jsp"%> +
                                                                      + + + + +
                                                                      + + +
                                                                      + +
                                                                      + + +
                                                                      +
                                                                      +
                                                                      查询条件
                                                                      +
                                                                      +
                                                                      + +
                                                                      + +
                                                                      + +
                                                                      + + +
                                                                      + + + + + +
                                                                      + + +
                                                                      + +
                                                                      +
                                                                      + + +
                                                                      +
                                                                      +
                                                                      + +
                                                                      + +
                                                                      +
                                                                      + + + +
                                                                      +
                                                                      +
                                                                      +
                                                                      + + + \ No newline at end of file diff --git a/src/main/webapp/jsp/user/role.jsp b/src/main/webapp/jsp/user/role.jsp index 9e1502a..c3088dd 100644 --- a/src/main/webapp/jsp/user/role.jsp +++ b/src/main/webapp/jsp/user/role.jsp @@ -1,168 +1,168 @@ -<%@ page contentType="text/html; charset=utf-8" language="java" - import="java.sql.*" errorPage=""%> -<%@ taglib prefix="sf" uri="http://www.springframework.org/tags/form"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> - - - - -角色权限 - - - - - - - - - - -
                                                                      - <%@ include file="/head.jsp" %> -
                                                                      - - - -
                                                                      - - -
                                                                      - -
                                                                      - - -
                                                                      -
                                                                      -
                                                                      -

                                                                      配置角色权限

                                                                      - - -
                                                                      - - - 请选择 - - ${p.role} - - -
                                                                      - -
                                                                      -
                                                                      - - -      - -
                                                                      - -
                                                                      -
                                                                      - - -      - -
                                                                      - -
                                                                      -
                                                                      -
                                                                      - -              - - 删除角色 -
                                                                      -
                                                                      -
                                                                      -
                                                                      -
                                                                      - -
                                                                      - -

                                                                       

                                                                      -
                                                                      -
                                                                      -
                                                                      - - - - +<%@ page contentType="text/html; charset=utf-8" language="java" + import="java.sql.*" errorPage=""%> +<%@ taglib prefix="sf" uri="http://www.springframework.org/tags/form"%> +<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> + + + + +角色权限 + + + + + + + + + + +
                                                                      + <%@ include file="/head.jsp" %> +
                                                                      + + + +
                                                                      + + +
                                                                      + +
                                                                      + + +
                                                                      +
                                                                      +
                                                                      +

                                                                      配置角色权限

                                                                      + + +
                                                                      + + + 请选择 + + ${p.role} + + +
                                                                      + +
                                                                      +
                                                                      + + +      + +
                                                                      + +
                                                                      +
                                                                      + + +      + +
                                                                      + +
                                                                      +
                                                                      +
                                                                      + +              + + 删除角色 +
                                                                      +
                                                                      +
                                                                      +
                                                                      +
                                                                      + +
                                                                      + +

                                                                       

                                                                      +
                                                                      +
                                                                      +
                                                                      + + + + diff --git a/src/main/webapp/jsp/user/role_add.jsp b/src/main/webapp/jsp/user/role_add.jsp index 7ca0023..21c30e9 100644 --- a/src/main/webapp/jsp/user/role_add.jsp +++ b/src/main/webapp/jsp/user/role_add.jsp @@ -1,116 +1,116 @@ -<%@ page contentType="text/html; charset=utf-8" language="java" - import="java.sql.*" errorPage=""%> -<%@ taglib prefix="sf" uri="http://www.springframework.org/tags/form"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> - - - - -添加角色权限 - - - - - - - - - - - -
                                                                      - <%@ include file="/head.jsp" %> -
                                                                      - - - -
                                                                      - - -
                                                                      - -
                                                                      - - -
                                                                      -
                                                                      -
                                                                      -

                                                                      添加角色权限

                                                                      - - -
                                                                      - - -
                                                                      - -
                                                                      -
                                                                      - - -      - -
                                                                      - -
                                                                      -
                                                                      - - -      - -
                                                                      - -
                                                                      -
                                                                      -
                                                                      - -
                                                                      -
                                                                      -
                                                                      -
                                                                      -
                                                                      - -
                                                                      - -

                                                                       

                                                                      -
                                                                      -
                                                                      -
                                                                      - - - - +<%@ page contentType="text/html; charset=utf-8" language="java" + import="java.sql.*" errorPage=""%> +<%@ taglib prefix="sf" uri="http://www.springframework.org/tags/form"%> +<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> + + + + +添加角色权限 + + + + + + + + + + + +
                                                                      + <%@ include file="/head.jsp" %> +
                                                                      + + + +
                                                                      + + +
                                                                      + +
                                                                      + + +
                                                                      +
                                                                      +
                                                                      +

                                                                      添加角色权限

                                                                      + + +
                                                                      + + +
                                                                      + +
                                                                      +
                                                                      + + +      + +
                                                                      + +
                                                                      +
                                                                      + + +      + +
                                                                      + +
                                                                      +
                                                                      +
                                                                      + +
                                                                      +
                                                                      +
                                                                      +
                                                                      +
                                                                      + +
                                                                      + +

                                                                       

                                                                      +
                                                                      +
                                                                      +
                                                                      + + + + diff --git a/src/main/webapp/jsp/user/user.jsp b/src/main/webapp/jsp/user/user.jsp index 1f9ddac..bb72e7d 100644 --- a/src/main/webapp/jsp/user/user.jsp +++ b/src/main/webapp/jsp/user/user.jsp @@ -1,336 +1,336 @@ -<%@ page contentType="text/html; charset=utf-8" language="java" - import="java.sql.*" errorPage=""%> -<%@ taglib prefix="sf" uri="http://www.springframework.org/tags/form"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> - - - - - -系统管理 - - - -
                                                                      - <%@ include file="/head.jsp"%> -
                                                                      - - - - -
                                                                      - - -
                                                                      - -
                                                                      - - -
                                                                      - -
                                                                      - - - - - - - -
                                                                      -
                                                                      - -
                                                                      -
                                                                      -
                                                                      -
                                                                      - - - +<%@ page contentType="text/html; charset=utf-8" language="java" + import="java.sql.*" errorPage=""%> +<%@ taglib prefix="sf" uri="http://www.springframework.org/tags/form"%> +<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> + + + + + +系统管理 + + + +
                                                                      + <%@ include file="/head.jsp"%> +
                                                                      + + + + +
                                                                      + + +
                                                                      + +
                                                                      + + +
                                                                      + +
                                                                      + + + + + + + +
                                                                      +
                                                                      + +
                                                                      +
                                                                      +
                                                                      +
                                                                      + + + \ No newline at end of file diff --git a/src/main/webapp/jsp/user/user_add.jsp b/src/main/webapp/jsp/user/user_add.jsp index 2383f71..163025c 100644 --- a/src/main/webapp/jsp/user/user_add.jsp +++ b/src/main/webapp/jsp/user/user_add.jsp @@ -1,143 +1,143 @@ -<%@ page contentType="text/html; charset=utf-8" language="java" - import="java.sql.*" errorPage=""%> -<%@ taglib prefix="sf" uri="http://www.springframework.org/tags/form"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> - - - - -用户添加 - - - - - - - - - - - -
                                                                      - <%@ include file="/head.jsp" %> -
                                                                      - - - -
                                                                      - - -
                                                                      - -
                                                                      - - -
                                                                      -
                                                                      -
                                                                      -

                                                                      创建一个账户

                                                                      - - -
                                                                      - - -
                                                                      -
                                                                      - - -
                                                                      -
                                                                      - - - 请选择 - - ${p.departmentname} - - -
                                                                      -
                                                                      - - - - ${p.projectname} - - -
                                                                      -
                                                                      -
                                                                      - - -      - -
                                                                      - -
                                                                      -
                                                                      - - -
                                                                      -
                                                                      - - -
                                                                      -
                                                                      - -
                                                                      -
                                                                      -
                                                                      - -
                                                                      -
                                                                      -
                                                                      -
                                                                      -
                                                                      - -
                                                                      - -

                                                                       

                                                                      -
                                                                      -
                                                                      -
                                                                      - - - - +<%@ page contentType="text/html; charset=utf-8" language="java" + import="java.sql.*" errorPage=""%> +<%@ taglib prefix="sf" uri="http://www.springframework.org/tags/form"%> +<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> + + + + +用户添加 + + + + + + + + + + + +
                                                                      + <%@ include file="/head.jsp" %> +
                                                                      + + + +
                                                                      + + +
                                                                      + +
                                                                      + + +
                                                                      +
                                                                      +
                                                                      +

                                                                      创建一个账户

                                                                      + + +
                                                                      + + +
                                                                      +
                                                                      + + +
                                                                      +
                                                                      + + + 请选择 + + ${p.departmentname} + + +
                                                                      +
                                                                      + + + + ${p.projectname} + + +
                                                                      +
                                                                      +
                                                                      + + +      + +
                                                                      + +
                                                                      +
                                                                      + + +
                                                                      +
                                                                      + + +
                                                                      +
                                                                      + +
                                                                      +
                                                                      +
                                                                      + +
                                                                      +
                                                                      +
                                                                      +
                                                                      +
                                                                      + +
                                                                      + +

                                                                       

                                                                      +
                                                                      +
                                                                      +
                                                                      + + + + diff --git a/src/main/webapp/jsp/user/user_info.jsp b/src/main/webapp/jsp/user/user_info.jsp index 9f2e1e5..e469cb0 100644 --- a/src/main/webapp/jsp/user/user_info.jsp +++ b/src/main/webapp/jsp/user/user_info.jsp @@ -1,101 +1,101 @@ -<%@ page contentType="text/html; charset=utf-8" language="java" import="java.sql.*" errorPage=""%> -<%@ taglib prefix="sf" uri="http://www.springframework.org/tags/form"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> - - - - -用户信息 - - - - - - - - - - - -
                                                                      - <%@ include file="/head.jsp" %> -
                                                                      - - - -
                                                                      - - -
                                                                      - -
                                                                      - - -
                                                                      -
                                                                      - -
                                                                      -

                                                                      个人资料

                                                                      - -
                                                                      - -
                                                                      -
                                                                      - -
                                                                      -
                                                                      - -
                                                                      -
                                                                      - - - - -
                                                                      -
                                                                      - -
                                                                      - - - -
                                                                      -
                                                                      - -
                                                                      - -

                                                                       

                                                                      -
                                                                      -
                                                                      -
                                                                      - - +<%@ page contentType="text/html; charset=utf-8" language="java" import="java.sql.*" errorPage=""%> +<%@ taglib prefix="sf" uri="http://www.springframework.org/tags/form"%> +<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> + + + + +用户信息 + + + + + + + + + + + +
                                                                      + <%@ include file="/head.jsp" %> +
                                                                      + + + +
                                                                      + + +
                                                                      + +
                                                                      + + +
                                                                      +
                                                                      + +
                                                                      +

                                                                      个人资料

                                                                      + +
                                                                      + +
                                                                      +
                                                                      + +
                                                                      +
                                                                      + +
                                                                      +
                                                                      + + + + +
                                                                      +
                                                                      + +
                                                                      + + + +
                                                                      +
                                                                      + +
                                                                      + +

                                                                       

                                                                      +
                                                                      +
                                                                      +
                                                                      + + diff --git a/src/main/webapp/jsp/user/user_proupdate.jsp b/src/main/webapp/jsp/user/user_proupdate.jsp index 615a6cd..d7f88a4 100644 --- a/src/main/webapp/jsp/user/user_proupdate.jsp +++ b/src/main/webapp/jsp/user/user_proupdate.jsp @@ -1,104 +1,104 @@ -<%@ page contentType="text/html; charset=utf-8" language="java" - import="java.sql.*" errorPage=""%> -<%@ taglib prefix="sf" uri="http://www.springframework.org/tags/form"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> - - - - -修改用户默认项目 - - - - - - - - - - - -
                                                                      - <%@ include file="/head.jsp" %> -
                                                                      - - - -
                                                                      - - -
                                                                      - -
                                                                      - - -
                                                                      -
                                                                      -
                                                                      -

                                                                      修改用户默认项目

                                                                      - - -
                                                                      - - - - ${p.projectname} - - -
                                                                      - -
                                                                      -
                                                                      - -
                                                                      -
                                                                      -
                                                                      -
                                                                      -
                                                                      - -
                                                                      - -

                                                                       

                                                                      -
                                                                      -
                                                                      -
                                                                      - - - - +<%@ page contentType="text/html; charset=utf-8" language="java" + import="java.sql.*" errorPage=""%> +<%@ taglib prefix="sf" uri="http://www.springframework.org/tags/form"%> +<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> + + + + +修改用户默认项目 + + + + + + + + + + + +
                                                                      + <%@ include file="/head.jsp" %> +
                                                                      + + + +
                                                                      + + +
                                                                      + +
                                                                      + + +
                                                                      +
                                                                      +
                                                                      +

                                                                      修改用户默认项目

                                                                      + + +
                                                                      + + + + ${p.projectname} + + +
                                                                      + +
                                                                      +
                                                                      + +
                                                                      +
                                                                      +
                                                                      +
                                                                      +
                                                                      + +
                                                                      + +

                                                                       

                                                                      +
                                                                      +
                                                                      +
                                                                      + + + + diff --git a/src/main/webapp/jsp/user/user_pswupdate.jsp b/src/main/webapp/jsp/user/user_pswupdate.jsp index dfadb7c..2d6f818 100644 --- a/src/main/webapp/jsp/user/user_pswupdate.jsp +++ b/src/main/webapp/jsp/user/user_pswupdate.jsp @@ -1,108 +1,108 @@ -<%@ page contentType="text/html; charset=utf-8" language="java" - import="java.sql.*" errorPage=""%> -<%@ taglib prefix="sf" uri="http://www.springframework.org/tags/form"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> - - - - -修改用户密码 - - - - - - - - - - - -
                                                                      - <%@ include file="/head.jsp" %> -
                                                                      - - - -
                                                                      - - -
                                                                      - -
                                                                      - - -
                                                                      -
                                                                      -
                                                                      -

                                                                      修改用户密码

                                                                      - - -
                                                                      - - -
                                                                      -
                                                                      -
                                                                      - - -
                                                                      -
                                                                      - - -
                                                                      -
                                                                      - -
                                                                      -
                                                                      - -
                                                                      -
                                                                      -
                                                                      -
                                                                      -
                                                                      - -
                                                                      - -

                                                                       

                                                                      -
                                                                      -
                                                                      -
                                                                      - - - - +<%@ page contentType="text/html; charset=utf-8" language="java" + import="java.sql.*" errorPage=""%> +<%@ taglib prefix="sf" uri="http://www.springframework.org/tags/form"%> +<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> + + + + +修改用户密码 + + + + + + + + + + + +
                                                                      + <%@ include file="/head.jsp" %> +
                                                                      + + + +
                                                                      + + +
                                                                      + +
                                                                      + + +
                                                                      +
                                                                      +
                                                                      +

                                                                      修改用户密码

                                                                      + + +
                                                                      + + +
                                                                      +
                                                                      +
                                                                      + + +
                                                                      +
                                                                      + + +
                                                                      +
                                                                      + +
                                                                      +
                                                                      + +
                                                                      +
                                                                      +
                                                                      +
                                                                      +
                                                                      + +
                                                                      + +

                                                                       

                                                                      +
                                                                      +
                                                                      +
                                                                      + + + + diff --git a/src/main/webapp/jsp/user/user_update.jsp b/src/main/webapp/jsp/user/user_update.jsp index d00eedf..c4997dc 100644 --- a/src/main/webapp/jsp/user/user_update.jsp +++ b/src/main/webapp/jsp/user/user_update.jsp @@ -1,243 +1,243 @@ -<%@ page contentType="text/html; charset=utf-8" language="java" - import="java.sql.*" errorPage=""%> -<%@ taglib prefix="sf" uri="http://www.springframework.org/tags/form"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> - - - - -用户信息修改 - - - - - - - - - - - -
                                                                      - <%@ include file="/head.jsp" %> -
                                                                      - - - -
                                                                      - - -
                                                                      - -
                                                                      - - -<%-- - - - - - - - - - - - - - - - - - -
                                                                      用户名 
                                                                      ${message}
                                                                      返 回
                                                                      -

                                                                      -
                                                                      --%> -
                                                                      -
                                                                      -
                                                                      -

                                                                      修改账户信息

                                                                      - - -
                                                                      - - -
                                                                      -
                                                                      - - -
                                                                      -
                                                                      - - - 请选择 - - ${p.departmentname} - - -
                                                                      -
                                                                      - - - - ${p.projectname} - - -
                                                                      -
                                                                      -
                                                                      - - -      - -
                                                                      - -
                                                                      -
                                                                      - - -
                                                                      -
                                                                      - - -
                                                                      -
                                                                      - -
                                                                      -
                                                                      -
                                                                      - -
                                                                      -
                                                                      -
                                                                      -
                                                                      -
                                                                      - -
                                                                      - -

                                                                       

                                                                      -
                                                                      -
                                                                      -
                                                                      - - - - +<%@ page contentType="text/html; charset=utf-8" language="java" + import="java.sql.*" errorPage=""%> +<%@ taglib prefix="sf" uri="http://www.springframework.org/tags/form"%> +<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> + + + + +用户信息修改 + + + + + + + + + + + +
                                                                      + <%@ include file="/head.jsp" %> +
                                                                      + + + +
                                                                      + + +
                                                                      + +
                                                                      + + +<%-- + + + + + + + + + + + + + + + + + +
                                                                      用户名 
                                                                      ${message}
                                                                      返 回
                                                                      +

                                                                      +
                                                                      --%> +
                                                                      +
                                                                      +
                                                                      +

                                                                      修改账户信息

                                                                      + + +
                                                                      + + +
                                                                      +
                                                                      + + +
                                                                      +
                                                                      + + + 请选择 + + ${p.departmentname} + + +
                                                                      +
                                                                      + + + + ${p.projectname} + + +
                                                                      +
                                                                      +
                                                                      + + +      + +
                                                                      + +
                                                                      +
                                                                      + + +
                                                                      +
                                                                      + + +
                                                                      +
                                                                      + +
                                                                      +
                                                                      +
                                                                      + +
                                                                      +
                                                                      +
                                                                      +
                                                                      +
                                                                      + +
                                                                      + +

                                                                       

                                                                      +
                                                                      +
                                                                      +
                                                                      + + + + diff --git a/src/main/webapp/progressus/assets/css/bootstrap-modal-loading.css b/src/main/webapp/progressus/assets/css/bootstrap-modal-loading.css index 4eecbf1..e88cd14 100644 --- a/src/main/webapp/progressus/assets/css/bootstrap-modal-loading.css +++ b/src/main/webapp/progressus/assets/css/bootstrap-modal-loading.css @@ -1,18 +1,18 @@ -.loading { - width: 220px; - height: 56px; - position: absolute; - top: 50%; - left: 50%; - line-height: 56px; - color: #fff; - padding-left: 60px; - font-size: 15px; - background: #000 url(/progressus/assets/img/loading.gif) no-repeat 10px 50%; - opacity: 0.7; - z-index: 9999; - -moz-border-radius: 20px; - -webkit-border-radius: 20px; - border-radius: 20px; - filter: progid:DXImageTransform.Microsoft.Alpha(opacity=70); +.loading { + width: 220px; + height: 56px; + position: absolute; + top: 50%; + left: 50%; + line-height: 56px; + color: #fff; + padding-left: 60px; + font-size: 15px; + background: #000 url(/progressus/assets/img/loading.gif) no-repeat 10px 50%; + opacity: 0.7; + z-index: 9999; + -moz-border-radius: 20px; + -webkit-border-radius: 20px; + border-radius: 20px; + filter: progid:DXImageTransform.Microsoft.Alpha(opacity=70); } \ No newline at end of file diff --git a/src/main/webapp/progressus/assets/css/main.css b/src/main/webapp/progressus/assets/css/main.css index 3c0d2cc..4c56ca2 100644 --- a/src/main/webapp/progressus/assets/css/main.css +++ b/src/main/webapp/progressus/assets/css/main.css @@ -1,82 +1,82 @@ -/* Header */ -#head { background:#181015 url( ../images/mac2.png) no-repeat; background-size: cover; min-height:520px; text-align: center; padding-top:240px; color:white; font-family:"Open sans", Helvetica, Arial; font-weight:300; } -#head.secondary { height:100px; min-height: 100px; padding-top:0px; } - #head .lead { font-family:"Open sans", Helvetica, Arial; font-size:44px; margin-bottom:6px; color:white; line-height:1.15em; } - #head .tagline { color:rgba(255,255,255,0.75); margin-bottom:25px; } - #head .tagline a { color:#fff; } - #head .btn { margin-bottom:10px;} - #head .btn-default { text-shadow: none; background:transparent; color:rgba(255,255,255,.5); -webkit-box-shadow:inset 0px 0px 0px 3px rgba(255,255,255,.5); -moz-box-shadow:inset 0px 0px 0px 3px rgba(255,255,255,.5); box-shadow:inset 0px 0px 0px 3px rgba(255,255,255,.5); background: transparent; } - #head .btn-default:hover, - #head .btn-default:focus { color:rgba(255,255,255,.8); -webkit-box-shadow:inset 0px 0px 0px 3px rgba(255,255,255,.8); -moz-box-shadow:inset 0px 0px 0px 3px rgba(255,255,255,.8); box-shadow:inset 0px 0px 0px 3px rgba(255,255,255,.8); background: transparent; } - #head .btn-default:active, - #head .btn-default.active { color:#fff; -webkit-box-shadow:inset 0px 0px 0px 3px #fff; -moz-box-shadow:inset 0px 0px 0px 3px #fff; box-shadow:inset 0px 0px 0px 3px #fff; background: transparent; } - -@media (max-width: 767px) { - #head { min-height:420px; padding-top:160px; } - #head .lead { font-size: 34px; } -} - - -/* Autohide navbar */ -.slideUp { top:-100px; } -.headroom { -webkit-transition: all 0.4s ease-out; -moz-transition: all 0.4s ease-out; -o-transition: all 0.4s ease-out; transition: all 0.4s ease-out; } - - -/* Highlights (in jumbotron in most cases) */ -.highlight { margin-top:40px; } - .h-caption { text-align: center; } - .h-caption i { display:block; font-size: 54px; color:#382526; margin-bottom:36px; } - .h-caption h4 { color:#382526; font-size: 16px; font-weight: bold; margin-bottom:20px; } - .h-body { } - - -/* Typography */ -h1, h2, h3, h4, h5, h6 { font-family:"Open sans", Helvetica, Arial; } -h1, .h1, h2, .h2, h3, .h3 { margin-top:30px; } -blockquote { font-style: italic; font-family: Georgia; color:#999; margin:30px 0 30px; } -label { color: #777; } -.thin { font-weight:300; } -.page-title { margin-top:20px; font-weight:300; } -.text-muted { color:#888; } -.breadcrumb { background:none; padding:0; margin:30px 0 0px 0; } -ul.list-spaces li{ margin-bottom:10px; } - -/* Helpers */ -.container-full { margin: 0 auto; width: 100%; } -.top-space { margin-top: 60px; } -.top-margin { margin-top:20px; } - -img { max-width:100%; } -img.pull-right { margin-left: 10px; } -img.pull-left { margin-right: 10px; } -#map { width:100%; height:280px; } -#social { margin-top:50px; margin-bottom:50px; } - #social .wrapper { width:340px; margin:0 auto; } - -/* Main content block */ -.maincontent { } - -/* Sidebars */ -.sidebar { padding-top:36px; padding-bottom:30px; } - .sidebar .widget { margin-bottom:20px; } - .sidebar h1, .sidebar .h1, .sidebar h2, .sidebar .h2, .sidebar h3, .sidebar .h3 { margin-top:20px; } - -/* Footer */ -.footer1 { background: #232323; padding: 30px 0 0 0; font-size: 12px; color: #999; } - .footer1 a { color: #ccc; } - .footer1 a:hover {color: #fff; } - .footer1 .widget { margin-bottom:30px; } - .footer1 .widget-title { font-size: 17px; font-weight: bold; color: #ccc; margin: 0 0 20px; } - .footer1 .entry-meta { border-top: 1px solid #ccc; border-bottom: 1px solid #ccc; margin: 0 0 35px 0; padding: 2px 0; color: #888888; font-size: 12px; font-size: 0.75rem; } - .footer1 .entry-meta a { color: #333333; } - .footer1 .entry-meta .meta-in { border-top: 1px solid #ccc; border-bottom: 1px solid #ccc; padding: 10px 0; } - .follow-me-icons { font-size:30px; } - .follow-me-icons i { float:left; margin:0 10px 0 0; } - -.footer2 { background: #191919; padding: 15px 0; color: #777; font-size: 12px; } - .footer2 a { color: #aaa; } - .footer2 a:hover { color: #fff; } - .footer2 p { margin: 0; } - - .widget-simplenav { margin-left:-5px; } +/* Header */ +#head { background:#181015 url( ../images/mac2.png) no-repeat; background-size: cover; min-height:520px; text-align: center; padding-top:240px; color:white; font-family:"Open sans", Helvetica, Arial; font-weight:300; } +#head.secondary { height:100px; min-height: 100px; padding-top:0px; } + #head .lead { font-family:"Open sans", Helvetica, Arial; font-size:44px; margin-bottom:6px; color:white; line-height:1.15em; } + #head .tagline { color:rgba(255,255,255,0.75); margin-bottom:25px; } + #head .tagline a { color:#fff; } + #head .btn { margin-bottom:10px;} + #head .btn-default { text-shadow: none; background:transparent; color:rgba(255,255,255,.5); -webkit-box-shadow:inset 0px 0px 0px 3px rgba(255,255,255,.5); -moz-box-shadow:inset 0px 0px 0px 3px rgba(255,255,255,.5); box-shadow:inset 0px 0px 0px 3px rgba(255,255,255,.5); background: transparent; } + #head .btn-default:hover, + #head .btn-default:focus { color:rgba(255,255,255,.8); -webkit-box-shadow:inset 0px 0px 0px 3px rgba(255,255,255,.8); -moz-box-shadow:inset 0px 0px 0px 3px rgba(255,255,255,.8); box-shadow:inset 0px 0px 0px 3px rgba(255,255,255,.8); background: transparent; } + #head .btn-default:active, + #head .btn-default.active { color:#fff; -webkit-box-shadow:inset 0px 0px 0px 3px #fff; -moz-box-shadow:inset 0px 0px 0px 3px #fff; box-shadow:inset 0px 0px 0px 3px #fff; background: transparent; } + +@media (max-width: 767px) { + #head { min-height:420px; padding-top:160px; } + #head .lead { font-size: 34px; } +} + + +/* Autohide navbar */ +.slideUp { top:-100px; } +.headroom { -webkit-transition: all 0.4s ease-out; -moz-transition: all 0.4s ease-out; -o-transition: all 0.4s ease-out; transition: all 0.4s ease-out; } + + +/* Highlights (in jumbotron in most cases) */ +.highlight { margin-top:40px; } + .h-caption { text-align: center; } + .h-caption i { display:block; font-size: 54px; color:#382526; margin-bottom:36px; } + .h-caption h4 { color:#382526; font-size: 16px; font-weight: bold; margin-bottom:20px; } + .h-body { } + + +/* Typography */ +h1, h2, h3, h4, h5, h6 { font-family:"Open sans", Helvetica, Arial; } +h1, .h1, h2, .h2, h3, .h3 { margin-top:30px; } +blockquote { font-style: italic; font-family: Georgia; color:#999; margin:30px 0 30px; } +label { color: #777; } +.thin { font-weight:300; } +.page-title { margin-top:20px; font-weight:300; } +.text-muted { color:#888; } +.breadcrumb { background:none; padding:0; margin:30px 0 0px 0; } +ul.list-spaces li{ margin-bottom:10px; } + +/* Helpers */ +.container-full { margin: 0 auto; width: 100%; } +.top-space { margin-top: 60px; } +.top-margin { margin-top:20px; } + +img { max-width:100%; } +img.pull-right { margin-left: 10px; } +img.pull-left { margin-right: 10px; } +#map { width:100%; height:280px; } +#social { margin-top:50px; margin-bottom:50px; } + #social .wrapper { width:340px; margin:0 auto; } + +/* Main content block */ +.maincontent { } + +/* Sidebars */ +.sidebar { padding-top:36px; padding-bottom:30px; } + .sidebar .widget { margin-bottom:20px; } + .sidebar h1, .sidebar .h1, .sidebar h2, .sidebar .h2, .sidebar h3, .sidebar .h3 { margin-top:20px; } + +/* Footer */ +.footer1 { background: #232323; padding: 30px 0 0 0; font-size: 12px; color: #999; } + .footer1 a { color: #ccc; } + .footer1 a:hover {color: #fff; } + .footer1 .widget { margin-bottom:30px; } + .footer1 .widget-title { font-size: 17px; font-weight: bold; color: #ccc; margin: 0 0 20px; } + .footer1 .entry-meta { border-top: 1px solid #ccc; border-bottom: 1px solid #ccc; margin: 0 0 35px 0; padding: 2px 0; color: #888888; font-size: 12px; font-size: 0.75rem; } + .footer1 .entry-meta a { color: #333333; } + .footer1 .entry-meta .meta-in { border-top: 1px solid #ccc; border-bottom: 1px solid #ccc; padding: 10px 0; } + .follow-me-icons { font-size:30px; } + .follow-me-icons i { float:left; margin:0 10px 0 0; } + +.footer2 { background: #191919; padding: 15px 0; color: #777; font-size: 12px; } + .footer2 a { color: #aaa; } + .footer2 a:hover { color: #fff; } + .footer2 p { margin: 0; } + + .widget-simplenav { margin-left:-5px; } .widget-simplenav a{ margin:0 5px; } \ No newline at end of file diff --git a/src/main/webapp/progressus/assets/js/bootstrap-suggest.min.js b/src/main/webapp/progressus/assets/js/bootstrap-suggest.min.js index db10a8b..a564044 100644 --- a/src/main/webapp/progressus/assets/js/bootstrap-suggest.min.js +++ b/src/main/webapp/progressus/assets/js/bootstrap-suggest.min.js @@ -1,8 +1,8 @@ -/** - * bootstrap-suggest-plugin - v0.1.20 - * @description 这是一个基于 bootstrap 按钮式下拉菜单组件的搜索建议插件,必须使用于按钮式下拉菜单组件上。 - * @author [object Object] - * @GitHub https://github.com/lzwme/bootstrap-suggest-plugin.git - * @since 2017-07-11 17:04:21 - */ +/** + * bootstrap-suggest-plugin - v0.1.20 + * @description 这是一个基于 bootstrap 按钮式下拉菜单组件的搜索建议插件,必须使用于按钮式下拉菜单组件上。 + * @author [object Object] + * @GitHub https://github.com/lzwme/bootstrap-suggest-plugin.git + * @since 2017-07-11 17:04:21 + */ !function(a){if("function"==typeof define&&define.amd)define(["jquery"],a);else if("object"==typeof exports&&"object"==typeof module)a(require("jquery"));else{if(!window.jQuery)throw new Error("Not found jQuery.");a(window.jQuery)}}(function(a){function b(a,b){window.console&&window.console.trace&&(console.trace(a),b&&console.trace(b))}function c(a){return a.data()}function d(a,b){return void 0!==b?a.attr("alt",b):a.attr("alt")}function e(a,b){return void 0!==b?a.attr("data-id",b):a.attr("data-id")}function f(a,b,c){if(b&&b.key){var d,f=c.separator||",";c&&c.multiWord?(d=a.val().split(f),d[d.length-1]=b.key,a.val(d.join(f)).focus()):e(a,b.id).val(b.key).focus(),a.trigger("onSetSelectValue",[b,(c.data.value||c._lastData.value)[b.index]])}}function g(a,b,c){if(b.is(":visible")){var d=a.parent();c.autoDropup&&setTimeout(function(){x.height()+x.scrollTop()-a.offset().topb.height()+x.scrollTop()?d.addClass("dropup"):d.removeClass("dropup")},10);var e={};return"left"===c.listAlign?e={left:a.siblings("div").width()-d.width(),right:"auto"}:"right"===c.listAlign&&(e={left:"auto",right:0}),y&&!c.showBtn&&(d.hasClass("dropup")?(e.top="auto",e.bottom=d.height()):(e.top=d.height(),e.bottom="auto")),c.autoMinWidth||(e.minWidth=d.width()),b.css(e),a}}function h(a,b){var c,d,f;return b.indexId===-1&&!b.idField||b.multiWord?a:(c=a.css("background-color").replace(/ /g,"").split(",",3).join(","),d=b.inputBgColor||"rgba(255,255,255,0.1)",f=b.inputWarnColor||"rgba(255,255,0,0.1)",e(a)||!a.val()?a.css("background",d):(~f.indexOf(c)||a.trigger("onUnsetSelectValue").css("background",f),a))}function i(a,b,c){var d,e,f=a.parent().find("tbody tr."+c.listHoverCSS);f.length&&(d=(f.index()+3)*f.height(),e=Number(b.css("max-height").replace("px","")),d>e||b.scrollTop()>e?d-=e:d=0,b.scrollTop(d))}function j(a,b){a.find("tr."+b.listHoverCSS).removeClass(b.listHoverCSS)}function k(a,b,c){return!b.length||a.data(B)?F:(a.data(B,{options:c}),E)}function l(a){var c,d=E;for(c in a)if("value"===c){d=F;break}return d?(b("返回数据格式错误!"),F):a.value.length?a:F}function m(b,c){var d=c.effectiveFields;return!("__index"===b||d.length&&!~a.inArray(b,d))}function n(b,c){return~a.inArray(b,c.searchFields)}function o(a,b,c,d){c.html('
                                                                      '+a+"
                                                                      ").show(),g(b,c,d)}function p(a,b,c){var d,e,f,h,i,j,k=a.parent().find("ul:eq(0)"),l=0,n=[''];if(!b||!(d=b.value.length))return c.emptyTip?o(c.emptyTip,a,k,c):k.empty().hide(),a;var p=b.value;if(c._lastData&&JSON.stringify(c._lastData.value)===JSON.stringify(p)&&k.find("tr").length===d)return k.show(),g(a,k,c),a;if(c._lastData=b,c.showHeader){n.push("");for(f in p[0])m(f,c)&&(n.push(""),l++);n.push("")}n.push("");var q;for(e=0;e',q[f],"");n.push('',h.join(""),"")}return n.push("
                                                                      ",c.effectiveFieldsAlias[f]||f,0===l?"("+d+")":"","
                                                                      "),k.html(n.join("")).show(),setTimeout(function(){if(!A){var a=k.find("table:eq(0)"),b=0,c=0;k.height()').prependTo(b.parent())),d.css({position:"absolute",top:12,right:c.showBtn?(b.next(".input-group-btn").width()||33)+2:12,zIndex:4,cursor:"pointer",fontSize:12}).hide()}var v,w="0.1.20",x=a(window),y="ActiveXObject"in window,z=navigator.userAgent.match(/Chrome\/(\d+)/);z&&(z=Number(z[1]));var A=y||z>51,B="bsSuggest",C="onDataRequestSuccess",D="disabled",E=!0,F=!1,G={url:null,jsonp:null,data:{value:[]},indexId:0,indexKey:0,idField:"",keyField:"",autoSelect:E,allowNoKeyword:E,getDataMethod:"firstByUrl",delayUntilKeyup:F,ignorecase:F,effectiveFields:[],effectiveFieldsAlias:{},searchFields:[],twoWayMatch:E,multiWord:F,separator:",",delay:300,emptyTip:"",searchingTip:"搜索中...",autoDropup:F,autoMinWidth:F,showHeader:F,showBtn:E,inputBgColor:"",inputWarnColor:"rgba(255,0,0,.1)",listStyle:{"padding-top":0,"max-height":"375px","max-width":"800px",overflow:"auto",width:"auto",transition:"0.3s","-webkit-transition":"0.3s","-moz-transition":"0.3s","-o-transition":"0.3s"},listAlign:"left",listHoverStyle:"background: #07d; color:#fff",listHoverCSS:"jhover",clearable:F,keyLeft:37,keyUp:38,keyRight:39,keyDown:40,keyEnter:13,fnProcessData:t,fnGetData:s,fnAdjustAjaxParam:null,fnPreprocessKeyword:null,fnAjaxFail:null},H={init:function(b){var l=this;return b=b||{},void 0===b.showHeader&&b.effectiveFields&&b.effectiveFields.length>1&&(b.showHeader=E),b=a.extend(E,{},G,b),b.processData&&(b.fnProcessData=b.processData),b.getData&&(b.fnGetData=b.getData),"firstByUrl"===b.getDataMethod&&b.url&&!b.delayUntilKeyup&&q(b).done(function(a){b.url=null,l.trigger(C,a)}),a("#"+B).length||a("head:eq(0)").append('"),l.each(function(){var l,m,n=a(this),o=n.parent(),q=u(n,b),r=o.find("ul:eq(0)");return k(n,r,b)?(b.showBtn||(n.css("border-radius","4px"),o.css("width","100%").find(".btn:eq(0)").hide()),n.removeClass(D).prop(D,F).attr("autocomplete","off"),r.css(b.listStyle),b.inputBgColor||(b.inputBgColor=n.css("background-color")),n.on("keydown",function(a){var g,h;if(r.is(":visible")){if(g=r.find("."+b.listHoverCSS),h="",j(r,b),a.keyCode===b.keyDown){if(g.length?g.next().length?h=c(g.next().mouseover()):b.autoSelect&&e(n,"").val(d(n)):h=c(r.find("tbody tr:first").mouseover()),i(n,r,b),!b.autoSelect)return}else if(a.keyCode===b.keyUp){if(g.length?g.prev().length?h=c(g.prev().mouseover()):b.autoSelect&&e(n,"").val(d(n)):h=c(r.find("tbody tr:last").mouseover()),i(n,r,b),!b.autoSelect)return}else a.keyCode===b.keyEnter?(h=c(g),r.hide()):e(n,"");f(n,h,b)}}).on("compositionstart",function(a){v=E}).on("compositionend",function(a){v=F}).on("keyup input paste",function(c){var e;return c.keyCode&&h(n,b),~a.inArray(c.keyCode,[b.keyDown,b.keyUp,b.keyEnter])?void n.val(n.val()):(clearTimeout(m),void(m=setTimeout(function(){v||(e=n.val(),a.trim(e)&&e===d(n)||(d(n,e),b.multiWord&&(e=e.split(b.separator).reverse()[0]),(e.length||b.allowNoKeyword)&&b.fnGetData(a.trim(e),n,p,b)))},b.delay||300)))}).on("focus",function(){g(n,r,b)}).on("blur",function(){l||r.css("display","")}).on("click",function(){var c=n.val();return a.trim(c)&&c===d(n)&&r.find("table tr").length?r.show():void(r.is(":visible")||(b.multiWord&&(c=c.split(b.separator).reverse()[0]),(c.length||b.allowNoKeyword)&&b.fnGetData(a.trim(c),n,p,b)))}),o.find(".btn:eq(0)").attr("data-toggle","").click(function(){var a="none";return r.css("display")===a&&(a="block",b.url?(n.click().focus(),r.find("tr").length||(a="none")):p(n,b.data,b)),r.css("display",a),F}),r.mouseenter(function(){l=1,n.blur()}).mouseleave(function(){l=0,n.focus()}).on("mouseenter","tbody tr",function(){return j(r,b),a(this).addClass(b.listHoverCSS),F}).on("mousedown","tbody tr",function(){var e=c(a(this));f(n,e,b),d(n,e.key),h(n,b),r.hide()}),void(q.length&&(q.click(function(){e(n,"").val(""),h(n,b)}),o.mouseenter(function(){n.prop(D)||q.show()}).mouseleave(function(){q.hide()})))):void console.warn("不是一个标准的 bootstrap 下拉式菜单或已初始化:",n)})},show:function(){return this.each(function(){a(this).click()})},hide:function(){return this.each(function(){a(this).parent().find("ul:eq(0)").css("display","")})},disable:function(){return this.each(function(){a(this).attr(D,E).parent().find(".btn:eq(0)").prop(D,E)})},enable:function(){return this.each(function(){a(this).attr(D,F).parent().find(".btn:eq(0)").prop(D,F)})},destroy:function(){return this.each(function(){a(this).off().removeData(B).removeAttr("style").parent().find(".btn:eq(0)").off().show().attr("data-toggle","dropdown").prop(D,F).next().css("display","").off()})},version:function(){return w}};a.fn[B]=function(b){if("string"==typeof b&&H[b]){var c=E;return this.each(function(){if(!a(this).data(B))return c=F}),c||"init"===b||"version"===b?H[b].apply(this,[].slice.call(arguments,1)):this}return H.init.apply(this,arguments)}}); \ No newline at end of file diff --git a/src/main/webapp/progressus/assets/js/bootstrapValidator/language/bg_BG.js b/src/main/webapp/progressus/assets/js/bootstrapValidator/language/bg_BG.js index 10b73fe..8a196cf 100644 --- a/src/main/webapp/progressus/assets/js/bootstrapValidator/language/bg_BG.js +++ b/src/main/webapp/progressus/assets/js/bootstrapValidator/language/bg_BG.js @@ -1,370 +1,370 @@ -(function($) { - /** - * Bulgarian language package - * Translated by @mraiur - */ - $.fn.bootstrapValidator.i18n = $.extend(true, $.fn.bootstrapValidator.i18n, { - base64: { - 'default': 'Моля, въведете валиден base 64 кодиран' - }, - between: { - 'default': 'Моля, въведете стойност между %s и %s', - notInclusive: 'Моля, въведете стойност точно между %s и %s' - }, - callback: { - 'default': 'Моля, въведете валидна стойност' - }, - choice: { - 'default': 'Моля, въведете валидна стойност', - less: 'Моля изберете минимална стойност %s', - more: 'Моля изберете максимална стойност %s', - between: 'Моля изберете от %s до %s стойност' - }, - color: { - 'default': 'Моля, въведете валиден цвят' - }, - creditCard: { - 'default': 'Моля, въведете валиден номер на кредитна карта' - }, - cusip: { - 'default': 'Моля, въведете валиден CUSIP номер' - }, - cvv: { - 'default': 'Моля, въведете валиден CVV номер' - }, - date: { - 'default': 'Моля, въведете валидна дата', - min: 'Моля въведете дата след %s', - max: 'Моля въведете дата преди %s', - range: 'Моля въведете дата между %s и %s' - }, - different: { - 'default': 'Моля, въведете различна стойност' - }, - digits: { - 'default': 'Моля, въведете само цифри' - }, - ean: { - 'default': 'Моля, въведете валиден EAN номер' - }, - emailAddress: { - 'default': 'Моля, въведете валиден имейл адрес' - }, - file: { - 'default': 'Моля, изберете валиден файл' - }, - greaterThan: { - 'default': 'Моля, въведете стойност по-голяма от или равна на %s', - notInclusive: 'Моля, въведете стойност по-голяма от %s' - }, - grid: { - 'default': 'Моля, изберете валиден GRId номер' - }, - hex: { - 'default': 'Моля, въведете валиден шестнадесетичен номер' - }, - hexColor: { - 'default': 'Моля, въведете валиден шестнадесетичен цвят' - }, - iban: { - 'default': 'Моля, въведете валиден IBAN номер', - countryNotSupported: 'Държавата %s не се поддържа', - country: 'Моля, въведете валиден номер на IBAN в %s', - countries: { - АD: 'Андора', - AE: 'Обединени арабски емирства', - AL: 'Албания', - AO: 'Ангола', - AT: 'Австрия', - AZ: 'Азербайджан', - BA: 'Босна и Херцеговина', - BE: 'Белгия', - BF: 'Буркина Фасо', - BG: 'България', - BH: 'Бахрейн', - BI: 'Бурунди', - BJ: 'Бенин', - BR: 'Бразилия', - CH: 'Швейцария', - CI: 'Ivory Coast', - CM: 'Камерун', - CR: 'Коста Рика', - CV: 'Cape Verde', - CY: 'Кипър', - CZ: 'Чешката република', - DE: 'Германия', - DK: 'Дания', - DO: 'Доминиканска република', - DZ: 'Алжир', - EE: 'Естония', - ES: 'Испания', - FI: 'Финландия', - FO: 'Фарьорските острови', - FR: 'Франция', - GB: 'Обединеното кралство', - GE: 'Грузия', - GI: 'Гибралтар', - GL: 'Гренландия', - GR: 'Гърция', - GT: 'Гватемала', - HR: 'Хърватия', - HU: 'Унгария', - IE: 'Ирландия', - IL: 'Израел', - IR: 'Иран', - IS: 'Исландия', - IT: 'Италия', - JO: 'Йордания', - KW: 'Кувейт', - KZ: 'Казахстан', - LB: 'Ливан', - LI: 'Лихтенщайн', - LT: 'Литва', - LU: 'Люксембург', - LV: 'Латвия', - MC: 'Монако', - MD: 'Молдова', - ME: 'Черна гора', - MG: 'Мадагаскар', - MK: 'Македония', - ML: 'Мали', - MR: 'Мавритания', - MT: 'Малта', - MU: 'Мавриций', - MZ: 'Мозамбик', - NL: 'Нидерландия', - NO: 'Норвегия', - PK: 'Пакистан', - PL: 'Полша', - PS: 'палестинска', - PT: 'Португалия', - QA: 'Катар', - RO: 'Румъния', - RS: 'Сърбия', - SA: 'Саудитска Арабия', - SE: 'Швеция', - SI: 'Словения', - SK: 'Словакия', - SM: 'San Marino', - SN: 'Сенегал', - TN: 'Тунис', - TR: 'Турция', - VG: 'Британски Вирджински острови' - } - }, - id: { - 'default': 'Моля, въведете валиден идентификационен номер', - countryNotSupported: 'Кода на държавата %s не се поддържа', - country: 'Моля, въведете валиден идентификационен номер в %s', - countries: { - BA: 'Босна и Херцеговина', - BG: 'България', - BR: 'Бразилия', - СН: 'Швейцария', - CL: 'Чили', - CN: 'Китай', - CZ: 'Чешката република', - DK: 'Дания', - EE: 'Естония', - ES: 'Испания', - FI: 'Финландия', - HR: 'Хърватия', - IE: 'Ирландия', - IS: 'Исландия', - LT: 'Литва', - LV: 'Латвия', - ME: 'Черна гора', - MK: 'Македония', - NL: 'Холандия', - RO: 'Румъния', - RS: 'Сърбия', - SE: 'Швеция', - SI: 'Словения', - SK: 'Словакия', - SM: 'San Marino', - TH: 'Тайланд', - ZA: 'Южна Африка' - } - }, - identical: { - 'default': 'Моля, въведете една и съща стойност' - }, - imei: { - 'default': 'Моля, въведете валиден IMEI номер' - }, - imo: { - 'default': 'Моля, въведете валиден IMO номер' - }, - integer: { - 'default': 'Моля, въведете валиден номер' - }, - ip: { - 'default': 'Моля, въведете валиден IP адрес', - ipv4: 'Моля, въведете валиден IPv4 адрес', - ipv6: 'Моля, въведете валиден IPv6 адрес' - }, - isbn: { - 'default': 'Моля, въведете валиден ISBN номер' - }, - isin: { - 'default': 'Моля, въведете валиден ISIN номер' - }, - ismn: { - 'default': 'Моля, въведете валиден ISMN номер' - }, - issn: { - 'default': 'Моля, въведете валиден ISSN номер' - }, - lessThan: { - 'default': 'Моля, въведете стойност по-малка или равна на %s', - notInclusive: 'Моля, въведете стойност по-малко от %s' - }, - mac: { - 'default': 'Моля, въведете валиден MAC адрес' - }, - meid: { - 'default': 'Моля, въведете валиден MEID номер' - }, - notEmpty: { - 'default': 'Моля, въведете стойност' - }, - numeric: { - 'default': 'Моля, въведете валидно число с плаваща запетая' - }, - phone: { - 'default': 'Моля, въведете валиден телефонен номер', - countryNotSupported: 'Държавата %s не се поддържа', - country: 'Моля, въведете валиден телефонен номер в %s', - countries: { - BR: 'Бразилия', - CN: 'Китай', - CZ: 'Чешката република', - DE: 'Германия', - DK: 'Дания', - ES: 'Испания', - FR: 'Франция', - GB: 'Обединеното кралство', - MA: 'Мароко', - PK: 'Пакистан', - RO: 'Румъния', - RU: 'Русия', - SK: 'Словакия', - TH: 'Тайланд', - US: 'САЩ', - VE: 'Венецуела' - } - }, - regexp: { - 'default': 'Моля, въведете стойност, отговаряща на модела' - }, - remote: { - 'default': 'Моля, въведете валидна стойност' - }, - rtn: { - 'default': 'Моля, въведете валиде RTN номер' - }, - sedol: { - 'default': 'Моля, въведете валиден SEDOL номер' - }, - siren: { - 'default': 'Моля, въведете валиден SIREN номер' - }, - siret: { - 'default': 'Моля, въведете валиден SIRET номер' - }, - step: { - 'default': 'Моля, въведете валиденa стъпка от %s' - }, - stringCase: { - 'default': 'Моля, въведете само с малки букви', - upper: 'Моля въведете само главни букви' - }, - stringLength: { - 'default': 'Моля, въведете стойност с валидни дължина', - less: 'Моля, въведете по-малко от %s знака', - more: 'Моля въведете повече от %s знака', - between: 'Моля, въведете стойност между %s и %s знака' - }, - uri: { - 'default': 'Моля, въведете валиден URI' - }, - uuid: { - 'default': 'Моля, въведете валиден UUID номер', - version: 'Моля, въведете валиден UUID номер с версия %s' - }, - vat: { - 'default': 'Моля, въведете валиден ДДС', - countryNotSupported: 'Държавата %s не се поддържа', - country: 'Моля, въведете валиден ДДС в %s', - countries: { - AT: 'Австрия', - BE: 'Белгия', - BG: 'България', - BR: 'Бразилия', - СН: 'Швейцария', - CY: 'Кипър', - CZ: 'Чешката република', - DE: 'Германия', - DK: 'Дания', - EE: 'Естония', - ES: 'Испания', - FI: 'Финландия', - FR: 'Франция', - GB: 'Обединеното кралство', - GR: 'Гърция', - EL: 'Гърция', - HU: 'Унгария', - HR: 'Ирландия', - IE: 'Ирландски', - IS: 'Исландия', - IT: 'Италия', - LT: 'Литва', - LU: 'Люксембург', - LV: 'Латвия', - MT: 'Малта', - NL: 'Холандия', - NO: 'Норвегия', - PL: 'Полша', - PT: 'Португалия', - RO: 'Румъния', - RU: 'Русия', - RS: 'Сърбия', - SE: 'Швеция', - SI: 'Словения', - SK: 'Словакия', - VE: 'Венецуела', - ZA: 'Южна Африка' - } - }, - vin: { - 'default': 'Моля, въведете валиден номер VIN' - }, - zipCode: { - 'default': 'Моля, въведете валиден пощенски код', - countryNotSupported: 'Кода на държавата %s не се поддържа', - country: 'Моля, въведете валиден пощенски код в %s', - countries: { - AT: 'Австрия', - BR: 'Бразилия', - CA: 'Канада', - СН: 'Швейцария', - CZ: 'Чешката република', - DE: 'Германия', - DK: 'Дания', - FR: 'Франция', - GB: 'Обединеното кралство', - IE: 'Ирландски', - IT: 'Италия', - MA: 'Мароко', - NL: 'Холандия', - PT: 'Португалия', - RO: 'Румъния', - RU: 'Русия', - SE: 'Швеция', - SG: 'Сингапур', - SK: 'Словакия', - US: 'САЩ' - } - } - }); -}(window.jQuery)); +(function($) { + /** + * Bulgarian language package + * Translated by @mraiur + */ + $.fn.bootstrapValidator.i18n = $.extend(true, $.fn.bootstrapValidator.i18n, { + base64: { + 'default': 'Моля, въведете валиден base 64 кодиран' + }, + between: { + 'default': 'Моля, въведете стойност между %s и %s', + notInclusive: 'Моля, въведете стойност точно между %s и %s' + }, + callback: { + 'default': 'Моля, въведете валидна стойност' + }, + choice: { + 'default': 'Моля, въведете валидна стойност', + less: 'Моля изберете минимална стойност %s', + more: 'Моля изберете максимална стойност %s', + between: 'Моля изберете от %s до %s стойност' + }, + color: { + 'default': 'Моля, въведете валиден цвят' + }, + creditCard: { + 'default': 'Моля, въведете валиден номер на кредитна карта' + }, + cusip: { + 'default': 'Моля, въведете валиден CUSIP номер' + }, + cvv: { + 'default': 'Моля, въведете валиден CVV номер' + }, + date: { + 'default': 'Моля, въведете валидна дата', + min: 'Моля въведете дата след %s', + max: 'Моля въведете дата преди %s', + range: 'Моля въведете дата между %s и %s' + }, + different: { + 'default': 'Моля, въведете различна стойност' + }, + digits: { + 'default': 'Моля, въведете само цифри' + }, + ean: { + 'default': 'Моля, въведете валиден EAN номер' + }, + emailAddress: { + 'default': 'Моля, въведете валиден имейл адрес' + }, + file: { + 'default': 'Моля, изберете валиден файл' + }, + greaterThan: { + 'default': 'Моля, въведете стойност по-голяма от или равна на %s', + notInclusive: 'Моля, въведете стойност по-голяма от %s' + }, + grid: { + 'default': 'Моля, изберете валиден GRId номер' + }, + hex: { + 'default': 'Моля, въведете валиден шестнадесетичен номер' + }, + hexColor: { + 'default': 'Моля, въведете валиден шестнадесетичен цвят' + }, + iban: { + 'default': 'Моля, въведете валиден IBAN номер', + countryNotSupported: 'Държавата %s не се поддържа', + country: 'Моля, въведете валиден номер на IBAN в %s', + countries: { + АD: 'Андора', + AE: 'Обединени арабски емирства', + AL: 'Албания', + AO: 'Ангола', + AT: 'Австрия', + AZ: 'Азербайджан', + BA: 'Босна и Херцеговина', + BE: 'Белгия', + BF: 'Буркина Фасо', + BG: 'България', + BH: 'Бахрейн', + BI: 'Бурунди', + BJ: 'Бенин', + BR: 'Бразилия', + CH: 'Швейцария', + CI: 'Ivory Coast', + CM: 'Камерун', + CR: 'Коста Рика', + CV: 'Cape Verde', + CY: 'Кипър', + CZ: 'Чешката република', + DE: 'Германия', + DK: 'Дания', + DO: 'Доминиканска република', + DZ: 'Алжир', + EE: 'Естония', + ES: 'Испания', + FI: 'Финландия', + FO: 'Фарьорските острови', + FR: 'Франция', + GB: 'Обединеното кралство', + GE: 'Грузия', + GI: 'Гибралтар', + GL: 'Гренландия', + GR: 'Гърция', + GT: 'Гватемала', + HR: 'Хърватия', + HU: 'Унгария', + IE: 'Ирландия', + IL: 'Израел', + IR: 'Иран', + IS: 'Исландия', + IT: 'Италия', + JO: 'Йордания', + KW: 'Кувейт', + KZ: 'Казахстан', + LB: 'Ливан', + LI: 'Лихтенщайн', + LT: 'Литва', + LU: 'Люксембург', + LV: 'Латвия', + MC: 'Монако', + MD: 'Молдова', + ME: 'Черна гора', + MG: 'Мадагаскар', + MK: 'Македония', + ML: 'Мали', + MR: 'Мавритания', + MT: 'Малта', + MU: 'Мавриций', + MZ: 'Мозамбик', + NL: 'Нидерландия', + NO: 'Норвегия', + PK: 'Пакистан', + PL: 'Полша', + PS: 'палестинска', + PT: 'Португалия', + QA: 'Катар', + RO: 'Румъния', + RS: 'Сърбия', + SA: 'Саудитска Арабия', + SE: 'Швеция', + SI: 'Словения', + SK: 'Словакия', + SM: 'San Marino', + SN: 'Сенегал', + TN: 'Тунис', + TR: 'Турция', + VG: 'Британски Вирджински острови' + } + }, + id: { + 'default': 'Моля, въведете валиден идентификационен номер', + countryNotSupported: 'Кода на държавата %s не се поддържа', + country: 'Моля, въведете валиден идентификационен номер в %s', + countries: { + BA: 'Босна и Херцеговина', + BG: 'България', + BR: 'Бразилия', + СН: 'Швейцария', + CL: 'Чили', + CN: 'Китай', + CZ: 'Чешката република', + DK: 'Дания', + EE: 'Естония', + ES: 'Испания', + FI: 'Финландия', + HR: 'Хърватия', + IE: 'Ирландия', + IS: 'Исландия', + LT: 'Литва', + LV: 'Латвия', + ME: 'Черна гора', + MK: 'Македония', + NL: 'Холандия', + RO: 'Румъния', + RS: 'Сърбия', + SE: 'Швеция', + SI: 'Словения', + SK: 'Словакия', + SM: 'San Marino', + TH: 'Тайланд', + ZA: 'Южна Африка' + } + }, + identical: { + 'default': 'Моля, въведете една и съща стойност' + }, + imei: { + 'default': 'Моля, въведете валиден IMEI номер' + }, + imo: { + 'default': 'Моля, въведете валиден IMO номер' + }, + integer: { + 'default': 'Моля, въведете валиден номер' + }, + ip: { + 'default': 'Моля, въведете валиден IP адрес', + ipv4: 'Моля, въведете валиден IPv4 адрес', + ipv6: 'Моля, въведете валиден IPv6 адрес' + }, + isbn: { + 'default': 'Моля, въведете валиден ISBN номер' + }, + isin: { + 'default': 'Моля, въведете валиден ISIN номер' + }, + ismn: { + 'default': 'Моля, въведете валиден ISMN номер' + }, + issn: { + 'default': 'Моля, въведете валиден ISSN номер' + }, + lessThan: { + 'default': 'Моля, въведете стойност по-малка или равна на %s', + notInclusive: 'Моля, въведете стойност по-малко от %s' + }, + mac: { + 'default': 'Моля, въведете валиден MAC адрес' + }, + meid: { + 'default': 'Моля, въведете валиден MEID номер' + }, + notEmpty: { + 'default': 'Моля, въведете стойност' + }, + numeric: { + 'default': 'Моля, въведете валидно число с плаваща запетая' + }, + phone: { + 'default': 'Моля, въведете валиден телефонен номер', + countryNotSupported: 'Държавата %s не се поддържа', + country: 'Моля, въведете валиден телефонен номер в %s', + countries: { + BR: 'Бразилия', + CN: 'Китай', + CZ: 'Чешката република', + DE: 'Германия', + DK: 'Дания', + ES: 'Испания', + FR: 'Франция', + GB: 'Обединеното кралство', + MA: 'Мароко', + PK: 'Пакистан', + RO: 'Румъния', + RU: 'Русия', + SK: 'Словакия', + TH: 'Тайланд', + US: 'САЩ', + VE: 'Венецуела' + } + }, + regexp: { + 'default': 'Моля, въведете стойност, отговаряща на модела' + }, + remote: { + 'default': 'Моля, въведете валидна стойност' + }, + rtn: { + 'default': 'Моля, въведете валиде RTN номер' + }, + sedol: { + 'default': 'Моля, въведете валиден SEDOL номер' + }, + siren: { + 'default': 'Моля, въведете валиден SIREN номер' + }, + siret: { + 'default': 'Моля, въведете валиден SIRET номер' + }, + step: { + 'default': 'Моля, въведете валиденa стъпка от %s' + }, + stringCase: { + 'default': 'Моля, въведете само с малки букви', + upper: 'Моля въведете само главни букви' + }, + stringLength: { + 'default': 'Моля, въведете стойност с валидни дължина', + less: 'Моля, въведете по-малко от %s знака', + more: 'Моля въведете повече от %s знака', + between: 'Моля, въведете стойност между %s и %s знака' + }, + uri: { + 'default': 'Моля, въведете валиден URI' + }, + uuid: { + 'default': 'Моля, въведете валиден UUID номер', + version: 'Моля, въведете валиден UUID номер с версия %s' + }, + vat: { + 'default': 'Моля, въведете валиден ДДС', + countryNotSupported: 'Държавата %s не се поддържа', + country: 'Моля, въведете валиден ДДС в %s', + countries: { + AT: 'Австрия', + BE: 'Белгия', + BG: 'България', + BR: 'Бразилия', + СН: 'Швейцария', + CY: 'Кипър', + CZ: 'Чешката република', + DE: 'Германия', + DK: 'Дания', + EE: 'Естония', + ES: 'Испания', + FI: 'Финландия', + FR: 'Франция', + GB: 'Обединеното кралство', + GR: 'Гърция', + EL: 'Гърция', + HU: 'Унгария', + HR: 'Ирландия', + IE: 'Ирландски', + IS: 'Исландия', + IT: 'Италия', + LT: 'Литва', + LU: 'Люксембург', + LV: 'Латвия', + MT: 'Малта', + NL: 'Холандия', + NO: 'Норвегия', + PL: 'Полша', + PT: 'Португалия', + RO: 'Румъния', + RU: 'Русия', + RS: 'Сърбия', + SE: 'Швеция', + SI: 'Словения', + SK: 'Словакия', + VE: 'Венецуела', + ZA: 'Южна Африка' + } + }, + vin: { + 'default': 'Моля, въведете валиден номер VIN' + }, + zipCode: { + 'default': 'Моля, въведете валиден пощенски код', + countryNotSupported: 'Кода на държавата %s не се поддържа', + country: 'Моля, въведете валиден пощенски код в %s', + countries: { + AT: 'Австрия', + BR: 'Бразилия', + CA: 'Канада', + СН: 'Швейцария', + CZ: 'Чешката република', + DE: 'Германия', + DK: 'Дания', + FR: 'Франция', + GB: 'Обединеното кралство', + IE: 'Ирландски', + IT: 'Италия', + MA: 'Мароко', + NL: 'Холандия', + PT: 'Португалия', + RO: 'Румъния', + RU: 'Русия', + SE: 'Швеция', + SG: 'Сингапур', + SK: 'Словакия', + US: 'САЩ' + } + } + }); +}(window.jQuery)); diff --git a/src/main/webapp/progressus/assets/js/template.js b/src/main/webapp/progressus/assets/js/template.js index 44d0aa3..5d57731 100644 --- a/src/main/webapp/progressus/assets/js/template.js +++ b/src/main/webapp/progressus/assets/js/template.js @@ -1,13 +1,13 @@ -jQuery(document).ready(function($) { - - $(".headroom").headroom({ - "tolerance": 20, - "offset": 50, - "classes": { - "initial": "animated", - "pinned": "slideDown", - "unpinned": "slideUp" - } - }); - +jQuery(document).ready(function($) { + + $(".headroom").headroom({ + "tolerance": 20, + "offset": 50, + "classes": { + "initial": "animated", + "pinned": "slideDown", + "unpinned": "slideUp" + } + }); + }); \ No newline at end of file diff --git a/src/main/webapp/progressus/contact.jsp b/src/main/webapp/progressus/contact.jsp index b87f700..bd07af9 100644 --- a/src/main/webapp/progressus/contact.jsp +++ b/src/main/webapp/progressus/contact.jsp @@ -1,70 +1,70 @@ -<%@ page language="java" contentType="text/html; charset=utf-8" - pageEncoding="utf-8"%> - - - - -联系我们 - - - -
                                                                      - <%@ include file="/head.jsp" %> -
                                                                      - - - - - -
                                                                      - - - -
                                                                      - - -
                                                                      - - -

                                                                      - 系统组一:test1  test2   -
                                                                      系统组二:test3  test4   -

                                                                      -
                                                                      - -
                                                                      - - - - - - -
                                                                      -
                                                                      -
                                                                      -

                                                                       

                                                                      -
                                                                      -
                                                                      - <%@ include file="/footer.jsp" %> -
                                                                      - +<%@ page language="java" contentType="text/html; charset=utf-8" + pageEncoding="utf-8"%> + + + + +联系我们 + + + +
                                                                      + <%@ include file="/head.jsp" %> +
                                                                      + + + + + +
                                                                      + + + +
                                                                      + + +
                                                                      + + +

                                                                      + 系统组一:test1  test2   +
                                                                      系统组二:test3  test4   +

                                                                      +
                                                                      + +
                                                                      + + + + + + +
                                                                      +
                                                                      +
                                                                      +

                                                                       

                                                                      +
                                                                      +
                                                                      + <%@ include file="/footer.jsp" %> +
                                                                      + \ No newline at end of file diff --git a/src/main/webapp/progressus/signin.jsp b/src/main/webapp/progressus/signin.jsp index cb95309..c94bcb9 100644 --- a/src/main/webapp/progressus/signin.jsp +++ b/src/main/webapp/progressus/signin.jsp @@ -1,207 +1,207 @@ -<%@ page language="java" contentType="text/html; charset=utf-8" - pageEncoding="utf-8"%> - - - - -用户登录 - - - -
                                                                      - <%@ include file="/head.jsp" %> -
                                                                      - - - - - -
                                                                      - - - -
                                                                      - - -
                                                                      - - -
                                                                      -
                                                                      - - - -
                                                                      -

                                                                      输入您的账号以及密码

                                                                      -

                                                                      本平台暂时不提供注册功能,如果您没有账号(忘记账号密码),请联系管理员为您分配。

                                                                      -
                                                                      - -
                                                                      -
                                                                      - - -
                                                                      -
                                                                      - - -
                                                                      - -
                                                                      - -
                                                                      -
                                                                      - - -
                                                                      -
                                                                      - -
                                                                      -
                                                                      -
                                                                      -
                                                                      -
                                                                      - -
                                                                      - -
                                                                      - - -
                                                                      -
                                                                      - - - - +<%@ page language="java" contentType="text/html; charset=utf-8" + pageEncoding="utf-8"%> + + + + +用户登录 + + + +
                                                                      + <%@ include file="/head.jsp" %> +
                                                                      + + + + + +
                                                                      + + + +
                                                                      + + +
                                                                      + + +
                                                                      +
                                                                      + + + +
                                                                      +

                                                                      输入您的账号以及密码

                                                                      +

                                                                      本平台暂时不提供注册功能,如果您没有账号(忘记账号密码),请联系管理员为您分配。

                                                                      +
                                                                      + +
                                                                      +
                                                                      + + +
                                                                      +
                                                                      + + +
                                                                      + +
                                                                      + +
                                                                      +
                                                                      + + +
                                                                      +
                                                                      + +
                                                                      +
                                                                      +
                                                                      +
                                                                      +
                                                                      + +
                                                                      + +
                                                                      + + +
                                                                      +
                                                                      + + + + \ No newline at end of file diff --git a/src/main/webapp/show.jsp b/src/main/webapp/show.jsp index 69fd642..a58639e 100644 --- a/src/main/webapp/show.jsp +++ b/src/main/webapp/show.jsp @@ -1,57 +1,57 @@ -<%@ page contentType="text/html; charset=utf-8" language="java" - import="java.sql.*" errorPage=""%> -<%@ taglib prefix="sf" uri="http://www.springframework.org/tags/form"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> - - - - - - - -项目版本信息对比 - - - - -
                                                                      - <%@ include file="/head.jsp" %> -
                                                                      - - -
                                                                      - - -
                                                                      - -
                                                                      - - - - - - -
                                                                      - -
                                                                      - -

                                                                       

                                                                      -
                                                                      -
                                                                      -
                                                                      - +<%@ page contentType="text/html; charset=utf-8" language="java" + import="java.sql.*" errorPage=""%> +<%@ taglib prefix="sf" uri="http://www.springframework.org/tags/form"%> +<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> + + + + + + + +项目版本信息对比 + + + + +
                                                                      + <%@ include file="/head.jsp" %> +
                                                                      + + +
                                                                      + + +
                                                                      + +
                                                                      + + + + + + +
                                                                      + +
                                                                      + +

                                                                       

                                                                      +
                                                                      +
                                                                      +
                                                                      + \ No newline at end of file diff --git a/src/main/webapp/success.jsp b/src/main/webapp/success.jsp index ee97169..164b291 100644 --- a/src/main/webapp/success.jsp +++ b/src/main/webapp/success.jsp @@ -1,53 +1,53 @@ -<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%> - - - - - -提示信息 - - - - -
                                                                      - <%@ include file="/head.jsp" %> -
                                                                      - - -
                                                                      - - -
                                                                      - -
                                                                      - - -
                                                                      - - - - - - - -
                                                                          -

                                                                      ${message}

                                                                      -

                                                                       

                                                                      -

                                                                      确定

                                                                      -
                                                                      - -

                                                                       

                                                                      -
                                                                      -
                                                                      -
                                                                      - +<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%> + + + + + +提示信息 + + + + +
                                                                      + <%@ include file="/head.jsp" %> +
                                                                      + + +
                                                                      + + +
                                                                      + +
                                                                      + + +
                                                                      + + + + + + + +
                                                                          +

                                                                      ${message}

                                                                      +

                                                                       

                                                                      +

                                                                      确定

                                                                      +
                                                                      + +

                                                                       

                                                                      +
                                                                      +
                                                                      +
                                                                      + \ No newline at end of file