public function setUp($currentSystemCode, $useRemoteCache = self::REMOTE_CACHE_USED) { if ($this->isSetup() == false) { DBC::requireNotEmptyString($currentSystemCode); $this->currentSystemCode = $currentSystemCode; BeanFinder::register('currentSystemCode', $this->currentSystemCode); $this->useRemoteCache = $useRemoteCache; include(dirname(__FILE__).'/dalsetting.php'); $this->orgDbConfigs['dbwrite'] = $dbwrite; $this->orgDbConfigs['dbread'] = $dbread; DAL::get()->registerDb($dbConfigs); DAL::get()->registerMsDb($msDbConfigs); DAL::get()->registerRemoteCache($caches); DAL::get()->registerGearman($gearmanConfigs); DAL::get()->initSession($sessionSavePaths); DAL::get()->registerRedis($redisConfigs); if (isset($this->dbConfigs[$currentSystemCode])) { BeanFinder::register('dbexecuter', $this->getDbExecuter()); } $this->isSetup = true; } return $this; }
public function paySms($request, $response) { /*{{{*/ $phoneNumbers = $request->phoneNumbers; $content = $request->content; DBC::requireNotEmpty($phoneNumbers, '手机号不能为空!'); DBC::requireNotEmptyString($content, '内容不能为空!'); SMSClient::getInstance()->sendAsync($phoneNumbers, $content, SMSLog::OPT_TYPE_TEL_ZIXUN); $response->setRedirect($response->router->urlfor('serviceorder/showdetail', array('id' => $request->id, 'msg' => '短信发送成功!'))); }
public function showDetail($request, $response) {/*{{{*/ DBC::requireNotEmptyString($request->id, "ID不能为空!"); DBC::requireTrue(class_exists($request->type, "无效的病历类型!")); $source = DAL::get()->find($request->type, $request->id); if ($source->isNull()) { throw new BizException('病历资料不存在!'); } $response->bingliSet = BingLiDtoClient::getInstance()->getBingLiByRelatedObj($source); $response->patient = $source->patient; $response->callback = $request->callback; }/*}}}*/
public function ajaxSetDoctorCount($request, $response) { /*{{{*/ $request->convertToGbk(); $type = $request->type; $count = $request->count; DBC::requireNotEmptyString($type, 'type不能为空'); DBC::requireTrue(is_numeric($count), '医生数量必须是数值'); DBC::requireNotEmptyString($request->diseasePageId, 'diseasepageid不能为空'); DiseasePageClient::getInstance()->setDoctorCount($request->diseasePageId, $type, $count); echo 'ok'; return parent::DIRECT_OUTPUT; }
public function setProviderConfigs($request, $response) { if (!$this->curOperator->isOperatorAdmin()) { throw new TelConfException('抱歉,此座席无权限查看!'); } $spType = $request->spType; $appType = $request->appType; DBC::requireNotEmptyString($spType, 'spType不能为空'); DBC::requireNotEmptyString($appType, 'appType不能为空'); $response->callcenterProvider = DAL::get()->find_by_sptype('teleconfprovider', $spType); $providerConfig = ProviderConfigFactory::createProviderConfig($spType, $appType); $response->appUrlList = $providerConfig->returnAppUrlList(); }
public function getDoctorInfo($request,$response) { $doctorId = $request->doctorid; DBC::requireNotEmptyString($doctorId, '医生Id不能为空'); $doctor = DAL::get()->find('doctor', $doctorId); $doctorInfo = ''; if (false == $doctor->isNull()) { $doctorInfo = $doctor->hospitalfaculty->hospital->name.$doctor->hospitalfaculty->faculty->name." ".$doctor->name; } $doctorInfo = array('doctorInfo' => mb_convert_encoding($doctorInfo,'utf-8','gbk')); echo json_encode($doctorInfo); exit; }
public function addPost($request, $response) { /*{{{*/ $name = $request->name; $keyword = $request->keyword; DBC::requireNotEmptyString($name, "name不存在"); DBC::requireNotEmptyString($keyword, "keyword不存在"); $keyworddesc = $request->keyworddesc; $pGroupTpl = PlaceClient::getInstance()->addPGroupTpl($name, $keyword, $keyworddesc); $msg = '添加失败 原因:pGroupTpl ' . $name . "已存在"; if ($pGroupTpl instanceof PGroupTpl) { $msg = '添加成功'; } else { die($msg); } $url = $response->router->urlfor('pgrouptpl/alllist', array('msg' => $msg)); $response->setRedirect($url); }
public function addPost($request, $response) { $name = $request->name; $ename = $request->ename; $content = $request->getPost('content'); DBC::requireNotEmptyString($name, "name不存在"); DBC::requireNotEmptyString($ename, "ename不存在"); DBC::requireNotEmptyString($content, "content不存在"); $paperTpl = PaperClient::getInstance()->addPaperTpl($ename, $name, $content); $msg = '添加失败 原因:paperTpl ' . $ename . "已存在"; if ($paperTpl instanceof PaperTpl) { $msg = '添加成功'; } else { die($msg); } $url = $response->router->urlfor('papertpl/alllist', array('msg' => $msg)); $response->setRedirect($url); }
public function addPost($request, $response) { $name = $request->name; $ename = $request->ename; $precontent = $request->getPost('precontent'); $suffcontent = $request->getPost('suffcontent'); DBC::requireNotEmptyString($name, "name不存在"); DBC::requireNotEmptyString($ename, "ename不存在"); DBC::requireNotEmptyString($precontent, "precontent不存在"); DBC::requireNotEmptyString($suffcontent, "suffcontent不存在"); $subunitTpl = PaperClient::getInstance()->addSubunitTpl($name, $ename, $precontent, $suffcontent); $msg = '添加失败 原因:subunitTpl ' . $ename . ' 已存在'; if ($subunitTpl instanceof SubunitTpl) { $msg = '添加成功'; } else { die($msg); } $url = $response->router->urlfor('chiptpl/listofsubunittpl', array('msg' => $msg, 'subunitTplId' => $subunitTpl->id)); $response->setRedirect($url); }
public function addPost($request, $response) { /*{{{*/ $keyword = $request->keyword; DBC::requireNotEmptyString($keyword, "keyword不存在"); $name = $request->name; DBC::requireNotEmptyString($name, "name不存在"); $content = html_entity_decode($request->getPost('content')); $pGroupTplId = $request->pGroupTplId; $pGroupTpl = DAL::get()->find('pGroupTpl', $pGroupTplId, true); DBC::requireTrue($pGroupTpl instanceof PGroupTpl, "PGroupTpl {$pGroupTplId} 不存在"); $placeTpl = PlaceClient::getInstance()->addPlaceTpl($pGroupTpl, $name, $keyword, $content); $msg = '添加失败 原因:pGroup ' . $name . "已存在"; if ($placeTpl instanceof PlaceTpl) { $msg = '添加成功'; } else { die($msg); } $url = $response->router->urlfor('placetpl/listofpgrouptpl', array('pgrouptplid' => $pGroupTplId, 'msg' => $msg)); $response->setRedirect($url); }
public function addPost($request, $response) { /*{{{*/ $keyword = $request->keyword; DBC::requireNotEmptyString($keyword, "keyword不存在"); $pGroupTplId = $request->pGroupTplId; $pGroupTpl = DAL::get()->find('pGroupTpl', $pGroupTplId, true); DBC::requireTrue($pGroupTpl instanceof PGroupTpl, "PGroupTpl {$pGroupTplId} 不存在"); $name = $request->name; $previewUrl = $request->previewurl; $editor = $this->curOperatorUser; $pGroup = PlaceClient::getInstance()->addPGroup($pGroupTpl, $name, $keyword, $previewUrl, $editor); $msg = '添加失败 原因:pGroup ' . $keyword . "已存在"; if ($pGroup instanceof PGroup) { $msg = '添加成功'; } else { die($msg); } $url = $response->router->urlfor('place/showlist', array('pGroupId' => $pGroup->id, 'msg' => $msg)); $response->setRedirect($url); }
private static function init($path, $encoding) { /*{{{*/ DBC::requireTrue(is_dir($path), '未知的path:' . $path); mb_internal_encoding($encoding); // just to make php use & as the separator when adding the PHPSESSID // variable to our requests ini_set("arg_seperator.output", "&"); ini_set("magic_quotes_runtime", 0); $configFile = $path . '/config/config.php'; DBC::requireTrue(is_file($configFile), '未知的config.php'); include $configFile; if (isset($configs['includePath']) && $configs['includePath']) { set_include_path($configs['includePath']); } $configs = new Configuration($configFile); BeanFinder::register('configs', $configs); DBC::requireNotEmptyString($configs->system, '未知系统code,请检查config中是否配置了system项'); DBC::requireNotEmptyString($configs->env, '未知系统env,请检查config中是否配置了system项'); self::initDebug($configs->env); DAL::get()->setUp($configs->system); Logger::setUp($configs->system); }
public function ajaxSubmitReview($request, $response) { /*{{{*/ $ticketId = $request->getRequest('passedTicketId', 0); DBC::requireNotEmptyString($ticketId, "passedTicketId 不能为空"); $ticket = DAL::get()->find("NfsTaskTicket", $ticketId); $remark = mb_convert_encoding($request->remark, 'gbk', 'utf-8'); if ($request->result != NfsTaskTicket::REVIEW_RESULT_UNREVIEW) { NfsAuditClient::getInstance()->review($this->auditor, $ticketId, $request->result, $remark); } $ticket = DAL::get()->find("NfsTaskTicket", $ticketId, true); if (false == $ticket->isReviewed()) { echo ''; } else { $reviewAuditor = $ticket->getReviewAuditor(); $resultArr = array(); $resultArr['result'] = NfsTaskTicket::$reviewResultDes[$ticket->reviewResult]; $resultArr['reviewAuditorName'] = $reviewAuditor->isNull() ? "" : $reviewAuditor->realName; $resultArr['reviewTime'] = $ticket->reviewTime->toString(); $resultArr['reviewRemark'] = $ticket->reviewRemark; mb_convert_variables('utf-8', 'gbk', $resultArr); echo json_encode($resultArr); } return parent::DIRECT_OUTPUT; }
public function sendMsg($request, $response) { /*{{{*/ $msg = $request->msg; DBC::requireNotEmptyString($msg, "消息不能为空!!!"); $wxUser = DAL::get()->find('WxUser', $request->wxUserId); DBC::requireTrue($wxUser instanceof WxUser, "WxUser不存在!!!"); WxApi::kefuTextMsg($wxUser, $msg); $toUser = $wxUser->nickname; WxMgrClient::getInstance()->addAdminReplyMsg($msg, $toUser); $response->setRedirect($_SERVER["HTTP_REFERER"]); }
public function ajaxgetdata4chart($request, $response) {/*{{{*/ DBC::requireNotEmptyString($request->categorykey, 'categoryKey不可为空'); $lastTime = XDateTime::valueOf($request->lasttime); $response->lastTime = $lastTime; $startTime = $lastTime->addDay(-30); $response->startTime = $startTime; $response->centerTitle = ''; switch ($request->categorykey) {/*{{{*/ case HealthRecordProblem::CHART_BLOODPRESSURE: $response->bloodJsonDataArr = HealthRecordClient::getInstance()->getBloodJsonData4StateSummaryChart($request->userid, $startTime->toShortString(), $lastTime->toShortString()); $high = isset($response->bloodJsonDataArr['high']) ? $response->bloodJsonDataArr['high'] : 0; $low = isset($response->bloodJsonDataArr['low']) ? $response->bloodJsonDataArr['low'] : 0; if(XString::jsArrayIsEmpty($high) && XString::jsArrayIsEmpty($low)) { $response->centerTitle = '这30天没有血压记录'; } break; case HealthRecordProblem::CHART_HEARTRATE: $response->heartRateJson = HealthRecordClient::getInstance()->getAnswerJsonData4StateSummaryChart($request->userid, HealthRecordProblem::HEARTRATE_TITLE, $startTime, $lastTime); if(XString::jsArrayIsEmpty($response->heartRateJson)) { $response->centerTitle = '这30天没有心率记录'; } break; case HealthRecordProblem::CHART_WEIGHT: $response->weightJson = HealthRecordClient::getInstance()->getAnswerJsonData4StateSummaryChart($request->userid, HealthRecordProblem::WEIGHT_TITLE, $startTime, $lastTime); if(XString::jsArrayIsEmpty($response->weightJson)) { $response->centerTitle = '这30天没有体重记录'; } break; case HealthRecordProblem::CHART_SHITSINGLE: $response->pinkShitJson = HealthRecordClient::getInstance()->getAnswerJsonData4StateSummaryChart($request->userid, HealthRecordProblem::PINKSHIT_TITLE, $startTime, $lastTime); $response->blackShitJson = HealthRecordClient::getInstance()->getAnswerJsonData4StateSummaryChart($request->userid, HealthRecordProblem::BLACKSHIT_TITLE, $startTime, $lastTime); $response->yellowShitJson = HealthRecordClient::getInstance()->getAnswerJsonData4StateSummaryChart($request->userid, HealthRecordProblem::YELLOWSHIT_TITLE, $startTime, $lastTime); $response->redShitJson = HealthRecordClient::getInstance()->getAnswerJsonData4StateSummaryChart($request->userid, HealthRecordProblem::REDSHIT_TITLE, $startTime, $lastTime); $response->whiteShitJson = HealthRecordClient::getInstance()->getAnswerJsonData4StateSummaryChart($request->userid, HealthRecordProblem::WHITESHIT_TITLE, $startTime, $lastTime); if(XString::jsArrayIsEmpty($response->pinkShitJson) && XString::jsArrayIsEmpty($response->blackShitJson) && XString::jsArrayIsEmpty($response->yellowShitJson) && XString::jsArrayIsEmpty($response->redShitJson) && XString::jsArrayIsEmpty($response->whiteShitJson) ) { $response->centerTitle = '这30天没有大便记录'; } break; case HealthRecordProblem::CHART_SHITTOTAL: $response->totalShitJson = HealthRecordClient::getInstance()->getShitTatalJsonData($request->userid, $startTime, $lastTime); $response->shitJsonHashData = HealthRecordClient::getInstance()->getShitJsonHashData($request->userid, $startTime, $lastTime); if(XString::jsArrayIsEmpty($response->totalShitJson)) { $response->centerTitle = '这30天没有大便记录'; } break; case HealthRecordProblem::CHART_CDAI: $startTime = $lastTime->addYear(-1); $response->startTime = $startTime; $response->cdaiJson = HealthRecordClient::getInstance()->getAnswerJsonData4StateSummaryChart($request->userid, HealthRecordProblem::CDAI_TITLE, $startTime, $lastTime); if(XString::jsArrayIsEmpty($response->cdaiJson)) { $response->centerTitle = '这一年没有CDAI记录'; } break; }/*}}}*/ return $request->categorykey; }/*}}}*/
public function doAddReserveTaskRemark($request, $response) { DBC::requireNum($request->eventId, "医生动态id是数字"); DBC::requireNotEmptyString($request->adminRemark, "备注不能为空"); PaymentClient::getInstance()->addRemark($request->eventId, $request->adminRemark, $this->curUser); $response->setRedirect($response->router->urlfor('telorder/addreservetaskremark', array('eventId'=>$request->eventId))); }
private function saveFollowupCustomerPhones($request, $response, $customerId) { /*{{{*/ DBC::requireNotEmptyString($customerId, 'customerId不能为空!'); // 更新已有电话 $editPhones = $request->getRequest('editPhones', array()); foreach ($editPhones as $phoneInfo) { $linkPhoneId = $phoneInfo['phoneId']; // 给患者设置默认/决策电话 $fields['defaultCallPhone'] = isset($phoneInfo['defaultCallPhone']) ? $phoneInfo['defaultCallPhone'] : 0; $fields['defaultMessagePhone'] = isset($phoneInfo['defaultMessagePhone']) ? $phoneInfo['defaultMessagePhone'] : 0; $fields['decisionPhone'] = isset($phoneInfo['decisionPhone']) ? $phoneInfo['decisionPhone'] : 0; unset($phoneInfo['defaultCallPhone']); unset($phoneInfo['defaultMessagePhone']); unset($phoneInfo['decisionPhone']); LinkPhoneClient::getInstance()->updateLinkPhone($linkPhoneId, $phoneInfo, $customerId, $this->auditor); FollowupClient::getInstance()->updatePhones($customerId, $linkPhoneId, $fields); } // 新增联系电话 $newPhones = $request->getRequest('newPhones', array()); foreach ($newPhones as $phoneInfo) { // 给患者设置默认/决策电话 $fields['defaultCallPhone'] = isset($phoneInfo['defaultCallPhone']) ? $phoneInfo['defaultCallPhone'] : 0; $fields['defaultMessagePhone'] = isset($phoneInfo['defaultMessagePhone']) ? $phoneInfo['defaultMessagePhone'] : 0; $fields['decisionPhone'] = isset($phoneInfo['decisionPhone']) ? $phoneInfo['decisionPhone'] : 0; unset($phoneInfo['defaultCallPhone']); unset($phoneInfo['defaultMessagePhone']); unset($phoneInfo['decisionPhone']); $linkPhoneId = LinkPhoneClient::getInstance()->addLinkPhone($phoneInfo, $customerId, $this->auditor); FollowupClient::getInstance()->updatePhones($customerId, $linkPhoneId, $fields, $this->auditor); } }
public function recoverDeletedFollowupPost($request, $response) { /*{{{*/ DBC::requireNotEmptyString($request->postid, '数据有错,请重试'); $postId = $request->postid; FollowupPostClient::getInstance()->recoverDelFollowupPost($postId); if (false == $request->ticketId && $request->flowId) { $response->setRedirect($response->router->urlfor('nfsaudit/notalk', array('refId' => $request->flowId))); } else { $response->setRedirect($response->router->urlfor('nfsaudit/nexttask', array('c' => 'nfsaudit', 'a' => 'nexttask', 'ticketId' => $request->ticketId, 'refresh' => 1))); } }
public function addIntentionTaskPost($request, $response) { /*{{{*/ $intention = DAL::get()->find('Intention', $request->id); DBC::requireFalse($intention->isNull(), '出错了'); DBC::requireNotEmptyString($request->remark, '备注不能为空'); BookingTaskClient::getInstance()->addIntentionTask($intention, $request->remark); $response->setRedirect($response->router->urlfor('booking/addintentiontask', array('id' => $request->id, 'msg' => true))); }
public function showOperations4HealthManage($request, $response) { /*{{{*/ $entityType = $request->type; $id = $request->id; DBC::requireNotEmptyString($entityType, '操作对象类型不能为空'); DBC::requireNotEmptyString($id, '操作对象id不能为空'); $entity = DAL::get()->find($entityType, $id); $list = array(); if (false == $entity->isNull()) { $list = S3LogClient::getInstance()->getLogList($entity->getLogable(), false); } $response->recordList = $list; }
public function doUnPendProposal($request, $response) { /*{{{*/ try { $proposal = DAL::get()->mustFind('Proposal', $request->proposalId); DBC::requireNotEmptyString($request->remark, '备注不能为空'); $remark = XString::convertToGbk($request->remark); $group = DAL::get()->mustFind('InspectGroup', $request->groupId); S3LogClient::getInstance()->add($this->curInspector, $proposal->getLogable()->action($group, $remark)); ProposalClient::getInstance()->unPendProposal($proposal, $this->curInspector); return parent::DIRECT_OUTPUT; } catch (Exception $e) { echo "<script>alert('" . $e->getMessage() . "');</script>"; return parent::DIRECT_OUTPUT; } }
public function doModifyClinicTime($request, $response) {/*{{{*/ $user = $this->weixSpaceUser->getUser(); $content = $request->getRequest('clinicContent'); DBC::requireNotEmptyString($content, "门诊时间不能为空"); $space = DAL::get()->find('space', $user->id); DBC::requireFalse($space->isNull(), "space不能为空"); SpaceClient::getInstance()->setProperties($space->id, array('note2'=>$content)); $this->buildBookingTask($space, '', $content); $url = $response->router->urlfor("weixindoctor/modifyclinictimesuccess",array()); $response->setRedirect($url); }/*}}}*/
public function createConf($request, $response) {/*{{{*/ $orderId = $request->orderid; $duration = $request->duration; $adminphone = $request->adminphone; $patientphone = $request->patientphone; $patientphone1 = $request->patientphone1; $patientphone2 = $request->patientphone2; $spacephone1 = $request->spacephone1; $spacephone2 = $request->spacephone2; $spacephone3 = $request->spacephone3; $adminUserId = $request->adminuserid; $adminUserName = $request->adminusername; if(empty($spacephone1) && empty($spacephone2) && empty($spacephone3)) { echo '会议室里没有医生'; return parent::DIRECT_OUTPUT; } $phones = array($adminphone, $patientphone, $patientphone1, $patientphone2, $spacephone1, $spacephone2, $spacephone3); DBC::requireNotEmptyString($adminUserId,'请先登录吧~'); $teleconfId = MeetingClient::getInstance()->createMeeting($orderId, $phones, $adminUserId, $adminUserName, $duration); $url = $response->router->urlfor('telconf/hold400telconference', $this->urlParams); $response->setRedirect($url); }/*}}}*/
public function readMedicineAnnotation($request, $response) {/*{{{*/ DBC::requireNotEmptyString($request->annotationid, 'annotationid不能为空'); AnnotationClient::getInstance()->setAnnotationUserRead($request->annotationid); $response->setRedirect($response->router->urlfor('myhealth/medicinecondition', array('userid'=>$this->user->id))); }/*}}}*/
public function addSpaceOwner($request, $response) {/*{{{*/ DBC::requireNotEmptyString($request->spaceId, 'spaceId不能为空'); $space = DAL::get()->find('Space', $request->spaceId); DBC::requireFalse($space->isNull(), '该医生不存在!'); $owner = $space->user->getTelOwner(); if ($owner instanceof TelOwner) { echo "http://hdfadmin.haodf.com/paymentfront/doctor/showadddoctorowner?ownerId=$owner->id&spaceId=$space->id"; exit; } die("创建失败!"); }/*}}}*/
public function showPresentListByCate($request, $response) { /*{{{*/ DBC::requireNotEmptyString($request->cateid, "分类ID不能为空"); }
public function updateEntity($entityType, $entityId, $args) { DBC::requireNotEmptyString($entityType, '实体名不可为空'); DBC::requireNotEmptyString($entityId, '实体Id不可为空'); DBC::requireNotEmpty($args, '要更新的参数不可为空'); self::checkEntityType($entityType); BeanFinder::get('dbexecuter')->mustUseMaster(); $entityObject = DAL::get()->find($entityType, $entityId); foreach ($args as $key => $value) { $entityObject->$key = $value; } return $entityObject->id; }
public function updatePost($request, $response) { $id = $request->id; $vars = $request->getUnSafeData('vars'); $vars['name'] = $request->name; DBC::requireNotEmptyString($id, '医院id不能为空'); DBC::requireNotEmptyString($vars['name'], '医院名字不能为空'); $hospital = HospitalClient::getInstance()->modify($id, $vars); if (!$hospital->isNull()) { self::clearCache($hospital); $response->setRedirect("/hospital/edit?msg=操作成功&id=" . $hospital->id); } }
public function getLogFromLogServer($request, $response) { DBC::requireNotEmptyString($request->date, "date不能为空"); DBC::requireNotEmptyString($request->confId, "confId不能为空"); DBC::requireNotEmptyString($request->spType, "confType不能为空"); DBC::requireNotEmptyString($request->logType, "logType不能为空"); $output = PhoneConference::getLogCmd($request->date, $request->spType, $request->logType, $request->confId); echo preg_replace("/(totaltime.*?)\s/i", "$1<br><br>", $output); return parent::DIRECT_OUTPUT; }
public function cancelOrder($request, $response) { /*{{{*/ $ref = DAL::get()->find('DoctorPatientRef', $request->refid); if ($ref->isNull()) { header('Location: ' . $this->space->getUrl()); return; } DBC::requireNotEmptyString($request->id, '您要查看的订单不存在'); BookingClient::getInstance()->userCancleOrder($this->user, $request->id); $response->setRedirect($ref->url); }