Search in sources :

Example 6 with ProjectExample

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

the class AdminController method listjson.

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

Example 7 with ProjectExample

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

the class BillServiceImpl 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.BillMapper.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 8 with ProjectExample

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

the class PersonalBillServiceImpl method getProjectMapByUserInfoId.

/**
 * 根据用户id查找订单表中对应的projectMap
 *
 * @param userInfo
 * @return
 */
public Map<Long, Project> getProjectMapByUserInfoId(Long userInfo) {
    Map<Long, Project> projectMap = new HashMap<Long, Project>();
    List<Long> projectIds = sqlSession.selectList("com.itrus.portal.db.BillMapper.selectProjectsByUserInfo", userInfo);
    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 9 with ProjectExample

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

the class SignatureConfigController method createForm.

// 返回新建页面
@RequestMapping(params = "form", produces = "text/html")
public String createForm(Model uiModel) {
    ProjectExample projectex = new ProjectExample();
    List projectexall = sqlSession.selectList("com.itrus.portal.db.ProjectMapper.selectByExample", projectex);
    uiModel.addAttribute("projects", projectexall);
    return "signatureconfig/create";
}
Also used : ProjectExample(com.itrus.portal.db.ProjectExample) List(java.util.List) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Example 10 with ProjectExample

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

the class OnlineServiceController method selectProject.

@RequestMapping(produces = "text/html")
public String selectProject(@RequestParam(value = "queryDate1", required = false) Date queryDate1, @RequestParam(value = "queryDate2", required = false) Date queryDate2, @RequestParam(value = "projectId", required = false) Long projectId, @RequestParam(value = "phone", required = false) String phone, @RequestParam(value = "enterpriseQq", required = false) String enterpriseQq, @RequestParam(value = "page", required = false) Integer page, @RequestParam(value = "size", required = false) Integer size, @RequestParam(value = "status", required = false) String status, Model uiModel) {
    if (queryDate1 == null && queryDate2 == null) {
        Calendar calendar = Calendar.getInstance();
        calendar.add(Calendar.DATE, 1);
        calendar.set(Calendar.HOUR_OF_DAY, 0);
        calendar.set(Calendar.MINUTE, 0);
        calendar.set(Calendar.SECOND, 0);
        calendar.set(Calendar.MILLISECOND, 0);
        calendar.add(Calendar.MILLISECOND, -1);
        queryDate2 = calendar.getTime();
        calendar.add(Calendar.MILLISECOND, 1);
        calendar.add(Calendar.MONTH, -1);
        queryDate1 = calendar.getTime();
    }
    // 管理员项目权限
    Long[] projectsOfAdmin = getProjectLongIdsOfAdmin();
    Map param = new HashMap();
    param.put("hasProjects", Arrays.asList(projectsOfAdmin));
    if (page == null || page < 1)
        page = 1;
    if (size == null || size < 1)
        size = 10;
    Integer offset = size * (page - 1);
    param.put("offset", offset);
    param.put("limit", size);
    param.put("queryDate1", queryDate1);
    param.put("queryDate2", queryDate2);
    if (projectId != null) {
        param.put("projectId", projectId);
    }
    if (StringUtils.isNotEmpty(phone)) {
        param.put("phone", "%" + phone + "%");
    }
    if (StringUtils.isNotEmpty(enterpriseQq)) {
        param.put("enterpriseQq", "%" + enterpriseQq + "%");
    }
    // 查詢qq客服
    List<Map<String, Object>> enterpriseqQq = onlineService.selectQqList(param);
    // 得到數量
    int count = onlineService.selectcount(param);
    uiModel.addAttribute("pages", (count + size - 1) / size);
    if (page > 1 && size * (page - 1) >= count) {
        page = (count + size - 1) / size;
    }
    Map<Long, List<CustomerService>> listmain = new HashMap<Long, List<CustomerService>>();
    for (int i = 0; i < enterpriseqQq.size(); i++) {
        long id = Long.parseLong(enterpriseqQq.get(i).get("id").toString());
        CustomerServiceExample customerE = new CustomerServiceExample();
        CustomerServiceExample.Criteria serviceE = customerE.createCriteria();
        int cid = Integer.parseInt(enterpriseqQq.get(i).get("id").toString());
        serviceE.andEnterpriseIdEqualTo(cid);
        List<CustomerService> listcustomer = onlineService.selectServiceList(customerE);
        listmain.put(id, listcustomer);
    }
    ProjectExample projectE = new ProjectExample();
    ProjectExample.Criteria pec = projectE.createCriteria();
    pec.andIdIn(Arrays.asList(projectsOfAdmin));
    List<Project> project = projectService.getProjectByExample(projectE);
    uiModel.addAttribute("listQq", enterpriseqQq);
    uiModel.addAttribute("listmain", listmain);
    uiModel.addAttribute("list", project);
    // 查询默认客服的数据
    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);
    uiModel.addAttribute("enterpriseqq", enterpriseqq);
    uiModel.addAttribute("customerService", customerService);
    uiModel.addAttribute("count", count);
    uiModel.addAttribute("queryDate1", queryDate1);
    uiModel.addAttribute("queryDate2", queryDate2);
    uiModel.addAttribute("projectId", projectId);
    uiModel.addAttribute("phone", phone);
    uiModel.addAttribute("enterpriseQq", enterpriseQq);
    uiModel.addAttribute("size", size);
    uiModel.addAttribute("page", page);
    return "onlineservices/list";
}
Also used : CustomerService(com.itrus.portal.db.CustomerService) CustomerServiceExample(com.itrus.portal.db.CustomerServiceExample) HashMap(java.util.HashMap) ProjectExample(com.itrus.portal.db.ProjectExample) Calendar(java.util.Calendar) Project(com.itrus.portal.db.Project) EnterpriseQq(com.itrus.portal.db.EnterpriseQq) ArrayList(java.util.ArrayList) List(java.util.List) EnterpriseQqExample(com.itrus.portal.db.EnterpriseQqExample) HashMap(java.util.HashMap) Map(java.util.Map) 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