Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
O
OA
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
PHP
OA
Commits
af1e9287
提交
af1e9287
authored
7月 30, 2020
作者:
fengzy
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
'调整emfk'
上级
81b68f8f
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
172 行增加
和
171 行删除
+172
-171
openemfkAction.php
webmain/task/openapi/openemfkAction.php
+172
-171
没有找到文件。
webmain/task/openapi/openemfkAction.php
浏览文件 @
af1e9287
...
...
@@ -177,177 +177,178 @@ class openemfkClassAction extends openapiAction
public
function
listAction
(){
$sql
=
'select id,fbillno,status from [Q]c_fininfom_oayfk where status=0 and fbillno is NOT null'
;
$dataarr
=
$this
->
db
->
getall
(
$sql
);
foreach
(
$dataarr
as
$key
=>
$value
)
{
$cloudUrl
=
"http://36.110.39.211/k3cloud/"
;
//登陆参数
$data
=
array
(
'5ef2c166ad1afa'
,
//帐套Id
'Administrator'
,
//用户名
'666666'
,
//密码
'2052'
//语言标识359010087
);
//定义记录Cloud服务端返回的Session
$cookie_jar
=
tempnam
(
'/tmp'
,
'CloudSession'
);
$post_content
=
self
::
create_postdata
(
$data
);
$result
=
self
::
invoke_login
(
$cloudUrl
,
$post_content
,
$cookie_jar
);
$data_model
=
'{
"FormId": "AP_PAYBILL",
"FieldKeys": "FBillNo,FDOCUMENTSTATUS,FPAYTOTALAMOUNTFOR,FPOSTDATE",
"FilterString": "",
"OrderString": "",
"TopRowCount": 0,
"StartRow": 0,
"Limit": 0
}'
;
$model
=
json_decode
(
$data_model
,
true
);
$model
[
'FilterString'
]
=
"FSRCBILLNO ="
.
"'"
.
$value
[
'fbillno'
]
.
"'"
;
$data_model
=
json_encode
(
$model
);
$data
=
array
(
$data_model
//具体Json字串
);
$post_content
=
self
::
create_postdata
(
$data
);
$result
=
self
::
invoke_save
(
$cloudUrl
,
$post_content
,
$cookie_jar
);
$array
=
json_decode
(
$result
,
true
);
var_dump
(
$array
);
die
;
if
(
count
(
$array
)
>
1
){
$key
=
[
'FBillNo'
,
'FDOCUMENTSTATUS'
,
'FPAYTOTALAMOUNTFOR'
,
'FPOSTDATE'
];
$new_array
=
array
();
foreach
(
$array
as
$k
=>
$v
)
{
$new_array
[
$k
]
=
array_combine
(
$key
,
$v
);
}
// 计算金钱
$sum
=
0
;
foreach
(
$new_array
as
$ke
=>
$item
){
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'
];
$datalist
=
$this
->
db
->
getone
(
'[Q]c_fininfom_oayfk'
,
"`fbillno`='"
.
$value
[
'fbillno'
]
.
"'"
,
'id,fbillno,amountOfThisPayment'
);
if
(
!
$payflow
){
$paymentflow
=
array
(
'fsrcbillno'
=>
$new_array
[
$ke
][
'FSRCBILLNO'
],
'fbillno'
=>
$new_array
[
$ke
][
'FBillNo'
],
'fpaytotalamountfor'
=>
$new_array
[
$ke
][
'FPAYTOTALAMOUNTFOR'
],
'mid'
=>
$datalist
[
'id'
],
'date'
=>
substr
(
$new_array
[
$ke
][
'FPOSTDATE'
],
0
,
strpos
(
$new_array
[
$ke
][
'FPOSTDATE'
],
'T'
))
);
m
(
'finifom_oayfk_paymentflow'
)
->
insert
(
$paymentflow
);
}
}
}
if
(
$datalist
[
'amountOfThisPayment'
]
==
$sum
){
m
(
'c_fininfom_oayfk'
)
->
update
(
'`status`=1'
,
$datalist
[
'id'
]);
$zfarr
=
array
(
'status'
=>
1
,
'nowcourseid'
=>
0
,
'nowcheckid'
=>
NULL
,
'nowcheckname'
=>
NULL
,
'nstatustext'
=>
'尹再伟处理同意'
,
);
m
(
'flow_bill'
)
->
update
(
$zfarr
,
'mid='
.
$datalist
[
'id'
]
.
''
);
$addarr
=
array
(
'table'
=>
'c_fininfom_oayfk'
,
'mid'
=>
$datalist
[
'id'
],
'status'
=>
1
,
'statusname'
=>
'同意'
,
'name'
=>
'出纳付款'
,
'courseid'
=>
310
,
'optdt'
=>
date
(
"Y-m-d H:i:s"
),
'explain'
=>
'系统自动确认'
,
'ip'
=>
'0.0.0.0'
,
'web'
=>
'Chrome'
,
'checkname'
=>
'尹再伟'
,
'checkid'
=>
1085
,
'modeid'
=>
103
,
'color'
=>
'green'
,
'valid'
=>
1
,
'step'
=>
5
,
'qmimg'
=>
NULL
,
'iszb'
=>
0
);
m
(
'flow_log'
)
->
insert
(
$addarr
);
echo
'成功'
;
}
}
else
{
$key
=
[
'FSRCBILLNO'
,
'FBillNo'
,
'FDOCUMENTSTATUS'
,
'FPAYTOTALAMOUNTFOR'
,
'FPOSTDATE'
];
$new_array
=
array
();
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'
);
if
(
$new_array
[
'FDOCUMENTSTATUS'
]
==
'C'
){
$payflow
=
$this
->
db
->
getone
(
'[Q]finifom_oayfk_paymentflow'
,
"`fbillno`='"
.
$new_array
[
'FBillNo'
]
.
"'"
,
'id,fbillno'
);
if
(
!
$payflow
){
$paymentflow
=
array
(
'fsrcbillno'
=>
$new_array
[
'FSRCBILLNO'
],
'fbillno'
=>
$new_array
[
'FBillNo'
],
'fpaytotalamountfor'
=>
$new_array
[
'FPAYTOTALAMOUNTFOR'
],
'mid'
=>
$datalist
[
'id'
],
'date'
=>
substr
(
$new_array
[
'FPOSTDATE'
],
0
,
strpos
(
$new_array
[
'FPOSTDATE'
],
'T'
))
);
m
(
'finifom_oayfk_paymentflow'
)
->
insert
(
$paymentflow
);
}
if
(
$datalist
[
'amountOfThisPayment'
]
==
$new_array
[
'FPAYTOTALAMOUNTFOR'
]){
m
(
'c_fininfom_oayfk'
)
->
update
(
'`status`=1'
,
$datalist
[
'id'
]);
$zfarr
=
array
(
'status'
=>
1
,
'nowcourseid'
=>
0
,
'nowcheckid'
=>
NULL
,
'nowcheckname'
=>
NULL
,
'nstatustext'
=>
'尹再伟处理同意'
,
);
m
(
'flow_bill'
)
->
update
(
$zfarr
,
'mid='
.
$datalist
[
'id'
]
.
''
);
$addarr
=
array
(
'table'
=>
'c_fininfom_oayfk'
,
'mid'
=>
$datalist
[
'id'
],
'status'
=>
1
,
'statusname'
=>
'同意'
,
'name'
=>
'出纳付款'
,
'courseid'
=>
310
,
'optdt'
=>
date
(
"Y-m-d H:i:s"
),
'explain'
=>
'系统自动确认'
,
'ip'
=>
'0.0.0.0'
,
'web'
=>
'Chrome'
,
'checkname'
=>
'尹再伟'
,
'checkid'
=>
1085
,
'modeid'
=>
103
,
'color'
=>
'green'
,
'valid'
=>
1
,
'step'
=>
5
,
'qmimg'
=>
NULL
,
'iszb'
=>
0
);
m
(
'flow_log'
)
->
insert
(
$addarr
);
echo
"成功1"
;
}
}
}
}
var_dump
(
213213
);
// $sql = 'select id,fbillno,status from [Q]c_fininfom_oayfk where status=0 and fbillno is NOT null';
// $dataarr = $this->db->getall($sql);
// foreach ($dataarr as $key => $value) {
//
// $cloudUrl = "http://36.110.39.211/k3cloud/";
// //登陆参数
// $data = array(
// '5ef2c166ad1afa',//帐套Id
// 'Administrator',//用户名
// '666666',//密码
// '2052'//语言标识359010087
// );
// //定义记录Cloud服务端返回的Session
// $cookie_jar = tempnam('/tmp','CloudSession');
// $post_content = self::create_postdata($data);
// $result = self::invoke_login($cloudUrl,$post_content,$cookie_jar);
// $data_model='{
// "FormId": "AP_PAYBILL",
// "FieldKeys": "FBillNo,FDOCUMENTSTATUS,FPAYTOTALAMOUNTFOR,FPOSTDATE",
// "FilterString": "",
// "OrderString": "",
// "TopRowCount": 0,
// "StartRow": 0,
// "Limit": 0
// }';
// $model=json_decode($data_model,true);
// $model['FilterString']="FSRCBILLNO ="."'".$value['fbillno']."'";
//
// $data_model=json_encode($model);
// $data = array(
// $data_model//具体Json字串
// );
//
// $post_content = self::create_postdata($data);
// $result = self::invoke_save($cloudUrl,$post_content,$cookie_jar);
// $array = json_decode($result,true);
//var_dump($array);die;
//
// if(count($array)>1){
//
// $key = ['FBillNo','FDOCUMENTSTATUS','FPAYTOTALAMOUNTFOR','FPOSTDATE' ];
// $new_array = array();
// foreach($array as $k=>$v) {
// $new_array[$k] = array_combine($key,$v);
//
// }
// // 计算金钱
// $sum = 0;
// foreach($new_array as $ke =>$item){
// 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'];
// $datalist = $this->db->getone('[Q]c_fininfom_oayfk',"`fbillno`='".$value['fbillno']."'",'id,fbillno,amountOfThisPayment');
// if(!$payflow ){
// $paymentflow=array(
// 'fsrcbillno' =>$new_array[$ke]['FSRCBILLNO'],
// 'fbillno' =>$new_array[$ke]['FBillNo'],
// 'fpaytotalamountfor' =>$new_array[$ke]['FPAYTOTALAMOUNTFOR'],
// 'mid' =>$datalist['id'],
// 'date' =>substr($new_array[$ke]['FPOSTDATE'],0,strpos($new_array[$ke]['FPOSTDATE'], 'T'))
// );
// m('finifom_oayfk_paymentflow')->insert($paymentflow);
//
// }
// }
// }
//
// if($datalist['amountOfThisPayment']==$sum){
//
// m('c_fininfom_oayfk')->update('`status`=1',$datalist['id']);
// $zfarr = array(
// 'status' =>1,
// 'nowcourseid' => 0,
// 'nowcheckid' => NULL,
// 'nowcheckname' => NULL,
// 'nstatustext' => '尹再伟处理同意',
// );
// m('flow_bill')->update($zfarr,'mid='.$datalist['id'].'');
//
// $addarr = array(
// 'table' => 'c_fininfom_oayfk',
// 'mid' => $datalist['id'],
// 'status' => 1,
// 'statusname' => '同意',
// 'name' => '出纳付款',
// 'courseid' => 310,
// 'optdt' => date("Y-m-d H:i:s"),
// 'explain' => '系统自动确认',
// 'ip' => '0.0.0.0',
// 'web' =>'Chrome',
// 'checkname' =>'尹再伟',
// 'checkid' =>1085,
// 'modeid' =>103,
// 'color' =>'green',
// 'valid' =>1,
// 'step' =>5,
// 'qmimg' =>NULL,
// 'iszb' =>0
// );
// m('flow_log')->insert($addarr);
// echo '成功';
// }
//
//
//
// }else{
//
// $key = ['FSRCBILLNO','FBillNo','FDOCUMENTSTATUS','FPAYTOTALAMOUNTFOR','FPOSTDATE' ];
// $new_array = array();
// 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');
// if($new_array['FDOCUMENTSTATUS']=='C'){
// $payflow = $this->db->getone('[Q]finifom_oayfk_paymentflow',"`fbillno`='".$new_array['FBillNo']."'",'id,fbillno');
// if(!$payflow ){
// $paymentflow=array(
// 'fsrcbillno' =>$new_array['FSRCBILLNO'],
// 'fbillno' =>$new_array['FBillNo'],
// 'fpaytotalamountfor' =>$new_array['FPAYTOTALAMOUNTFOR'],
// 'mid' =>$datalist['id'],
// 'date' =>substr($new_array['FPOSTDATE'],0,strpos($new_array['FPOSTDATE'], 'T'))
// );
// m('finifom_oayfk_paymentflow')->insert($paymentflow);
//
// }
//
//
//
// if($datalist['amountOfThisPayment']==$new_array['FPAYTOTALAMOUNTFOR']){
// m('c_fininfom_oayfk')->update('`status`=1',$datalist['id']);
// $zfarr = array(
// 'status' =>1,
// 'nowcourseid' => 0,
// 'nowcheckid' => NULL,
// 'nowcheckname' => NULL,
// 'nstatustext' => '尹再伟处理同意',
// );
// m('flow_bill')->update($zfarr,'mid='.$datalist['id'].'');
//
// $addarr = array(
// 'table' => 'c_fininfom_oayfk',
// 'mid' => $datalist['id'],
// 'status' => 1,
// 'statusname' => '同意',
// 'name' => '出纳付款',
// 'courseid' => 310,
// 'optdt' => date("Y-m-d H:i:s"),
// 'explain' => '系统自动确认',
// 'ip' => '0.0.0.0',
// 'web' =>'Chrome',
// 'checkname' =>'尹再伟',
// 'checkid' =>1085,
// 'modeid' =>103,
// 'color' =>'green',
// 'valid' =>1,
// 'step' =>5,
// 'qmimg' =>NULL,
// 'iszb' =>0
// );
// m('flow_log')->insert($addarr);
//
// echo "成功1";
// }
// }
// }
//
// }
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论