Package org.focusns.model.core

Examples of org.focusns.model.core.Project


    private BlogPost fillBlogPost(BlogPost blogPost) {
        if (blogPost == null) {
            return blogPost;
        }
        if (blogPost.getProject() == null && blogPost.getProjectId() > 0) {
            Project project = projectDao.select(blogPost.getProjectId());
            blogPost.setProject(project);
        }
        if (blogPost.getCreatedBy() == null && blogPost.getCreatedById() > 0) {
            ProjectUser createdBy = projectUserDao.select(blogPost.getCreatedById());
            blogPost.setCreatedBy(createdBy);
View Full Code Here


        ProjectTemplate projectTemplate = getProjectTemplate(category.getCode());
        //
        String projectCode = String.valueOf(10000000 + projectUser.getId());
        //
        Date now = new Date();
        Project project = new Project();
        project.setCode(projectCode);
        project.setTitle(projectUser.getNickname());
        project.setDescription(projectTemplate.getDescription());
        project.setCategoryId(category.getId());
        project.setCreatedAt(now);
        project.setModifiedAt(now);
        project.setCreatedById(projectUser.getId());
        project.setModifiedById(projectUser.getId());
        //
        projectDao.insert(project);
        // 更新 注册用户的 project id
        projectUser.setProjectId(project.getId());
        projectUserDao.update(projectUser);
        //
        for(ProjectFeature projectFeature : projectTemplate.getProjectFeatures()) {
            projectFeature.setProjectId(project.getId());
            projectFeatureDao.insert(projectFeature);
        }
        //
        for(ProjectRole projectRole : projectTemplate.getProjectRoles()) {
            // project role
            projectRole.setProjectId(project.getId());
            projectRoleDao.insert(projectRole);
            for(ProjectAuthority projectAuthority : projectTemplate.getProjectAuthorities(projectRole)) {
                // project authority
                ProjectAuthority _projectAuthority = projectAuthorityDao.selectByCode(projectAuthority.getCode());
                // project permission
                ProjectPermission projectPermission = new ProjectPermission();
                projectPermission.setProjectId(project.getId());
                projectPermission.setProjectRoleId(projectRole.getId());
                projectPermission.setProjectAuthorityId(_projectAuthority.getId());
                projectPermission.setEnabled(projectAuthority.isEnabled());
                //
                projectPermissionDao.insert(projectPermission);
View Full Code Here

TOP

Related Classes of org.focusns.model.core.Project

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.