public function taskEventList($request, $response)
 {
     /*{{{*/
     $request->page = $request->page ? $request->page : 1;
     $_pageSize = $request->pageSize ? $request->pageSize : 200;
     $response->spacePhone = $spacePhone = $request->spacePhone ? $request->spacePhone : "";
     $response->spaceName = $spaceName = $request->spaceName ? $request->spaceName : '';
     $response->spaceId = $spaceId = $request->spaceId ? $request->spaceId : "";
     $response->userName = $userName = $request->userName ? $request->userName : "";
     $response->userPhone = $userPhone = $request->userPhone ? $request->userPhone : '';
     $response->orderId = $orderId = $request->orderId ? $request->orderId : '';
     $response->priority = $priority = $request->priority ? $request->priority : "";
     $response->taskStatus = $taskStatus = $request->taskStatus ? $request->taskStatus : TelOrderTask::STATUS_UN_FOLLOW . "," . TelOrderTask::STATUS_IN_FOLLOW;
     $response->taskType = $taskType = $request->taskType ? $request->taskType : "";
     $response->timeType = $timeType = $request->timeType ? $request->timeType : "";
     $response->searchBeginTime = $searchBeginTime = $request->searchBeginTime ? $request->searchBeginTime : "";
     $response->searchEndTime = $searchEndTime = $request->searchEndTime ? $request->searchEndTime : "";
     $groupNames = $this->getGroupName($request, $response);
     $params = array('spaceName' => $spaceName, 'spacePhone' => $spacePhone, 'spaceId' => $spaceId, 'userName' => $userName, 'userPhone' => $userPhone, 'orderId' => $orderId, 'priority' => $priority, 'taskStatus' => $taskStatus, 'taskType' => $taskType, 'timeType' => $timeType, 'searchBeginTime' => $searchBeginTime, 'searchEndTime' => $searchEndTime, 'paymentfront' => true);
     $res = TelOrderTaskClient::getInstance()->getOrderTaskList($groupNames, $request->page, $_pageSize, $params);
     $pagelink = PageNav::getNavLink(PageNav::getPageNavTemplate("?spaceName={$spaceName}&spacePhone={$spacePhone}&userName={$userName}&userPhone={$userPhone}&orderId={$orderId}&searchBeginTime={$searchBeginTime}&searchEndTime={$searchEndTime}&taskType={$taskType}&taskStatus={$taskStatus}&priority={$priority}&timeType={$timeType}&page="), $res['pageInfo']['nowpage'], $res['pageInfo']['pagesize'], $res['pageInfo']['total']);
     $spaceList = array();
     if (isset($res['taskCount']) && false == empty($res['taskCount'])) {
         foreach ($res['taskCount'] as $key => $value) {
             $space = DAL::get()->find('space', $key);
             array_push($spaceList, $space);
         }
     }
     $response->offset = ($res['pageInfo']['nowpage'] - 1) * $res['pageInfo']['pagesize'];
     $response->spaceList = $spaceList;
     $response->taskCount = isset($res['taskCount']) ? $res['taskCount'] : '';
     $response->pagelink = $pagelink;
     $response->autoRefresh = $request->autoRefresh;
 }
    public function confirmTime($request, $response)
    {/*{{{*/
        $fromHour = ($request->fromHour != "")?$request->fromHour:0;
        $fromMinute = ($request->fromMinute != "")?$request->fromMinute:0;
    	DBC::requireFalse($fromHour > 24 || $fromMinute > 60, '时间格式不对');
        $dateInfos = explode('-', $request->appointmentDate);
        $fromTime = mktime($fromHour, $fromMinute, 0, $dateInfos[1], $dateInfos[2], $dateInfos[0]);
        $fromTime = XDateTime::valueOfTime($fromTime);
        $isSendSms = ($request->isSendConfirmTime != "") ? $request->isSendConfirmTime : 0;

        //时间段超过数量,不允许预约
        $overLoadConfirmTimeInfos = DAL::get()->queryOverLoadConfirmTimeByCnt('TelOrder', 100);
        if(false == empty($overLoadConfirmTimeInfos) && 
            ( isset($overLoadConfirmTimeInfos[$fromTime->toString()])
            || isset($overLoadConfirmTimeInfos[$fromTime->addMinute(-5)->toString()])
            || isset($overLoadConfirmTimeInfos[$fromTime->addMinute(5)->toString()]) ))
        {
            echo 'false';
            return parent::DIRECT_OUTPUT;
        }

        TelOrderClient::getInstance()->confirmTime($this->curUser, $request->orderId, $fromTime, array('isSendSms' => $isSendSms, 'caseTitle'=>$request->caseTitle));
       //关闭任务,添加备注,添加日志 
        $taskList = DAL::get()->find_all_by_telorderid_and_tasktype('TelOrderTask', $request->orderId, TelOrderTask::TYPE_RESERVE_DEAL_ORDER); 
        foreach($taskList as $task)
        {
            if($task->isFinished())
            { 
                continue;
            }
            $taskId = $task->id;
            TelOrderTaskClient::getInstance()->executeTask($taskId, $this->curUser->id, TelOrderTask::STATUS_FINISHED);
            TelOrderRemarkClient::getInstance()->createOrderRemark($this->curUser, $task->spaceId, $task->id, TelOrderRemark::TYPE_SET_EXECUTETIME,"确认咨询时间: " . $fromTime->toStringByFormat('Y-m-d H:i'));
        }
        //重新约时间时,关闭已经有的空会议室
        $conf = phoneConferenceClient::getInstance()->getInitPhoneConf($request->orderId);
        if(false == $conf->isNull() && $conf->isConfInit())
        {
            PhoneConferenceClient::getInstance()->dismissConsultConf($conf);
        }

        echo "ok";
        return parent::DIRECT_OUTPUT;
    }/*}}}*/
	public function submitRemark($request, $response)
    {/*{{{*/
        DBC::requireNotEmptyString($request->taskId, 'taskId 不能为空');
        DBC::requireNotEmptyString($request->needClose, 'needClose 不能为空');
        DBC::requireNotEmptyString($request->remarkType, 'remarkType 不能为空');
        DBC::requireNotEmptyString($request->taskRemark, 'taskRemark 不能为空');
        $taskId = $request->taskId;
        $task = DAL::get()->find('TelOrderTask', $taskId);
        DBC::requireTrue(false == $task->isNull(), 'task不存在');

        $remark = "添加备注: ";
        if($request->needClose == 1)
        {
            if(false == $this->canFinishTask($taskId))
            {
                DBC::requireTrue(false == $task->isNull(), '订单没有完成或关闭, 不能关闭任务');
            }
            TelOrderTaskClient::getInstance()->executeTask($taskId, $this->curUser->id, TelOrderTask::STATUS_CLOSED);
            $remark .= "并关闭订单";
        }
        $remark .= $request->taskRemark;
        TelOrderRemarkClient::getInstance()->createOrderRemark($this->curUser, $task->spaceId, $taskId, $request->remarkType, $remark); 
        $this->redirectToTaskDetail($request, $response);
    }/*}}}*/
 public function telTaskList4AfterSaler($request, $response)
 {
     /*{{{*/
     $page = $request->page ? $request->page : 1;
     $response->page = $page;
     $pageSize = 20;
     $response->pageSize = $pageSize;
     $taskStatus = $request->taskStatus || $request->taskStatus == 0 ? $request->taskStatus : TelOrderTask::transStatusOrTypeArray2String(TelOrderTask::$taskStatusDesc);
     $taskType = $request->taskType ? $request->taskType : TelOrderTask::transStatusOrTypeArray2String(TelOrderTask::$telTaskType4AfterSaler);
     $params = array('taskStatus' => $taskStatus, 'exeUserName' => $request->exeUserName, 'telNo' => $request->telNo, 'inComingCallTel' => $request->inComingCallTel, 'callBackTel' => $request->callBackTel, 'taskType' => $taskType, 'searchBeginTime' => $request->searchBeginTime, 'searchEndTime' => $request->searchEndTime);
     $res = TelOrderTaskClient::getInstance()->getTelTaskList($page, $pageSize, $params);
     $telTaskList = $res['tasklist'];
     $response->telTaskList = $telTaskList;
     $response->params = $params;
     $response->taskStatus = $request->taskStatus;
     $response->taskType = $request->taskType;
     if (false == empty($res['pageInfo'])) {
         $response->total = $res['pageInfo']['total'];
         $response->pageLink = PageNav::getNavLink(PageNav::getPageNavTemplate("teltasklist4aftersaler?taskStatus={$request->taskStatus}&telNo={$request->telNo}&inComingCallTel={$request->inComingCallTel}&callBackTek={$request->callBackTel}&taskType={$request->taskType}&exeUserName={$request->exeUserName}&searchBeginTime={$request->searchBeginTime}&searchEndTime={$request->searchEndTime}&page="), $res['pageInfo']['nowpage'], $res['pageInfo']['pagesize'], $res['pageInfo']['total']);
     }
 }
Exemplo n.º 5
0
 /**
  * sendMsg 通知医助确定 
  * 
  * @param mixed $userId 
  * @param mixed $type 
  * @param mixed $content 
  * @access public
  * @return void
  */
 public function sendMsg($userId, $type, $content)
 {/*{{{*/
     $space = DAL::get()->find('space', $userId);
     if($space->isNull() || empty($content))
     {
         $this->setErrorCode(328);
         return 0;
     }
     $emergency = $this->getEmergency($type);
     //$id = PaymentClient::getInstance()->createTelOrderEvent($space->user, $type, $content, 0, $emergency);
     $id = TelOrderTaskClient::getInstance()->createTelOrderTask4DoctorFromMobile($space->user, $emergency, $content);
     $this->content = array('id'=>$id);
 }/*}}}*/