Commit 3ae4fc9e authored by 蒋林's avatar 蒋林

志高-维修业务-浏览相关接口

parent b66a0c28
......@@ -110,6 +110,60 @@ class Chigo extends BaseController
$obj->ReturnMessage(true, '', $result);
}
//家用维修业务-业务-安装单补录-浏览
public function queryInstallPatch()
{
$param = $this->input->post();
//验证参数
$obj = $this->receiveObj();
$obj->SetValues($param);
$obj->CheckQueryInstallPatchValues();
$values = $obj->GetValues();
$this->saveLog('', 'queryInstallPatch', $values);
$sourceObj = $this->sourceObj($values['account'], $values['pwd']);
$result = $sourceObj->QueryInstallPatch($values);
$obj->ReturnMessage(true, '', $result);
}
//家用维修业务-业务-维修过保机录入-浏览
public function queryOverdateBill()
{
$param = $this->input->post();
//验证参数
$obj = $this->receiveObj();
$obj->SetValues($param);
$obj->CheckQueryOverdateBillValues();
$values = $obj->GetValues();
$this->saveLog('', 'queryOverdateBill', $values);
$sourceObj = $this->sourceObj($values['account'], $values['pwd']);
$result = $sourceObj->QueryOverdateBill($values);
$obj->ReturnMessage(true, '', $result);
}
//家用维修业务-业务-维修单据结算-浏览
public function repairBrowseCloseAccount()
{
$param = $this->input->post();
//验证参数
$obj = $this->receiveObj();
$obj->SetValues($param);
$obj->CheckRepairBrowseCloseAccountValues();
$values = $obj->GetValues();
$this->saveLog('', 'repairBrowseCloseAccount', $values);
$sourceObj = $this->sourceObj($values['account'], $values['pwd']);
$result = $sourceObj->RepairBrowseCloseAccount($values);
$obj->ReturnMessage(true, '', $result);
}
//服务商编号
public function pickupAllSerNodeForUser()
......
......@@ -58,7 +58,7 @@ class Chigo extends BaseController
{
$xml = '<?xml version="1.0" encoding="gbk" standalone="yes"?>
<DATAPACKET Version="2.0"><ACTION isquery="true"/><DATASET providername="QueryRepairBill"><METADATA><FIELDS><FIELD attrname="INPUT_DATE_BEGIN" fieldtype="string" width="0"/><FIELD attrname="INPUT_DATE_END" fieldtype="string" width="0"/><FIELD attrname="NODE_ID" fieldtype="string" width="0"/><FIELD attrname="REPAIR_DATE_BEGIN" fieldtype="string" width="0"/><FIELD attrname="REPAIR_DATE_END" fieldtype="string" width="0"/><FIELD attrname="REPAIR_NO" fieldtype="string" width="0"/><FIELD attrname="MACHINE_MODEL" fieldtype="string" width="0"/></FIELDS><PARAMS/></METADATA><ROWDATA><ROW INPUT_DATE_BEGIN="2016-10-01" INPUT_DATE_END="2016-11-08" NODE_ID="" REPAIR_DATE_BEGIN="" REPAIR_DATE_END="" REPAIR_NO="" MACHINE_MODEL="&lt;10"/></ROWDATA></DATASET></DATAPACKET>
<DATAPACKET Version="2.0"><ACTION isquery="true"/><DATASET providername="BrowseCloseAccount"><METADATA><FIELDS><FIELD attrname="PERIODB" fieldtype="string" width="0"/><FIELD attrname="PERIODE" fieldtype="string" width="0"/><FIELD attrname="SER_NODE_ID" fieldtype="string" width="0"/><FIELD attrname="CENTER_CODE" fieldtype="string" width="0"/><FIELD attrname="INS_REP" fieldtype="string" width="0"/><FIELD attrname="WXQX" fieldtype="string" width="0"/></FIELDS><PARAMS/></METADATA><ROWDATA><ROW PERIODB="201610" PERIODE="201611" SER_NODE_ID="0200145" CENTER_CODE="0801" INS_REP="C" WXQX="C"/></ROWDATA></DATASET></DATAPACKET>
';
$sobj = $this->sourceObj();
......@@ -74,12 +74,7 @@ class Chigo extends BaseController
public function facilitatorReservation()
{
$obj = $this->receiveObj();
$data = [
'appid' => '10001',
'account' => self::$testu,
'pwd' => self::$testp,
$post = [
'adat_begin' => '20161012',
'adat_end' => '20161102',
'mobile' => '',
......@@ -88,27 +83,12 @@ class Chigo extends BaseController
'ano' => '0020201610125742',
];
$data['nonce_str'] = $obj->GetNonceStr();
$obj->SetValues($data);
$obj->SetSign();
$values = $obj->GetValues();
$url = self::$apiUrl . "api/chigo/facilitatorReservation";
$result = curl_post($url, $values);
$result = json_decode($result['data'], true);
$this->show($result);
$this->httpPost('facilitatorReservation', $post);
}
public function visitingService()
{
$obj = $this->receiveObj();
$data = [
'appid' => '10001',
'account' => self::$testu,
'pwd' => self::$testp,
$post = [
'adat_begin' => '20161001',
'adat_end' => '20161130',
'mobile' => '',
......@@ -119,27 +99,13 @@ class Chigo extends BaseController
'bxcd' => '1', //报修催单: 1:选中; 0:未选中
];
$data['nonce_str'] = $obj->GetNonceStr();
$obj->SetValues($data);
$obj->SetSign();
$values = $obj->GetValues();
$url = self::$apiUrl . "api/chigo/visitingService";
$result = curl_post($url, $values);
$result = json_decode($result['data'], true);
$this->show($result);
$this->httpPost('visitingService', $post);
}
public function queryInstallBill()
{
$obj = $this->receiveObj();
$data = [
'appid' => '10001',
'account' => self::$testu,
'pwd' => self::$testp,
$post = [
'input_date_begin' => '20160927',
'input_date_end' => '20161108',
'telephone_no' => '',
......@@ -150,47 +116,83 @@ class Chigo extends BaseController
'warranty' => '153178470',
];
$data['nonce_str'] = $obj->GetNonceStr();
$obj->SetValues($data);
$obj->SetSign();
$values = $obj->GetValues();
$url = self::$apiUrl . "api/chigo/queryInstallBill";
$result = curl_post($url, $values);
$result = json_decode($result['data'], true);
$this->show($result);
$this->httpPost('queryInstallBill', $post);
}
public function browseCloseAccount()
{
$obj = $this->receiveObj();
$data = [
'appid' => '10001',
'account' => self::$testu,
'pwd' => self::$testp,
$post = [
'periodb' => '201610',
'periode' => '201611',
'ser_node_id' => '0200145',
'center_code' => '0801'
];
$data['nonce_str'] = $obj->GetNonceStr();
$obj->SetValues($data);
$obj->SetSign();
$values = $obj->GetValues();
$this->httpPost('browseCloseAccount', $post);
}
$url = self::$apiUrl . "api/chigo/browseCloseAccount";
$result = curl_post($url, $values);
public function queryRepairBill()
{
$result = json_decode($result['data'], true);
$post = [
'input_date_begin' => '20161001',
'input_date_end' => '20161108',
'node_id' => '0200145',
'repair_date_begin' => '',
'repair_date_end' => '',
'repair_no' => '201609235',
];
$this->show($result);
$this->httpPost('queryRepairBill', $post);
}
public function queryRepairBill()
public function queryInstallPatch()
{
$post = [
'input_date_begin' => '',
'input_date_end' => '',
'telephone_no' => '',
'node_id' => '',
'install_date_begin' => '',
'install_date_end' => '',
'customer_name' => '',
'warranty' => '',
'barcode' => '',
];
$this->httpPost('queryInstallPatch', $post);
}
public function queryOverdateBill()
{
$post = [
'input_date_begin' => '',
'input_date_end' => '',
'node_id' => '',
'repair_date_begin' => '',
'repair_date_end' => '',
'repair_no' => '',
];
$this->httpPost('queryOverdateBill', $post);
}
public function repairBrowseCloseAccount()
{
$post = [
'periodb' => '201610',
'periode' => '201611',
'ser_node_id' => '0200145',
'center_code' => '0801',
'ins_rep' => '0',
'wxqx' => '0',
];
$this->httpPost('repairBrowseCloseAccount', $post);
}
private function httpPost($url, $post)
{
$obj = $this->receiveObj();
......@@ -198,27 +200,23 @@ class Chigo extends BaseController
'appid' => '10001',
'account' => self::$testu,
'pwd' => self::$testp,
'input_date_begin' => '20161001',
'input_date_end' => '20161108',
'node_id' => '0200145',
'repair_date_begin' => '',
'repair_date_end' => '',
'repair_no' => '201609235',
];
$data = array_merge($data, $post);
$url = self::$apiUrl . "api/chigo/" . $url;
$data['nonce_str'] = $obj->GetNonceStr();
$obj->SetValues($data);
$obj->SetSign();
$values = $obj->GetValues();
$url = self::$apiUrl . "api/chigo/queryRepairBill";
$result = curl_post($url, $values);
$result = json_decode($result['data'], true);
$this->show($result);
}
public function pickupAllSerNodeForUser()
{
$obj = $this->receiveObj();
......
......@@ -228,7 +228,7 @@ class Receive
protected function SelectValues($val, $options, $default='')
{
if (empty($val)) {
if ($val == '') {
return $val;
}
......@@ -237,7 +237,7 @@ class Receive
protected function IntValues($val, $out='int')
{
if (empty($val)) {
if ($val == '') {
return $val;
}
......@@ -248,7 +248,7 @@ class Receive
protected function DateFormatValues($date, $format='Y-m-d')
{
if (empty($date)) {
if ($date == '') {
return $date;
}
......@@ -257,7 +257,7 @@ class Receive
protected function TimeFormatValues($time, $format='Y-m-d')
{
if (empty($time)) {
if ($time == '') {
return $time;
}
......
......@@ -116,4 +116,69 @@ class ReceiveChigo extends Receive
$this->values['repair_date_end'] = $this->DateFormatValues($this->values['repair_date_end']);
}
public function CheckQueryInstallPatchValues()
{
$fileds = [];
$this->CheckValues($fileds);
$dfields = [
'input_date_begin', //20161011
'input_date_end',
'telephone_no',
'node_id',
'install_date_begin', //20161011
'install_date_end',
'customer_name',
'warranty',
'barcode',
];
$this->SetDefaultValues($dfields);
$this->values['input_date_begin'] = $this->DateFormatValues($this->values['input_date_begin']);
$this->values['input_date_end'] = $this->DateFormatValues($this->values['input_date_end']);
$this->values['install_date_begin'] = $this->DateFormatValues($this->values['install_date_begin']);
$this->values['install_date_end'] = $this->DateFormatValues($this->values['install_date_end']);
}
public function CheckQueryOverdateBillValues()
{
$fileds = [];
$this->CheckValues($fileds);
$dfields = [
'input_date_begin', //20161011
'input_date_end',
'node_id', //0200145
'repair_date_begin', //20161011
'repair_date_end',
'repair_no', //
];
$this->SetDefaultValues($dfields);
$this->values['input_date_begin'] = $this->DateFormatValues($this->values['input_date_begin']);
$this->values['input_date_end'] = $this->DateFormatValues($this->values['input_date_end']);
$this->values['repair_date_begin'] = $this->DateFormatValues($this->values['repair_date_begin']);
$this->values['repair_date_end'] = $this->DateFormatValues($this->values['repair_date_end']);
}
public function CheckRepairBrowseCloseAccountValues()
{
$fileds = ['ins_rep', 'wxqx'];
$this->CheckValues($fileds);
$dfields = [
'periodb', //201610
'periode',
'ser_node_id',
'center_code',
'ins_rep',
'wxqx'
];
$this->SetDefaultValues($dfields);
$select = ['C', 'H'];
$this->values['ins_rep'] = $this->SelectValues($this->values['ins_rep'], $select);
$this->values['wxqx'] = $this->SelectValues($this->values['wxqx'], $select);
}
}
\ No newline at end of file
......@@ -145,6 +145,72 @@ class SourceChigo extends Source
return $data;
}
/**
* 家用维修业务-业务-安装单补录-浏览
* @param $condition
* @return array
*/
public function QueryInstallPatch($condition)
{
$post = [
'input_date_begin' => $condition['input_date_begin'], //输单日期 2016-10-01
'input_date_end' => $condition['input_date_end'],
'telephone_no' => $condition['telephone_no'], //用户电话: 手机号码
'node_id' => $condition['node_id'], //服务商, PickupAllSerNodeForUser->node_id
'install_date_begin' => $condition['install_date_begin'], //安装日期 2016-10-01
'install_date_end' => $condition['install_date_end'],
'customer_name' => $condition['customer_name'], //用户姓名
'warranty' => $condition['warranty'], //保修卡号
'barcode' => $condition['barcode'], //条码
];
//转码
$post['customer_name'] = $this->Utf8ToGbk($post['customer_name']);
$data = $this->HandelAction('InstallPatchAction', 'QueryInstallPatch', $post);
return $data;
}
/**
* 家用维修业务-业务-维修过保机录入-浏览
* @param $condition
* @return array
*/
public function QueryOverdateBill($condition)
{
$post = [
'input_date_begin' => $condition['input_date_begin'], //输单日期: 2016-10-01
'input_date_end' => $condition['input_date_end'],
'node_id' => $condition['node_id'], //服务商, PickupAllSerNodeForUser->node_id
'repair_date_begin' => $condition['repair_date_begin'], //维修日期: 2016-10-01
'repair_date_end' => $condition['repair_date_end'],
'repair_no' => $condition['repair_no'], //维修单号: 201609235
];
$data = $this->HandelAction('OverdateBillAction', 'QueryOverdateBill', $post);
return $data;
}
/**
* 家用维修业务-业务-维修单据结算-浏览
* @param $condition
* @return array
*/
public function RepairBrowseCloseAccount($condition)
{
$post = [
'periodb' => $condition['periodb'], //'201610'
'periode' => $condition['periode'],
'ser_node_id' => $condition['ser_node_id'], //服务商, PickupAllSerNodeForUser->node_id
'center_code' => $condition['center_code'], //中心, PickupAllForUser->center_code
'ins_rep' => $condition['ins_rep'], //系统: C:志高; H:现代
'wxqx' => $condition['wxqx'], //业务类型: C:维修; H:清洗
];
$data = $this->HandelAction('BrowseCloseAccount', 'BrowseCloseAccount', $post);
return $data;
}
//服务商编号
public function PickupAllSerNodeForUser()
......@@ -214,6 +280,15 @@ class SourceChigo extends Source
$url = "http://58.254.204.86:9001/cus/RepairBillAction.do";
break;
//家用维修业务-安装单补录
case 'InstallPatchAction':
$url = "http://58.254.204.86:9001/cus/InstallPatchAction.do";
break;
case 'OverdateBillAction':
$url = "http://58.254.204.86:9001/cus/OverdateBillAction.do";
break;
default:
$url = '';
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment