示例#1
0
 // 已拨电话清单
 @RequestMapping("/agent/listCallHis.do")
 public String listCallHisAction(AgentCallHisDto dto) {
   //		Agent agent = Struts2Helper.getCurrentAgent();
   //		if (agent != null) {
   //			dto.setAgentId(agent.getId());
   //		}
   Company c = SpringHelper.getCurrentCompany();
   if (c != null) {
     dto.setCompanyId(c.getId());
   }
   User user = SpringHelper.getCurrentUser();
   List<User> list = null;
   if (StringUtils.isEmpty(dto.getDeptId())) {
     list = CRMHelper.getAccessAgentUsers(user, CRMHelper.isCurrentUserManager());
     // 有部门
   } else {
     Dept dept = ServiceLocator.getDeptService().getDept(dto.getDeptId());
     list = dept.getAvailableUsers();
   }
   if (StringUtils.isEmpty(dto.getProcessor())) {
     if (list.size() > 1) {
       StringBuilder sb = new StringBuilder();
       for (int i = 0; i < list.size(); i++) {
         sb.append("'").append(list.get(i).getId()).append("',");
       }
       dto.setProcessor(sb.substring(0, sb.length() - 1));
     } else {
       dto.setProcessor(user.getId());
     }
   }
   this.getRequest()
       .setAttribute("isManager", securityService.hasRole(Role.ROLE_CODE_CRM_MANAGER));
   this.getRequest().setAttribute("userlist", list);
   Pagination pagination = service.queryPage(dto);
   this.getRequest().setAttribute("pagination", pagination);
   this.getRequest().setAttribute("dto", dto);
   return CRMConstants.CRM_JSP_ROOT + "call/callList";
 }
示例#2
0
 @Override
 public boolean isCompanyHasSystemWorkTime(Company company) {
   String sql = "select count(*) from KGADE.T_ADE_WORKTIME where company_id = ? and system = 1";
   int count = jdbcTemplate.queryForObject(sql, Integer.class, company.getId());
   return count > 0;
 }