public function forceAllOffLine($request, $response)
 {
     /*{{{*/
     $groupId = (int) $request->getRequest('groupid', 0);
     $group = InspectGroup::find($groupId);
     DBC::requireFalse($group->isNull(), "审核组不存在");
     InspectClient::getInstance()->forceReleaseByGroup($group);
     $url = $response->router->urlfor('outpatienttool/selectgroup');
     $response->setRedirect($url);
 }
         </div>
         <?php 
     }
     ?>
         <?php 
 }
 ?>
     </div>
     <?php 
 if (false == empty($oldDtos)) {
     ?>
     <div><a class="blueA" id="triggerBtn">收起方案<<</a></div>
     <div id="oldHistoryProposals" class="detail-proposalhistorylist">
         <?php 
     foreach ($oldDtos as $dto) {
         $inspectgroup = InspectGroup::find($dto->proposal->inspectGroup->id);
         if ($inspectgroup instanceof BuInspectgroup) {
             $isCurProposal = isset($task) && $task->proposal->id == $dto->proposal->id;
             $pclass = '';
             $logs = array();
             if ($isCurProposal) {
                 $pclass = ' detail-proposalhistory_proposalborder';
             }
             if ($isCurProposal || isset($readOnly)) {
                 $logs = S3LogClient::getInstance()->getLogList($dto->proposal->getLogable(), false);
                 $taskComment = $task->comment;
             }
             ?>
         <div class="detail-proposalhistory_detail<?php 
             echo $pclass;
             ?>
 public function nextOrdinarySignin($request, $response)
 {
     /*{{{*/
     $inspectGroupName = $request->inspectgroup;
     $inspectGroup = DAL::get()->find_by_name('PatientSigninInspectGroup', $inspectGroupName);
     if ($inspectGroup->isNull()) {
         $inspectGroup = PatientSigninInspectRule::getPatientSigninInspectGroup();
     }
     $response->msg = $request->msg;
     $user = $this->user;
     $signinId = $request->signinId;
     //老患者报到类型
     $signinType = PatientSignin::TYPE_ORDINARY;
     $response->signinType = $signinType;
     $ticket = new NullEntity();
     //获取工单
     if (empty($signinId)) {
         $inspectGroupId = $request->getRequest('inspectGroupId', $inspectGroup->id);
         $signinGroup = InspectGroup::find($inspectGroupId);
         $orderby = 'desc';
         $ticket = InspectClient::getInstance()->pickTicket($this->curInspector, $signinGroup, $orderby);
         if ($ticket->isNull()) {
             echo "工单审核结束";
             return parent::DIRECT_OUTPUT;
         }
     }
     //报到者
     $patientSignin = new NullEntity();
     if ($ticket->isNull() == false) {
         $patientSignin = $ticket->getSource();
         if (false == $patientSignin->isNull() && $patientSignin->isSrcWeiXin()) {
             $patientSignin = DAL::get()->find('PatientSignin', $patientSignin->id, true);
         }
     } elseif (empty($signinId) == false) {
         $patientSignin = DAL::get()->find('PatientSignin', $signinId);
     }
     if ($patientSignin->isNull()) {
         die('审核结束');
     }
     $response->helpInfos = DAL::get()->find_all_by_patientSigninId('PatientSigninHelpInfo', $patientSignin->id);
     $response->assignerId = $this->curInspector->id;
     $response->patientSignin = $patientSignin;
     $response->ticket = $ticket;
     $doctorPatientRef = DAL::get()->find_by_patientid_and_spaceid('DoctorPatientRef', $patientSignin->patient->id, $patientSignin->space->id);
     $response->doctorPatientRef = $doctorPatientRef;
     //关联疾病
     $signinId = $signinId ? $signinId : $patientSignin->id;
     $diseaseRefList = DAL::get()->find_all_by_signinid('PatientSigninDiseaseRef', $signinId);
     if (empty($diseaseRefList) && false == $doctorPatientRef->isNull()) {
         $mark = DAL::get()->find_by_doctorpatientrefid('FlowDiseaseMark', $doctorPatientRef->id);
         if (false == $mark->isNull()) {
             $diseaseRefList = array($mark);
         }
     }
     if (empty($diseaseRefList)) {
         $response->diseaseRefList = array();
     } else {
         $response->diseaseRefList = array(array_pop($diseaseRefList));
     }
     $response->defaultRefuseReason = $this->defaultRefusePatientSignin($patientSignin);
     $diseaseRef = DAL::get()->find_by_signinid('PatientSigninDiseaseRef', $patientSignin->id);
     $response->isDiseaseHasQuestionSheet = false;
     if (false == $diseaseRef->disease->isNull()) {
         $response->isDiseaseHasQuestionSheet = $this->checkDiseaseQuestionSheet($diseaseRef->disease->id, $patientSignin->space->id);
     }
     $patientId = $patientSignin->patient->id;
     $userName = $patientSignin->space->userName;
     $res = PatientCourseClient::getInstance()->searchPatientCase(null, $userName, '', null, null, null, null, null, true, 1, 10, '', $patientId);
     $response->total = $res["pageInfo"]["total"];
     //判断是否为MSD医生
     $isMsdSpace = FlowMarkClient::getInstance()->isMarkForSpace($patientSignin->space, SpaceSymbol::TYPE_MSD);
     $response->isMsdSpace = $isMsdSpace;
     $groups = DAL::get()->find_all_by_spaceid_and_type('ReGroup', $patientSignin->space->id, ReGroup::TYPE_1, true);
     $groups = DAL::get()->find('regroup', array_keys($groups), true);
     $groupMemberCntList = ForumClient::getInstance()->getAllRegroupMemberCnt($patientSignin->space);
     $unGroup = DAL::get()->find_by_spaceid_and_type('ReGroup', $patientSignin->space->id, ReGroup::TYPE_2);
     $unGroup = DAL::get()->find('regroup', $unGroup->id, true);
     $response->unGroup = $unGroup;
     $defaultGroup = DAL::get()->find_id_ByPatientIdAndSpaceId('regroup', $patientSignin->patient->id, $patientSignin->space->id);
     $response->groups = $groups;
     $response->groupMemberCntList = $groupMemberCntList;
     if (empty($defaultGroup)) {
         $defaultGroup[0] = "-1";
     }
     $response->defaultGroupId = $defaultGroup[0];
     //判断是否为MSD患者
     $isMsdPatient = FlowMarkClient::getInstance()->isMarkPatientForSpace($patientSignin->space, $patientSignin->patient, SpaceSymbol::TYPE_MSD);
     $response->isMsdPatient = $isMsdPatient;
     //获取已标记患者数
     $msdPatientAmount = FlowMarkClient::getInstance()->getPatientAmountForSpace($patientSignin->space, SpaceSymbol::TYPE_MSD);
     $response->msdPatientAmount = $msdPatientAmount;
     $response->inspectGroupName = $inspectGroupName;
 }
 public function showCreateTask($request, $response)
 {
     /*{{{*/
     if ($request->tmpProposalId) {
         $proposal = DAL::get()->find('TemporaryProposal', $request->tmpProposalId);
     }
     if ($request->proposalId) {
         $proposal = DAL::get()->find('Proposal', $request->proposalId);
     }
     DBC::requireTrue(isset($proposal) && false == $proposal->isNull(), '方案不能为空');
     $response->proposal = $proposal;
     $group = InspectGroup::find($proposal->inspectgroupid);
     $response->group = $group;
     $response->_my_template = '/intention/proposal/showcreatetask.php';
 }
 private function checkAssignTask4Leader($request, $response)
 {
     /*{{{*/
     $taskIds = $request->taskids;
     DBC::requireFalse(empty($taskIds), '没有选择任务');
     $group = InspectGroup::find($request->groupid);
     DBC::requireTrue($this->curInspector->isTaskLeader($group), '不是当前组的组长或者管理员,不允许操作');
 }
 private function getGroup($groupId)
 {
     /*{{{*/
     return InspectGroup::find($groupId);
 }