Search in sources :

Example 11 with Project

use of com.itrus.portal.db.Project in project portal by ixinportal.

the class ProjectKeyInfoController method show.

// 显示详情
@RequestMapping(value = "/{id}", produces = "text/html")
public String show(@PathVariable("id") Long id, Model uiModel) {
    ProjectKeyInfo projectkeyinfo = sqlSession.selectOne("com.itrus.portal.db.ProjectKeyInfoMapper.selectByPrimaryKey", id);
    // 检查是否有权限操作
    Long[] projects = getProjectLongIdsOfAdmin();
    List<Long> list = Arrays.asList(projects);
    if (list != null && !list.contains(projectkeyinfo.getProject())) {
        return "status403";
    }
    Project project = sqlSession.selectOne("com.itrus.portal.db.ProjectMapper.selectByPrimaryKey", projectkeyinfo.getProject());
    uiModel.addAttribute("project", project);
    uiModel.addAttribute("projectkeyinfo", projectkeyinfo);
    return "projectkeyinfos/show";
}
Also used : Project(com.itrus.portal.db.Project) ProjectKeyInfo(com.itrus.portal.db.ProjectKeyInfo) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Example 12 with Project

use of com.itrus.portal.db.Project in project portal by ixinportal.

the class ProjectKeyInfoController method delete.

// 删除
@RequestMapping(value = "/{id}", method = RequestMethod.DELETE, produces = "text/html")
public String delete(@PathVariable("id") Long id, HttpServletRequest request, Model uiModel) {
    String retPath = getReferer(request, "redirect:/projectkeyinfos", true);
    ProjectKeyInfo projectkeyinfo = sqlSession.selectOne("com.itrus.portal.db.ProjectKeyInfoMapper.selectByPrimaryKey", id);
    // 检查是否有权限操作
    Long[] projects = getProjectLongIdsOfAdmin();
    List<Long> list = Arrays.asList(projects);
    if (list != null && !list.contains(projectkeyinfo.getProject())) {
        return "status403";
    }
    Project project = sqlSession.selectOne("com.itrus.portal.db.ProjectMapper.selectByPrimaryKey", projectkeyinfo.getProject());
    sqlSession.delete("com.itrus.portal.db.ProjectKeyInfoMapper.deleteByPrimaryKey", id);
    String oper = "删除序列号";
    String info = "项目名称: " + project.getName() + ", 序列号1: " + projectkeyinfo.getSn1() + ", 序列号2: " + projectkeyinfo.getSn2();
    LogUtil.adminlog(sqlSession, oper, info);
    cacheCustomer.initProjectKeyInfos();
    return retPath;
}
Also used : Project(com.itrus.portal.db.Project) ProjectKeyInfo(com.itrus.portal.db.ProjectKeyInfo) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Example 13 with Project

use of com.itrus.portal.db.Project in project portal by ixinportal.

the class AppController method show.

/**
 * 显示应用详情
 * @return
 */
@RequestMapping(value = "/show/{id}")
public String show(@PathVariable("id") Long id, Model uiModel) {
    App app = sqlSession.selectOne("com.itrus.portal.db.AppMapper.selectByPrimaryKey", id);
    Project project = sqlSession.selectOne("com.itrus.portal.db.ProjectMapper.selectByPrimaryKey", app.getProject());
    uiModel.addAttribute("project", project);
    uiModel.addAttribute("app", app);
    return "apps/show";
}
Also used : App(com.itrus.portal.db.App) Project(com.itrus.portal.db.Project) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Example 14 with Project

use of com.itrus.portal.db.Project in project portal by ixinportal.

the class MailTemplateController method show.

// 查看邮件模版
@RequestMapping(value = "/{id}", produces = "text/html")
public String show(@PathVariable("id") Long id, Model uiModel) {
    MailTemplate mailtemplate = sqlSession.selectOne("com.itrus.portal.db.MailTemplateMapper.selectByPrimaryKey", id);
    if (mailtemplate == null) {
        return "status403";
    }
    String adminProject = getRoleProjects();
    if (adminProject != null && adminProject.equals(mailtemplate.getProjectName())) {
        return "status403";
    }
    Project project = sqlSession.selectOne("com.itrus.portal.db.ProjectMapper.selectByPrimaryKey", mailtemplate.getProjectName());
    uiModel.addAttribute("mailtemplate", mailtemplate);
    uiModel.addAttribute("project", project);
    return "mailtemplate/show";
}
Also used : Project(com.itrus.portal.db.Project) MailTemplate(com.itrus.portal.db.MailTemplate) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Example 15 with Project

use of com.itrus.portal.db.Project in project portal by ixinportal.

the class OnlineServiceController method establishCustomerService.

/*
	 * 创建客服
	 * 
	 */
@RequestMapping(produces = "text/html", params = "form")
public String establishCustomerService(Model model) {
    // 管理员项目权限
    Long[] projectsOfAdmin = getProjectLongIdsOfAdmin();
    List<Map<String, Object>> projectIds = onlineService.getProjects();
    List<Long> pids = new ArrayList<>();
    for (Map<String, Object> p : projectIds) {
        if (p != null) {
            Long project_id = (Long) p.get("project_id");
            pids.add(project_id);
        }
    }
    model.addAttribute("pids", pids);
    // 查询默认客服的数据
    EnterpriseQqExample enterpriseE = new EnterpriseQqExample();
    EnterpriseQqExample.Criteria qqEx = enterpriseE.createCriteria();
    qqEx.andEnterpriseQqStateEqualTo(0L);
    EnterpriseQq enterpriseqq = onlineService.selectQq(enterpriseE);
    // 查询默认客服的数据
    CustomerServiceExample customerE = new CustomerServiceExample();
    CustomerServiceExample.Criteria serviceE = customerE.createCriteria();
    serviceE.andServiceStateEqualTo(0);
    CustomerService customerService = onlineService.selectService(customerE);
    if (customerService == null) {
        model.addAttribute("customerstatus", 1);
    }
    if (enterpriseqq == null) {
        model.addAttribute("qqstatus", 1);
    }
    ProjectExample projectE = new ProjectExample();
    ProjectExample.Criteria pec = projectE.createCriteria();
    pec.andIdIn(Arrays.asList(projectsOfAdmin));
    List<Project> projectlist = projectService.getProjectByExample(projectE);
    // Map<Long,Project> projectlist= onlineService.selectProject();
    model.addAttribute("projectlist", projectlist);
    return "onlineservices/create";
}
Also used : CustomerService(com.itrus.portal.db.CustomerService) CustomerServiceExample(com.itrus.portal.db.CustomerServiceExample) ProjectExample(com.itrus.portal.db.ProjectExample) ArrayList(java.util.ArrayList) Project(com.itrus.portal.db.Project) EnterpriseQq(com.itrus.portal.db.EnterpriseQq) JSONObject(com.alibaba.fastjson.JSONObject) EnterpriseQqExample(com.itrus.portal.db.EnterpriseQqExample) HashMap(java.util.HashMap) Map(java.util.Map) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Aggregations

Project (com.itrus.portal.db.Project)77 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)59 HashMap (java.util.HashMap)32 UserInfo (com.itrus.portal.db.UserInfo)24 Enterprise (com.itrus.portal.db.Enterprise)20 ExtraProduct (com.itrus.portal.db.ExtraProduct)17 ProjectExample (com.itrus.portal.db.ProjectExample)16 ArrayList (java.util.ArrayList)15 ProjectKeyInfo (com.itrus.portal.db.ProjectKeyInfo)12 UserInfoServiceException (com.itrus.portal.exception.UserInfoServiceException)12 Product (com.itrus.portal.db.Product)10 Date (java.util.Date)10 ResponseBody (org.springframework.web.bind.annotation.ResponseBody)9 BusinessLicense (com.itrus.portal.db.BusinessLicense)8 IdentityCard (com.itrus.portal.db.IdentityCard)8 OrgCode (com.itrus.portal.db.OrgCode)8 TaxRegisterCert (com.itrus.portal.db.TaxRegisterCert)8 UserinfoEnterprise (com.itrus.portal.db.UserinfoEnterprise)8 List (java.util.List)8 Map (java.util.Map)8