Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
O
OA
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
PHP
OA
Commits
d9adb49c
提交
d9adb49c
authored
7月 05, 2020
作者:
fengzy
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
oa付款单
上级
422f3656
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
234 行增加
和
233 行删除
+234
-233
finfybxModel.php
webmain/model/flow/finfybxModel.php
+234
-233
没有找到文件。
webmain/model/flow/finfybxModel.php
浏览文件 @
d9adb49c
...
...
@@ -152,267 +152,268 @@ class flow_finfybxClassModel extends flowModel
// $id=$this->rs['id'];
// $sql = " mid ='$id' and `table`='fininfom' ";
// $flow_bill = m('flow_bill')->getone($sql,'allcheckid');
// $option = m('option')->getall('pid = 1568','num,name,value,sort');
// foreach ($option as $key => $value) {
// if(in_array($value['value'], $allcheckid)){
// $checkid= $value['value'];
// $explain= $value['explain'];
// break;
// }
// //查询流程为财务确认
// $flowid = $this->getflow();
$id
=
$this
->
rs
[
'id'
];
$sql
=
" mid ='
$id
' and `table`='fininfom' "
;
$flow_bill
=
m
(
'flow_bill'
)
->
getone
(
$sql
,
'allcheckid'
);
$option
=
m
(
'option'
)
->
getall
(
'pid = 1568'
,
'num,name,value,sort'
);
foreach
(
$option
as
$key
=>
$value
)
{
if
(
in_array
(
$value
[
'value'
],
$allcheckid
)){
$checkid
=
$value
[
'value'
];
$explain
=
$value
[
'explain'
];
break
;
}
}
//查询流程为财务确认
$flowid
=
$this
->
getflow
();
//
if($flowid['nowcheckid']==$checkid && $flowid['nowcourseid']==$explain){
if
(
$flowid
[
'nowcheckid'
]
==
$checkid
&&
$flowid
[
'nowcourseid'
]
==
$explain
){
//
$data=$this->db->getone('oa_personfile',"name='".$this->rs['applicant']."'");
//
$gonncode=$data['gonncode'];
//
// $data['pfbanknum'];//对方银行卡号
//
// $data['gonncode'];//员工编号
$data
=
$this
->
db
->
getone
(
'oa_personfile'
,
"name='"
.
$this
->
rs
[
'applicant'
]
.
"'"
);
$gonncode
=
$data
[
'gonncode'
];
// $data['pfbanknum'];//对方银行卡号
// $data['gonncode'];//员工编号
//
//明细
//
$oa_fininfos=$this->db->getrows('oa_fininfos',"mid='".$this->rs['id']."'");
//明细
$oa_fininfos
=
$this
->
db
->
getrows
(
'oa_fininfos'
,
"mid='"
.
$this
->
rs
[
'id'
]
.
"'"
);
//
$arr=[];
//
foreach ($oa_fininfos as $k=> $value) {
//
foreach ($value as $key => $val) {
//
switch ($key) {
//
case 'bxType':
$arr
=
[];
foreach
(
$oa_fininfos
as
$k
=>
$value
)
{
foreach
(
$value
as
$key
=>
$val
)
{
switch
(
$key
)
{
case
'bxType'
:
//
$arr['FPAYAPPLYENTRY'][$k]['FCOSTID']['FNUMBER']=self::getbxlx($val);
$arr
[
'FPAYAPPLYENTRY'
][
$k
][
'FCOSTID'
][
'FNUMBER'
]
=
self
::
getbxlx
(
$val
);
//
break;
//
case 'money':
break
;
case
'money'
:
//
$arr['FPAYAPPLYENTRY'][$k]['FAPPLYAMOUNTFOR']=$val;
$arr
[
'FPAYAPPLYENTRY'
][
$k
][
'FAPPLYAMOUNTFOR'
]
=
$val
;
//
break;
//
case 'sm':
break
;
case
'sm'
:
//
$arr['FPAYAPPLYENTRY'][$k]['FDescription']=$val;
//
break;
//
default:
//
$arr['FPAYAPPLYENTRY'][$k]['FSETTLETYPEID']['FNumber']='JSFS04_SYS';
//
$arr['FPAYAPPLYENTRY'][$k]['FPAYPURPOSEID']['FNumber']='SFKYT10_SYS';
//
$arr['FPAYAPPLYENTRY'][$k]['FENDDATE']=$this->rs['applydt'].' 00:00:00';
//
$arr['FPAYAPPLYENTRY'][$k]['FEXPECTPAYDATE']=$this->rs['applydt'].' 00:00:00';
//
$arr['FPAYAPPLYENTRY'][$k]['FEACHBANKACCOUNT']=$data['pfbanknum'];
$arr
[
'FPAYAPPLYENTRY'
][
$k
][
'FDescription'
]
=
$val
;
break
;
default
:
$arr
[
'FPAYAPPLYENTRY'
][
$k
][
'FSETTLETYPEID'
][
'FNumber'
]
=
'JSFS04_SYS'
;
$arr
[
'FPAYAPPLYENTRY'
][
$k
][
'FPAYPURPOSEID'
][
'FNumber'
]
=
'SFKYT10_SYS'
;
$arr
[
'FPAYAPPLYENTRY'
][
$k
][
'FENDDATE'
]
=
$this
->
rs
[
'applydt'
]
.
' 00:00:00'
;
$arr
[
'FPAYAPPLYENTRY'
][
$k
][
'FEXPECTPAYDATE'
]
=
$this
->
rs
[
'applydt'
]
.
' 00:00:00'
;
$arr
[
'FPAYAPPLYENTRY'
][
$k
][
'FEACHBANKACCOUNT'
]
=
$data
[
'pfbanknum'
];
//
break;
//
}
//
}
//
}
break
;
}
}
}
//
$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);
//
header("Content-type: text/html; charset=utf8");
//
$starttime = microtime(true);
//
$applicant=$this->rs['applicant'];//申请人
//
$applicationdpt=$this->rs['applicationdpt'];//申请部门
//
$applydt=$this->rs['applydt'];//申请日期
//
$cbxmid=$this->rs['cbxmid'];//成本中心
$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
);
header
(
"Content-type: text/html; charset=utf8"
);
$starttime
=
microtime
(
true
);
$applicant
=
$this
->
rs
[
'applicant'
];
//申请人
$applicationdpt
=
$this
->
rs
[
'applicationdpt'
];
//申请部门
$applydt
=
$this
->
rs
[
'applydt'
];
//申请日期
$cbxmid
=
$this
->
rs
[
'cbxmid'
];
//成本中心
//
$cbxmid=substr($cbxmid,0,strpos($cbxmid, "("));
$cbxmid
=
substr
(
$cbxmid
,
0
,
strpos
(
$cbxmid
,
"("
));
//
$money=$this->rs['money'];//合计金额
//
// $applydt=$this->rs['applydt'];//发票日期
//
// $company_scale=$this->rs['company_scale'];//发票类型
//
// $web_site=$this->rs['web_site'];//发票号
//
// $settle_type=$this->rs['settle_type'];//费用科目
//
// $pay_condition=$this->rs['pay_condition'];// 金额
//
// $tend_type=$this->rs['tend_type'];// *说明
$money
=
$this
->
rs
[
'money'
];
//合计金额
// $applydt=$this->rs['applydt'];//发票日期
// $company_scale=$this->rs['company_scale'];//发票类型
// $web_site=$this->rs['web_site'];//发票号
// $settle_type=$this->rs['settle_type'];//费用科目
// $pay_condition=$this->rs['pay_condition'];// 金额
// $tend_type=$this->rs['tend_type'];// *说明
//
$data_model ='{
//
"Creator": "",
//
"NeedUpDateFields": [],
//
"NeedReturnFields": [],
//
"IsDeleteEntry": "true",
//
"SubSystemId": "",
//
"IsVerifyBaseDataField": "false",
//
"IsEntryBatchFill": "true",
//
"ValidateFlag": "true",
//
"NumberSearch": "true",
//
"InterationFlags": "",
//
"IsAutoSubmitAndAudit": "false",
//
"Model": {
//
"FID": 0,
//
"FBILLTYPEID": {
//
"FNUMBER": "FKSQ005_SYS"
//
},
//
"FDATE": "2020-02-11 00:00:00",
//
"FCONTACTUNITTYPE": "BD_Empinfo",
//
"FCONTACTUNIT": {
//
"FNumber": "GONN-0002"
//
},
//
"FRECTUNITTYPE": "BD_Empinfo",
//
"FRECTUNIT": {
//
"FNumber": "GONN-0002"
//
},
//
"FCURRENCYID": {
//
"FNumber": "PRE001"
//
},
//
"FPAYORGID": {
//
"FNumber": "1000"
//
},
//
"FSETTLEORGID": {
//
"FNumber": "1000"
//
},
//
"FDEPARTMENT": {
//
"FNumber": ""
//
},
//
"F_PAEZ_OADJBH": "123321",
//
"FDOCUMENTSTATUS": "Z",
//
"FCANCELSTATUS": "A",
//
"FMAINBOOKID": {
//
"FNUMBER": "PRE001"
//
},
//
"FIsCredit": false,
//
"FAPPLYORGID": {
//
"FNumber": "1000"
//
},
//
"FSETTLECUR": {
//
"FNUMBER": "PRE001"
//
},
//
"FISCARRYRATE": false,
//
"F_PAEZ_Cbzx": {
//
"FNUMBER": " GS.BJ.B1"
//
}
$data_model
=
'{
"Creator": "",
"NeedUpDateFields": [],
"NeedReturnFields": [],
"IsDeleteEntry": "true",
"SubSystemId": "",
"IsVerifyBaseDataField": "false",
"IsEntryBatchFill": "true",
"ValidateFlag": "true",
"NumberSearch": "true",
"InterationFlags": "",
"IsAutoSubmitAndAudit": "false",
"Model": {
"FID": 0,
"FBILLTYPEID": {
"FNUMBER": "FKSQ005_SYS"
},
"FDATE": "2020-02-11 00:00:00",
"FCONTACTUNITTYPE": "BD_Empinfo",
"FCONTACTUNIT": {
"FNumber": "GONN-0002"
},
"FRECTUNITTYPE": "BD_Empinfo",
"FRECTUNIT": {
"FNumber": "GONN-0002"
},
"FCURRENCYID": {
"FNumber": "PRE001"
},
"FPAYORGID": {
"FNumber": "1000"
},
"FSETTLEORGID": {
"FNumber": "1000"
},
"FDEPARTMENT": {
"FNumber": ""
},
"F_PAEZ_OADJBH": "123321",
"FDOCUMENTSTATUS": "Z",
"FCANCELSTATUS": "A",
"FMAINBOOKID": {
"FNUMBER": "PRE001"
},
"FIsCredit": false,
"FAPPLYORGID": {
"FNumber": "1000"
},
"FSETTLECUR": {
"FNUMBER": "PRE001"
},
"FISCARRYRATE": false,
"F_PAEZ_Cbzx": {
"FNUMBER": " GS.BJ.B1"
}
//
}
//
}';
//
$model=json_decode($data_model,true);
//
$model['Model']['F_PAEZ_Cbzx']['FNUMBER']=$cbxmid;
//
$model['Model']['FDATE']=$applydt;
//
$model['Model']['FCONTACTUNIT']['FNumber']=$gonncode;
//
$model['Model']['F_PAEZ_OADJBH']=$this->rs['docnum'];;
//
$model['Model']['FRECTUNIT']['FNumber']=$gonncode;
//
$model['Model']['FPAYAPPLYENTRY']=$arr['FPAYAPPLYENTRY'];
}
}'
;
$model
=
json_decode
(
$data_model
,
true
);
$model
[
'Model'
][
'F_PAEZ_Cbzx'
][
'FNUMBER'
]
=
$cbxmid
;
$model
[
'Model'
][
'FDATE'
]
=
$applydt
;
$model
[
'Model'
][
'FCONTACTUNIT'
][
'FNumber'
]
=
$gonncode
;
$model
[
'Model'
][
'F_PAEZ_OADJBH'
]
=
$this
->
rs
[
'docnum'
];;
$model
[
'Model'
][
'FRECTUNIT'
][
'FNumber'
]
=
$gonncode
;
$model
[
'Model'
][
'FPAYAPPLYENTRY'
]
=
$arr
[
'FPAYAPPLYENTRY'
];
//
$data_model=json_encode($model);
//
$data = array(
//
'CN_PAYAPPLY',//业务对象标识FormId
//
$data_model//具体Json字串
//
);
$data_model
=
json_encode
(
$model
);
$data
=
array
(
'CN_PAYAPPLY'
,
//业务对象标识FormId
$data_model
//具体Json字串
);
//
$post_content = self::create_postdata($data);
//
$result = self::invoke_add($cloudUrl,$post_content,$cookie_jar);
//
$array = json_decode($result,true);
//
var_dump($array);
//
if($array['Result']['ResponseStatus']['IsSuccess']){
//
$num=$array['Result']['Number'];
//
$this->update("`fbillno`='$num'", $this->rs['id']);
$post_content
=
self
::
create_postdata
(
$data
);
$result
=
self
::
invoke_add
(
$cloudUrl
,
$post_content
,
$cookie_jar
);
$array
=
json_decode
(
$result
,
true
);
var_dump
(
$array
);
if
(
$array
[
'Result'
][
'ResponseStatus'
][
'IsSuccess'
]){
$num
=
$array
[
'Result'
][
'Number'
];
$this
->
update
(
"`fbillno`='
$num
'"
,
$this
->
rs
[
'id'
]);
//
$erp_log=array(
//
'sericnum'=> $this->rs['docnum'],
//
'table'=>'fininfom',
//
'name' => '保存成功',
//
'remark' => json_encode($array),
//
'optdt' =>date("Y-m-d H:i:s"),
//
'level'=>2,
//
'fbillno'=>$num,
//
'fbillnoid'=>$array['Result']['Id'],
//
'fbillno_type'=>1,
//
);
//
m('log_erp')->insert($erp_log);
//
if($this->supplier_submit($cloudUrl,$cookie_jar,$array['Result']['Id'],$array['Result']['Number'])){
//
$erp_log=array(
//
'sericnum'=> $this->rs['docnum'],
//
'table'=>'fininfom',
//
'name' => '提交成功',
//
'remark' => json_encode($array),
//
'optdt' =>date("Y-m-d H:i:s"),
//
'level'=>2,
//
'fbillno'=>$num,
//
'fbillnoid'=>$array['Result']['Id'],
//
'fbillno_type'=>2,
//
);
//
m('log_erp')->insert($erp_log);
//
}else{
//
$erp_log=array(
//
'sericnum'=> $this->rs['docnum'],
//
'table'=>'fininfom',
//
'name' => '提交失败',
//
'remark' => json_encode($array),
//
'optdt' =>date("Y-m-d H:i:s"),
//
'level'=>1,
//
'fbillno'=>$num,
//
'fbillnoid'=>$array['Result']['Id'],
//
'fbillno_type'=>2,
//
);
//
m('log_erp')->insert($erp_log);
//
}
//
if($this->supplier_audit($cloudUrl,$cookie_jar,$array['Result']['Id'],$array['Result']['Number'])){
//
$erp_log=array(
//
'sericnum'=> $this->rs['docnum'],
//
'table'=>'fininfom',
//
'name' => '审核成功',
//
'remark' => json_encode($array),
//
'optdt' =>date("Y-m-d H:i:s"),
//
'level'=>2,
//
'fbillno'=>$num,
//
'fbillnoid'=>$array['Result']['Id'],
//
'fbillno_type'=>3,
//
);
//
m('log_erp')->insert($erp_log);
//
}else{
//
$erp_log=array(
//
'sericnum'=> $this->rs['docnum'],
//
'table'=>'fininfom',
//
'name' => '审核失败',
//
'remark' => json_encode($array),
//
'optdt' =>date("Y-m-d H:i:s"),
//
'level'=>1,
//
'fbillno'=>$num,
//
'fbillnoid'=>$array['Result']['Id'],
//
'fbillno_type'=>3,
//
);
//
m('log_erp')->insert($erp_log);
//
}
$erp_log
=
array
(
'sericnum'
=>
$this
->
rs
[
'docnum'
],
'table'
=>
'fininfom'
,
'name'
=>
'保存成功'
,
'remark'
=>
json_encode
(
$array
),
'optdt'
=>
date
(
"Y-m-d H:i:s"
),
'level'
=>
2
,
'fbillno'
=>
$num
,
'fbillnoid'
=>
$array
[
'Result'
][
'Id'
],
'fbillno_type'
=>
1
,
);
m
(
'log_erp'
)
->
insert
(
$erp_log
);
if
(
$this
->
supplier_submit
(
$cloudUrl
,
$cookie_jar
,
$array
[
'Result'
][
'Id'
],
$array
[
'Result'
][
'Number'
])){
$erp_log
=
array
(
'sericnum'
=>
$this
->
rs
[
'docnum'
],
'table'
=>
'fininfom'
,
'name'
=>
'提交成功'
,
'remark'
=>
json_encode
(
$array
),
'optdt'
=>
date
(
"Y-m-d H:i:s"
),
'level'
=>
2
,
'fbillno'
=>
$num
,
'fbillnoid'
=>
$array
[
'Result'
][
'Id'
],
'fbillno_type'
=>
2
,
);
m
(
'log_erp'
)
->
insert
(
$erp_log
);
}
else
{
$erp_log
=
array
(
'sericnum'
=>
$this
->
rs
[
'docnum'
],
'table'
=>
'fininfom'
,
'name'
=>
'提交失败'
,
'remark'
=>
json_encode
(
$array
),
'optdt'
=>
date
(
"Y-m-d H:i:s"
),
'level'
=>
1
,
'fbillno'
=>
$num
,
'fbillnoid'
=>
$array
[
'Result'
][
'Id'
],
'fbillno_type'
=>
2
,
);
m
(
'log_erp'
)
->
insert
(
$erp_log
);
}
if
(
$this
->
supplier_audit
(
$cloudUrl
,
$cookie_jar
,
$array
[
'Result'
][
'Id'
],
$array
[
'Result'
][
'Number'
])){
$erp_log
=
array
(
'sericnum'
=>
$this
->
rs
[
'docnum'
],
'table'
=>
'fininfom'
,
'name'
=>
'审核成功'
,
'remark'
=>
json_encode
(
$array
),
'optdt'
=>
date
(
"Y-m-d H:i:s"
),
'level'
=>
2
,
'fbillno'
=>
$num
,
'fbillnoid'
=>
$array
[
'Result'
][
'Id'
],
'fbillno_type'
=>
3
,
);
m
(
'log_erp'
)
->
insert
(
$erp_log
);
}
else
{
$erp_log
=
array
(
'sericnum'
=>
$this
->
rs
[
'docnum'
],
'table'
=>
'fininfom'
,
'name'
=>
'审核失败'
,
'remark'
=>
json_encode
(
$array
),
'optdt'
=>
date
(
"Y-m-d H:i:s"
),
'level'
=>
1
,
'fbillno'
=>
$num
,
'fbillnoid'
=>
$array
[
'Result'
][
'Id'
],
'fbillno_type'
=>
3
,
);
m
(
'log_erp'
)
->
insert
(
$erp_log
);
}
//
}else{
//
$erp_log=array(
//
'sericnum'=> $this->rs['docnum'],
//
'table'=>'fininfom',
//
'name' => '保存失败',
//
'remark' => json_encode($array),
//
'optdt' =>date("Y-m-d H:i:s"),
//
'level'=>1,
//
'fbillno'=>$num,
//
'fbillnoid'=>$array['Result']['Id'],
//
'fbillno_type'=>1,
//
);
//
m('log_erp')->insert($erp_log);
//
}
}
else
{
$erp_log
=
array
(
'sericnum'
=>
$this
->
rs
[
'docnum'
],
'table'
=>
'fininfom'
,
'name'
=>
'保存失败'
,
'remark'
=>
json_encode
(
$array
),
'optdt'
=>
date
(
"Y-m-d H:i:s"
),
'level'
=>
1
,
'fbillno'
=>
$num
,
'fbillnoid'
=>
$array
[
'Result'
][
'Id'
],
'fbillno_type'
=>
1
,
);
m
(
'log_erp'
)
->
insert
(
$erp_log
);
}
//
}
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论