Esempio n. 1
0
 public function listAction()
 {
     $da = $this->get("we_data_access");
     $da_im = $this->get('we_data_access_im');
     $request = $this->getRequest();
     //访问权限校验
     $api = new \Justsy\OpenAPIBundle\Controller\ApiController();
     $api->setContainer($this->container);
     $isWeFaFaDomain = $api->checkWWWDomain();
     if (!$isWeFaFaDomain) {
         $token = $api->checkAccessToken($request, $da);
         if (!$token) {
             $re = array("returncode" => "9999");
             $re["code"] = "err0105";
             $re["msg"] = "参数Appid或Openid或Access_token未指定或无效.";
             return $this->responseJson($request, $re);
         }
     }
     $openid = $request->get("openid");
     $staffinfo = new \Justsy\BaseBundle\Management\Staff($da, $da_im, $openid, $this->get("logger"), $this->container);
     $staffdata = $staffinfo->getInfo();
     if (empty($staffdata)) {
         $result = Utils::WrapResultError("无效操作帐号");
         return $this->responseJson($request, $result);
     }
     $verCrl = new \Justsy\AdminAppBundle\Controller\VersionController();
     $verCrl->setContainer($this->container);
     return $this->responseJson($request, $verCrl->SearchVersionAction());
 }
Esempio n. 2
0
 public function accessCheck()
 {
     $da = $this->get("we_data_access");
     $da_im = $this->get('we_data_access_im');
     $request = $this->getRequest();
     //访问权限校验
     $api = new ApiController();
     $api->setContainer($this->container);
     $isWeFaFaDomain = $api->checkWWWDomain();
     if (!$isWeFaFaDomain) {
         $token = $api->checkAccessToken($request, $da);
         if (!$token) {
             $re = array("returncode" => "9999");
             $re["code"] = "err0105";
             $re["msg"] = "参数Appid或Openid或Access_token未指定或无效.";
             return $re;
         }
     }
     $openid = $request->get("openid");
     $staffinfo = new Staff($da, $da_im, $openid, $this->get("logger"), $this->container);
     $staffdata = $staffinfo->getInfo();
     if (empty($staffdata)) {
         return Utils::WrapResultError("无效操作帐号");
     }
     return Utils::WrapResultOk($staffinfo);
 }
Esempio n. 3
0
 public function removeMonitorAction()
 {
     $da = $this->get("we_data_access");
     $da_im = $this->get('we_data_access_im');
     $request = $this->getRequest();
     //访问权限校验
     $api = new ApiController();
     $api->setContainer($this->container);
     $isWeFaFaDomain = $api->checkWWWDomain();
     if (!$isWeFaFaDomain) {
         $token = $api->checkAccessToken($request, $da);
         if (!$token) {
             $re = array("returncode" => "9999");
             $re["code"] = "err0105";
             $re["msg"] = "参数Appid或Openid或Access_token未指定或无效.";
             return $this->responseJson($request, $re);
         }
     }
     $openid = $request->get("openid");
     $staffinfo = new Staff($da, $da_im, $openid, $this->get("logger"), $this->container);
     $staffdata = $staffinfo->getInfo();
     if (empty($staffdata)) {
         $result = Utils::WrapResultError("无效操作帐号");
         return $this->responseJson($request, $result);
     }
     $to = $request->get("to");
     if (empty($to)) {
         $result = Utils::WrapResultError("无效的帐号");
         return $this->responseJson($request, $result);
     }
     $to = $staffinfo->getStaffInfo($to);
     if (empty($to)) {
         $result = Utils::WrapResultError("无效的帐号");
         return $this->responseJson($request, $result);
     }
     try {
         $sql = 'delete from  t_module_location_monitor where staff=?';
         $da->ExecSQL($sql, array((string) $to['jid']));
         $sql = 'delete from  t_module_location where staff=?';
         $da->ExecSQL($sql, array((string) $to['login_account']));
     } catch (\Exception $e) {
     }
     $senddata = array('opt' => 'stop');
     $msg = Utils::WrapMessage('sendlocation', $senddata, array());
     //$msgxml = Utils::WrapMessageXml($this->module["jid"],$msg,'sendlocation-id');
     $api->sendMsg("", $to['jid'], 'sendlocation', json_encode($msg));
     return $this->responseJson($request, Utils::WrapResultOk(""));
 }
Esempio n. 4
0
 public function push_receiverlistAction()
 {
     $da = $this->get("we_data_access");
     $da_im = $this->get('we_data_access_im');
     $request = $this->getRequest();
     //访问权限校验
     $api = new \Justsy\OpenAPIBundle\Controller\ApiController();
     $api->setContainer($this->container);
     $isWeFaFaDomain = $api->checkWWWDomain();
     if (!$isWeFaFaDomain) {
         $token = $api->checkAccessToken($request, $da);
         if (!$token) {
             $re = array("returncode" => "9999");
             $re["code"] = "err0105";
             $re["msg"] = "参数Appid或Openid或Access_token未指定或无效.";
             return $this->responseJson($request, $re);
         }
     }
     $openid = $request->get("openid");
     $staffinfo = new \Justsy\BaseBundle\Management\Staff($da, $da_im, $openid, $this->get("logger"), $this->container);
     $staffdata = $staffinfo->getInfo();
     if (empty($staffdata)) {
         $result = Utils::WrapResultError("无效操作帐号");
         return $this->responseJson($request, $result);
     }
     $appid = $request->get('appid');
     $appmgr = new \Justsy\BaseBundle\Management\App($this->container);
     $appdata = $appmgr->getappinfo(array('appid' => $appid));
     if (empty($appdata)) {
         $result = Utils::WrapResultError("无效应用标识");
         return $this->responseJson($request, $result);
     }
     $data = $request->get("data");
     //部门名称
     if (empty($data)) {
         $result = Utils::WrapResultError("无效的数据");
         return $this->responseJson($request, $result);
     }
     $data = json_decode($data, true);
     $noticeMgr = new \Justsy\BaseBundle\Management\PromptlyNotice($this->container, $staffdata, $appdata);
     $result = $noticeMgr->getReceiverList($data);
     return $this->responseJson($request, $result);
 }
Esempio n. 5
0
 public function checkBaoXiao_tmpAction()
 {
     $data = array("s" => 1);
     $da = $this->get("we_data_access_test");
     $request = $this->get("request");
     //$bx_data=$request->get("data");
     try {
         $sql = "select apply_jid from baoxiao a where a.id=? ";
         $ds = $da->GetData("t", $sql, array((string) $request->get("orderid")));
         //$obj_data = json_decode($bx_data);
         $sql = "insert into baoxiao_check(orderid,check_date,check_memo,check_person,check_result,check_jid)values(?,now(),?,?,?,?)";
         $para = array((string) $request->get("orderid"), (string) $request->get("check_memo"), (string) $request->get("check_person"), (string) $request->get("check_result"), (string) $request->get("check_jid"));
         $da->ExecSQL($sql, $para);
         //推送消息
         $api = new ApiController();
         $api->setContainer($this->container);
         //$token = $this->getToken("e148ef39fa1235ea4296bfebb94e813f","wJsNWJ4n");
         $msgContent = array();
         $title = $request->get("apply_person") . "-报销单审批";
         $content = "你的报销单已处理,审批意见:" . $request->get("check_memo");
         $items = array();
         array_push($items, array('title' => $title, 'content' => $content));
         $msgContent = array('textmsg' => array('item' => $items));
         $msgContent = json_encode($msgContent);
         $api->sendMsg2("3b2c1752fdf2f121468e641c1d2c400b", $ds["t"]["rows"][0]["apply_jid"], $msgContent, "TEXT");
     } catch (\Exception $e) {
         $data = array("s" => 0, "msg" => $e->getMessage());
     }
     return $this->responseJson($data);
 }