提交 80881cfa authored 作者: fengzy's avatar fengzy

oa付款单

上级 5370dd5a
...@@ -144,446 +144,446 @@ class flow_finfybxClassModel extends flowModel ...@@ -144,446 +144,446 @@ class flow_finfybxClassModel extends flowModel
} }
// //流程全部完成后调用 //流程全部完成后调用
// protected function flowcheckfinsh($zt){ protected function flowcheckfinsh($zt){
// $docnum=$this->rs['docnum'];
// $withhold_cost = m('c_withhold_fininform')->getall("docnum='$docnum' and status =1", 'id,cost_id,amount');
// foreach ($withhold_cost as $key => $vo) {
// // 扣除账户余额 c_fund_account account_balance
// $cbzxid= $vo['cost_id'];
// $model = 'c_fund_account';
// $sql = " cost_id ='$cbzxid' and status = 1 and is_default=1";
// $data = m($model)->getone($sql,'id,name,account_balance,freeze_amount');
// $zfarr = array(
// 'account_balance' =>$data['account_balance']-$vo['amount'],
// );
// $id=$data['id'];
// m('c_fund_account')->update($zfarr,"`id`='$id'");
// $freeze = array(
// 'freeze_amount' => $data['freeze_amount'] - $vo['amount'],
// );
// m('c_fund_account')->update($freeze, "`id`='$id'");
// // 成本中心 amount 变更
// $cbzx = substr($cbzxid,0,strrpos($cbzxid,"("));
// $cbzxsql = " code ='$cbzx' and status = 1";
// $cbzxdata = m('c_cbzx')->getone($cbzxsql,'id,amount');
// $cbarr = array(
// 'amount' =>$cbzxdata['amount']+$vo['amount'],
// );
// m('c_cbzx')->update($cbarr,"`code`='$cbzx'");
// //账户明细 c_account_detail
// $account_detail=array(
// 'account' => $data['name'],
// 'opt_type' => 2,
// 'amount' =>$vo['amount'],
// 'trans_numb' => $this->rs['docnum'],
// 'account_balance' => $data['account_balance']-$vo['amount'],
// 'create_time' =>date("Y-m-d H:i:s"),
// 'uid' =>$this->rs['uid'],
// );
// m('c_account_detail')->insert($account_detail);
// // 业务付款8业务预付款10费用报销11 oa_c_fund_detail
// $fund_detail=array(
// 'trans_numb' =>$this->rs['docnum'],
// 'account' => $data['name'],
// 'toaccount' =>$this->rs['applicant'],
// 'trans_amount' =>$vo['amount'],
// 'business_type' =>11,
// 'opt_type' =>2,
// 'account_balance'=>$data['account_balance']-$vo['amount'],
// 'create_time' =>date("Y-m-d H:i:s"),
// 'uid' =>$this->rs['uid'],
// );
// m('c_fund_detail')->insert($fund_detail);
// }
// }
//审核完成后调用 $docnum=$this->rs['docnum'];
protected function flowcheckafter($zt, $sm,$nowcourse){ $withhold_cost = m('c_withhold_fininform')->getall("docnum='$docnum' and status =1", 'id,cost_id,amount');
$flowid=$this->getflow();
$cloudUrl = "http://36.110.39.211/k3cloud/";
//登陆参数
$data = array(
'5d8acc5a26042d',//帐套Id
'Administrator',//用户名
'kJyGjIQ5DW0tpd@B',//密码
'2052'//语言标识359010087
);
//定义记录Cloud服务端返回的Session
$cookie_jar = tempnam('/tmp','CloudSession');
$post_content = self::create_postdata($data);
$result = self::invoke_login($cloudUrl,$post_content,$cookie_jar);
header("Content-type: text/html; charset=utf8");
$starttime = microtime(true);
$applicant=$this->rs['applicant'];//申请人
$FCREATORID=$this->db->getone('oa_personfile',"name='".$this->rs['applicant']."'");
$gonncode=$FCREATORID['gonncode']; //申请人编号
$applicationdpt=$this->rs['applicationdpt'];//申请部门
$applydt=$this->rs['optdt'];//申请日期
$amountOfThisPayment=$this->rs['amountOfThisPayment'];//金额
$contractNumber=$this->rs['contractNumber'];//合同编号
$contracta=(strpos($contractNumber, "("));
$contractb=(strrpos($contractNumber, ")"));
$b = mb_strpos($contractNumber,"(") + mb_strlen("(");
$e = mb_strpos($contractNumber, ")") - $b;
$contractNumber=mb_substr($contractNumber,$b,$e);
$contract = $this->db->getone('oa_c_contract', 'numb = "' . $contractNumber . '"');
if($contract['receive']==2){
$suppliername= $contract['partb_name'];//供应商名称
}else{
$suppliername= $contract['parta_name'];//供应商名称
}
$sql = 'bank_code = ' .$contract['bankcode'];
$data = $this->db->getone('oa_supplier_bank_info', $sql);
$paymentMethod=$this->rs['paymentMethod'];//付款方式
$cbxmid=$this->rs['cbzxid'];//成本中心
$cbxmid=substr($cbxmid,0,strpos($cbxmid, "("));
// $data_model='{
// "Creator": "",
// "NeedUpDateFields": [],
// "NeedReturnFields": [],
// "IsDeleteEntry": "true",
// "SubSystemId": "",
// "IsVerifyBaseDataField": "false",
// "IsEntryBatchFill": "true",
// "ValidateFlag": "true",
// "NumberSearch": "true",
// "InterationFlags": "",
// "IsAutoSubmitAndAudit": "false",
// "Model": {
// "FID": 0,
// "FBILLTYPEID": {
// "FNUMBER": "FKSQ008"
// },
// "FCREATORID": {
// "FNUMBER": ""
// },
// "FDATE": "2020-03-02 00:00:00",
// "FCONTACTUNITTYPE": "BD_Supplier",
// "FCONTACTUNIT": {
// "FNumber": "GSGYS-0005"
// },
// "FRECTUNITTYPE": "BD_Supplier",
// "FRECTUNIT": {
// "FNumber": "GSGYS-0005"
// },
// "FCURRENCYID": {
// "FNumber": "PRE001"
// },
// "FAPPLYORGID": {
// "FNumber": "1000"
// },
// "FPAYORGID": {
// "FNumber": "1000"
// },
// "FSETTLEORGID": {
// "FNumber": "1000"
// },
// "FPURCHASEORGID": {
// "FNumber": "1000"
// },
// "FDOCUMENTSTATUS": "Z",
// "FCANCELSTATUS": "A",
// "FMAINBOOKID": {
// "FNUMBER": "PRE001"
// },
// "FIsCredit": false,
// "FSETTLECUR": {
// "FNUMBER": "PRE001"
// },
// "FISCARRYRATE": false,
// "F_PAEZ_Cbzx": {
// "FNUMBER": "GS.BJ.B01.02"
// }
// }
// }';
$data_model= '{
"Creator": "",
"NeedUpDateFields": [],
"NeedReturnFields": [],
"IsDeleteEntry": "true",
"SubSystemId": "",
"IsVerifyBaseDataField": "false",
"IsEntryBatchFill": "true",
"ValidateFlag": "true",
"NumberSearch": "true",
"InterationFlags": "",
"IsAutoSubmitAndAudit": "false",
"Model": {
"FID": 0,
"FBillTypeID": {
"FNUMBER": "FKDLX08"
},
"FDATE": "2020-06-24 00:00:00",
"FCONTACTUNITTYPE": "BD_Supplier",
"FCONTACTUNIT": {
"FNumber": "GSGYS-0010"
},
"FRECTUNITTYPE": "BD_Supplier",
"FRECTUNIT": {
"FNumber": "GSGYS-0010"
},
"FDepartment": {
"FNumber": "06.06"
},
"FISINIT": false,
"FCURRENCYID": {
"FNumber": "PRE001"
},
"FEXCHANGERATE": 1.0,
"FSETTLERATE": 1.0,
"FSETTLEORGID": {
"FNumber": "1000"
},
"FDOCUMENTSTATUS": "Z",
"FCancelStatus": "A",
"FPAYORGID": {
"FNumber": "1000"
},
"FISSAMEORG": true,
"FIsCredit": false,
"FSETTLECUR": {
"FNUMBER": "PRE001"
},
"F_YeWuLine": {
"FNUMBER": "CWCLYWX-009"
},
"FIsWriteOff": false,
"FREALPAY": false,
"F_ZHname": "无",
"FORDate": "2017-04-01 00:00:00",
"FISCARRYRATE": false,
"FSETTLEMAINBOOKID": {
"FNUMBER": "PRE001"
},
"FPAYBILLENTRY": [
{
"F_XM_ID": {
"FNUMBER": " WLFX-3-TTTZ-19021"
},
"FCostType": {
"FNUMBER": "CBLX0001"
},
"FCostModel": {
"FNUMBER": "CBMS0001"
},
"F_KXType": {
"FNUMBER": "009"
},
"FSETTLETYPEID": {
"FNumber": "JSFS21_SYS"
},
"FPURPOSEID": {
"FNumber": "SFKYT015"
},
"FPAYTOTALAMOUNTFOR": 99999.0,
"FPAYAMOUNTFOR_E": 99999.0,
"FSETTLEPAYAMOUNTFOR": 99999.0,
"FREALPAYAMOUNTFOR_D": 99999.0,
"FRecType": "1",
"FPAYAMOUNT_E": 99999.0,
"FPOSTDATE": "2020-06-24 00:00:00",
"FPayType": "A",
"FRuZhangType": "1"
}
]
}
}';
// $arr['FPAYAPPLYENTRY'][0]['FENDDATE']=$this->rs['applydt'].' 00:00:00';
// $arr['FPAYAPPLYENTRY'][0]['FEXPECTPAYDATE']=$this->rs['applydt'].' 00:00:00';
// $arr['FPAYAPPLYENTRY'][0]['FAPPLYAMOUNTFOR']=intval($amountOfThisPayment);
// $arr['FPAYAPPLYENTRY'][0]['FEACHBANKACCOUNT']=$data['bank_code'];
// $arr['FPAYAPPLYENTRY'][0]['FEACHCCOUNTNAME']=$data['bank_holder'];
// $arr['FPAYAPPLYENTRY'][0]['FEACHBANKNAME']=$data['open_bank_name'];
// $model=json_decode($data_model,true);
// $model['Model']['F_PAEZ_Cbzx']['FNUMBER']=$cbxmid;
// $model['Model']['FCREATORID']['FNUMBER']=$gonncode;
// $model['Model']['FDATE']=$applydt;
// $model['Model']['FCONTACTUNIT']['FNumber']=$suppliername;
// $model['Model']['FRECTUNIT']['FNumber']=$suppliername;
// $model['Model']['FPAYAPPLYENTRY']=$arr['FPAYAPPLYENTRY'];
// $data_model=json_encode($model);
$data = array(
'AP_PAYBILL',//业务对象标识FormId
$data_model//具体Json字串
);
$post_content = self::create_postdata($data); foreach ($withhold_cost as $key => $vo) {
$result = self::invoke_add($cloudUrl,$post_content,$cookie_jar); // 扣除账户余额 c_fund_account account_balance
$array = json_decode($result,true);
echo "<pre>";
var_dump($array);
if($array['Result']['ResponseStatus']['IsSuccess']){
// $num=$array['Result']['Number'];
// $this->update("`fbillno`='$num'", $this->rs['id']);
var_dump($this->supplier_submit($cloudUrl,$cookie_jar,$array['Result']['Id'],$array['Result']['Number']));
var_dump($this->supplier_audit($cloudUrl,$cookie_jar,$array['Result']['Id'],$array['Result']['Number']));
} $cbzxid= $vo['cost_id'];
} $model = 'c_fund_account';
$sql = " cost_id ='$cbzxid' and status = 1 and is_default=1";
$data = m($model)->getone($sql,'id,name,account_balance,freeze_amount');
public function supplier_submit($cloudUrl,$cookie_jar,$id,$number){ $zfarr = array(
$start_time = microtime(true); 'account_balance' =>$data['account_balance']-$vo['amount'],
$data_model ="{
'CreateOrgId': 0,
'Numbers': [],
'Ids': $id,
'SelectedPostId': 0
}";
$data = array(
'CN_PAYAPPLY',//业务对象标识FormId
$data_model//具体Json字串
); );
$id=$data['id'];
m('c_fund_account')->update($zfarr,"`id`='$id'");
$post_content = self::create_postdata($data); $freeze = array(
'freeze_amount' => $data['freeze_amount'] - $vo['amount'],
$result = self::invoke_submit($cloudUrl,$post_content,$cookie_jar);
$array = json_decode($result,true);
return $array;
}
public function supplier_audit($cloudUrl,$cookie_jar,$id,$number){
$data_model ="{
'CreateOrgId': 0,
'Numbers': [],
'Ids': $id,
'InterationFlags': ''
}";
$data = array(
'CN_PAYAPPLY',//业务对象标识FormId
$data_model//具体Json字串
); );
$post_content = self::create_postdata($data); m('c_fund_account')->update($freeze, "`id`='$id'");
$result = self::invoke_audit($cloudUrl,$post_content,$cookie_jar);
$array = json_decode($result,true);
return $array;
}
//登陆
static function invoke_login($cloudUrl,$post_content,$cookie_jar)
{
$loginurl = $cloudUrl.'Kingdee.BOS.WebApi.ServicesStub.AuthService.ValidateUser.common.kdsvc';
return self::invoke_post($loginurl,$post_content,$cookie_jar,TRUE);
}
//查询
static function invoke_save($cloudUrl,$post_content,$cookie_jar)
{
$invokeurl = $cloudUrl.'Kingdee.BOS.WebApi.ServicesStub.DynamicFormService.View.common.kdsvc';
return self::invoke_post($invokeurl,$post_content,$cookie_jar,FALSE);
}
//添加
static function invoke_add($cloudUrl,$post_content,$cookie_jar)
{
$invokeurl = $cloudUrl.'Kingdee.BOS.WebApi.ServicesStub.DynamicFormService.Save.common.kdsvc';
return self::invoke_post($invokeurl,$post_content,$cookie_jar,FALSE);
}
//提交
static function invoke_submit($cloudUrl,$post_content,$cookie_jar)
{
$invokeurl = $cloudUrl.'Kingdee.BOS.WebApi.ServicesStub.DynamicFormService.Submit.common.kdsvc';
return self::invoke_post($invokeurl,$post_content,$cookie_jar,FALSE);
}
//审核 // 成本中心 amount 变更
static function invoke_audit($cloudUrl,$post_content,$cookie_jar) $cbzx = substr($cbzxid,0,strrpos($cbzxid,"("));
{ $cbzxsql = " code ='$cbzx' and status = 1";
$invokeurl = $cloudUrl.'Kingdee.BOS.WebApi.ServicesStub.DynamicFormService.Audit.common.kdsvc';
return self::invoke_post($invokeurl,$post_content,$cookie_jar,FALSE);
}
static function invoke_post($url,$post_content,$cookie_jar,$isLogin) $cbzxdata = m('c_cbzx')->getone($cbzxsql,'id,amount');
{ $cbarr = array(
$ch = curl_init($url); 'amount' =>$cbzxdata['amount']+$vo['amount'],
);
$this_header = array( m('c_cbzx')->update($cbarr,"`code`='$cbzx'");
'Content-Type: application/json', //账户明细 c_account_detail
'Content-Length: '.strlen($post_content) $account_detail=array(
'account' => $data['name'],
'opt_type' => 2,
'amount' =>$vo['amount'],
'trans_numb' => $this->rs['docnum'],
'account_balance' => $data['account_balance']-$vo['amount'],
'create_time' =>date("Y-m-d H:i:s"),
'uid' =>$this->rs['uid'],
); );
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST'); m('c_account_detail')->insert($account_detail);
curl_setopt($ch, CURLOPT_HTTPHEADER, $this_header);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post_content);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
if($isLogin){
curl_setopt($ch, CURLOPT_COOKIEJAR, $cookie_jar);
}
else{
curl_setopt($ch, CURLOPT_COOKIEFILE, $cookie_jar);
}
curl_setopt($ch, CURLOPT_TIMEOUT, 5);
$result = curl_exec($ch); // 业务付款8业务预付款10费用报销11 oa_c_fund_detail
curl_close($ch);
return $result;
}
static function getbxlx($name)
{
if($name=='现金'){
return 'JSFS01_SYS';
}else{
return 'JSFS04_SYS';
}
}
//构造Web API请求格式 $fund_detail=array(
static function create_postdata($args) { 'trans_numb' =>$this->rs['docnum'],
$postdata = array( 'account' => $data['name'],
'format'=>1, 'toaccount' =>$this->rs['applicant'],
'useragent'=>'ApiClient', 'trans_amount' =>$vo['amount'],
'rid'=>self::create_guid(), 'business_type' =>11,
'parameters'=>$args, 'opt_type' =>2,
'timestamp'=>date('Y-m-d'), 'account_balance'=>$data['account_balance']-$vo['amount'],
'v'=>'1.0' 'create_time' =>date("Y-m-d H:i:s"),
'uid' =>$this->rs['uid'],
); );
return json_encode($postdata); m('c_fund_detail')->insert($fund_detail);
} }
//生成guid
static function create_guid() {
$charid = strtoupper(md5(uniqid(mt_rand(), true)));
$hyphen = chr(45);// "-"
$uuid = chr(123)// "{"
.substr($charid, 0, 8).$hyphen
.substr($charid, 8, 4).$hyphen
.substr($charid,12, 4).$hyphen
.substr($charid,16, 4).$hyphen
.substr($charid,20,12)
.chr(125);// "}"
return $uuid;
} }
//审核完成后调用
// protected function flowcheckafter($zt, $sm,$nowcourse){
// $flowid=$this->getflow();
// $cloudUrl = "http://36.110.39.211/k3cloud/";
// //登陆参数
// $data = array(
// '5d8acc5a26042d',//帐套Id
// 'Administrator',//用户名
// 'kJyGjIQ5DW0tpd@B',//密码
// '2052'//语言标识359010087
// );
// //定义记录Cloud服务端返回的Session
// $cookie_jar = tempnam('/tmp','CloudSession');
// $post_content = self::create_postdata($data);
// $result = self::invoke_login($cloudUrl,$post_content,$cookie_jar);
// header("Content-type: text/html; charset=utf8");
// $starttime = microtime(true);
// $applicant=$this->rs['applicant'];//申请人
// $FCREATORID=$this->db->getone('oa_personfile',"name='".$this->rs['applicant']."'");
// $gonncode=$FCREATORID['gonncode']; //申请人编号
// $applicationdpt=$this->rs['applicationdpt'];//申请部门
// $applydt=$this->rs['optdt'];//申请日期
// $amountOfThisPayment=$this->rs['amountOfThisPayment'];//金额
// $contractNumber=$this->rs['contractNumber'];//合同编号
// $contracta=(strpos($contractNumber, "("));
// $contractb=(strrpos($contractNumber, ")"));
// $b = mb_strpos($contractNumber,"(") + mb_strlen("(");
// $e = mb_strpos($contractNumber, ")") - $b;
// $contractNumber=mb_substr($contractNumber,$b,$e);
// $contract = $this->db->getone('oa_c_contract', 'numb = "' . $contractNumber . '"');
// if($contract['receive']==2){
// $suppliername= $contract['partb_name'];//供应商名称
// }else{
// $suppliername= $contract['parta_name'];//供应商名称
// }
// $sql = 'bank_code = ' .$contract['bankcode'];
// $data = $this->db->getone('oa_supplier_bank_info', $sql);
// $paymentMethod=$this->rs['paymentMethod'];//付款方式
// $cbxmid=$this->rs['cbzxid'];//成本中心
// $cbxmid=substr($cbxmid,0,strpos($cbxmid, "("));
// // $data_model='{
// // "Creator": "",
// // "NeedUpDateFields": [],
// // "NeedReturnFields": [],
// // "IsDeleteEntry": "true",
// // "SubSystemId": "",
// // "IsVerifyBaseDataField": "false",
// // "IsEntryBatchFill": "true",
// // "ValidateFlag": "true",
// // "NumberSearch": "true",
// // "InterationFlags": "",
// // "IsAutoSubmitAndAudit": "false",
// // "Model": {
// // "FID": 0,
// // "FBILLTYPEID": {
// // "FNUMBER": "FKSQ008"
// // },
// // "FCREATORID": {
// // "FNUMBER": ""
// // },
// // "FDATE": "2020-03-02 00:00:00",
// // "FCONTACTUNITTYPE": "BD_Supplier",
// // "FCONTACTUNIT": {
// // "FNumber": "GSGYS-0005"
// // },
// // "FRECTUNITTYPE": "BD_Supplier",
// // "FRECTUNIT": {
// // "FNumber": "GSGYS-0005"
// // },
// // "FCURRENCYID": {
// // "FNumber": "PRE001"
// // },
// // "FAPPLYORGID": {
// // "FNumber": "1000"
// // },
// // "FPAYORGID": {
// // "FNumber": "1000"
// // },
// // "FSETTLEORGID": {
// // "FNumber": "1000"
// // },
// // "FPURCHASEORGID": {
// // "FNumber": "1000"
// // },
// // "FDOCUMENTSTATUS": "Z",
// // "FCANCELSTATUS": "A",
// // "FMAINBOOKID": {
// // "FNUMBER": "PRE001"
// // },
// // "FIsCredit": false,
// // "FSETTLECUR": {
// // "FNUMBER": "PRE001"
// // },
// // "FISCARRYRATE": false,
// // "F_PAEZ_Cbzx": {
// // "FNUMBER": "GS.BJ.B01.02"
// // }
// // }
// // }';
// $data_model= '{
// "Creator": "",
// "NeedUpDateFields": [],
// "NeedReturnFields": [],
// "IsDeleteEntry": "true",
// "SubSystemId": "",
// "IsVerifyBaseDataField": "false",
// "IsEntryBatchFill": "true",
// "ValidateFlag": "true",
// "NumberSearch": "true",
// "InterationFlags": "",
// "IsAutoSubmitAndAudit": "false",
// "Model": {
// "FID": 0,
// "FBillTypeID": {
// "FNUMBER": "FKDLX08"
// },
// "FDATE": "2020-06-24 00:00:00",
// "FCONTACTUNITTYPE": "BD_Supplier",
// "FCONTACTUNIT": {
// "FNumber": "GSGYS-0010"
// },
// "FRECTUNITTYPE": "BD_Supplier",
// "FRECTUNIT": {
// "FNumber": "GSGYS-0010"
// },
// "FDepartment": {
// "FNumber": "06.06"
// },
// "FISINIT": false,
// "FCURRENCYID": {
// "FNumber": "PRE001"
// },
// "FEXCHANGERATE": 1.0,
// "FSETTLERATE": 1.0,
// "FSETTLEORGID": {
// "FNumber": "1000"
// },
// "FDOCUMENTSTATUS": "Z",
// "FCancelStatus": "A",
// "FPAYORGID": {
// "FNumber": "1000"
// },
// "FISSAMEORG": true,
// "FIsCredit": false,
// "FSETTLECUR": {
// "FNUMBER": "PRE001"
// },
// "F_YeWuLine": {
// "FNUMBER": "CWCLYWX-009"
// },
// "FIsWriteOff": false,
// "FREALPAY": false,
// "F_ZHname": "无",
// "FORDate": "2017-04-01 00:00:00",
// "FISCARRYRATE": false,
// "FSETTLEMAINBOOKID": {
// "FNUMBER": "PRE001"
// },
// "FPAYBILLENTRY": [
// {
// "F_XM_ID": {
// "FNUMBER": " WLFX-3-TTTZ-19021"
// },
// "FCostType": {
// "FNUMBER": "CBLX0001"
// },
// "FCostModel": {
// "FNUMBER": "CBMS0001"
// },
// "F_KXType": {
// "FNUMBER": "009"
// },
// "FSETTLETYPEID": {
// "FNumber": "JSFS21_SYS"
// },
// "FPURPOSEID": {
// "FNumber": "SFKYT015"
// },
// "FPAYTOTALAMOUNTFOR": 99999.0,
// "FPAYAMOUNTFOR_E": 99999.0,
// "FSETTLEPAYAMOUNTFOR": 99999.0,
// "FREALPAYAMOUNTFOR_D": 99999.0,
// "FRecType": "1",
// "FPAYAMOUNT_E": 99999.0,
// "FPOSTDATE": "2020-06-24 00:00:00",
// "FPayType": "A",
// "FRuZhangType": "1"
// }
// ]
// }
// }';
// // $arr['FPAYAPPLYENTRY'][0]['FENDDATE']=$this->rs['applydt'].' 00:00:00';
// // $arr['FPAYAPPLYENTRY'][0]['FEXPECTPAYDATE']=$this->rs['applydt'].' 00:00:00';
// // $arr['FPAYAPPLYENTRY'][0]['FAPPLYAMOUNTFOR']=intval($amountOfThisPayment);
// // $arr['FPAYAPPLYENTRY'][0]['FEACHBANKACCOUNT']=$data['bank_code'];
// // $arr['FPAYAPPLYENTRY'][0]['FEACHCCOUNTNAME']=$data['bank_holder'];
// // $arr['FPAYAPPLYENTRY'][0]['FEACHBANKNAME']=$data['open_bank_name'];
// // $model=json_decode($data_model,true);
// // $model['Model']['F_PAEZ_Cbzx']['FNUMBER']=$cbxmid;
// // $model['Model']['FCREATORID']['FNUMBER']=$gonncode;
// // $model['Model']['FDATE']=$applydt;
// // $model['Model']['FCONTACTUNIT']['FNumber']=$suppliername;
// // $model['Model']['FRECTUNIT']['FNumber']=$suppliername;
// // $model['Model']['FPAYAPPLYENTRY']=$arr['FPAYAPPLYENTRY'];
// // $data_model=json_encode($model);
// $data = array(
// 'AP_PAYBILL',//业务对象标识FormId
// $data_model//具体Json字串
// );
// $post_content = self::create_postdata($data);
// $result = self::invoke_add($cloudUrl,$post_content,$cookie_jar);
// $array = json_decode($result,true);
// echo "<pre>";
// var_dump($array);
// if($array['Result']['ResponseStatus']['IsSuccess']){
// // $num=$array['Result']['Number'];
// // $this->update("`fbillno`='$num'", $this->rs['id']);
// var_dump($this->supplier_submit($cloudUrl,$cookie_jar,$array['Result']['Id'],$array['Result']['Number']));
// var_dump($this->supplier_audit($cloudUrl,$cookie_jar,$array['Result']['Id'],$array['Result']['Number']));
// }
// }
// public function supplier_submit($cloudUrl,$cookie_jar,$id,$number){
// $start_time = microtime(true);
// $data_model ="{
// 'CreateOrgId': 0,
// 'Numbers': [],
// 'Ids': $id,
// 'SelectedPostId': 0
// }";
// $data = array(
// 'CN_PAYAPPLY',//业务对象标识FormId
// $data_model//具体Json字串
// );
// $post_content = self::create_postdata($data);
// $result = self::invoke_submit($cloudUrl,$post_content,$cookie_jar);
// $array = json_decode($result,true);
// return $array;
// }
// public function supplier_audit($cloudUrl,$cookie_jar,$id,$number){
// $data_model ="{
// 'CreateOrgId': 0,
// 'Numbers': [],
// 'Ids': $id,
// 'InterationFlags': ''
// }";
// $data = array(
// 'CN_PAYAPPLY',//业务对象标识FormId
// $data_model//具体Json字串
// );
// $post_content = self::create_postdata($data);
// $result = self::invoke_audit($cloudUrl,$post_content,$cookie_jar);
// $array = json_decode($result,true);
// return $array;
// }
// //登陆
// static function invoke_login($cloudUrl,$post_content,$cookie_jar)
// {
// $loginurl = $cloudUrl.'Kingdee.BOS.WebApi.ServicesStub.AuthService.ValidateUser.common.kdsvc';
// return self::invoke_post($loginurl,$post_content,$cookie_jar,TRUE);
// }
// //查询
// static function invoke_save($cloudUrl,$post_content,$cookie_jar)
// {
// $invokeurl = $cloudUrl.'Kingdee.BOS.WebApi.ServicesStub.DynamicFormService.View.common.kdsvc';
// return self::invoke_post($invokeurl,$post_content,$cookie_jar,FALSE);
// }
// //添加
// static function invoke_add($cloudUrl,$post_content,$cookie_jar)
// {
// $invokeurl = $cloudUrl.'Kingdee.BOS.WebApi.ServicesStub.DynamicFormService.Save.common.kdsvc';
// return self::invoke_post($invokeurl,$post_content,$cookie_jar,FALSE);
// }
// //提交
// static function invoke_submit($cloudUrl,$post_content,$cookie_jar)
// {
// $invokeurl = $cloudUrl.'Kingdee.BOS.WebApi.ServicesStub.DynamicFormService.Submit.common.kdsvc';
// return self::invoke_post($invokeurl,$post_content,$cookie_jar,FALSE);
// }
// //审核
// static function invoke_audit($cloudUrl,$post_content,$cookie_jar)
// {
// $invokeurl = $cloudUrl.'Kingdee.BOS.WebApi.ServicesStub.DynamicFormService.Audit.common.kdsvc';
// return self::invoke_post($invokeurl,$post_content,$cookie_jar,FALSE);
// }
// static function invoke_post($url,$post_content,$cookie_jar,$isLogin)
// {
// $ch = curl_init($url);
// $this_header = array(
// 'Content-Type: application/json',
// 'Content-Length: '.strlen($post_content)
// );
// curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
// curl_setopt($ch, CURLOPT_HTTPHEADER, $this_header);
// curl_setopt($ch, CURLOPT_POSTFIELDS, $post_content);
// curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
// if($isLogin){
// curl_setopt($ch, CURLOPT_COOKIEJAR, $cookie_jar);
// }
// else{
// curl_setopt($ch, CURLOPT_COOKIEFILE, $cookie_jar);
// }
// curl_setopt($ch, CURLOPT_TIMEOUT, 5);
// $result = curl_exec($ch);
// curl_close($ch);
// return $result;
// }
// static function getbxlx($name)
// {
// if($name=='现金'){
// return 'JSFS01_SYS';
// }else{
// return 'JSFS04_SYS';
// }
// }
// //构造Web API请求格式
// static function create_postdata($args) {
// $postdata = array(
// 'format'=>1,
// 'useragent'=>'ApiClient',
// 'rid'=>self::create_guid(),
// 'parameters'=>$args,
// 'timestamp'=>date('Y-m-d'),
// 'v'=>'1.0'
// );
// return json_encode($postdata);
// }
// //生成guid
// static function create_guid() {
// $charid = strtoupper(md5(uniqid(mt_rand(), true)));
// $hyphen = chr(45);// "-"
// $uuid = chr(123)// "{"
// .substr($charid, 0, 8).$hyphen
// .substr($charid, 8, 4).$hyphen
// .substr($charid,12, 4).$hyphen
// .substr($charid,16, 4).$hyphen
// .substr($charid,20,12)
// .chr(125);// "}"
// return $uuid;
// }
} }
\ No newline at end of file
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论