use of com.itrus.portal.db.Project in project portal by ixinportal.
the class AdminController method getProjectNameByAdminId.
public String getProjectNameByAdminId(Long adminId) {
List<Project> projects = adminService.getProjectByAdminId(adminId);
String projectNameStr = "";
if (null != projects && !projects.isEmpty()) {
for (Project project : projects) {
projectNameStr += project.getName() + " ";
}
}
return projectNameStr;
}
use of com.itrus.portal.db.Project in project portal by ixinportal.
the class AppController method update.
/**
* 修改信息保存
* @return
*/
@RequestMapping(value = "/update")
public String update(@Valid App app, @RequestParam(value = "photofile", required = false) MultipartFile photofile, BindingResult bindingResult, Model uiModel, HttpServletRequest httpServletRequest) throws Exception {
if (bindingResult.hasErrors()) {
uiModel.addAttribute("app", app);
return "apps/update";
}
App app0 = sqlSession.selectOne("com.itrus.portal.db.AppMapper.selectByPrimaryKey", app.getId());
if (!isRightPhoto(httpServletRequest)) {
uiModel.addAttribute("projects", getProjectMapOfAdmin().values());
uiModel.addAttribute("app", app);
uiModel.addAttribute("photoError", "请设置符合规则的应用图片");
return "apps/update";
}
if (null != app0.getAppIcon()) {
app.setAppIcon(app0.getAppIcon());
}
if (null != photofile && !photofile.isEmpty()) {
File logoFile = appService.saveFile(photofile, app.getId(), FILE_TYPE_JPG);
app.setAppIcon(logoFile.getName());
}
app.setCreateTime(app0.getCreateTime());
app.setUniqueId(app0.getUniqueId());
app.setAuthPass(app0.getAuthPass());
if (StringUtils.isBlank(app0.getUniqueId())) {
app.setUniqueId(UniqueIDUtils.genAppUID(app0, app0.getCreateTime()));
}
if (StringUtils.isBlank(app0.getAuthPass())) {
app.setAuthPass(md5Encoder.encodePassword(app.getUniqueId() + getNameOfAdmin() + new Date().getTime(), null).toUpperCase());
}
sqlSession.update("com.itrus.portal.db.AppMapper.updateByPrimaryKey", app);
Project project = sqlSession.selectOne("com.itrus.portal.db.ProjectMapper.selectByPrimaryKey", app.getProject());
String oper = "修改应用";
String info = "项目名称: " + project.getName() + ", 应用名称: " + app.getName() + ", 应用简称: " + app.getShortName();
LogUtil.adminlog(sqlSession, oper, info);
uiModel.addAttribute("app", app);
uiModel.addAttribute("projects", getProjectMapOfAdmin().values());
return "redirect:/apps/show/" + app.getId();
}
use of com.itrus.portal.db.Project in project portal by ixinportal.
the class AppController method delete.
/**
* 删除应用
* @param id
* @param session
* @return
*/
@RequestMapping(value = "/{id}", method = RequestMethod.DELETE, produces = "text/html")
public String delete(@PathVariable("id") Long id, HttpSession session) {
App app = sqlSession.selectOne("com.itrus.portal.db.AppMapper.selectByPrimaryKey", id);
sqlSession.delete("com.itrus.portal.db.AppMapper.deleteByPrimaryKey", id);
session.setAttribute(APP_DEL_MSG, "应用【" + app.getName() + "】删除成功");
Project project = sqlSession.selectOne("com.itrus.portal.db.ProjectMapper.selectByPrimaryKey", app.getProject());
String oper = "删除应用";
String info = "项目名称: " + project.getName() + ", 应用名称: " + app.getName() + ", 应用简称: " + app.getShortName();
LogUtil.adminlog(sqlSession, oper, info);
return "redirect:/apps";
}
use of com.itrus.portal.db.Project in project portal by ixinportal.
the class ExtraBillServiceImpl method getProjectMapByEnterpriseId.
/**
* 根据企业id查询增值订单表中对应的projectMap
*
* @param enterprise
* @return
*/
public Map<Long, Project> getProjectMapByEnterpriseId(Long enterprise) {
Map<Long, Project> projectMap = new HashMap<Long, Project>();
List<Long> projectIds = sqlSession.selectList("com.itrus.portal.db.ExtraBillMapper.selectProjectsByEnterprise", enterprise);
if (null != projectIds && !projectIds.isEmpty()) {
ProjectExample projectExample = new ProjectExample();
ProjectExample.Criteria criteria = projectExample.or();
criteria.andIdIn(projectIds);
projectMap = sqlSession.selectMap("com.itrus.portal.db.ProjectMapper.selectByExample", projectExample, "id");
}
return projectMap;
}
use of com.itrus.portal.db.Project in project portal by ixinportal.
the class BillServiceImpl method getProjectMapByBills.
/**
* 根据订单list查找出对应的projectMap
*
* @param bills
* @return
*/
public Map<Long, Project> getProjectMapByBills(List<Bill> bills) {
Map<Long, Project> projectMap = new HashMap<Long, Project>();
List<Long> projectIds = new ArrayList<Long>();
for (Bill bill : bills) {
projectIds.add(bill.getProject());
}
if (!projectIds.isEmpty()) {
ProjectExample projectExample = new ProjectExample();
ProjectExample.Criteria criteria = projectExample.or();
criteria.andIdIn(projectIds);
projectMap = sqlSession.selectMap("com.itrus.portal.db.ProjectMapper.selectByExample", projectExample, "id");
}
return projectMap;
}
Aggregations