Commit dbed7d67 authored by 蒋林's avatar 蒋林

1. 安装单相关接口

2. 维修单相关接口
parent 47cb6f79
......@@ -6,9 +6,15 @@ defined('BASEPATH') OR exit('No direct script access allowed');
*/
class Welcome extends BaseController {
public function t()
public function postd()
{
echo '11';
$str = '';
}
protected function handel($str)
{
return '';
}
}
......@@ -25,37 +25,108 @@ class Galanz extends BaseController
parent::__construct();
}
//订单详情
public function getOrderDetail()
//搜索订单
public function searchOrder()
{
$param = $this->input->post();
//验证参数
$obj = $this->receiveGalanzObj();
$obj->SetValues($param);
$obj->CheckGetOrderDetailValues();
$obj->CheckSearchOrderValues();
$values = $obj->GetValues();
$this->saveLog($values['out_trade_no'], 'searchOrder', $param);
$obj->ReturnMessage(true, '', $values);
}
$this->saveLog($values['out_trade_no'], 'getOrderDetail', $param);
//查询订单
public function queryOrder()
{
$param = $this->input->post();
//验证参数
$obj = $this->receiveGalanzObj();
$obj->SetValues($param);
$obj->CheckQueryOrderValues();
$values = $obj->GetValues();
$this->saveLog($values['out_trade_no'], 'queryOrder', $param);
$this->load->model('galanz_model');
$info = $this->galanz_model->infoByNewName($values['out_trade_no']);
//搜索订单
$sourceGalanzObj = $this->sourceGalanzObj($values['account'], $obj);
$search = $sourceGalanzObj->SearchOrder($values['out_trade_no']);
if (empty($info)) {
$obj->ReturnMessage(false, '订单不存在');
if (empty($search)) {
$obj->ReturnMessage(false, '查询的订单不存在');
}
//订单详情
$sourceGalanzObj = $this->sourceGalanzObj($info['new_username'], $obj);
$order = $sourceGalanzObj->OrderDetail($info['new_id']);
$order = $sourceGalanzObj->OrderDetail($search[0][0]);
if (!isset($order['new_name']) && !$order['new_name']) {
$obj->ReturnMessage(false, '查询的订单不存在');
}
$obj->ReturnMessage(true, '', $order);
}
//搜索订单
public function searchOrder()
//查询维修订单
public function queryWorkOrder()
{
$param = $this->input->post();
//验证参数
$obj = $this->receiveGalanzObj();
$obj->SetValues($param);
$obj->CheckQueryWorkOrderValues();
$values = $obj->GetValues();
$this->saveLog($values['work_order_no'], 'queryWorkOrder', $param);
//搜索订单
$sourceGalanzObj = $this->sourceGalanzObj($values['account'], $obj);
$search = $sourceGalanzObj->SearchWorkOrder($values['work_order_no']);
if (empty($search)) {
$obj->ReturnMessage(false, '查询的维修单不存在');
}
//订单详情
$order = $sourceGalanzObj->WorkOrderDetail($search[0][0]);
if (!isset($order['new_name']) && !$order['new_name']) {
$obj->ReturnMessage(false, '查询的维修单不存在');
}
$obj->ReturnMessage(true, '', $order);
}
public function queryUserProfileOrder()
{
$param = $this->input->post();
//验证参数
$obj = $this->receiveGalanzObj();
$obj->SetValues($param);
$obj->CheckSaveUserProfileOrderValues();
$values = $obj->GetValues();
$this->saveLog($values['up_order_no'], 'queryUserProfileOrder', $param);
//搜索订单
$sourceGalanzObj = $this->sourceGalanzObj($values['account'], $obj);
$search = $sourceGalanzObj->SearchUserProfieOrder($values['mobile'], $values['up_order_no']);
if (empty($search)) {
$obj->ReturnMessage(false, '查询的安装单不存在');
}
//订单详情
$order = $sourceGalanzObj->UserProfileOrderDetail($search[0][0]);
if (!isset($order['new_number']) && !$order['new_number']) {
$obj->ReturnMessage(false, '查询的安装单不存在');
}
$obj->ReturnMessage(true, '', $order);
}
//搜索维修单
......@@ -70,9 +141,54 @@ class Galanz extends BaseController
$obj->SetValues($param);
$obj->CheckSaveOrderValues();
$values = $obj->GetValues();
$this->saveLog('', 'saveOrder', $param);
$this->saveLog($values['out_trade_no'], 'saveOrder', $param);
//搜索订单
$sourceGalanzObj = $this->sourceGalanzObj($values['account'], $obj);
$search = $sourceGalanzObj->SearchOrder($values['out_trade_no']);
if (empty($search)) {
$obj->ReturnMessage(false, '查询的订单不存在');
}
//订单详情
$order = $sourceGalanzObj->OrderDetail($search[0][0]);
if (!isset($order['new_name']) && !$order['new_name']) {
$obj->ReturnMessage(false, '查询的订单不存在');
}
//处理参数
if ($values['new_sitecontacttime'] != '') {
$order['new_sitecontacttime'] = $values['sitecontacttime'];
}
if ($values['new_siteappointmenttime'] != '') {
$order['new_siteappointmenttime'] = $values['siteappointmenttime'];
}
if ($values['new_actualvisittime'] != '') {
$order['new_actualvisittime'] = $values['actualvisittime'];
}
if ($values['new_isguaranty'] != '') {
$order['new_isguaranty'] = $values['isguaranty'] ? 'True' : 'False';
}
if ($values['new_finishstatus'] != '') {
$order['new_finishstatus'] = $values['finishstatus'] ? 'True' : 'False';
}
if ($values['new_unfinishreason'] != '') {
$order['new_unfinishreason'] = $values['unfinishreason'];
}
if ($values['new_sitedealremarks'] != '') {
$order['new_sitedealremarks'] = $values['sitedealremarks'];
}
if ($values['new_ServicePersonnel'] != '') {
$order['new_ServicePersonnel'] = $values['servicePersonnel'];
}
//保存订单
//$sourceGalanzObj->SaveOrder($order['new_id'], $order);
$obj->ReturnMessage(true, '', $order);
$obj->ReturnMessage(true, '', $values);
}
//拒绝订单
......@@ -115,24 +231,194 @@ class Galanz extends BaseController
$obj->SetValues($param);
$obj->CheckCreateWorkOrderValues();
$values = $obj->GetValues();
$this->saveLog('', 'createWorkOrder', $param);
$this->saveLog($values['out_trade_no'], 'createWorkOrder', $param);
//搜索订单
$sourceGalanzObj = $this->sourceGalanzObj($values['account'], $obj);
$search = $sourceGalanzObj->SearchOrder($values['out_trade_no']);
if (empty($search)) {
$obj->ReturnMessage(false, '查询的订单不存在');
}
//订单详情
$order = $sourceGalanzObj->OrderDetail($search[0][0]);
if (!isset($order['new_name']) && !$order['new_name']) {
$obj->ReturnMessage(false, '查询的订单不存在');
}
//保存订单
$result = $sourceGalanzObj->CreateWorkOrder($order['new_id'], $order);
if ($result) {
$obj->ReturnMessage(true, '', $result);
} else {
$obj->ReturnMessage(false, '转录维修单失败');
}
$obj->ReturnMessage(true, '', $values);
}
//转录安装单
public function createUserprofileOrder()
public function createUserProfileOrder()
{
$param = $this->input->post();
//验证参数
$obj = $this->receiveGalanzObj();
$obj->SetValues($param);
$obj->CheckCreateUserprofileOrderValues();
$obj->CheckCreateUserProfileOrderValues();
$values = $obj->GetValues();
$this->saveLog('', 'createUserprofileOrder', $param);
$this->saveLog($values['out_trade_no'], 'createUserprofileOrder', $param);
$obj->ReturnMessage(true, '', $values);
//搜索订单
$sourceGalanzObj = $this->sourceGalanzObj($values['account'], $obj);
$search = $sourceGalanzObj->SearchOrder($values['out_trade_no']);
if (empty($search)) {
$obj->ReturnMessage(false, '查询的订单不存在');
}
//订单详情
$order = $sourceGalanzObj->OrderDetail($search[0][0]);
if (!isset($order['new_name']) && !$order['new_name']) {
$obj->ReturnMessage(false, '查询的订单不存在');
}
//保存订单
$result = $sourceGalanzObj->CreateUserProfileOrder($order['new_id'], $order);
$obj->ReturnMessage(true, '', $result);
}
//保存维修单
public function saveWorkOrder()
{
$param = $this->input->post();
//验证参数
$obj = $this->receiveGalanzObj();
$obj->SetValues($param);
$obj->CheckSaveWorkOrderValues();
$values = $obj->GetValues();
$this->saveLog($values['work_order_no'], 'saveWorkOrder', $param);
//搜索订单
$sourceGalanzObj = $this->sourceGalanzObj($values['account'], $obj);
$search = $sourceGalanzObj->SearchWorkOrder($values['out_trade_no']);
if (empty($search)) {
$obj->ReturnMessage(false, '查询的维修单不存在');
}
//订单详情
$order = $sourceGalanzObj->WorkOrderDetail($search[0][0]);
if (!isset($order['new_name']) && !$order['new_name']) {
$obj->ReturnMessage(false, '查询的维修单不存在');
}
//保存订单
$result = $sourceGalanzObj->SaveWorkOrder($order['new_id'], $order);
$obj->ReturnMessage(true, '', $result);
}
public function sendWorkOrder()
{
$param = $this->input->post();
//验证参数
$obj = $this->receiveGalanzObj();
$obj->SetValues($param);
$obj->CheckSendWorkOrderValues();
$values = $obj->GetValues();
$this->saveLog($values['work_order_no'], 'sendWorkOrder', $param);
//搜索订单
$sourceGalanzObj = $this->sourceGalanzObj($values['account'], $obj);
$search = $sourceGalanzObj->SearchWorkOrder($values['out_trade_no']);
if (empty($search)) {
$obj->ReturnMessage(false, '查询的维修单不存在');
}
//订单详情
$order = $sourceGalanzObj->WorkOrderDetail($search[0][0]);
if (!isset($order['new_name']) && !$order['new_name']) {
$obj->ReturnMessage(false, '查询的维修单不存在');
}
//发送订单
$result = $sourceGalanzObj->SendWorkOrder($order['new_id'], $order);
$obj->ReturnMessage(true, '', $result);
}
public function saveUserProfileOrder()
{
$param = $this->input->post();
//验证参数
$obj = $this->receiveGalanzObj();
$obj->SetValues($param);
$obj->CheckSaveUserProfileOrderValues();
$values = $obj->GetValues();
$this->saveLog($values['up_order_no'], 'saveUserProfileOrder', $param);
//搜索订单
$sourceGalanzObj = $this->sourceGalanzObj($values['account'], $obj);
$search = $sourceGalanzObj->SearchUserProfieOrder($values['mobile'], $values['up_order_no']);
if (empty($search)) {
$obj->ReturnMessage(false, '查询的安装单不存在');
}
//订单详情
$order = $sourceGalanzObj->UserProfileOrderDetail($search[0][0]);
if (!isset($order['new_number']) && !$order['new_number']) {
$obj->ReturnMessage(false, '查询的安装单不存在');
}
//保存订单
$result = $sourceGalanzObj->SaveUserProfileOrder($order['new_id'], $order);
$obj->ReturnMessage(true, '', $result);
}
public function sendUserProfileOrder()
{
$param = $this->input->post();
//验证参数
$obj = $this->receiveGalanzObj();
$obj->SetValues($param);
$obj->CheckSendUserProfileOrderValues();
$values = $obj->GetValues();
$this->saveLog($values['up_order_no'], 'sendUserProfileOrder', $param);
//搜索订单
$sourceGalanzObj = $this->sourceGalanzObj($values['account'], $obj);
$search = $sourceGalanzObj->SearchUserProfieOrder($values['mobile'], $values['up_order_no']);
if (empty($search)) {
$obj->ReturnMessage(false, '查询的安装单不存在');
}
//订单详情
$order = $sourceGalanzObj->UserProfileOrderDetail($search[0][0]);
if (!isset($order['new_number']) && !$order['new_number']) {
$obj->ReturnMessage(false, '查询的安装单不存在');
}
//发送订单
$result = $sourceGalanzObj->SendUserProfileOrder($order['new_id'], $order);
$obj->ReturnMessage(true, '', $result);
}
private function saveLog($search, $method, $data)
......
......@@ -37,7 +37,7 @@ class Galanz extends BaseController
$galanzAccount = $account['galanz'];
$orders = [];
foreach ($galanzAccount as $v) {
foreach ($galanzAccount as $k => $v) {
$orders[] = $this->galanzHandle($v);
}
......
......@@ -15,19 +15,101 @@ defined('BASEPATH') OR exit('No direct script access allowed');
*/
class Rgalanz extends BaseController
{
public function getOrderDetail()
protected static $apiUrl = 'http://wxh.pp.cn/';
public function t()
{
$url = "http://localhost/test/weixiuhui.php";
$data['username'] = '10001';
$data['username1'] = 'CALL2016082400507';
$data['username2'] = 'c01000005';
$result = $this->curlPost($url, $data);
print_r($result);
}
public function createWorkOrder()
{
$obj = $this->galanzObj();
$data['appid'] = '10001';
$data['out_trade_no'] = 'CALL2016082400507';
$data['account'] = 'c01000005';
$data['nonce_str'] = $obj->GetNonceStr();
$obj->SetValues($data);
$obj->SetSign();
$values = $obj->GetValues();
$url = self::$apiUrl . "api/galanz/CreateWorkOrder";
$result = $this->curlPost($url, $values);
$result = json_decode($result['data'], true);
$this->show($result);
}
public function queryOrder()
{
$obj = $this->galanzObj();
$data['appid'] = '10001';
$data['out_trade_no'] = 'CALL2015100900929';
$data['account'] = 'c01000005';
$data['nonce_str'] = $obj->GetNonceStr();
$obj->SetValues($data);
$obj->SetSign();
$values = $obj->GetValues();
$url = self::$apiUrl . "api/galanz/queryOrder";
$result = $this->curlPost($url, $values);
$result['data'] = json_decode($result['data'], true);
$this->show($result['data']);
}
public function queryWorkOrder()
{
$obj = $this->galanzObj();
$data['appid'] = '10001';
$data['out_trade_no'] = 'CALL2016082200544';
$data['work_order_no'] = 'WO2016082204280';
$data['account'] = 'c01000005';
$data['nonce_str'] = $obj->GetNonceStr();
$obj->SetValues($data);
$obj->SetSign();
$values = $obj->GetValues();
$url = self::$apiUrl . "api/galanz/queryWorkOrder";
$result = $this->curlPost($url, $values);
$result['data'] = json_decode($result['data'], true);
$this->show($result['data']);
}
public function queryUserProfileOrder()
{
$obj = $this->galanzObj();
$data['appid'] = '10001';
$data['up_order_no'] = 'N2016082303159';
$data['mobile'] = '18631653945';
$data['account'] = 'c01000005';
$data['nonce_str'] = $obj->GetNonceStr();
$obj->SetValues($data);
$obj->SetSign();
$values = $obj->GetValues();
$url = "http://wxh.pp.cn/api/galanz/getOrderDetail";
$url = self::$apiUrl . "api/galanz/queryUserProfileOrder";
$result = $this->curlPost($url, $values);
$result['data'] = json_decode($result['data'], true);
......@@ -52,6 +134,7 @@ class Rgalanz extends BaseController
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_HEADER, 0);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
// curl_setopt($curl, CURLOPT_POSTFIELDS, $post);
curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($post));
$result = curl_exec($curl);
$code = curl_getinfo($curl, CURLINFO_HTTP_CODE);
......
......@@ -15,17 +15,36 @@ defined('BASEPATH') OR exit('No direct script access allowed');
*/
class Sgalanz extends BaseController
{
public function searchOrder()
public function userProfileOrderDetail()
{
$obj = $this->galanzObj();
$list = $obj->SearchOrder('CALL2016082203611');
$list = $obj->UserProfileOrderDetail('cede5a21-0c3a-42ad-8f43-cc9810c1f1f1');
$this->show($list);
}
public function orderDetail()
public function saveOrder()
{
$obj = $this->galanzObj();
$list = $obj->OrderDetail('3911c4cd-6855-4a2c-8085-6e489972e6a3');
$order = $obj->OrderDetail('a7babae4-df15-4405-b5d2-2301554b6292');
$result = $obj->SaveOrder($order['new_id'], $order);
$this->show($result);
}
public function createWorkOrder()
{
$obj = $this->galanzObj();
$order = $obj->OrderDetail('a7babae4-df15-4405-b5d2-2301554b6292');
$result = $obj->CreateWorkOrder($order['new_id'], $order);
$this->show($result);
}
public function searchOrder()
{
$obj = $this->galanzObj();
$list = $obj->SearchOrder('CALL2016082203611');
$this->show($list);
}
......@@ -35,10 +54,26 @@ class Sgalanz extends BaseController
$list = $obj->SearchWorkOrder('WO2016082204280');
$this->show($list);
}
public function searchUserProfieOrder()
{
$obj = $this->galanzObj();
$list = $obj->SearchUserProfieOrder('18631653945', 'N2016082303159');
$this->show($list);
}
public function orderDetail()
{
$obj = $this->galanzObj();
$list = $obj->OrderDetail('3911c4cd-6855-4a2c-8085-6e489972e6a3');
$this->show($list);
}
public function workOrderDetail()
{
$obj = $this->galanzObj();
$list = $obj->WorkOrderDetail('07ef7b0e-9788-4d05-88a5-25adc4406aef');
$list = $obj->WorkOrderDetail('511626f5-c8d8-4840-92ce-a01902f522d4');
$this->show($list);
}
......
......@@ -10,32 +10,28 @@ require 'Receive.php';
class ReceiveGalanz extends Receive
{
public function CheckPublicValues()
/**
* 订单详情
*/
public function CheckQueryOrderValues()
{
if (!$this->GetValues()) {
$this->ReturnMessage(false, '参数错误!');
}
if ($this->CheckAppid() == false) {
$this->ReturnMessage(false, '缺少appid参数!');
}
$fileds = ['out_trade_no', 'account'];
$this->CheckValues($fileds);
}
if ($this->CheckSign() == false) {
$this->ReturnMessage(false, '签名错误!');
}
public function CheckQueryWorkOrderValues()
{
$fileds = ['work_order_no', 'account'];
$this->CheckValues($fileds);
}
/**
* 订单详情
* 搜索订单
*/
public function CheckGetOrderDetailValues()
public function CheckSearchOrderValues()
{
$this->CheckPublicValues();
if (!array_key_exists('out_trade_no', $this->values) || $this->values['out_trade_no'] == '') {
$this->ReturnMessage(false, '缺少out_trade_no参数!');
}
$fileds = ['out_trade_no', 'account'];
$this->CheckValues($fileds);
}
/**
......@@ -43,8 +39,20 @@ class ReceiveGalanz extends Receive
*/
public function CheckSaveOrderValues()
{
$this->CheckPublicValues();
$fileds = ['out_trade_no', 'account'];
$this->CheckValues($fileds);
$dfields = [
'sitecontacttime',
'actualvisittime',
'isguaranty',
'finishstatus',
'unfinishreason',
'complete_reason',
'sitedealremarks',
'servicePersonnel',
];
$this->SetDefaultValues($dfields);
}
/**
......@@ -52,7 +60,7 @@ class ReceiveGalanz extends Receive
*/
public function CheckRefuseOrderValues()
{
$this->CheckPublicValues();
$this->CheckValues();
}
......@@ -61,7 +69,7 @@ class ReceiveGalanz extends Receive
*/
public function CheckAcceptOrderValues()
{
$this->CheckPublicValues();
$this->CheckValues();
}
......@@ -70,16 +78,83 @@ class ReceiveGalanz extends Receive
*/
public function CheckCreateWorkOrderValues()
{
$this->CheckPublicValues();
$fileds = ['out_trade_no', 'account'];
$this->CheckValues($fileds);
}
/**
* 转录安装单
*/
public function CheckCreateUserprofileOrderValues()
public function CheckCreateUserProfileOrderValues()
{
$fileds = ['out_trade_no', 'account'];
$this->CheckValues($fileds);
}
public function CheckSaveWorkOrderValues()
{
$this->CheckPublicValues();
$fileds = ['work_order_no', 'account'];
$this->CheckValues($fileds);
}
public function CheckSendWorkOrderValues()
{
$fileds = ['work_order_no', 'account'];
$this->CheckValues($fileds);
}
public function CheckSaveUserProfileOrderValues()
{
$fileds = ['up_order_no', 'account'];
$this->CheckValues($fileds);
}
public function CheckSendUserProfileOrderValues()
{
$fileds = ['up_order_no', 'account'];
$this->CheckValues($fileds);
}
/**
* 检查参数
* @param array $fields
*/
private function CheckValues($fields = [])
{
if (!$this->GetValues()) {
$this->ReturnMessage(false, '参数错误!');
}
if ($this->CheckAppid() == false) {
$this->ReturnMessage(false, 'appid参数错误!');
}
if ($this->CheckSign() == false) {
$this->ReturnMessage(false, '签名错误!');
}
if ($fields) {
foreach ($fields as $v) {
if (!array_key_exists($v, $this->values) || $this->values[$v] == '') {
$this->ReturnMessage(false, "{$v}参数错误!");
}
}
}
}
/**
* 给指定参数增加默认值
* @param $fields
*/
private function SetDefaultValues($fields)
{
if ($fields) {
foreach ($fields as $v) {
if (!array_key_exists($v, $this->values)) {
$this->values[$v] == '';
}
}
}
}
}
\ No newline at end of file
......@@ -11,26 +11,86 @@ require 'Source.php';
class SourceGalanz extends Source
{
private static $account = [];
private static $host = 'http://202.104.26.131:3081';
public function __construct($account = [])
public function __construct($account)
{
//默认账号
if (empty($account)) {
self::$account = [
'username' => 'c01000005', //用户名
'pwd' => 'weixiuhui010', //密码
'city' => '北京', //地区
'product' => '热水器', //产品
];
} else {
self::$account = $account;
$CI =& get_instance();
$CI->load->config('account', true);
$accountConfig = $CI->config->item('account');
$galanzAccount = $accountConfig['galanz'];
if (!array_key_exists($account['username'], $galanzAccount)) {
die("galanz系统账号({$account['username']})不存在");
}
self::$account = $account;
self::$cookieFilePath = PUBDIR . "cookie/galanz_". self::$account['username'] .".cookie";
self::$captchaFilePath = PUBDIR . "captcha/galanz_". self::$account['username'] .".gif";
$this->IsLogin();
}
/**
* 保存订单
* @param $id
* @param $data
* @return array|mixed|string
*/
public function SaveOrder($id, $data)
{
$result = $this->HandelCallOrder($id, $data, 1);
return $result;
}
/**
* 订单转维修单
* @param $id
* @param $data
* @return array
*/
public function CreateWorkOrder($id, $data)
{
$result = $this->HandelCallOrder($id, $data, 4);
//获取订单id
preg_match('/new_srv_workorderEP.aspx\?id=([^\']+)\'/', $result, $arr);
$workOrderId = isset($arr[1]) ? $arr[1] : '';
//返回维修单信息
$workOrder = [];
if ($workOrderId) {
$workOrder = $this->WorkOrderDetail($workOrderId);
}
return $workOrder;
}
/**
* 订单转安装单
* @param $id
* @param $data
* @return array
*/
public function CreateUserProfileOrder($id, $data)
{
$result = $this->HandelCallOrder($id, $data, 5);
//获取订单id
preg_match('/new_srv_userprofileEP.aspx\?id=([^\']+)\'/', $result, $arr);
$orderId = isset($arr[1]) ? $arr[1] : '';
//返回维修单信息
$order = [];
if ($orderId) {
$order = $this->UserProfileOrderDetail($orderId);
}
return $order;
}
public function SearchOrder($new_name = '', $mobile = '', $startTime = '', $endTime = '')
{
......@@ -58,7 +118,7 @@ class SourceGalanz extends Source
'ctl00$ContentData$PagerToolBar1$ctl05' => 1
];
$url = 'http://202.104.26.131:3081/Complaint/new_srv_callinMP.aspx?type=unsubscribe';
$url = self::$host . '/Complaint/new_srv_callinMP.aspx';
$content = $this->GetUrlContents($url);
preg_match('/<input[^>]+name="__VIEWSTATE"[^>]+value="([^"]*)"/', $content, $arr);
......@@ -74,45 +134,13 @@ class SourceGalanz extends Source
if ($tr[0]) {
foreach ($tr[0] as $k => $v) {
preg_match_all('/(<td[^>]*>[\s\S]+?<\/td>)/', $v, $td);
foreach ($td[0] as $kk => $vv) {
if ($kk == 0) {
preg_match('/value="([^"]+)"/', $vv, $temp);
$vv = $temp[1];
} else {
$vv = preg_replace('/<[^>]+>/', '', $vv);
$vv = trim($vv);
}
$td[0][$kk] = $vv;
}
$orders[$k] = $td[0];
$orders[$k] = $this->TableTdPreg($v);
}
}
return $orders;
}
public function OrderDetail($id)
{
$orderField = $this->OrderFormFields();
$url = 'http://202.104.26.131:3081/Complaint/new_srv_callinEP.aspx?mainid=&mainidname=&attrcode=&id=' . $id;
$result = $this->GetUrlContents($url);
$order['new_id'] = $id;
$order['new_username'] = self::$account['username'];
$order['new_category'] = self::$account['category'];
foreach ($orderField as $kk => $vv) {
$order[$kk] = $this->OrderFormValue($result, $vv['reg'], $vv['type']);
}
return $order;
}
/**
* 查询维修单
* @param string $new_number
......@@ -146,7 +174,7 @@ class SourceGalanz extends Source
'ctl00$ContentData$PagerToolBar1$ctl05' => 1,
];
$url = 'http://202.104.26.131:3081/repair/new_srv_workorderMP.aspx';
$url = self::$host . '/repair/new_srv_workorderMP.aspx';
$content = $this->GetUrlContents($url);
preg_match('/<input[^>]+name="__VIEWSTATE"[^>]+value="([^"]*)"/', $content, $arr);
$post['__VIEWSTATE'] = $arr[1];
......@@ -161,32 +189,107 @@ class SourceGalanz extends Source
if ($tr[0]) {
foreach ($tr[0] as $k => $v) {
preg_match_all('/(<td[^>]*>[\s\S]+?<\/td>)/', $v, $td);
foreach ($td[0] as $kk => $vv) {
if ($kk == 0) {
preg_match('/value="([^"]+)"/', $vv, $temp);
$vv = $temp[1];
} else {
$vv = preg_replace('/<[^>]+>/', '', $vv);
$vv = trim($vv);
}
$td[0][$kk] = $vv;
$orders[$k] = $this->TableTdPreg($v);
}
}
return $orders;
}
public function SearchUserProfieOrder($mobile = '', $new_number = '')
{
$post = [
'__EVENTTARGET' => 'ctl00$ContentQuery$btnQuery',
'__EVENTARGUMENT' => '',
'__LASTFOCUS' => '',
'__VIEWSTATE' => '',
'ctl00$hidPageSiteMapTitle' => '安装单录入',
'ctl00$ContentQuery$hidMainId' => '',
'ctl00$ContentQuery$hidAttrCode' => '',
'ctl00$ContentQuery$hidMainIdName' => '',
'ctl00$ContentQuery$txtname' => '',
'ctl00$ContentQuery$ddlnew_investstatus' => '-1',
'ctl00$ContentQuery$ddlnew_status' => '-1',
'ctl00$ContentQuery$txtcontactname' => '',
'ctl00$ContentQuery$txtmobile' => $mobile,
'ctl00$ContentQuery$ddlhavaDetail' => '-1',
'ctl00$ContentQuery$hidDateFrom' => '',
'ctl00$ContentQuery$txtDateFrom' => '',
'ctl00$ContentQuery$hidDateTo' => '',
'ctl00$ContentQuery$txtDateTo' => '',
'ctl00$ContentQuery$ddlisuseful' => '-1',
'ctl00$ContentQuery$hidCreatedONFrom' => '',
'ctl00$ContentQuery$txtCreatedONFrom' => '',
'ctl00$ContentQuery$hidCreatedONTo' => '',
'ctl00$ContentQuery$txtCreatedONTo' => '',
'ctl00$ContentQuery$ddlJiesuanStatus' => '',
'ctl00$ContentQuery$txtproducenumber' => '',
'ctl00$ContentQuery$txtnew_accountaddr' => '',
'ctl00$ContentToolbar$PagerToolBar1$ctl00' => '50',
'ctl00$ContentToolbar$PagerToolBar1$ctl05' => '1',
];
$url = self::$host . '/Warranty/new_srv_userprofileMP.aspx';
$orders = $this->HandelSearchOrder($url, $post);
if ($orders && $new_number) {
foreach ($orders as $k => $v) {
if ($new_number != $v[2]) {
unset($orders[$k]);
}
}
}
return $orders;
}
$orders[$k] = $td[0];
private function HandelSearchOrder($url, $post)
{
$content = $this->GetUrlContents($url);
preg_match('/<input[^>]+name="__VIEWSTATE"[^>]+value="([^"]*)"/', $content, $arr);
$post['__VIEWSTATE'] = $arr[1];
$headers = $this->Header($url);
$result = $this->CurlPost($url, $post, $headers);
$result = gzdecode($result['data']);
preg_match_all('/(<tr>\s+<td class="checkbox">[\s\S]+?<\/tr>)/', $result, $tr);
$orders = [];
if ($tr[0]) {
foreach ($tr[0] as $k => $v) {
$orders[$k] = $this->TableTdPreg($v);
}
}
return $orders;
}
public function OrderDetail($id)
{
$orderField = $this->OrderFormFields();
$url = self::$host . '/Complaint/new_srv_callinEP.aspx?mainid=&mainidname=&attrcode=&id=' . $id;
$result = $this->GetUrlContents($url);
$order['new_id'] = $id;
$order['new_username'] = self::$account['username'];
$order['new_category'] = self::$account['category'];
foreach ($orderField as $kk => $vv) {
$order[$kk] = $this->OrderFormValue($result, $vv['reg'], $vv['type']);
}
return $order;
}
public function WorkOrderDetail($id)
{
$orderField = $this->WorkOrderFormFields();
$url = 'http://202.104.26.131:3081/repair/new_srv_workorderEP.aspx?mainid=&mainidname=&attrcode=&id=' . $id;
$url = self::$host . '/repair/new_srv_workorderEP.aspx?mainid=&mainidname=&attrcode=&id=' . $id;
$result = $this->GetUrlContents($url);
$order['new_id'] = $id;
......@@ -197,9 +300,265 @@ class SourceGalanz extends Source
$order[$kk] = $this->OrderFormValue($result, $vv['reg'], $vv['type']);
}
//机器信息
$order['machine'] = $this->WorkOrderMachine($result);
//故障信息
$order['fault'] = $this->WorkOrderFault($result);
//换件信息
$order['parts'] = $this->WorkOrderParts($result);
$order['new_distancekm'] = bcadd($order['new_distancekm'], 0, 2);
$order['new_baseamount'] = bcadd($order['new_baseamount'], 0, 2);
$order['new_mileamount'] = bcadd($order['new_mileamount'], 0, 2);
return $order;
}
private function WorkOrderMachine($html)
{
$result = [];
preg_match('/<table[^>]*id="tableProd"[^>]*>[\s\S]+?<\/table>/', $html, $table);
preg_match_all('/(<tr>\s+<td class="checkbox">[\s\S]+?<\/tr>)/', $table[0], $tr);
if ($tr[1]) {
foreach ($tr[1] as $k => $v) {
preg_match_all('/<td[^>]*>[\s\S]+?<\/td>/', $v, $td);
if ($td[0]) {
// $reg = $this->OrderFormReg('chk');
// $temp['chk'] = $this->OrderFormValue($td[0][0], $reg);
$reg = $this->OrderFormReg('cbiserror', 'checkbox');
$temp['cbiserror'] = $this->OrderFormValue($td[0][1], $reg, 'checkbox');
$reg = $this->OrderFormReg('txtproducenumber', 'text');
$temp['txtproducenumber'] = $this->OrderFormValue($td[0][2], $reg, 'text');
// $reg = $this->OrderFormReg('new_producttypeid', 'text');
// $temp['new_producttypeid'] = $this->OrderFormValue($td[0][3], $reg, 'text');
$reg = $this->OrderFormReg('new_producttypeidName', 'text');
$temp['new_producttypeidName'] = $this->OrderFormValue($td[0][3], $reg, 'text');
// $reg = $this->OrderFormReg('new_productmodelid', 'text');
// $temp['new_productmodelid'] = $this->OrderFormValue($td[0][4], $reg, 'text');
$reg = $this->OrderFormReg('new_productmodelidName', 'text');
$temp['new_productmodelidName'] = $this->OrderFormValue($td[0][4], $reg, 'text');
$reg = $this->OrderFormReg('hidnew_productnumber', 'text');
$temp['hidnew_productnumber'] = $this->OrderFormValue($td[0][5], $reg, 'text');
$reg = $this->OrderFormReg('hidnew_modelnumber', 'text');
$temp['hidnew_modelnumber'] = $this->OrderFormValue($td[0][6], $reg, 'text');
$reg = $this->OrderFormReg('new_productiondate', 'span');
$temp['new_productiondate'] = $this->OrderFormValue($td[0][7], $reg, 'span');
$reg = $this->OrderFormReg('new_stockoutdate', 'span');
$temp['new_stockoutdate'] = $this->OrderFormValue($td[0][8], $reg, 'span');
$reg = $this->OrderFormReg('new_goldcardno', 'text');
$temp['new_goldcardno'] = $this->OrderFormValue($td[0][9], $reg, 'text');
$reg = $this->OrderFormReg('new_month', 'span');
$temp['new_month'] = $this->OrderFormValue($td[0][10], $reg, 'span');
$result[] = $temp;
}
}
}
return $result;
}
private function WorkOrderFault($html)
{
$result = [];
preg_match('/<table[^>]*id="tableError"[^>]*>[\s\S]+?<\/table>/', $html, $table);
preg_match_all('/(<tr>\s+<td class="checkbox">[\s\S]+?<\/tr>)/', $table[0], $tr);
if ($tr[1]) {
foreach ($tr[1] as $k => $v) {
preg_match_all('/<td[^>]*>[\s\S]+?<\/td>/', $v, $td);
if ($td[0]) {
// $reg = $this->OrderFormReg('chk');
// $temp['chk'] = $this->OrderFormValue($td[0][0], $reg);
//
// $reg = $this->OrderFormReg('new_srv_workorderproductid', 'text');
// $temp['new_srv_workorderproductid'] = $this->OrderFormValue($td[0][0], $reg, 'text');
//
// $reg = $this->OrderFormReg('New_srv_wokordererrorid', 'text');
// $temp['New_srv_wokordererrorid'] = $this->OrderFormValue($td[0][0], $reg, 'text');
$reg = $this->OrderFormReg('new_name', 'span');
$temp['new_name'] = $this->OrderFormValue($td[0][1], $reg, 'span');
$reg = $this->OrderFormReg('new_errorpart', 'span');
$temp['new_errorpart'] = $this->OrderFormValue($td[0][2], $reg, 'span');
// $reg = $this->OrderFormReg('new_errormoduleid', 'text');
// $temp['new_errormoduleid'] = $this->OrderFormValue($td[0][3], $reg, 'text');
$reg = $this->OrderFormReg('new_errormoduleidName', 'text');
$temp['new_errormoduleidName'] = $this->OrderFormValue($td[0][3], $reg, 'text');
$reg = $this->OrderFormReg('new_errordesc', 'span');
$temp['new_errordesc'] = $this->OrderFormValue($td[0][4], $reg, 'span');
// $reg = $this->OrderFormReg('new_errorgroupid', 'text');
// $temp['new_errorgroupid'] = $this->OrderFormValue($td[0][5], $reg, 'text');
$reg = $this->OrderFormReg('new_errorgroupidName', 'text');
$temp['new_errorgroupidName'] = $this->OrderFormValue($td[0][5], $reg, 'text');
$reg = $this->OrderFormReg('new_causedesc', 'span');
$temp['new_causedesc'] = $this->OrderFormValue($td[0][6], $reg, 'span');
// $reg = $this->OrderFormReg('new_srv_errorsolutionid', 'text');
// $temp['new_srv_errorsolutionid'] = $this->OrderFormValue($td[0][7], $reg, 'text');
$reg = $this->OrderFormReg('new_srv_errorsolutionidName', 'text');
$temp['new_srv_errorsolutionidName'] = $this->OrderFormValue($td[0][7], $reg, 'span');
$reg = $this->OrderFormReg('new_solutiondesc', 'span');
$temp['new_solutiondesc'] = $this->OrderFormValue($td[0][8], $reg, 'span');
$result[] = $temp;
}
}
}
return $result;
}
private function WorkOrderParts($html)
{
$result = [];
preg_match('/<table[^>]*id="tableParts"[^>]*>[\s\S]+?<\/table>/', $html, $table);
preg_match_all('/(<tr>\s+<td class="checkbox">[\s\S]+?<\/tr>)/', $table[0], $tr);
if ($tr[1]) {
foreach ($tr[1] as $k => $v) {
preg_match_all('/<td[^>]*>[\s\S]+?<\/td>/', $v, $td);
if ($td[0]) {
// $reg = $this->OrderFormReg('chk');
// $temp['chk'] = $this->OrderFormValue($td[0][0], $reg);
//
// $reg = $this->OrderFormReg('new_srv_wokordererrorid', 'text');
// $temp['new_srv_wokordererrorid'] = $this->OrderFormValue($td[0][1], $reg, 'text');
$reg = $this->OrderFormReg('new_srv_wokordererroridName', 'span');
$temp['new_srv_wokordererroridName'] = $this->OrderFormValue($td[0][1], $reg, 'span');
$reg = $this->OrderFormReg('new_oldpartsid', 'span');
$temp['new_oldpartsid'] = $this->OrderFormValue($td[0][2], $reg, 'span');
// $reg = $this->OrderFormReg('new_errorpartsid', 'text');
// $temp['new_errorpartsid'] = $this->OrderFormValue($td[0][2], $reg, 'text');
$reg = $this->OrderFormReg('new_errorpartsidName', 'text');
$temp['new_errorpartsidName'] = $this->OrderFormValue($td[0][2], $reg, 'text');
$reg = $this->OrderFormReg('new_newpartsid', 'span');
$temp['new_newpartsid'] = $this->OrderFormValue($td[0][3], $reg, 'span');
// $reg = $this->OrderFormReg('new_partsid', 'text');
// $temp['new_partsid'] = $this->OrderFormValue($td[0][4], $reg, 'text');
$reg = $this->OrderFormReg('new_partsidName', 'text');
$temp['new_partsidName'] = $this->OrderFormValue($td[0][4], $reg, 'text');
$reg = $this->OrderFormReg('new_qty', 'text');
$temp['new_qty'] = $this->OrderFormValue($td[0][5], $reg, 'text');
$result[] = $temp;
}
}
}
return $result;
}
public function UserProfileOrderDetail($id)
{
$orderField = $this->UserProfileOrderFormFields();
$url = self::$host . '/Warranty/new_srv_userprofileEP.aspx?mainid=&mainidname=&attrcode=&id=' . $id;
$result = $this->GetUrlContents($url);
$order['new_id'] = $id;
$order['new_username'] = self::$account['username'];
$order['new_category'] = self::$account['category'];
foreach ($orderField as $kk => $vv) {
$order[$kk] = $this->OrderFormValue($result, $vv['reg'], $vv['type']);
}
//明细信息
$order['products'] = $this->UserProfileOrderMingxi($result);
$order['isamount'] = bcadd($order['isamount'], 0, 2);
$order['ifamount'] = bcadd($order['ifamount'], 0, 2);
return $order;
}
private function UserProfileOrderMingxi($html)
{
$result = [];
preg_match('/<table[^>]*id="grouplist"[^>]*>[\s\S]+?<\/table>/', $html, $table);
preg_match_all('/(<tr>\s+<td class="checkbox">[\s\S]+?<\/tr>)/', $table[0], $tr);
if ($tr[1]) {
foreach ($tr[1] as $k => $v) {
$temp = $this->TableTdPreg($v);
$result[] = [
'jqtm' => $temp[1], //机器条码
'jxmc' => $temp[2], //机型名称
'scrq' => $temp[3], //生产日期
'ckrq' => $temp[4], //出库日期
];
}
}
return $result;
}
public function SaveWorkOrder($id, $data)
{
$result = $this->HandelWorkOrder($id, $data, 'save');
return $result;
}
public function SendWorkOrder($id, $data)
{
$result = $this->HandelWorkOrder($id, $data, 'send');
return $result;
}
public function SaveUserProfileOrder($id, $data)
{
$result = $this->HandelUserProfileOrder($id, $data, 'save');
return $result;
}
public function SendUserProfileOrder($id, $data)
{
$result = $this->HandelUserProfileOrder($id, $data, 'send');
return $result;
}
/**
* 是否登录
* 登录失败, 重试5次
......@@ -208,7 +567,7 @@ class SourceGalanz extends Source
*/
private function IsLogin($num = 0)
{
$url = 'http://202.104.26.131:3081/Complaint/new_srv_callinMP.aspx?type=unsubscribe';
$url = self::$host . '/Complaint/new_srv_callinMP.aspx?type=unsubscribe';
$result = $this->GetUrlContents($url);
......@@ -226,8 +585,8 @@ class SourceGalanz extends Source
private function Login()
{
$loginUrl = "http://202.104.26.131:3081/FLoginNew.aspx";
$captchaUrl = "http://202.104.26.131:3081/SystemSetting/CheckCode.aspx";
$loginUrl = self::$host . "/FLoginNew.aspx";
$captchaUrl = self::$host . "/SystemSetting/CheckCode.aspx";
$content = $this->SetUrlCookie($loginUrl);
$this->SaveUrlCaptcha($captchaUrl);
......@@ -252,9 +611,378 @@ class SourceGalanz extends Source
return $this->CurlPost($loginUrl, $post, $headers);
}
/**
* 处理派工单
* @param $id
* @param $data
* @param $type
* @return array|mixed|string
*/
private function HandelCallOrder($id, $data, $type)
{
switch ($type) {
case 1:
$post = [
'__EVENTTARGET' => 'ctl00$ContentHeader$btnSave',
'__EVENTARGUMENT' => '',
'__VIEWSTATE' => $data['__VIEWSTATE'],
'ctl00$hidPageSiteMapTitle' => '派工单编辑页面',
'ctl00$ContentHeader$hidFormId' => $data['new_id'],
'ctl00$ContentHeader$hidState' => $type,
'ctl00$ContentData$new_name' => $data['new_name'],
'ctl00$ContentData$new_callintime' => $data['new_callintime'],
'ctl00$ContentData$new_custname' => $data['new_custname'],
'ctl00$ContentData$new_custmobile' => $data['new_custmobile'],
'ctl00$ContentData$new_custtel' => $data['new_custtel'],
'ctl00$ContentData$new_provinceid' => $data['new_provinceid'],
'ctl00$ContentData$new_provinceidName' => $data['new_provinceidName'],
'ctl00$ContentData$new_cityid' => $data['new_cityid'],
'ctl00$ContentData$new_cityidName' => $data['new_cityidName'],
'ctl00$ContentData$new_countyid' => $data['new_countyid'],
'ctl00$ContentData$new_countyidname' => $data['new_countyidname'],
'ctl00$ContentData$new_townid' => $data['new_townid'],
'ctl00$ContentData$new_townidName' => $data['new_townidName'],
'ctl00$ContentData$new_address' => $data['new_address'],
'ctl00$ContentData$new_visittime' => $data['new_visittime'],
'ctl00$ContentData$new_producttype' => $data['new_producttype'],
'ctl00$ContentData$new_csnumber' => $data['new_csnumber'],
'ctl00$ContentData$new_installsiteid' => $data['new_installsiteid'],
'ctl00$ContentData$new_installsiteidname' => $data['new_installsiteidname'],
'ctl00$ContentData$new_broughtdate' => $data['new_broughtdate'],
'ctl00$ContentData$new_installdate' => $data['new_installdate'],
'ctl00$ContentData$new_errormoduleid' => $data['new_errormoduleid'],
'ctl00$ContentData$new_errormoduleidName' => $data['new_errormoduleidName'],
'ctl00$ContentData$new_productqty' => $data['new_productqty'],
'ctl00$ContentData$new_market' => $data['new_market'],
'ctl00$ContentData$new_siteaccepttime' => $data['new_siteaccepttime'],
'ctl00$ContentData$new_sitecontacttime' => $data['new_sitecontacttime'],
'ctl00$ContentData$new_siteappointmenttime' => $data['new_siteappointmenttime'],
'ctl00$ContentData$new_actualvisittime' => $data['new_actualvisittime'],
'ctl00$ContentData$new_isguaranty' => $data['new_isguaranty'],
'ctl00$ContentData$new_finishstatus' => $data['new_finishstatus'],
'ctl00$ContentData$new_finishtime' => $data['new_finishtime'],
'ctl00$ContentData$new_complete_reason' => $data['new_complete_reason'],
'ctl00$ContentData$new_sitedealremarks' => $data['new_sitedealremarks'],
'ctl00$ContentData$new_sentsiteid' => $data['new_sentsiteid'],
'ctl00$ContentData$new_ServicePersonnel' => $data['new_ServicePersonnel'],
'ctl00$ContentData$txtFollowmemo' => $data['txtFollowmemo'],
];
break;
case 4:
$post = [
'__EVENTTARGET' => 'ctl00$ContentHeader$btnCreateWorkOrder',
'__EVENTARGUMENT' => '',
'__VIEWSTATE' => $data['__VIEWSTATE'],
'ctl00$hidPageSiteMapTitle' => '派工单编辑页面',
'ctl00$ContentHeader$hidFormId' => $data['new_id'],
'ctl00$ContentHeader$hidState' => $type,
'ctl00$ContentData$new_name' => $data['new_name'],
'ctl00$ContentData$new_callintime' => $data['new_callintime'],
'ctl00$ContentData$new_custname' => $data['new_custname'],
'ctl00$ContentData$new_custmobile' => $data['new_custmobile'],
'ctl00$ContentData$new_custtel' => $data['new_custtel'],
'ctl00$ContentData$new_provinceid' => $data['new_provinceid'],
'ctl00$ContentData$new_provinceidName' => $data['new_provinceidName'],
'ctl00$ContentData$new_cityid' => $data['new_cityid'],
'ctl00$ContentData$new_cityidName' => $data['new_cityidName'],
'ctl00$ContentData$new_countyid' => $data['new_countyid'],
'ctl00$ContentData$new_countyidname' => $data['new_countyidname'],
'ctl00$ContentData$new_townid' => $data['new_townid'],
'ctl00$ContentData$new_townidName' => $data['new_townidName'],
'ctl00$ContentData$new_address' => $data['new_address'],
'ctl00$ContentData$new_visittime' => $data['new_visittime'],
'ctl00$ContentData$new_producttype' => $data['new_producttype'],
'ctl00$ContentData$new_csnumber' => $data['new_csnumber'],
'ctl00$ContentData$new_installsiteid' => $data['new_installsiteid'],
'ctl00$ContentData$new_installsiteidname' => $data['new_installsiteidname'],
'ctl00$ContentData$new_broughtdate' => $data['new_broughtdate'],
'ctl00$ContentData$new_installdate' => $data['new_installdate'],
'ctl00$ContentData$new_errormoduleid' => $data['new_errormoduleid'],
'ctl00$ContentData$new_errormoduleidName' => $data['new_errormoduleidName'],
'ctl00$ContentData$new_productqty' => $data['new_productqty'],
'ctl00$ContentData$new_market' => $data['new_market'],
'ctl00$ContentData$new_sitedealremarks' => $data['new_sitedealremarks'],
'ctl00$ContentData$new_sentsiteid' => $data['new_sentsiteid'],
'ctl00$ContentData$new_ServicePersonnel' => $data['new_ServicePersonnel'],
'ctl00$ContentData$txtFollowmemo' => $data['txtFollowmemo'],
];
break;
case 5:
$post = [
'__EVENTTARGET' => 'ctl00%24ContentHeader%24btnCreateUserprofile',
'__EVENTARGUMENT' => '',
'__VIEWSTATE' => $data['__VIEWSTATE'],
'ctl00$hidPageSiteMapTitle' => '派工单编辑页面',
'ctl00$ContentHeader$hidFormId' => $data['new_id'],
'ctl00$ContentHeader$hidState' => $type,
'ctl00$ContentData$new_name' => $data['new_name'],
'ctl00$ContentData$new_callintime' => $data['new_callintime'],
'ctl00$ContentData$new_custname' => $data['new_custname'],
'ctl00$ContentData$new_custmobile' => $data['new_custmobile'],
'ctl00$ContentData$new_custtel' => $data['new_custtel'],
'ctl00$ContentData$new_provinceid' => $data['new_provinceid'],
'ctl00$ContentData$new_provinceidName' => $data['new_provinceidName'],
'ctl00$ContentData$new_cityid' => $data['new_cityid'],
'ctl00$ContentData$new_cityidName' => $data['new_cityidName'],
'ctl00$ContentData$new_countyid' => $data['new_countyid'],
'ctl00$ContentData$new_countyidname' => $data['new_countyidname'],
'ctl00$ContentData$new_townid' => $data['new_townid'],
'ctl00$ContentData$new_townidName' => $data['new_townidName'],
'ctl00$ContentData$new_address' => $data['new_address'],
'ctl00$ContentData$new_visittime' => $data['new_visittime'],
'ctl00$ContentData$new_producttype' => $data['new_producttype'],
'ctl00$ContentData$new_csnumber' => $data['new_csnumber'],
'ctl00$ContentData$new_installsiteid' => $data['new_installsiteid'],
'ctl00$ContentData$new_installsiteidname' => $data['new_installsiteidname'],
'ctl00$ContentData$new_broughtdate' => $data['new_broughtdate'],
'ctl00$ContentData$new_installdate' => $data['new_installdate'],
'ctl00$ContentData$new_errormoduleid' => $data['new_errormoduleid'],
'ctl00$ContentData$new_errormoduleidName' => $data['new_errormoduleidName'],
'ctl00$ContentData$new_productqty' => $data['new_productqty'],
'ctl00$ContentData$new_market' => $data['new_market'],
'ctl00$ContentData$new_sitedealremarks' => $data['new_sitedealremarks'],
'ctl00$ContentData$new_sentsiteid' => $data['new_sentsiteid'],
'ctl00$ContentData$new_ServicePersonnel' => $data['new_ServicePersonnel'],
'ctl00$ContentData$txtFollowmemo' => $data['txtFollowmemo'],
];
break;
}
$url = self::$host . '/Complaint/new_srv_callinEP.aspx?mainid=&mainidname=&attrcode=&id=' . $id;
$headers = $this->Header($url);
$result = $this->CurlPost($url, $post, $headers);
$result = gzdecode($result['data']);
//替换script, 防止页面跳转
$result = str_replace('script', 'scriptt', $result);
return $result;
}
private function HandelWorkOrder($id, $data, $type)
{
switch ($type){
case 'save':
$target = 'ctl00$ContentQuery$btnSave';
break;
case 'send':
$target = 'ctl00$ContentQuery$btnSend';
break;
}
$post = [
'__EVENTTARGET' => $target,
'__EVENTARGUMENT' => '',
'__LASTFOCUS' => '',
'__VIEWSTATE' => $data['__VIEWSTATE'],
'__SCROLLPOSITIONX' => '0',
'__SCROLLPOSITIONY' => '0',
'ctl00$hidPageSiteMapTitle' => '维修单-编辑页面',
'ctl00$ContentHeader$hidFormId' => $data['new_id'],
'ctl00$ContentHeader$hidUserId' => $data['hidUserId'],
'ctl00$ContentHeader$hidIsKT' => $data['hidIsKT'],
'ctl00$ContentHeader$hidformPosition' => $data['hidformPosition'],
'ctl00$ContentHeader$OwnerId' => $data['OwnerId'],
'ctl00$ContentHeader$dtNow' => $data['dtNow'],
'ctl00$ContentData$New_sitecode' => $data['new_sitecode'],
'ctl00$ContentData$new_siteid' => $data['new_siteid'],
'ctl00$ContentData$new_siteidName' => $data['new_siteidName'],
'ctl00$ContentData$new_srv_callinid' => $data['new_srv_callinid'],
'ctl00$ContentData$new_srv_callinidName' => $data['new_srv_callinidName'],
'ctl00$ContentData$new_approvalstatus' => $data['new_approvalstatus'],
'ctl00$ContentData$new_name' => $data['new_name'],
'ctl00$ContentData$new_productgroupid' => $data['new_productgroupid'],
'ctl00$ContentData$new_productgroupidName' => $data['new_productgroupidName'],
'ctl00$ContentData$new_businessunitid' => $data['new_businessunitid'],
'ctl00$ContentData$new_businessunitidName' => $data['new_businessunitidName'],
'ctl00$ContentData$new_number' => $data['new_number'],
'ctl00$ContentData$new_uninvsestreasonName' => $data['new_uninvsestreasonName'],
'ctl00$ContentData$new_reconsidermemo' => $data['new_reconsidermemo'],
'ctl00$ContentData$new_approvalremark' => $data['new_approvalremark'],
'ctl00$ContentData$rptProd$ctl00$cbiserror' => '',
'ctl00$ContentData$rptProd$ctl00$txtproducenumber' => '',
'ctl00$ContentData$rptProd$ctl00$new_producttypeid' => '',
'ctl00$ContentData$rptProd$ctl00$new_producttypeidName' => '',
'ctl00$ContentData$rptProd$ctl00$new_productmodelid' => '',
'ctl00$ContentData$rptProd$ctl00$new_productmodelidName' => '',
'ctl00$ContentData$rptProd$ctl00$hidnew_productnumber' => '',
'ctl00$ContentData$rptProd$ctl00$hidnew_modelnumber' => '',
'ctl00$ContentData$rptProd$ctl00$new_goldcardno' => '',
'ctl00$ContentData$new_custname' => $data['new_custname'],
'ctl00$ContentData$new_custmobile' => $data['new_custmobile'],
'ctl00$ContentData$new_custtel' => $data['new_custtel'],
'ctl00$ContentData$new_provinceid' => $data['new_provinceid'],
'ctl00$ContentData$new_provinceidName' => $data['new_provinceidName'],
'ctl00$ContentData$new_cityid' => $data['new_cityid'],
'ctl00$ContentData$new_cityidName' => $data['new_cityidName'],
'ctl00$ContentData$new_countyid' => $data['new_countyid'],
'ctl00$ContentData$new_countyidName' => $data['new_countyidName'],
'ctl00$ContentData$new_townid' => $data['new_townid'],
'ctl00$ContentData$new_townidName' => $data['new_townidName'],
'ctl00$ContentData$new_address' => $data['new_address'],
'ctl00$ContentData$New_shipdate' => $data['new_shipdate'],
'ctl00$ContentData$hidmarket' => $data['hidmarket'],
'ctl00$ContentData$new_market' => $data['new_market'],
'ctl00$ContentData$new_broughtdate' => $data['new_broughtdate'],
'ctl00$ContentData$new_installsiteid' => $data['new_installsiteid'],
'ctl00$ContentData$new_installsiteidName' => $data['new_installsiteidName'],
'ctl00$ContentData$new_installdate' => $data['new_installdate'],
'ctl00$ContentData$new_time' => $data['new_time'],
'ctl00$ContentData$new_visittime' => $data['new_visittime'],
'ctl00$ContentData$new_actualvisittime' => $data['new_actualvisittime'],
'ctl00$ContentData$new_finishtime' => $data['new_finishtime'],
'ctl00$ContentData$new_repairapply' => $data['new_repairapply'],
'ctl00$ContentData$new_ischangepart' => $data['new_ischangepart'],
'ctl00$ContentData$new_scope' => $data['new_scope'],
'ctl00$ContentData$new_distancekm' => $data['new_distancekm'],
'ctl00$ContentData$new_investstatus' => $data['new_investstatus'],
'ctl00$ContentData$new_reliefmemo' => $data['new_reliefmemo'],
'ctl00$ContentData$new_siteremark' => $data['new_siteremark'],
'ctl00$ContentData$new_approvalstep' => $data['new_approvalstep'],
'ctl00$ContentData$rptError$ctl00$chk' => '',
'ctl00$ContentData$rptError$ctl00$new_srv_workorderproductid' => '',
'ctl00$ContentData$rptError$ctl00$New_srv_wokordererrorid' => '',
'ctl00$ContentData$rptError$ctl00$new_errormoduleid' => '',
'ctl00$ContentData$rptError$ctl00$new_errormoduleidName' => '',
'ctl00$ContentData$rptError$ctl00$new_errorgroupid' => '',
'ctl00$ContentData$rptError$ctl00$new_errorgroupidName' => '',
'ctl00$ContentData$rptError$ctl00$new_srv_errorsolutionid' => '',
'ctl00$ContentData$rptError$ctl00$new_srv_errorsolutionidName' => '',
'ctl00$ContentData$rptError$ctl00$new_befpic' => '',
'ctl00$ContentData$rptError$ctl00$file_imgbef' => '',
'ctl00$ContentData$rptError$ctl00$new_aftpic' => '',
'ctl00$ContentData$rptError$ctl00$file_imgaft' => '',
'ctl00$ContentData$rptParts$ctl00$new_srv_wokordererrorid' => '',
'ctl00$ContentData$rptParts$ctl00$new_errorpartsid' => '',
'ctl00$ContentData$rptParts$ctl00$new_errorpartsidName' => '',
'ctl00$ContentData$rptParts$ctl00$new_partsid' => '',
'ctl00$ContentData$rptParts$ctl00$new_partsidName' => '',
'ctl00$ContentData$rptParts$ctl00$new_qty' => '',
'ctl00$ContentData$new_baseamount' => $data['new_baseamount'],
'ctl00$ContentData$new_mileamount' => $data['new_mileamount'],
'ctl00$ContentData$productname' => $data['productname'],
'ctl00$ContentData$new_laxiuamount' => $data['new_laxiuamount'],
'ctl00$ContentData$new_arrivetime' => $data['new_arrivetime'],
'ctl00$ContentData$new_satisfaction_manner' => $data['new_satisfaction_manner'],
'ctl00$ContentData$new_satisfaction_quality' => $data['new_satisfaction_manner'],
'ctl00$ContentData$new_othersuggest' => $data['new_othersuggest'],
];
return $post;
$url = self::$host . '/repair/new_srv_workorderEP.aspx?mainid=&mainidname=&attrcode=&id=' . $id;
$headers = $this->Header($url);
$result = $this->CurlPost($url, $post, $headers);
$result = gzdecode($result['data']);
//替换script, 防止页面跳转
$result = str_replace('script', 'scriptt', $result);
return $result;
}
/**
* 处理安装单
* @param $id
* @param $data
* @param $type
* @return array|mixed|string
*/
private function HandelUserProfileOrder($id, $data, $type)
{
switch ($type){
case 'save':
$target = 'ctl00$ContentQuery$btnSave';
break;
case 'send':
$target = 'ctl00$ContentQuery$btnSend';
break;
}
$post = [
'__EVENTTARGET' => $target,
'__EVENTARGUMENT' => '',
'__LASTFOCUS' => '',
'__VIEWSTATE' => $data['__VIEWSTATE'],
'ctl00$hidPageSiteMapTitle' => '安装单录入—编辑页面',
'ctl00$ContentHeader$hidFormId' => $data['new_id'],
'ctl00$ContentHeader$hidproductgroupid' => $data['hidproductgroupid'],
'ctl00$ContentData$new_number' => $data['new_number'],
'ctl00$ContentData$new_srv_callinid' => $data['new_srv_callinid'],
'ctl00$ContentData$new_srv_callinidName' => $data['new_srv_callinidName'],
'ctl00$ContentData$new_name' => $data['new_name'],
'ctl00$ContentData$new_productgroupid' => $data['new_productgroupid'],
'ctl00$ContentData$new_productgroupidName' => $data['new_productgroupidName'],
'ctl00$ContentData$new_iskt' => $data['new_iskt'],
'ctl00$ContentData$new_businessunitid' => $data['new_businessunitid'],
'ctl00$ContentData$new_businessunitidName' => $data['new_businessunitidName'],
'ctl00$ContentData$zhuangtai_value' => $data['zhuangtai_value'],
'ctl00$ContentData$zhuangtai_name' => $data['zhuangtai_name'],
'ctl00$ContentData$new_uninvsestreasonName' => $data['new_uninvsestreasonName'],
'ctl00$ContentData$ddlengineeringmachine' => $data['ddlengineeringmachine'],
'ctl00$ContentData$ddlisreplacesettle' => $data['ddlisreplacesettle'],
'ctl00$ContentData$new_replace_site' => $data['new_replace_site'],
'ctl00$ContentData$ddlismissingparts' => $data['ddlismissingparts'],
'ctl00$ContentData$new_missingpartsremarks' => $data['new_missingpartsremarks'],
'ctl00$ContentData$new_unqualifiedremarks' => $data['new_unqualifiedremarks'],
'ctl00$ContentData$new_reconsidermemo' => $data['new_reconsidermemo'],
'ctl00$ContentData$new_contactname' => $data['new_contactname'],
'ctl00$ContentData$new_mobile' => $data['new_mobile'],
'ctl00$ContentData$new_telephone' => $data['new_telephone'],
'ctl00$ContentData$new_province_id' => $data['new_province_id'],
'ctl00$ContentData$new_province_idName' => $data['new_province_idName'],
'ctl00$ContentData$new_city_id' => $data['new_city_id'],
'ctl00$ContentData$new_city_idName' => $data['new_city_idName'],
'ctl00$ContentData$new_county_id' => $data['new_county_id'],
'ctl00$ContentData$new_county_idName' => $data['new_county_idName'],
'ctl00$ContentData$new_town_id' => $data['new_town_id'],
'ctl00$ContentData$new_town_idName' => $data['new_town_idName'],
'ctl00$ContentData$new_accountaddr' => $data['new_accountaddr'],
'ctl00$ContentData$new_email' => $data['new_email'],
'ctl00$ContentData$new_installsiteid' => $data['new_installsiteid'],
'ctl00$ContentData$new_installsiteidName' => $data['new_installsiteidName'],
'ctl00$ContentData$new_framecode' => $data['new_framecode'],
'ctl00$ContentData$new_broughtdate' => $data['new_broughtdate'],
'ctl00$ContentData$new_installdate' => $data['new_installdate'],
'ctl00$ContentData$new_appointmenttime' => $data['new_appointmenttime'],
'ctl00$ContentData$new_salesite' => $data['new_salesite'],
'ctl00$ContentData$new_installer' => $data['new_installer'],
'ctl00$ContentData$new_goldcard' => $data['new_goldcard'],
'ctl00$ContentData$new_remarks' => $data['new_remarks'],
'ctl00$ContentData$txtproducenumber' => $data['txtproducenumber'],
'ctl00$ContentData$new_qualityresult' => $data['new_qualityresult'],
'ctl00$ContentData$new_custadvice' => $data['new_custadvice'],
'ctl00$ContentData$ownerid' => $data['ownerid'],
'ctl00$ContentData$owneridname' => $data['owneridname'],
'ctl00$ContentData$new_unqualifiedtimes' => $data['new_unqualifiedtimes'],
'ctl00$ContentData$isamount' => $data['isamount'],
'ctl00$ContentData$ifamount' => $data['ifamount'],
];
return $post;
$url = self::$host . '/Warranty/new_srv_userprofileEP.aspx?mainid=&mainidname=&attrcode=&id=' . $id;
$headers = $this->Header($url);
$result = $this->CurlPost($url, $post, $headers);
$result = gzdecode($result['data']);
//替换script, 防止页面跳转
$result = str_replace('script', 'scriptt', $result);
return $result;
}
private function OrderFormFields()
{
return [
'__VIEWSTATE' => [
'type' => 'text',
'reg' => $this->OrderFormReg('__VIEWSTATE')
],
'new_name' => [
'type' => 'text',
'reg' => $this->OrderFormReg('new_name')
......@@ -281,19 +1009,35 @@ class SourceGalanz extends Source
'reg' => $this->OrderFormReg('new_custtel')
], //顾客电话
'new_provinceid' => [
'type' => 'text',
'reg' => $this->OrderFormReg('new_provinceid')
], //省份id
'new_provinceidName' => [
'type' => 'text',
'reg' => $this->OrderFormReg('new_provinceidName')
], //省份
'new_cityid' => [
'type' => 'text',
'reg' => $this->OrderFormReg('new_cityid')
], //城市id
'new_cityidName' => [
'type' => 'text',
'reg' => $this->OrderFormReg('new_cityidName')
], //城市
'new_countyid' => [
'type' => 'text',
'reg' => $this->OrderFormReg('new_countyid')
], //区/县id
'new_countyidname' => [
'type' => 'text',
'reg' => $this->OrderFormReg('new_countyidname')
], //区/县
'new_townid' => [
'type' => 'text',
'reg' => $this->OrderFormReg('new_townid')
], //街道/镇id
'new_townidName' => [
'type' => 'text',
'reg' => $this->OrderFormReg('new_townidName')
......@@ -315,6 +1059,10 @@ class SourceGalanz extends Source
'type' => 'text',
'reg' => $this->OrderFormReg('new_csnumber')
], //机器条码
'new_installsiteid' => [
'type' => 'text',
'reg' => $this->OrderFormReg('new_installsiteid')
], //安装网点id
'new_installsiteidname' => [
'type' => 'text',
'reg' => $this->OrderFormReg('new_installsiteidname')
......@@ -328,6 +1076,10 @@ class SourceGalanz extends Source
'type' => 'text',
'reg' => $this->OrderFormReg('new_installdate')
], //安装日期
'new_errormoduleid' => [
'type' => 'text',
'reg' => $this->OrderFormReg('new_errormoduleid')
], //故障现象
'new_errormoduleidName' => [
'type' => 'text',
'reg' => $this->OrderFormReg('new_errormoduleidName')
......@@ -378,12 +1130,12 @@ class SourceGalanz extends Source
'new_isguaranty' => [
'type' => 'select',
'reg' => $this->OrderFormReg('new_isguaranty', 'select')
], //是否保内: 1:是; 2:否;
], //是否保内: True:是; False:否;
'new_finishstatus' => [
'type' => 'select',
'reg' => $this->OrderFormReg('new_finishstatus', 'select')
], //完成状态: 1:是; 2:否;
], //完成状态: True:是; False:否;
'new_finishtime' => [
'type' => 'text',
'reg' => $this->OrderFormReg('new_finishtime')
......@@ -396,29 +1148,69 @@ class SourceGalanz extends Source
'new_complete_reason' => [
'type' => 'select',
'reg' => $this->OrderFormReg('new_complete_reason', 'select')
], //完成方式: 1:是; 2:否;
], //完成方式: 1:正常完成; 2:用户退货;
'new_sitedealremarks' => [
'type' => 'text',
'reg' => $this->OrderFormReg('new_sitedealremarks')
], //备注
'new_sentsiteid' => [
'type' => 'text',
'reg' => $this->OrderFormReg('new_sentsiteid')
], //服务人员
'new_ServicePersonnel' => [
'type' => 'text',
'reg' => $this->OrderFormReg('new_ServicePersonnel')
], //服务人员
'txtFollowmemo' => [
'type' => 'text',
'reg' => $this->OrderFormReg('txtFollowmemo')
], //跟踪内容
];
}
private function WorkOrderFormFields()
{
return [
'__VIEWSTATE' => [
'type' => 'text',
'reg' => $this->OrderFormReg('__VIEWSTATE'),
],
'hidUserId' => [
'type' => 'text',
'reg' => $this->OrderFormReg('hidUserId'),
],
'hidIsKT' => [
'type' => 'text',
'reg' => $this->OrderFormReg('hidIsKT'),
],
'hidformPosition' => [
'type' => 'text',
'reg' => $this->OrderFormReg('hidformPosition'),
],
'OwnerId' => [
'type' => 'text',
'reg' => $this->OrderFormReg('OwnerId'),
],
'dtNow' => [
'type' => 'text',
'reg' => $this->OrderFormReg('dtNow'),
],
'new_sitecode' => [
'type' => 'text',
'reg' => $this->OrderFormReg('New_sitecode'),
], //网点编码
'new_siteid' => [
'type' => 'text',
'reg' => $this->OrderFormReg('new_siteid')
],
'new_siteidName' => [
'type' => 'text',
'reg' => $this->OrderFormReg('new_siteidName')
], //网点名称
'new_srv_callinid' => [
'type' => 'text',
'reg' => $this->OrderFormReg('new_srv_callinid')
],
'new_srv_callinidName' => [
'type' => 'text',
'reg' => $this->OrderFormReg('new_srv_callinidName')
......@@ -431,10 +1223,18 @@ class SourceGalanz extends Source
'type' => 'text',
'reg' => $this->OrderFormReg('new_name')
], //凭证单号
'new_productgroupid' => [
'type' => 'text',
'reg' => $this->OrderFormReg('new_productgroupid')
],
'new_productgroupidName' => [
'type' => 'text',
'reg' => $this->OrderFormReg('new_productgroupidName')
], //产品线
'new_businessunitid' => [
'type' => 'text',
'reg' => $this->OrderFormReg('new_businessunitid')
],
'new_businessunitidName' => [
'type' => 'text',
'reg' => $this->OrderFormReg('new_businessunitidName')
......@@ -451,6 +1251,14 @@ class SourceGalanz extends Source
'type' => 'text',
'reg' => $this->OrderFormReg('new_uninvsestreasonName')
], //不合格原因
'new_reconsidermemo' => [
'type' => 'text',
'reg' => $this->OrderFormReg('new_reconsidermemo')
], //复议备注
'new_approvalremark' => [
'type' => 'text',
'reg' => $this->OrderFormReg('new_approvalremark')
], //驳回备注
'new_custname' => [
'type' => 'text',
......@@ -464,18 +1272,34 @@ class SourceGalanz extends Source
'type' => 'text',
'reg' => $this->OrderFormReg('new_custtel')
], //顾客电话
'new_provinceid' => [
'type' => 'text',
'reg' => $this->OrderFormReg('new_provinceid')
],
'new_provinceidName' => [
'type' => 'text',
'reg' => $this->OrderFormReg('new_provinceidName')
], //省份
'new_cityid' => [
'type' => 'text',
'reg' => $this->OrderFormReg('new_cityid')
],
'new_cityidName' => [
'type' => 'text',
'reg' => $this->OrderFormReg('new_cityidName')
], //城市
'new_countyid' => [
'type' => 'text',
'reg' => $this->OrderFormReg('new_countyid')
],
'new_countyidname' => [
'type' => 'text',
'reg' => $this->OrderFormReg('new_countyidname')
], //区/县
'new_townid' => [
'type' => 'text',
'reg' => $this->OrderFormReg('new_townid')
],
'new_townidName' => [
'type' => 'text',
'reg' => $this->OrderFormReg('new_townidName')
......@@ -488,6 +1312,10 @@ class SourceGalanz extends Source
'type' => 'text',
'reg' => $this->OrderFormReg('New_shipdate')
], //生产日期
'hidmarket' => [
'type' => 'text',
'reg' => $this->OrderFormReg('hidmarket')
],
'new_market' => [
'type' => 'text',
'reg' => $this->OrderFormReg('new_market')
......@@ -496,6 +1324,10 @@ class SourceGalanz extends Source
'type' => 'text',
'reg' => $this->OrderFormReg('new_broughtdate')
], //购买日期
'new_installsiteid' => [
'type' => 'text',
'reg' => $this->OrderFormReg('new_installsiteid')
],
'new_installsiteidName' => [
'type' => 'text',
'reg' => $this->OrderFormReg('new_installsiteidName')
......@@ -540,6 +1372,10 @@ class SourceGalanz extends Source
'type' => 'text',
'reg' => $this->OrderFormReg('new_distancekm')
], //上门距离
'new_investstatus' => [
'type' => 'select',
'reg' => $this->OrderFormReg('new_investstatus', 'select')
], //回访审核状态: 1:未回访; 2:回访中; 3:已回访
'new_isrelief' => [
'type' => 'checkbox',
'reg' => $this->OrderFormReg('new_isrelief', 'checkbox')
......@@ -556,6 +1392,10 @@ class SourceGalanz extends Source
'type' => 'text',
'reg' => $this->OrderFormReg('new_siteremark')
], //网点备注
'new_approvalstep' => [
'type' => 'select',
'reg' => $this->OrderFormReg('new_approvalstep', 'select')
], //1:网点; 2:担当; 3:回访; 4:部长;
'new_baseamount' => [
'type' => 'text',
'reg' => $this->OrderFormReg('new_baseamount')
......@@ -564,6 +1404,14 @@ class SourceGalanz extends Source
'type' => 'text',
'reg' => $this->OrderFormReg('new_mileamount')
], //交通费
'productname' => [
'type' => 'text',
'reg' => $this->OrderFormReg('productname')
],
'new_laxiuamount' => [
'type' => 'text',
'reg' => $this->OrderFormReg('new_laxiuamount')
],
'new_arrivetime' => [
'type' => 'text',
'reg' => $this->OrderFormReg('new_arrivetime')
......@@ -583,6 +1431,229 @@ class SourceGalanz extends Source
];
}
private function UserProfileOrderFormFields()
{
return [
'__VIEWSTATE' => [
'type' => 'text',
'reg' => $this->OrderFormReg('__VIEWSTATE')
],
'hidproductgroupid' => [
'type' => 'text',
'reg' => $this->OrderFormReg('hidproductgroupid')
],
'new_number' => [
'type' => 'text',
'reg' => $this->OrderFormReg('new_number')
], //安装单流水号
'new_srv_callinid' => [
'type' => 'text',
'reg' => $this->OrderFormReg('new_srv_callinid')
], //受理单号
'new_srv_callinidName' => [
'type' => 'text',
'reg' => $this->OrderFormReg('new_srv_callinidName')
], //受理单号
'new_isuseful' => [
'type' => 'select',
'reg' => $this->OrderFormReg('new_isuseful', 'select')
], //是否生效: 1:是; 2:否
'new_name' => [
'type' => 'text',
'reg' => $this->OrderFormReg('new_name')
], //安装卡号
'new_productgroupid' => [
'type' => 'text',
'reg' => $this->OrderFormReg('new_productgroupid')
],
'new_productgroupidName' => [
'type' => 'text',
'reg' => $this->OrderFormReg('new_productgroupidName')
], //产品线
'new_iskt' => [
'type' => 'text',
'reg' => $this->OrderFormReg('new_iskt')
],
'new_businessunitid' => [
'type' => 'text',
'reg' => $this->OrderFormReg('new_businessunitid')
],
'new_businessunitidName' => [
'type' => 'text',
'reg' => $this->OrderFormReg('new_businessunitidName')
], //服务中心
'zhuangtai_value' => [
'type' => 'text',
'reg' => $this->OrderFormReg('zhuangtai_value')
],
'zhuangtai_name' => [
'type' => 'text',
'reg' => $this->OrderFormReg('zhuangtai_name')
], //单据状态
'new_investstatus' => [
'type' => 'select',
'reg' => $this->OrderFormReg('new_investstatus', 'select')
], //回访状态: 1:未回访; 2:待回访; 3:已回访
'new_uninvsestreasonName' => [
'type' => 'text',
'reg' => $this->OrderFormReg('new_uninvsestreasonName')
],
'ddlengineeringmachine' => [
'type' => 'select',
'reg' => $this->OrderFormReg('ddlengineeringmachine', 'select')
], //是否工程机: 0:否; 1:是;
'ddlisreplacesettle' => [
'type' => 'select',
'reg' => $this->OrderFormReg('ddlisreplacesettle', 'select')
], //是否代结算: 0:否; 1:是;
'new_replace_site' => [
'type' => 'text',
'reg' => $this->OrderFormReg('new_replace_site')
], //被代结算单位
'ddlismissingparts' => [
'type' => 'select',
'reg' => $this->OrderFormReg('__VIEWSTATE', 'select')
], //是否开箱缺件: 0:否; 1:是;
'new_missingpartsremarks' => [
'type' => 'text',
'reg' => $this->OrderFormReg('new_missingpartsremarks')
], //缺件备注
'new_unqualifiedremarks' => [
'type' => 'text',
'reg' => $this->OrderFormReg('new_unqualifiedremarks')
], //驳回备注
'new_reconsidermemo' => [
'type' => 'text',
'reg' => $this->OrderFormReg('new_reconsidermemo')
], //复议备注
'new_contactname' => [
'type' => 'text',
'reg' => $this->OrderFormReg('new_contactname')
], //顾客姓名
'new_mobile' => [
'type' => 'text',
'reg' => $this->OrderFormReg('new_mobile')
], //顾客手机
'new_telephone' => [
'type' => 'text',
'reg' => $this->OrderFormReg('new_telephone')
], //顾客电话
'new_province_id' => [
'type' => 'text',
'reg' => $this->OrderFormReg('new_province_id')
], //省份id
'new_province_idName' => [
'type' => 'text',
'reg' => $this->OrderFormReg('new_province_idName')
], //省份
'new_city_id' => [
'type' => 'text',
'reg' => $this->OrderFormReg('new_city_id')
], //城市id
'new_city_idName' => [
'type' => 'text',
'reg' => $this->OrderFormReg('new_city_idName')
], //城市
'new_county_id' => [
'type' => 'text',
'reg' => $this->OrderFormReg('new_county_id')
], //区/县id
'new_county_idName' => [
'type' => 'text',
'reg' => $this->OrderFormReg('new_county_idName')
], //区/县
'new_town_id' => [
'type' => 'text',
'reg' => $this->OrderFormReg('new_town_id')
], //街道/镇id
'new_town_idName' => [
'type' => 'text',
'reg' => $this->OrderFormReg('new_town_idName')
], //街道/镇
'new_accountaddr' => [
'type' => 'text',
'reg' => $this->OrderFormReg('new_accountaddr')
],//地址
'new_email' => [
'type' => 'text',
'reg' => $this->OrderFormReg('new_email')
],//Email
'new_installsiteid' => [
'type' => 'text',
'reg' => $this->OrderFormReg('new_installsiteid')
],
'new_installsiteidName' => [
'type' => 'text',
'reg' => $this->OrderFormReg('new_installsiteidName')
],//安装网点
'new_framecode' => [
'type' => 'text',
'reg' => $this->OrderFormReg('new_framecode')
],//网点编码
'new_broughtdate' => [
'type' => 'text',
'reg' => $this->OrderFormReg('new_broughtdate')
],//购买日期
'new_installdate' => [
'type' => 'text',
'reg' => $this->OrderFormReg('new_installdate')
],//安装时间
'new_appointmenttime' => [
'type' => 'text',
'reg' => $this->OrderFormReg('new_appointmenttime')
],//预约上门时间
'new_salesite' => [
'type' => 'text',
'reg' => $this->OrderFormReg('new_salesite')
],//购买商场
'new_installer' => [
'type' => 'text',
'reg' => $this->OrderFormReg('new_installer')
],//安装人员
'new_goldcard' => [
'type' => 'text',
'reg' => $this->OrderFormReg('new_goldcard')
],//金卡号
'new_remarks' => [
'type' => 'text',
'reg' => $this->OrderFormReg('new_remarks')
],//备注
'txtproducenumber' => [
'type' => 'text',
'reg' => $this->OrderFormReg('txtproducenumber')
],
'new_qualityresult' => [
'type' => 'select',
'reg' => $this->OrderFormReg('new_qualityresult', 'select')
],//质量评价: 1:满意; 2:不满意; 3:不表态; 4:很满意;
'new_custadvice' => [
'type' => 'text',
'reg' => $this->OrderFormReg('new_custadvice')
],//顾客意见
'ownerid' => [
'type' => 'text',
'reg' => $this->OrderFormReg('ownerid')
],
'owneridname' => [
'type' => 'text',
'reg' => $this->OrderFormReg('owneridname')
],//负责人
'new_unqualifiedtimes' => [
'type' => 'text',
'reg' => $this->OrderFormReg('new_unqualifiedtimes')
],
'isamount' => [
'type' => 'text',
'reg' => $this->OrderFormReg('isamount')
],//安装费
'ifamount' => [
'type' => 'text',
'reg' => $this->OrderFormReg('ifamount')
],//信息费
];
}
/**
* 匹配订单值
* @param $html
......@@ -592,19 +1663,22 @@ class SourceGalanz extends Source
*/
private function OrderFormValue($html, $reg, $type='text')
{
preg_match("/$reg/", $html, $val);
switch ($type) {
case 'select':
preg_match("/$reg/", $html, $val);
$result = isset($val[1]) ? $val[1] : '';
break;
case 'checkbox':
preg_match("/$reg/", $html, $val);
$result = isset($val[1]) && $val[1]=='checked' ? 1 : 0;
break;
case 'span':
$result = isset($val[1]) ? $val[1] : '';
break;
default:
preg_match("/$reg/", $html, $val);
$result = isset($val[1]) ? $val[1] : '';
}
......@@ -630,6 +1704,10 @@ class SourceGalanz extends Source
$result = 'id="'. $id .'"[^>]+checked="([^"]*)"';
break;
case 'span':
$result = 'id="'. $id .'"[^>]*>([^<]*)<\/span>';
break;
default:
$result = 'id="'. $id .'"[^>]+value="([^"]*)"';
}
......@@ -637,6 +1715,31 @@ class SourceGalanz extends Source
return $result;
}
/**
* 处理表格td
* @param $tr
* @return mixed
*/
private function TableTdPreg($tr)
{
preg_match_all('/<td[^>]*>[\s\S]+?<\/td>/', $tr, $td);
foreach ($td[0] as $kk => $vv) {
if (stripos($vv, '<input') !== false) {
preg_match('/value="([^"]+)"/', $vv, $temp);
$vv = isset($temp[1]) ? $temp[1] : '';
} else {
$vv = preg_replace('/<[^>]+>/', '', $vv);
$vv = trim($vv);
}
$td[0][$kk] = $vv;
}
return $td[0];
}
public function Header($referer)
{
$header = [
......
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