提交 af1e9287 authored 作者: fengzy's avatar fengzy

'调整emfk'

上级 81b68f8f
...@@ -177,177 +177,178 @@ class openemfkClassAction extends openapiAction ...@@ -177,177 +177,178 @@ class openemfkClassAction extends openapiAction
public function listAction(){ public function listAction(){
$sql = 'select id,fbillno,status from [Q]c_fininfom_oayfk where status=0 and fbillno is NOT null'; var_dump(213213);
$dataarr = $this->db->getall($sql); // $sql = 'select id,fbillno,status from [Q]c_fininfom_oayfk where status=0 and fbillno is NOT null';
foreach ($dataarr as $key => $value) { // $dataarr = $this->db->getall($sql);
// foreach ($dataarr as $key => $value) {
$cloudUrl = "http://36.110.39.211/k3cloud/"; //
//登陆参数 // $cloudUrl = "http://36.110.39.211/k3cloud/";
$data = array( // //登陆参数
'5ef2c166ad1afa',//帐套Id // $data = array(
'Administrator',//用户名 // '5ef2c166ad1afa',//帐套Id
'666666',//密码 // 'Administrator',//用户名
'2052'//语言标识359010087 // '666666',//密码
); // '2052'//语言标识359010087
//定义记录Cloud服务端返回的Session // );
$cookie_jar = tempnam('/tmp','CloudSession'); // //定义记录Cloud服务端返回的Session
$post_content = self::create_postdata($data); // $cookie_jar = tempnam('/tmp','CloudSession');
$result = self::invoke_login($cloudUrl,$post_content,$cookie_jar); // $post_content = self::create_postdata($data);
$data_model='{ // $result = self::invoke_login($cloudUrl,$post_content,$cookie_jar);
"FormId": "AP_PAYBILL", // $data_model='{
"FieldKeys": "FBillNo,FDOCUMENTSTATUS,FPAYTOTALAMOUNTFOR,FPOSTDATE", // "FormId": "AP_PAYBILL",
"FilterString": "", // "FieldKeys": "FBillNo,FDOCUMENTSTATUS,FPAYTOTALAMOUNTFOR,FPOSTDATE",
"OrderString": "", // "FilterString": "",
"TopRowCount": 0, // "OrderString": "",
"StartRow": 0, // "TopRowCount": 0,
"Limit": 0 // "StartRow": 0,
}'; // "Limit": 0
$model=json_decode($data_model,true); // }';
$model['FilterString']="FSRCBILLNO ="."'".$value['fbillno']."'"; // $model=json_decode($data_model,true);
// $model['FilterString']="FSRCBILLNO ="."'".$value['fbillno']."'";
$data_model=json_encode($model); //
$data = array( // $data_model=json_encode($model);
$data_model//具体Json字串 // $data = array(
); // $data_model//具体Json字串
// );
$post_content = self::create_postdata($data); //
$result = self::invoke_save($cloudUrl,$post_content,$cookie_jar); // $post_content = self::create_postdata($data);
$array = json_decode($result,true); // $result = self::invoke_save($cloudUrl,$post_content,$cookie_jar);
var_dump($array);die; // $array = json_decode($result,true);
//var_dump($array);die;
if(count($array)>1){ //
// if(count($array)>1){
$key = ['FBillNo','FDOCUMENTSTATUS','FPAYTOTALAMOUNTFOR','FPOSTDATE' ]; //
$new_array = array(); // $key = ['FBillNo','FDOCUMENTSTATUS','FPAYTOTALAMOUNTFOR','FPOSTDATE' ];
foreach($array as $k=>$v) { // $new_array = array();
$new_array[$k] = array_combine($key,$v); // foreach($array as $k=>$v) {
// $new_array[$k] = array_combine($key,$v);
} //
// 计算金钱 // }
$sum = 0; // // 计算金钱
foreach($new_array as $ke =>$item){ // $sum = 0;
if($item['FDOCUMENTSTATUS']=='C'){ // foreach($new_array as $ke =>$item){
$sum += (int)$item['FPAYTOTALAMOUNTFOR']; // if($item['FDOCUMENTSTATUS']=='C'){
// $sum += (int)$item['FPAYTOTALAMOUNTFOR'];
$payflow = $this->db->getone('[Q]finifom_oayfk_paymentflow',"`fbillno`='".$new_array[$ke]['FBillNo']."'",'id,fbillno'); //
$fbillno=$new_array['FSRCBILLNO']; // $payflow = $this->db->getone('[Q]finifom_oayfk_paymentflow',"`fbillno`='".$new_array[$ke]['FBillNo']."'",'id,fbillno');
$datalist = $this->db->getone('[Q]c_fininfom_oayfk',"`fbillno`='".$value['fbillno']."'",'id,fbillno,amountOfThisPayment'); // $fbillno=$new_array['FSRCBILLNO'];
if(!$payflow ){ // $datalist = $this->db->getone('[Q]c_fininfom_oayfk',"`fbillno`='".$value['fbillno']."'",'id,fbillno,amountOfThisPayment');
$paymentflow=array( // if(!$payflow ){
'fsrcbillno' =>$new_array[$ke]['FSRCBILLNO'], // $paymentflow=array(
'fbillno' =>$new_array[$ke]['FBillNo'], // 'fsrcbillno' =>$new_array[$ke]['FSRCBILLNO'],
'fpaytotalamountfor' =>$new_array[$ke]['FPAYTOTALAMOUNTFOR'], // 'fbillno' =>$new_array[$ke]['FBillNo'],
'mid' =>$datalist['id'], // 'fpaytotalamountfor' =>$new_array[$ke]['FPAYTOTALAMOUNTFOR'],
'date' =>substr($new_array[$ke]['FPOSTDATE'],0,strpos($new_array[$ke]['FPOSTDATE'], 'T')) // 'mid' =>$datalist['id'],
); // 'date' =>substr($new_array[$ke]['FPOSTDATE'],0,strpos($new_array[$ke]['FPOSTDATE'], 'T'))
m('finifom_oayfk_paymentflow')->insert($paymentflow); // );
// m('finifom_oayfk_paymentflow')->insert($paymentflow);
} //
} // }
} // }
// }
if($datalist['amountOfThisPayment']==$sum){ //
// if($datalist['amountOfThisPayment']==$sum){
m('c_fininfom_oayfk')->update('`status`=1',$datalist['id']); //
$zfarr = array( // m('c_fininfom_oayfk')->update('`status`=1',$datalist['id']);
'status' =>1, // $zfarr = array(
'nowcourseid' => 0, // 'status' =>1,
'nowcheckid' => NULL, // 'nowcourseid' => 0,
'nowcheckname' => NULL, // 'nowcheckid' => NULL,
'nstatustext' => '尹再伟处理同意', // 'nowcheckname' => NULL,
); // 'nstatustext' => '尹再伟处理同意',
m('flow_bill')->update($zfarr,'mid='.$datalist['id'].''); // );
// m('flow_bill')->update($zfarr,'mid='.$datalist['id'].'');
$addarr = array( //
'table' => 'c_fininfom_oayfk', // $addarr = array(
'mid' => $datalist['id'], // 'table' => 'c_fininfom_oayfk',
'status' => 1, // 'mid' => $datalist['id'],
'statusname' => '同意', // 'status' => 1,
'name' => '出纳付款', // 'statusname' => '同意',
'courseid' => 310, // 'name' => '出纳付款',
'optdt' => date("Y-m-d H:i:s"), // 'courseid' => 310,
'explain' => '系统自动确认', // 'optdt' => date("Y-m-d H:i:s"),
'ip' => '0.0.0.0', // 'explain' => '系统自动确认',
'web' =>'Chrome', // 'ip' => '0.0.0.0',
'checkname' =>'尹再伟', // 'web' =>'Chrome',
'checkid' =>1085, // 'checkname' =>'尹再伟',
'modeid' =>103, // 'checkid' =>1085,
'color' =>'green', // 'modeid' =>103,
'valid' =>1, // 'color' =>'green',
'step' =>5, // 'valid' =>1,
'qmimg' =>NULL, // 'step' =>5,
'iszb' =>0 // 'qmimg' =>NULL,
); // 'iszb' =>0
m('flow_log')->insert($addarr); // );
echo '成功'; // m('flow_log')->insert($addarr);
} // echo '成功';
// }
//
//
}else{ //
// }else{
$key = ['FSRCBILLNO','FBillNo','FDOCUMENTSTATUS','FPAYTOTALAMOUNTFOR','FPOSTDATE' ]; //
$new_array = array(); // $key = ['FSRCBILLNO','FBillNo','FDOCUMENTSTATUS','FPAYTOTALAMOUNTFOR','FPOSTDATE' ];
foreach($array as $k=>$v) { // $new_array = array();
$new_array= array_combine($key,$v); // foreach($array as $k=>$v) {
} // $new_array= array_combine($key,$v);
$fbillno=$new_array['FSRCBILLNO']; // }
$datalist = $this->db->getone('[Q]c_fininfom_oayfk',"`fbillno`='".$fbillno."'",'id,fbillno,amountOfThisPayment'); // $fbillno=$new_array['FSRCBILLNO'];
if($new_array['FDOCUMENTSTATUS']=='C'){ // $datalist = $this->db->getone('[Q]c_fininfom_oayfk',"`fbillno`='".$fbillno."'",'id,fbillno,amountOfThisPayment');
$payflow = $this->db->getone('[Q]finifom_oayfk_paymentflow',"`fbillno`='".$new_array['FBillNo']."'",'id,fbillno'); // if($new_array['FDOCUMENTSTATUS']=='C'){
if(!$payflow ){ // $payflow = $this->db->getone('[Q]finifom_oayfk_paymentflow',"`fbillno`='".$new_array['FBillNo']."'",'id,fbillno');
$paymentflow=array( // if(!$payflow ){
'fsrcbillno' =>$new_array['FSRCBILLNO'], // $paymentflow=array(
'fbillno' =>$new_array['FBillNo'], // 'fsrcbillno' =>$new_array['FSRCBILLNO'],
'fpaytotalamountfor' =>$new_array['FPAYTOTALAMOUNTFOR'], // 'fbillno' =>$new_array['FBillNo'],
'mid' =>$datalist['id'], // 'fpaytotalamountfor' =>$new_array['FPAYTOTALAMOUNTFOR'],
'date' =>substr($new_array['FPOSTDATE'],0,strpos($new_array['FPOSTDATE'], 'T')) // 'mid' =>$datalist['id'],
); // 'date' =>substr($new_array['FPOSTDATE'],0,strpos($new_array['FPOSTDATE'], 'T'))
m('finifom_oayfk_paymentflow')->insert($paymentflow); // );
// m('finifom_oayfk_paymentflow')->insert($paymentflow);
} //
// }
//
//
if($datalist['amountOfThisPayment']==$new_array['FPAYTOTALAMOUNTFOR']){ //
m('c_fininfom_oayfk')->update('`status`=1',$datalist['id']); // if($datalist['amountOfThisPayment']==$new_array['FPAYTOTALAMOUNTFOR']){
$zfarr = array( // m('c_fininfom_oayfk')->update('`status`=1',$datalist['id']);
'status' =>1, // $zfarr = array(
'nowcourseid' => 0, // 'status' =>1,
'nowcheckid' => NULL, // 'nowcourseid' => 0,
'nowcheckname' => NULL, // 'nowcheckid' => NULL,
'nstatustext' => '尹再伟处理同意', // 'nowcheckname' => NULL,
); // 'nstatustext' => '尹再伟处理同意',
m('flow_bill')->update($zfarr,'mid='.$datalist['id'].''); // );
// m('flow_bill')->update($zfarr,'mid='.$datalist['id'].'');
$addarr = array( //
'table' => 'c_fininfom_oayfk', // $addarr = array(
'mid' => $datalist['id'], // 'table' => 'c_fininfom_oayfk',
'status' => 1, // 'mid' => $datalist['id'],
'statusname' => '同意', // 'status' => 1,
'name' => '出纳付款', // 'statusname' => '同意',
'courseid' => 310, // 'name' => '出纳付款',
'optdt' => date("Y-m-d H:i:s"), // 'courseid' => 310,
'explain' => '系统自动确认', // 'optdt' => date("Y-m-d H:i:s"),
'ip' => '0.0.0.0', // 'explain' => '系统自动确认',
'web' =>'Chrome', // 'ip' => '0.0.0.0',
'checkname' =>'尹再伟', // 'web' =>'Chrome',
'checkid' =>1085, // 'checkname' =>'尹再伟',
'modeid' =>103, // 'checkid' =>1085,
'color' =>'green', // 'modeid' =>103,
'valid' =>1, // 'color' =>'green',
'step' =>5, // 'valid' =>1,
'qmimg' =>NULL, // 'step' =>5,
'iszb' =>0 // 'qmimg' =>NULL,
); // 'iszb' =>0
m('flow_log')->insert($addarr); // );
// m('flow_log')->insert($addarr);
echo "成功1"; //
} // echo "成功1";
} // }
} // }
// }
} //
// }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论