Search in sources :

Example 1 with ProjectExample

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

the class ProjectController method isExistProject.

/**
 * 判断企业代码的唯一性
 *
 * @param projecId
 * @param orgCode
 * @return
 */
private boolean isExistProject(Long projecId, String orgCode) {
    if (StringUtils.isBlank(orgCode))
        return false;
    ProjectExample example = new ProjectExample();
    ProjectExample.Criteria criteria = example.or();
    if (projecId != null) {
        List<Long> ids = new ArrayList<Long>();
        ids.add(projecId);
        criteria.andIdNotIn(ids);
    }
    criteria.andOrgCodeEqualTo(orgCode);
    List projectList = sqlSession.selectList("com.itrus.portal.db.ProjectMapper.selectByExample", example);
    return (projectList == null || projectList.isEmpty()) ? false : true;
}
Also used : ProjectExample(com.itrus.portal.db.ProjectExample) ArrayList(java.util.ArrayList) ArrayList(java.util.ArrayList) List(java.util.List)

Example 2 with ProjectExample

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

the class ProjectController method list.

// 列表所有信息
@RequestMapping(produces = "text/html")
public String list(@RequestParam(value = "page", required = false) Integer page, @RequestParam(value = "size", required = false) Integer size, Model uiModel) {
    // page,size
    if (page == null || page < 1)
        page = 1;
    if (size == null || size < 1)
        size = 10;
    // count,pages
    Integer count = sqlSession.selectOne("com.itrus.portal.db.ProjectMapper.countByExample", null);
    uiModel.addAttribute("count", count);
    uiModel.addAttribute("pages", (count + size - 1) / size);
    // page, size
    if (page > 1 && size * (page - 1) >= count) {
        page = (count + size - 1) / size;
    }
    uiModel.addAttribute("page", page);
    uiModel.addAttribute("size", size);
    // query data
    Integer offset = size * (page - 1);
    ProjectExample projectex = new ProjectExample();
    // projectex.or().andIdIsNotNull();
    projectex.setOffset(offset);
    projectex.setLimit(size);
    List projectall = sqlSession.selectList("com.itrus.portal.db.ProjectMapper.selectByExample", projectex);
    uiModel.addAttribute("projects", projectall);
    // itemcount
    uiModel.addAttribute("itemcount", projectall.size());
    return "projects/list";
}
Also used : ProjectExample(com.itrus.portal.db.ProjectExample) ArrayList(java.util.ArrayList) List(java.util.List) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Example 3 with ProjectExample

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

the class ProjectKeyInfoController method listjson.

// 列表所有信息
@RequestMapping(value = "/listjson", method = RequestMethod.GET)
@ResponseBody
public Map listjson() {
    ProjectKeyInfoExample projectkeyinfoex = new ProjectKeyInfoExample();
    List<ProjectKeyInfo> projectkeyinfoall = sqlSession.selectList("com.itrus.portal.db.ProjectKeyInfoMapper.selectByExample", projectkeyinfoex);
    ProjectExample projectex = new ProjectExample();
    Map projectmap = sqlSession.selectMap("com.itrus.portal.db.ProjectMapper.selectByExample", projectex, "id");
    return projectmap;
}
Also used : ProjectKeyInfo(com.itrus.portal.db.ProjectKeyInfo) ProjectExample(com.itrus.portal.db.ProjectExample) ProjectKeyInfoExample(com.itrus.portal.db.ProjectKeyInfoExample) HashMap(java.util.HashMap) Map(java.util.Map) RequestMapping(org.springframework.web.bind.annotation.RequestMapping) ResponseBody(org.springframework.web.bind.annotation.ResponseBody)

Example 4 with ProjectExample

use of com.itrus.portal.db.ProjectExample 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)

Example 5 with ProjectExample

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

the class SignatureConfigController method updateForm.

// 返回修改页面
@RequestMapping(value = "/{id}", params = "form", produces = "text/html")
public String updateForm(@PathVariable("id") Long id, Model uiModel) throws Exception {
    SignatureConfig signatureconfig = sqlSession.selectOne("com.itrus.portal.db.SignatureConfigMapper.selectByPrimaryKey", id);
    uiModel.addAttribute("signatureconfig", signatureconfig);
    ProjectExample projectex = new ProjectExample();
    List projectexall = sqlSession.selectList("com.itrus.portal.db.ProjectMapper.selectByExample", projectex);
    uiModel.addAttribute("projects", projectexall);
    return "signatureconfig/update";
}
Also used : ProjectExample(com.itrus.portal.db.ProjectExample) SignatureConfig(com.itrus.portal.db.SignatureConfig) List(java.util.List) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Aggregations

ProjectExample (com.itrus.portal.db.ProjectExample)24 Project (com.itrus.portal.db.Project)16 HashMap (java.util.HashMap)13 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)13 ArrayList (java.util.ArrayList)11 List (java.util.List)8 Map (java.util.Map)7 Admin (com.itrus.portal.db.Admin)4 CustomerService (com.itrus.portal.db.CustomerService)3 CustomerServiceExample (com.itrus.portal.db.CustomerServiceExample)3 EnterpriseQq (com.itrus.portal.db.EnterpriseQq)3 EnterpriseQqExample (com.itrus.portal.db.EnterpriseQqExample)3 JSONObject (com.alibaba.fastjson.JSONObject)2 AdminExample (com.itrus.portal.db.AdminExample)2 FileConfig (com.itrus.portal.db.FileConfig)2 FileConfigExample (com.itrus.portal.db.FileConfigExample)2 Calendar (java.util.Calendar)2 ResponseBody (org.springframework.web.bind.annotation.ResponseBody)2 Bill (com.itrus.portal.db.Bill)1 ProjectKeyInfo (com.itrus.portal.db.ProjectKeyInfo)1