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";
}
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;
}
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";
}
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";
}
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";
}
Aggregations