use of com.itrus.portal.db.FileIssue in project portal by ixinportal.
the class DownloadConfigController method updateForm.
// 返回修改页面
@RequestMapping(value = "/{id}/{status}", params = "form", produces = "text/html")
public String updateForm(@PathVariable("id") Long id, @PathVariable("status") Integer status, Model uiModel) {
if (status == 1) {
FileConfig fileConfig = configServiceImpl.getFileConfigById(id);
uiModel.addAttribute("fileConfig", fileConfig);
return "downloadconfig/update1";
} else if (status == 2) {
FileIssue fileIssue = configServiceImpl.getFileIssueById(id);
// uiModel.addAttribute("fileIssue", fileIssue);
// 获取对应项目信息
Project project = projectServiceImpl.selectByPrimaryKey(fileIssue.getProject());
uiModel.addAttribute("project", project);
// Map<String, Object> param = new HashMap<>();
// param.put("projectId1", fileIssue.getProject());
// List<Map<String, Object>> fileIssues = configServiceImpl.getList(param);
// 获取所有文件信息
List<FileConfig> fileConfigs = configServiceImpl.getList(new FileConfigExample());
uiModel.addAttribute("fileConfigs", fileConfigs);
try {
uiModel.addAttribute("jsonFile", jsonTool.writeValueAsString(fileConfigs));
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
// 获取对应项目下的所有发布文件
FileIssueExample issueExample = new FileIssueExample();
FileIssueExample.Criteria fec = issueExample.createCriteria();
fec.andProjectEqualTo(fileIssue.getProject());
issueExample.setOrderByClause("priority asc");
List<FileIssue> fileIssues = configServiceImpl.getList(issueExample);
try {
uiModel.addAttribute("jsonFileIssues", jsonTool.writeValueAsString(fileIssues));
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
uiModel.addAttribute("fileIssues", fileIssues);
return "downloadconfig/update2";
} else {
FileConfig fileConfig = configServiceImpl.getFileConfigById(id);
uiModel.addAttribute("fileConfig", fileConfig);
uiModel.addAttribute("message", "修改文件管理信息失败!");
return "downloadconfig/update1";
}
}
use of com.itrus.portal.db.FileIssue in project portal by ixinportal.
the class ThirdPartyController method customerService.
/**
* 进入常见问题页面
* @param product
* @param uiModel
* @param request
* @return
*/
@RequestMapping("/s/{product}/help")
public String customerService(@PathVariable("product") String product, Model uiModel, HttpServletRequest request) {
HttpSession session = request.getSession();
Product pro = productService.getProductByproName(product);
if (pro != null) {
// 查询企业客服
EnterpriseQqExample enterprise = new EnterpriseQqExample();
EnterpriseQqExample.Criteria qqEx = enterprise.createCriteria();
qqEx.andProjectIdEqualTo(pro.getProject());
EnterpriseQq enterpriseqq = enterpriseqqService.selectByEnterpriseQq(enterprise);
// 查询发布文件
FileIssueExample fileIssueExample = new FileIssueExample();
FileIssueExample.Criteria cec = fileIssueExample.createCriteria();
cec.andProjectEqualTo(pro.getProject());
List<FileIssue> FileIssues = configServiceImpl.getList(fileIssueExample);
Long questionId = 0L;
ServiceExample serviceExample = new ServiceExample();
ServiceExample.Criteria srCriteria = serviceExample.createCriteria();
serviceExample.clear();
serviceExample.setLimit(null);
srCriteria = serviceExample.createCriteria();
srCriteria.andProjectEqualTo(pro.getProject());
srCriteria.andTypeEqualTo(1);
Service service = questionService.getService(serviceExample);
if (null == service && (enterpriseqq == null || FileIssues.size() == 0)) {
serviceExample.clear();
srCriteria = serviceExample.createCriteria();
srCriteria.andNameEqualTo("缺省项目");
srCriteria.andTypeEqualTo(1);
Service service2 = questionService.getService(serviceExample);
questionId = service2.getId();
} else {
questionId = service.getId();
}
// 查询是否存在
Service service1 = questionService.getService(questionId);
// Service pService = sqlSession.selectOne("com.itrus.portal.db.ServiceMapper.selectByPrimaryKey", service.getParentId());
uiModel.addAttribute("service", service1);
// uiModel.addAttribute("pService", pService);
// 查询子节点
ServiceExample serviceExample2 = new ServiceExample();
ServiceExample.Criteria srCriteria2 = serviceExample2.createCriteria();
serviceExample2.clear();
serviceExample2.setLimit(null);
srCriteria2 = serviceExample2.createCriteria();
srCriteria2.andParentIdEqualTo(questionId);
Map<Long, Service> childSR = questionService.getChildSR(serviceExample2);
uiModel.addAttribute("childSR", childSR);
// 若没有子节点,直接返回
if (childSR == null || childSR.isEmpty()) {
return null;
}
Map<Integer, Long> idMap = new HashMap<>();
// 查询子节点是否包含下级节点
serviceExample2.clear();
srCriteria2 = serviceExample2.createCriteria();
srCriteria2.andParentIdIn(new ArrayList<Long>(childSR.keySet()));
Map<Long, Object> childNumMap = questionService.getChildNumMap(serviceExample2);
// 组装子节点信息
// List<Map<String,Object>> childList = new ArrayList<Map<String, Object>>();
// 对节点按照id顺序排序
List<List<Service>> childrenList = new ArrayList<List<Service>>();
List<Service> typeList = questionService.sortTypesMap(childSR);
List<Service> childList = new ArrayList<Service>();
int i = 1;
for (Service sr : typeList) {
if (childNumMap != null && childNumMap.containsKey(sr.getId())) {
serviceExample2.clear();
serviceExample2.setLimit(null);
srCriteria2 = serviceExample2.createCriteria();
srCriteria2.andParentIdEqualTo(sr.getId());
Map<Long, Service> childMap = questionService.getChildSR(serviceExample2);
childList = questionService.sortTypesMap(childMap);
childrenList.add(childList);
} else {
childrenList.add(childList);
}
idMap.put(i, sr.getId());
i++;
}
uiModel.addAttribute("childNumMap", childNumMap);
uiModel.addAttribute("childrenList", childrenList);
uiModel.addAttribute("idMap", idMap);
uiModel.addAttribute("pid", questionId);
serviceExample2.clear();
srCriteria = serviceExample2.createCriteria();
srCriteria.andTypeEqualTo(2);
srCriteria.andParentIdEqualTo(service1.getId());
List<Service> serviceList1 = questionService.getServiceList(serviceExample2);
Long sId = serviceList1.get(0).getId();
serviceExample2.clear();
srCriteria = serviceExample2.createCriteria();
srCriteria.andTypeEqualTo(3);
srCriteria.andParentIdEqualTo(sId);
List<Service> serviceList2 = questionService.getServiceList(serviceExample2);
Long gsId = serviceList2.get(0).getId();
uiModel.addAttribute("gsid", gsId);
uiModel.addAttribute("tab", "kehufuwu");
if (enterpriseqq != null && enterpriseqq.getId() != null) {
uiModel.addAttribute("eid", enterpriseqq.getId());
session.setAttribute("enterpriseqqE", enterpriseqq.getEnterpriseQqLinks());
}
return "ixinweb/kehufuwu_changjianwenti";
}
uiModel.addAttribute("tab", "kehufuwu");
return "ixinweb/kehufuwu_xuanzexiangmu";
}
use of com.itrus.portal.db.FileIssue in project portal by ixinportal.
the class DownloadConfigServiceImpl method selectFileIssue.
/**
* 根据文件Id 和 项目Id 获取对应的文件发表信息
* @param fileConfigId
* @param productId
* @return
*/
public FileIssue selectFileIssue(Long fileConfigId, Long projectId) {
FileIssueExample fileIssueExample = new FileIssueExample();
FileIssueExample.Criteria fec = fileIssueExample.createCriteria();
fec.andProjectEqualTo(projectId);
fec.andFileConfigEqualTo(fileConfigId);
FileIssue fileIssue = sqlSession.selectOne("com.itrus.portal.db.FileIssueMapper.selectByExample", fileIssueExample);
if (fileIssue == null) {
return null;
} else {
return fileIssue;
}
}
Aggregations