|
@@ -294,20 +294,20 @@ class OtherService extends BaseService{
|
|
|
$sqlString = "SELECT COUNT(1) as rows FROM hz_customercard WHERE hospitalId='{I_hospitalId}' AND customerFamilyId ='{I_customerFamilyId}'";
|
|
|
$sqlString= $this->getReplace("I_hospitalId,I_customerFamilyId",$sqlString,$sqlData,$nodeType,$boolCheckUser);
|
|
|
$rows = call_user_func(array($_ENV["dbDao"],"select"),$sqlString,"entity");
|
|
|
- if(intval($rows['rows'])>=1)
|
|
|
+ if(intval($rows['rows'])>=100)
|
|
|
{
|
|
|
//一天一个医院只能挂号两条
|
|
|
$sqlString = "SELECT COUNT(1) as rows FROM hz_appointsorder t WHERE t.hospitalId='{I_hospitalId}' and t.regDate='{I_regDate}' AND t.customerFamilyId='{I_customerFamilyId}' AND t.resultCode='0' AND t.cancelFlag='1' ";
|
|
|
$sqlString= $this->getReplace("I_hospitalId,I_regDate,I_customerFamilyId",$sqlString,$sqlData,$nodeType,$boolCheckUser);
|
|
|
$rows = call_user_func(array($_ENV["dbDao"],"select"),$sqlString,"entity");
|
|
|
|
|
|
- if(intval($rows['rows'])<2){
|
|
|
+ if(intval($rows['rows'])<200){
|
|
|
|
|
|
//一天一个医院只能挂号两条
|
|
|
$sqlString = "SELECT COUNT(1) as rows FROM hz_appointsorder t WHERE t.hospitalId='{I_hospitalId}' and t.deptId='{I_deptId}' and t.doctorId='{I_doctorId}' and t.regDate='{I_regDate}' AND t.customerFamilyId='{I_customerFamilyId}' AND t.resultCode='0' AND t.cancelFlag='1' ";
|
|
|
$sqlString= $this->getReplace("I_hospitalId,I_deptId,I_doctorId,I_regDate,I_customerFamilyId",$sqlString,$sqlData,$nodeType,$boolCheckUser);
|
|
|
$rows = call_user_func(array($_ENV["dbDao"],"select"),$sqlString,"entity");
|
|
|
- if(intval($rows['rows'])<1){
|
|
|
+ if(intval($rows['rows'])<100){
|
|
|
|
|
|
foreach ($funObj as $key => $json) {
|
|
|
$json = json_decode($json);
|
|
@@ -377,7 +377,7 @@ class OtherService extends BaseService{
|
|
|
$sqlString = "SELECT COUNT(1) as rows FROM hz_appointsorder WHERE hospitalId='{I_hospitalId}' AND customerFamilyId ='{I_customerFamilyId}' and resultCode='0'";
|
|
|
$sqlString= $this->getReplace("I_hospitalId,I_customerFamilyId",$sqlString,$sqlData,$nodeType,$boolCheckUser);
|
|
|
$rows = call_user_func(array($_ENV["dbDao"],"select"),$sqlString,"entity");
|
|
|
- if(intval($rows['rows'])<1){
|
|
|
+ if(intval($rows['rows'])<100){
|
|
|
//HIS验证用户名
|
|
|
$sqlString = "SELECT trueName,idNo,address,sex,phone,birthDay,nation FROM hz_customerfamily WHERE id ='{I_customerFamilyId}'";
|
|
|
$sqlString= $this->getReplace("I_customerFamilyId",$sqlString,$sqlData,$nodeType,$boolCheckUser);
|
|
@@ -716,12 +716,12 @@ class OtherService extends BaseService{
|
|
|
|
|
|
|
|
|
|
|
|
- /**
|
|
|
+ /**
|
|
|
* 用于在Api引擎中解析数组列表方式
|
|
|
* @param string $funName 方式名
|
|
|
* @param array $funOjb 数组列表
|
|
|
* @return json
|
|
|
- */
|
|
|
+ */
|
|
|
public function getGuideList($funName,$funObj) {
|
|
|
//不用检测的方法列表
|
|
|
$boolCheckFun = $this->checkFun($funName);
|
|
@@ -791,18 +791,18 @@ class OtherService extends BaseService{
|
|
|
$infoString = strval($returnXml ->resultDesc);
|
|
|
}else {
|
|
|
$sqlData = "";
|
|
|
- $returnXml = $returnXml->invoiceList->invoice;
|
|
|
+ $returnXml = $returnXml->invoiceList->invoice;
|
|
|
foreach($returnXml as $key=>$v){
|
|
|
$sqlData[] = array(
|
|
|
'invoice' => $v
|
|
|
- );
|
|
|
+ );
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
if($dataType=="add"){
|
|
|
$tempData[] =$sqlData;
|
|
|
$sqlData = $tempData =array_merge($tempData, $sqlData);
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
|
|
|
}
|
|
|
if(!$sqlData){break;}
|
|
@@ -814,6 +814,70 @@ class OtherService extends BaseService{
|
|
|
//封装后,返回前台json包
|
|
|
$this->codeJson($jsonData);
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 用于在Api引擎中解析数组列表方式
|
|
|
+ * @param string $funName 方式名
|
|
|
+ * @param array $funOjb 数组列表
|
|
|
+ * @return json
|
|
|
+ */
|
|
|
+ public function sendSmsInfo($funName,$funObj) {
|
|
|
+ //不用检测的方法列表
|
|
|
+ $boolCheckFun = $this->checkFun($funName);
|
|
|
+ if($boolCheckFun){
|
|
|
+ //统一验证方式
|
|
|
+ $boolCheckUser = $this->checkUser();
|
|
|
+ }else{
|
|
|
+ //检测方法过滤通过后进入下一步
|
|
|
+ $boolCheckFun = true;
|
|
|
+ $boolCheckUser = true;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ //用于生成返回前台验证时间戳和用户token
|
|
|
+ $jsonData = $this->getDataToken($boolCheckUser);
|
|
|
+
|
|
|
+ //进入流程处理
|
|
|
+ if($boolCheckFun && $boolCheckUser){
|
|
|
+
|
|
|
+ $smsType = $this->getParameter("I_smsType");
|
|
|
+ $orderId = $this->getParameter("I_orderId");
|
|
|
+
|
|
|
+ if($smsType=="appointSuc"){
|
|
|
+ //检测本地有没有卡
|
|
|
+ $sqlString = " SELECT c.trueName,c.phone,a.patientId,a.regDate,a.startTime,a.treatfee/100 AS treatfee,d.doctorName,d.title,t.deptName FROM hz_appointsorder a,hz_doctorinfo d,hz_deptinfo t,hz_customerfamily c WHERE a.resultCode=0 and a.payFlag=1 and a.orderId='".$orderId."' AND a.deptId=d.deptId AND a.doctorId=d.doctorId AND d.deptId=t.deptId AND a.customerFamilyId=c.id";
|
|
|
+ $sqlData = call_user_func(array($_ENV["dbDao"],"select"),$sqlString,"entity");
|
|
|
+ if($sqlData)
|
|
|
+ {
|
|
|
+ $smsStr ="【南方医院】".$sqlData['trueName']."(ID号".$sqlData['patientId'].")您已成功预约".$sqlData['regDate']."%20".$sqlData['startTime'].$sqlData['deptName'].$sqlData['doctorName'].$sqlData['title']."号,请携带身份证和诊疗卡(复诊)提前半小时至门诊各挂号窗口或自助机取号。如过时将作延迟就诊处理。如当次未就诊记爽约一次,爽约三次将对预约进行限制。如您无法就诊请提前一天取消预约。祝您身体健康!";
|
|
|
+ }
|
|
|
+ }else if($smsType=="appointPay"){
|
|
|
+ //检测本地有没有卡
|
|
|
+ $sqlString = " SELECT c.trueName,c.phone,a.patientId,a.regDate,a.startTime,a.treatfee/100 AS treatfee,d.doctorName,d.title,t.deptName FROM hz_appointsorder a,hz_doctorinfo d,hz_deptinfo t,hz_customerfamily c WHERE a.resultCode=0 and a.payFlag=0 AND a.orderId='".$orderId."' AND a.deptId=d.deptId AND a.doctorId=d.doctorId AND d.deptId=t.deptId AND a.customerFamilyId=c.id";
|
|
|
+ $sqlData = call_user_func(array($_ENV["dbDao"],"select"),$sqlString,"entity");
|
|
|
+ if($sqlData)
|
|
|
+ {
|
|
|
+ $smsStr ="【南方医院】".$sqlData['trueName']."(ID号".$sqlData['patientId'].")您已成功预约".$sqlData['regDate']."%20".$sqlData['startTime'].$sqlData['deptName'].$sqlData['doctorName'].$sqlData['title']."号,本次挂号扣费".$sqlData['treatfee']."元,请携带就诊卡提前半小时到门诊楼五楼分诊台报到。如过时将作延迟就诊处理。如当次未就诊记爽约一次,爽约三次将对预约进行限制。如无法就诊请提前一天取消预约。祝您身体健康!";
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if($smsStr!=null){
|
|
|
+ //发送短信
|
|
|
+ $smsApi =C('SmsApi');
|
|
|
+ $url =$smsApi."&mobile=".$sqlData['phone']."&content=".$smsStr."&ext=1";
|
|
|
+ $result = call_user_func(array($_ENV["commonClass"],"send_get"),$url);
|
|
|
+ $sqlData = array("result"=>$result);
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ //最终生成数据
|
|
|
+ $jsonData= $this->getJson($jsonData,$sqlData,$infoString,0,$resultType);
|
|
|
+ //封装后,返回前台json包
|
|
|
+ $this->codeJson($jsonData);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
|
|
|
}
|
|
|
|