示例#1
0
 @RequestMapping("/agent/updateAgent.do")
 public void updateAgent(HttpServletResponse response) {
   try {
     String agentval = this.getRequest().getParameter("agentState");
     Agent agent = service.getAgent(CRMHelper.getCurrentAgent().getId());
     log.debug("座席:" + agent.getPhone() + " 设置状态为:" + agentval);
     agent.setState(agentval);
     service.updateAgent(agent);
     SpringHelper.getSession().setAttribute(CRMConstants.CRM_SESSION_CURRENT_AGENT, agent);
     CallServiceClient.getInstance().notifyAgentStateChangeAsync(agent);
     if (agentval.equals(Agent.STATE_IDLE)) {
       write(response, "Bizidle");
     } else {
       write(response, "BizBusy");
     }
   } catch (Exception ex) {
     log.error(ex.getMessage(), ex);
   }
 }
示例#2
0
 @RequestMapping("/agent/makeCallAjax.do")
 public void makeCallAjax(HttpServletResponse response) {
   JsonResult jr = new JsonResult();
   try {
     String callNum = this.getRequest().getParameter("callNum").trim();
     if (callNum.startsWith("1") && callNum.length() >= 11) {
       String localCode = CRMConfiguration.getLocalAreaCode();
       String mobileCode = service.getMobileArea(callNum);
       if (!localCode.equals(mobileCode)) {
         callNum = "0" + callNum;
       }
     }
     Agent agent = CRMHelper.getCurrentAgent();
     log.debug(agent.getPhone() + " called " + callNum);
     CRMServiceLocator.getCallService().doMakeCall(agent, callNum);
   } catch (Exception ex) {
     log.error(ex.getMessage(), ex);
     jr.setResult(JsonResult.RESULT_FALSE);
     jr.setMessage(ex.getMessage());
   }
   writeJson(response, jr);
 }