Search in sources :

Example 66 with Project

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;
}
Also used : Project(com.itrus.portal.db.Project)

Example 67 with Project

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();
}
Also used : App(com.itrus.portal.db.App) Project(com.itrus.portal.db.Project) File(java.io.File) MultipartFile(org.springframework.web.multipart.MultipartFile) Date(java.util.Date) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Example 68 with Project

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";
}
Also used : App(com.itrus.portal.db.App) Project(com.itrus.portal.db.Project) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Example 69 with Project

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;
}
Also used : Project(com.itrus.portal.db.Project) HashMap(java.util.HashMap) ProjectExample(com.itrus.portal.db.ProjectExample)

Example 70 with Project

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;
}
Also used : Project(com.itrus.portal.db.Project) HashMap(java.util.HashMap) ProjectExample(com.itrus.portal.db.ProjectExample) ArrayList(java.util.ArrayList) Bill(com.itrus.portal.db.Bill)

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