private function buildBookingTask($space, $note1='', $note2='')
	{/*{{{*/
		if($space->isBookingOpened() && $space->isDoctor() && BookingTask::isCreateTask() )
		{
			$doctor = $space->host;
            $doctor = DAL::get()->find('doctor', $doctor->id, true);
			$announceTime = $doctor->userUpdateTime->toShortString();
            if($note1)
            {
                $note1 = "空间公告1(停诊)-".$note1;
                $remark = $note1."-医生发布公告日期:".$announceTime;
                BookingTaskClient::getInstance()->addDoctorMovementTask($doctor, $remark);
            }
            if($note2)
            {
                $note2 = "公告2(出诊)-".$note2;
                $remark = $note2."-医生发布公告日期:".$announceTime;
                BookingTaskClient::getInstance()->addDoctorMovementTask($doctor, $remark);
            }
		}
	}/*}}}*/
 public function showOperateRecord($request, $response)
 {
     /*{{{*/
     $status = $request->status;
     $id = $request->id;
     if ($id != null && $status == 'order') {
         $order = DAL::get()->find('BookingOrder', $id);
         $operateRecordList = BookingTaskClient::getInstance()->getBookingLog($order);
         $response->operateRecordList = $operateRecordList;
         $response->status = $status;
     } else {
         if ($id != null && $status == 'spaceBusinessRequirement') {
             $spaceBusinessRequirement = DAL::get()->find('SpaceBusinessRequirement', $id);
             $operateRecordList4Booking = BookingTaskClient::getInstance()->getBookingLog($spaceBusinessRequirement);
             $requirementLogs = S3LogClient::getInstance()->getLogList($spaceBusinessRequirement);
             $operateRecordList = array_merge($requirementLogs, $operateRecordList4Booking);
             $response->operateRecordList = $this->sortLogList($operateRecordList);
             $response->status = $status;
         } else {
             if ($id != null && $status == 'space') {
                 $space = DAL::get()->find('space', $id);
                 $operateRecordList = BookingTaskClient::getInstance()->getBookingLog($space);
                 $response->operateRecordList = $operateRecordList;
                 $response->status = $status;
             } else {
                 $operateRecordList = array();
                 $response->operateRecordList = $operateRecordList;
             }
         }
     }
 }
예제 #3
0
 public function cancelHigherlevelTask($request, $response)
 {
     /*{{{*/
     BookingTaskClient::getInstance()->cancel($request->id, $this->curInspector->user);
     $response->setRedirect($response->router->urlfor('booking/showdetailhigherleveltask', array('taskId' => $request->id, 'msg' => true)));
 }
예제 #4
0
 public function denyBookingOrder($doctorId, $bookingOrderId, $type, $denyContent)
 {/*{{{*/
     $content = trim($denyContent);
     $doctor = DAL::get()->find('doctor', $doctorId);
     $res = $this->checkDoctorAndSpace($doctor);
     if($res)
     {
         $this->setErrorCode($res);
         return 0;
     }
     if($doctor->space->isBookingOpened() == false)
     {
         $this->setErrorCode(160);
         return 0;
     }    
     $bookingOrder = DAL::get()->find('bookingorder', $bookingOrderId);
     if ($bookingOrder->isNull())
     {
         $this->setErrorCode(158);
         return 0;
     }
     if($bookingOrder->status == BookingOrder::STATUS_AUDIT)
     {
         /*
         if($type == 4 && $content == '')
         {
             $this->setErrorCode(161);
             return 0;
         }
          */
         $message_content = $bookingOrder->getRefuseReasonMailContent($type, $content);
         //增加医生动态任务
         BookingTaskClient::getInstance()->addDoctorMovementTask($doctor, "医生拒绝订单-".$message_content);
         BookingClient::getInstance()->doctorRefuseOrder($doctor->space->user, $bookingOrderId, $message_content);
     }
     else
     {
         BookingClient::getInstance()->doctorCancelOrder($doctor->space->user, $bookingOrderId);
         BookingTaskClient::getInstance()->addDoctorMovementTask($bookingOrder->space->host, "医生取消订单"); 
     }
 }/*}}}*/
예제 #5
0
 private function buildBookingTask($id, $space, $arg)
 {
     $result = SpaceClient::getInstance()->setProperties($id, array('updateStatus' => $arg));
     if ($space->isNull() == false && $space->isDoctor() && $space->isBookingOpened()) {
         $remark1 = $remark2 = $noTask1 = $noTask2 = '';
         $announceTime = $space->host->userUpdateTime->toShortString();
         if ($space->updateStatus & 2) {
             $note1 = $space->getChangeData4Name('note1');
             $note1 = "空间公告1(停诊)-" . $note1;
             $remark1 = $note1 . "-医生发布公告日期:" . $announceTime;
             $where1 = $note1 . "-医生发布公告日期:";
         }
         if ($space->updateStatus & 4) {
             $note2 = $space->getChangeData4Name('note2');
             $note2 = "公告2(出诊)-" . $note2;
             $remark2 = $note2 . "-医生发布公告日期:" . $announceTime;
             $where2 = $note2 . "-医生发布公告日期:";
         }
         if (false == BookingTask::isCreateTask()) {
             $this->createBookingTask($space, $remark1, $remark2);
         } else {
             if ($remark1) {
                 $noTask1 = BookingTaskClient::getInstance()->queryDiagnoseTask('BookingTask', $space->host, $where1);
             }
             if ($remark2) {
                 $noTask2 = BookingTaskClient::getInstance()->queryDiagnoseTask('BookingTask', $space->host, $where2);
             }
             if ($noTask1 || $noTask2) {
                 $this->createBookingTask($space, $remark1, $remark2);
             }
         }
     }
 }
 public function orderDoctorCancel($request, $response)
 {
     /*{{{*/
     $user = DAL::get()->find('User', $request->userid);
     $bookingOrder = DAL::get()->find('BookingOrder', $request->id);
     $comment = "医生取消";
     if (false == $bookingOrder->isInvalid()) {
         BookingTaskClient::getInstance()->addDoctorMovementTask($bookingOrder->space->host, "医生取消订单");
         BookingClient::getInstance()->doctorCancelOrder($user, $request->id);
     }
     $this->message('修改成功!', $response);
 }