Commit 5fad1500 authored by 蒋林's avatar 蒋林

格兰仕 添加跟踪内容

parent 14a96c07
...@@ -225,6 +225,27 @@ class Galanz extends BaseController ...@@ -225,6 +225,27 @@ class Galanz extends BaseController
} }
//添加跟踪内容
public function callOrderAddFollow()
{
$param = $this->input->post();
//验证参数
$obj = $this->receiveGalanzObj();
$obj->SetValues($param);
$obj->CheckCallOrderAddFollowValues();
$values = $obj->GetValues();
$this->saveLog($values['id'], 'callOrderAddFollow', $param);
$sourceGalanzObj = $this->sourceGalanzObj($values['account'], $values['pwd']);
$order = $this->getCallOrder($values['id'], $sourceGalanzObj);
$order = $obj->SetCallOrderAddFollowValues($order, $values);
$result = $sourceGalanzObj->CallOrderAddFollow($order['new_id'], $order);
$result = $this->diffOrder($result);
$obj->ReturnMessage(true, '', $result);
}
//转录安装单 //转录安装单
public function createUserProfileOrder() public function createUserProfileOrder()
{ {
......
...@@ -41,9 +41,10 @@ class Galanz extends BaseController ...@@ -41,9 +41,10 @@ class Galanz extends BaseController
7 => ['u' => 'c02000043', 'p' => 'weixiuhui09'], 7 => ['u' => 'c02000043', 'p' => 'weixiuhui09'],
8 => ['u' => 'R75510005', 'p' => 'dgqh!769'], 8 => ['u' => 'R75510005', 'p' => 'dgqh!769'],
9 => ['u' => 'W75509335', 'p' => 'szwxh!755'], 9 => ['u' => 'W75509335', 'p' => 'szwxh!755'],
10 => ['u' => 'W02029017', 'p' => 'weixiuhui09'],
]; ];
$key = 5; $key = 10;
self::$testu = $account[$key]['u']; self::$testu = $account[$key]['u'];
self::$testp = $account[$key]['p']; self::$testp = $account[$key]['p'];
//self::$testp = urlencode(str_aes($account[5]['p'])); //self::$testp = urlencode(str_aes($account[5]['p']));
...@@ -179,7 +180,7 @@ class Galanz extends BaseController ...@@ -179,7 +180,7 @@ class Galanz extends BaseController
$data['appid'] = '10001'; $data['appid'] = '10001';
$data['account'] = self::$testu; $data['account'] = self::$testu;
$data['pwd'] = self::$testp; $data['pwd'] = self::$testp;
$data['id'] = 'e8ed9016-d621-45b3-9015-60fc3de89833'; $data['id'] = '890bd97f-9e1b-4528-a9cd-d4625f484fdb';
$data['nonce_str'] = $obj->GetNonceStr(); $data['nonce_str'] = $obj->GetNonceStr();
$obj->SetValues($data); $obj->SetValues($data);
...@@ -262,6 +263,29 @@ class Galanz extends BaseController ...@@ -262,6 +263,29 @@ class Galanz extends BaseController
$this->show($result); $this->show($result);
} }
public function callOrderAddFollow()
{
$obj = $this->galanzObj();
$data['appid'] = '10001';
$data['account'] = self::$testu;
$data['pwd'] = self::$testp;
$data['id'] = '890bd97f-9e1b-4528-a9cd-d4625f484fdb';
$data['txtFollowmemo'] = '16号上门';
$data['nonce_str'] = $obj->GetNonceStr();
$obj->SetValues($data);
$obj->SetSign();
$values = $obj->GetValues();
$url = self::$apiUrl . "api/galanz/callOrderAddFollow";
$result = curl_post($url, $values);
$result['data'] = json_decode($result['data'], true);
$this->show($result);
}
public function createUserProfileOrder() public function createUserProfileOrder()
{ {
$obj = $this->galanzObj(); $obj = $this->galanzObj();
......
...@@ -161,6 +161,21 @@ class ReceiveGalanz extends Receive ...@@ -161,6 +161,21 @@ class ReceiveGalanz extends Receive
} }
public function CheckCallOrderAddFollowValues()
{
$fileds = ['id','txtFollowmemo'];
$this->CheckValues($fileds);
}
public function SetCallOrderAddFollowValues($order, $values)
{
if ($values['txtFollowmemo']) {
$order['txtFollowmemo'] = trim($values['txtFollowmemo']);
}
return $order;
}
/** /**
* 转录维修单 * 转录维修单
*/ */
......
...@@ -151,6 +151,21 @@ class SourceGalanz extends Source ...@@ -151,6 +151,21 @@ class SourceGalanz extends Source
return $order; return $order;
} }
/**
* 派工订单添加跟踪内容
* @param $id
* @param $data
* @return mixed
*/
public function CallOrderAddFollow($id, $data)
{
$result = $this->HandelCallOrder($id, $data, 'AddFollow');
$this->HandelOrderError($result);
$order = $this->OrderDetail($id);
return $order;
}
/** /**
* 派工单转维修单 * 派工单转维修单
* @param $id * @param $id
...@@ -590,6 +605,27 @@ class SourceGalanz extends Source ...@@ -590,6 +605,27 @@ class SourceGalanz extends Source
$order[$kk] = $this->OrderFormValue($result, $vv['reg'], $vv['type']); $order[$kk] = $this->OrderFormValue($result, $vv['reg'], $vv['type']);
} }
//跟踪内容列表
$order['follow'] = [];
preg_match('/id="grouplist"[\s\S]+?<tbody>([\s\S]+?)<\/tbody>/', $result, $follow);
if (isset($follow[1])) {
preg_match_all('/<tr>[\s\S]+?<\/tr>/', $follow[1], $followTr);
//$order['follow'] = $followTr;
if ($followTr[0]) {
foreach ($followTr[0] as $k => $v) {
preg_match_all('/<td[^>]+>[\s\S]+?<\/td>/', $v, $followTd);
if ($followTd) {
$order['follow'][$k]['name'] = trim(preg_replace('/<[^>]+>/', '', $followTd[0][0]));
$order['follow'][$k]['text'] = trim(preg_replace('/<[^>]+>/', '', $followTd[0][1]));
$order['follow'][$k]['time'] = trim(preg_replace('/<[^>]+>/', '', $followTd[0][2]));
}
}
}
}
return $order; return $order;
} }
...@@ -1367,7 +1403,7 @@ class SourceGalanz extends Source ...@@ -1367,7 +1403,7 @@ class SourceGalanz extends Source
'ctl00$ContentData$new_sitedealremarks' => $data['new_sitedealremarks'], 'ctl00$ContentData$new_sitedealremarks' => $data['new_sitedealremarks'],
'ctl00$ContentData$new_sentsiteid' => $data['new_sentsiteid'], 'ctl00$ContentData$new_sentsiteid' => $data['new_sentsiteid'],
'ctl00$ContentData$new_ServicePersonnel' => $data['new_ServicePersonnel'], 'ctl00$ContentData$new_ServicePersonnel' => $data['new_ServicePersonnel'],
'ctl00$ContentData$txtFollowmemo' => $data['txtFollowmemo'], 'ctl00$ContentData$txtFollowmemo' => '',
]; ];
switch ($type) { switch ($type) {
...@@ -1403,8 +1439,30 @@ class SourceGalanz extends Source ...@@ -1403,8 +1439,30 @@ class SourceGalanz extends Source
case 'Refuse': case 'Refuse':
$post['__EVENTTARGET'] = 'ctl00$ContentHeader$btnRefuse'; $post['__EVENTTARGET'] = 'ctl00$ContentHeader$btnRefuse';
break; break;
}
case 'AddFollow':
$post['ctl00$ContentHeader$hidState'] = '1';
$post['ctl00$ContentData$new_confirmcode1'] = '';
$post['ctl00$ContentData$new_siteaccepttime'] = $data['new_siteaccepttime'];
$post['ctl00$ContentData$new_sitecontacttime'] = $data['new_sitecontacttime'];
$post['ctl00$ContentData$new_siteappointmenttime'] = $data['new_siteappointmenttime'];
$post['ctl00$ContentData$new_actualvisittime'] = $data['new_actualvisittime'];
$post['ctl00$ContentData$new_isguaranty'] = $data['new_isguaranty'];
$post['ctl00$ContentData$new_finishstatus'] = $data['new_finishstatus'];
if ($data['new_finishstatus'] === false) {
$post['ctl00$ContentData$new_unfinishreason'] = $data['new_unfinishreason'];
} else {
$post['ctl00$ContentData$new_finishtime'] = $data['new_finishtime'];
$post['ctl00$ContentData$new_complete_reason'] = $data['new_complete_reason'];
}
$post['ctl00$ContentData$new_usr_staffandallowanceid'] = '';
$post['ctl00$ContentData$txtFollowmemo'] = $data['txtFollowmemo'];
$post['ctl00$ContentData$btnAddFollow'] = '添加';
break;
}
//return_msg(true, '', $post); //return_msg(true, '', $post);
$url = self::$host . '/Complaint/new_srv_callinEP.aspx?mainid=&mainidname=&attrcode=&id=' . $id; $url = self::$host . '/Complaint/new_srv_callinEP.aspx?mainid=&mainidname=&attrcode=&id=' . $id;
......
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