From a3f6c368d437eb20fbacd415b78b33ee1377feab Mon Sep 17 00:00:00 2001 From: lyt Date: Mon, 17 Jun 2019 09:52:44 +0800 Subject: [PATCH 01/13] =?UTF-8?q?=E4=BB=8E=E6=9C=AA=E5=BD=95=E5=85=A5?= =?UTF-8?q?=E7=9A=84=E5=BC=80=E5=A7=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- webht/third_party/vendorPlanSync/models/Group_model.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/webht/third_party/vendorPlanSync/models/Group_model.php b/webht/third_party/vendorPlanSync/models/Group_model.php index f3e90d02..629eb3ce 100644 --- a/webht/third_party/vendorPlanSync/models/Group_model.php +++ b/webht/third_party/vendorPlanSync/models/Group_model.php @@ -26,6 +26,8 @@ class Group_model extends CI_Model { AND VAS_IsSendSucceed=1 AND isnull(VAS_IsReceive,0)=0 -- AND EOI_GetDate between '$start_date' AND '$end_date' AND EOI_GetDate > CONVERT(date, GETDATE()) + -- 上线初期避免已录入的重复 + AND VAS_SN >=1688036 AND isnull(VAS_IsConfirm,0)=0 AND isnull(VAS_SendVary,0)=0 "; $sql .= " order by EOI_GetDate asc,vas.VAS_SendTime asc, vas.VAS_IsConfirm asc"; From 30f57c8942b405a83a782e382a69dc2d9412dc49 Mon Sep 17 00:00:00 2001 From: lyt Date: Mon, 17 Jun 2019 11:43:03 +0800 Subject: [PATCH 02/13] fixed Notice --- webht/third_party/vendorPlanSync/libraries/Tulanduo.php | 2 +- webht/third_party/vendorPlanSync/models/Group_model.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/webht/third_party/vendorPlanSync/libraries/Tulanduo.php b/webht/third_party/vendorPlanSync/libraries/Tulanduo.php index 52bc8a4c..0f04a6b0 100644 --- a/webht/third_party/vendorPlanSync/libraries/Tulanduo.php +++ b/webht/third_party/vendorPlanSync/libraries/Tulanduo.php @@ -306,7 +306,7 @@ class Tulanduo * ) * ) */ - public function tour_apart($all_pag_info, $need_complete=false) + public function tour_apart($all_pag_info) { $apart = array(); $ret = array(); foreach ($all_pag_info as $key => $pag) { diff --git a/webht/third_party/vendorPlanSync/models/Group_model.php b/webht/third_party/vendorPlanSync/models/Group_model.php index 629eb3ce..8c63ee14 100644 --- a/webht/third_party/vendorPlanSync/models/Group_model.php +++ b/webht/third_party/vendorPlanSync/models/Group_model.php @@ -96,7 +96,7 @@ class Group_model extends CI_Model { $vgrd->ACI_PersonNum = intval($vaci->ACI_PersonNum); $vgrd->ACI_ChildNum = intval($vaci->ACI_ChildNum); $vgrd->ACI_BabyNum = intval($vaci->ACI_BabyNum); - $vgrd->PAG_DEI_SN = $vaci->PAG_DEI_SN; + $vgrd->PAG_DEI_SN = $vaci->PAG_DEI_SN ? $vaci->PAG_DEI_SN : 0; if ( strval($vaci->ACI_ServiceType)==='D') { $vgrd->PAG_Code = mb_strtoupper($vaci->PAG_Code); $vgrd->PAG_ExtendType = mb_strtoupper($vaci->PAG_ExtendType); From cd4a2535511a0888db74a3769ab03f658a897534 Mon Sep 17 00:00:00 2001 From: lyt Date: Mon, 17 Jun 2019 11:51:38 +0800 Subject: [PATCH 03/13] =?UTF-8?q?=E5=85=81=E8=AE=B8=E5=8F=91=E9=80=81?= =?UTF-8?q?=E6=8C=87=E5=AE=9A=E5=9B=A2=E6=8C=87=E5=AE=9A=E5=9C=B0=E6=8E=A5?= =?UTF-8?q?=E7=A4=BE=E7=9A=84=E8=AE=A1=E5=88=92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- webht/third_party/vendorPlanSync/controllers/index.php | 4 ++-- webht/third_party/vendorPlanSync/libraries/Tulanduo.php | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/webht/third_party/vendorPlanSync/controllers/index.php b/webht/third_party/vendorPlanSync/controllers/index.php index 2506ad81..0feb4228 100644 --- a/webht/third_party/vendorPlanSync/controllers/index.php +++ b/webht/third_party/vendorPlanSync/controllers/index.php @@ -24,9 +24,9 @@ class Index extends CI_Controller { * * 使用供应商平台登陆账号获取接口的key */ - public function index($GRI_SN=0) + public function index($GRI_SN=0, $vendor=null) { - $auto_vendor_str = implode(",", $this->vendor->auto_vendor); + $auto_vendor_str = $vendor===null ? implode(",", $this->vendor->auto_vendor) : $vendor; return $this->push($GRI_SN, $auto_vendor_str); } diff --git a/webht/third_party/vendorPlanSync/libraries/Tulanduo.php b/webht/third_party/vendorPlanSync/libraries/Tulanduo.php index 0f04a6b0..fe2d8703 100644 --- a/webht/third_party/vendorPlanSync/libraries/Tulanduo.php +++ b/webht/third_party/vendorPlanSync/libraries/Tulanduo.php @@ -128,7 +128,6 @@ class Tulanduo $grd_apart_info = $this->tour_apart($grd_info); $big_order_index = 0; $expect_order_cnt = count($grd_apart_info['com'])+intval(!empty($grd_apart_info['big_pvt']))+intval(!empty($grd_apart_info['pvt'])); -// echo json_encode($grd_info);exit; foreach ($grd_apart_info as $group_key => $grd_a) { $big_order_index = $this->tour_apart_order_exec($group_key, $vas, $request_info, $guestlist, $grd_a, $big_order_index); } From 84ee424dd31dfb1961f67b561fb31741ddc7c3ef Mon Sep 17 00:00:00 2001 From: lyt Date: Mon, 17 Jun 2019 12:39:41 +0800 Subject: [PATCH 04/13] =?UTF-8?q?fixed=E6=97=A0=E8=A1=8C=E7=A8=8B=E7=9A=84?= =?UTF-8?q?=E6=97=A5=E6=9C=9F=E5=AF=BC=E8=87=B4=E6=95=B0=E6=8D=AE=E4=B8=8D?= =?UTF-8?q?=E5=85=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- webht/third_party/vendorPlanSync/libraries/Tulanduo.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/webht/third_party/vendorPlanSync/libraries/Tulanduo.php b/webht/third_party/vendorPlanSync/libraries/Tulanduo.php index fe2d8703..e3176bfb 100644 --- a/webht/third_party/vendorPlanSync/libraries/Tulanduo.php +++ b/webht/third_party/vendorPlanSync/libraries/Tulanduo.php @@ -309,6 +309,10 @@ class Tulanduo { $apart = array(); $ret = array(); foreach ($all_pag_info as $key => $pag) { + if ( ! isset($pag->PAG_DEI_SN)) { + // 通宵火车或其他, 不含该社行程 + continue; + } // CH下的产品编号修正 if (intval($pag->PAG_DEI_SN)===1 && ! empty($pag->PAG_Code)) { $pag->PAG_Code = $this->ci->trippest->ch_code_transfer( mb_strtoupper($pag->PAG_Code)); From ad8c957db9500dae5e3481af286c161fc01073da Mon Sep 17 00:00:00 2001 From: lyt Date: Mon, 17 Jun 2019 15:49:20 +0800 Subject: [PATCH 05/13] =?UTF-8?q?=E8=AE=A1=E5=88=92=E5=8F=91=E9=80=81:fixe?= =?UTF-8?q?d=E7=81=AB=E8=BD=A6=E7=A5=A8=E8=AE=A2=E5=8D=95=E6=B2=A1?= =?UTF-8?q?=E6=9C=89=E7=A6=BB=E5=9B=A2=E6=97=A5=E6=9C=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- webht/third_party/vendorPlanSync/libraries/Tulanduo.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/webht/third_party/vendorPlanSync/libraries/Tulanduo.php b/webht/third_party/vendorPlanSync/libraries/Tulanduo.php index e3176bfb..d02759bf 100644 --- a/webht/third_party/vendorPlanSync/libraries/Tulanduo.php +++ b/webht/third_party/vendorPlanSync/libraries/Tulanduo.php @@ -411,6 +411,7 @@ class Tulanduo $agcOrderNo = $vas->GRI_Name; $last_date = count($train_order)-1; $end_date = strstr($train_order[$last_date]->COLD_EndDate, " ", true); + $end_date = $end_date ? $end_date : strstr($train_order[0]->COLD_StartDate, " ", true); $this->ci->tldOrderBuilder->setUserId($userId) ->setKey($userKey) ->setOrderType($order_type) @@ -457,6 +458,7 @@ class Tulanduo $s_index++; } $this->ci->tldOrderBuilder->clearModifyLogInfo(); + // echo $this->ci->tldOrderBuilder->getBizContent();exit; $resp = $this->excute_curl($this->neworder_url, $this->ci->tldOrderBuilder); $response = json_decode($resp); $sync_orderstate = 10; From daee15dc6a1c79649e70a95b6f80eb3803aa328d Mon Sep 17 00:00:00 2001 From: lyt Date: Mon, 17 Jun 2019 23:22:30 +0800 Subject: [PATCH 06/13] =?UTF-8?q?=E5=9C=B0=E6=8E=A5=E8=AE=A1=E5=88=92:?= =?UTF-8?q?=E6=8E=92=E9=99=A4=E5=B7=B2=E5=8F=91=E9=80=81=E7=9A=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- webht/third_party/vendorPlanSync/libraries/Tulanduo.php | 1 - webht/third_party/vendorPlanSync/models/Group_model.php | 5 ++++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/webht/third_party/vendorPlanSync/libraries/Tulanduo.php b/webht/third_party/vendorPlanSync/libraries/Tulanduo.php index d02759bf..ec31d702 100644 --- a/webht/third_party/vendorPlanSync/libraries/Tulanduo.php +++ b/webht/third_party/vendorPlanSync/libraries/Tulanduo.php @@ -484,7 +484,6 @@ class Tulanduo /** VendorArrangeState VAS_IsReceive */ $this->ci->Group_model->set_plan_received($vas_sn); } - echo ($this->ci->tldOrderBuilder->getBizContent()); } if ( ! empty($pag_coldsn_arr)) { $this->biz_pag_order_exec($vas,$grd_info); diff --git a/webht/third_party/vendorPlanSync/models/Group_model.php b/webht/third_party/vendorPlanSync/models/Group_model.php index 8c63ee14..1baa4bce 100644 --- a/webht/third_party/vendorPlanSync/models/Group_model.php +++ b/webht/third_party/vendorPlanSync/models/Group_model.php @@ -29,6 +29,9 @@ class Group_model extends CI_Model { -- 上线初期避免已录入的重复 AND VAS_SN >=1688036 AND isnull(VAS_IsConfirm,0)=0 AND isnull(VAS_SendVary,0)=0 + and not exists ( + select 1 from VendorPlanSendout where VPS_VAS_SN=VAS_SN + ) "; $sql .= " order by EOI_GetDate asc,vas.VAS_SendTime asc, vas.VAS_IsConfirm asc"; return $this->HT->query($sql)->result(); @@ -121,7 +124,7 @@ class Group_model extends CI_Model { $vgrd->ACI_BabyNum = intval($vcold->COLD_BabyNum); $vgrd->PAG_DEI_SN = $vcold->PAG_DEI_SN; $vgrd->PAG_sub_sn = intval($vcold->COLD_ServiceSN2); - $vgrd->vendor_memo = trim($vcold->COLD_VendorMemo); + $vgrd->vendor_memo = trim($vcold->COLD_vendorMemo); if ( strval($vcold->COLD_ServiceType)==='D') { $vgrd->PAG_Code = mb_strtoupper($vcold->PAG_Code); $vgrd->PAG_ExtendType = mb_strtoupper($vcold->PAG_ExtendType); From 5e0d9dab8f2c00afdc5ed744b88b858d89901f26 Mon Sep 17 00:00:00 2001 From: lyt Date: Tue, 18 Jun 2019 09:31:23 +0800 Subject: [PATCH 07/13] =?UTF-8?q?=E5=9C=B0=E6=8E=A5=E8=AE=A1=E5=88=92:?= =?UTF-8?q?=E5=95=86=E5=8A=A1=E8=AE=A2=E5=8D=95=E8=AE=A1=E5=88=92=E6=9B=B4?= =?UTF-8?q?=E6=96=B0=E5=8F=91=E9=80=81=E7=8A=B6=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- webht/third_party/vendorPlanSync/libraries/Tulanduo.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/webht/third_party/vendorPlanSync/libraries/Tulanduo.php b/webht/third_party/vendorPlanSync/libraries/Tulanduo.php index ec31d702..accca6fe 100644 --- a/webht/third_party/vendorPlanSync/libraries/Tulanduo.php +++ b/webht/third_party/vendorPlanSync/libraries/Tulanduo.php @@ -563,9 +563,14 @@ class Tulanduo // echo json_encode($grd_apart_info);exit; $request_info = $this->ci->Group_model->get_plan_request($vas->GRI_SN); $big_order_index = 0; + $expect_order_cnt = count($grd_apart_info['com'])+intval(!empty($grd_apart_info['big_pvt']))+intval(!empty($grd_apart_info['pvt'])); foreach ($grd_apart_info as $group_key => $grd_part) { $big_order_index = $this->tour_apart_order_exec($group_key, $vas, $request_info, null, $grd_part, $big_order_index); } + if ($big_order_index === $expect_order_cnt) { + /** VendorArrangeState VAS_IsReceive */ + $this->ci->Group_model->set_plan_received($vas->VAS_SN); + } } /*! From 403e626b20193712159d20988e5f7446ebfc9799 Mon Sep 17 00:00:00 2001 From: lyt Date: Tue, 18 Jun 2019 10:22:10 +0800 Subject: [PATCH 08/13] =?UTF-8?q?=E5=9C=B0=E6=8E=A5=E8=AE=A1=E5=88=92:Trip?= =?UTF-8?q?pest=E8=AE=A1=E5=88=92=E9=A2=84=E8=AE=A2=E4=BA=86=E5=A4=9A?= =?UTF-8?q?=E5=9C=B0=E9=A1=B9=E7=9B=AE=E5=AF=BC=E8=87=B4=E9=87=8D=E5=A4=8D?= =?UTF-8?q?=E5=8F=91=E9=80=81=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- webht/third_party/vendorPlanSync/libraries/Tulanduo.php | 2 +- webht/third_party/vendorPlanSync/models/Group_model.php | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/webht/third_party/vendorPlanSync/libraries/Tulanduo.php b/webht/third_party/vendorPlanSync/libraries/Tulanduo.php index accca6fe..c7338520 100644 --- a/webht/third_party/vendorPlanSync/libraries/Tulanduo.php +++ b/webht/third_party/vendorPlanSync/libraries/Tulanduo.php @@ -902,7 +902,7 @@ class Tulanduo $this->ci->BIZ_order->insert_biz_order_log($coli_sn, "vendorPlanUpdateSendout_" . $tour_code); } /** VendorArrangeState VAS_IsReceive */ - $this->ci->Group_model->set_plan_received($vas_sn); + $this->ci->Group_model->set_plan_received($vas_sn, $gri_sn); } } return "[Tulanduo>push_trippest] Done. " . $COLI_ID; diff --git a/webht/third_party/vendorPlanSync/models/Group_model.php b/webht/third_party/vendorPlanSync/models/Group_model.php index 1baa4bce..d3d0b41a 100644 --- a/webht/third_party/vendorPlanSync/models/Group_model.php +++ b/webht/third_party/vendorPlanSync/models/Group_model.php @@ -296,10 +296,13 @@ class Group_model extends CI_Model { return $eva_g_sn; } - public function set_plan_received($vas_sn=0) + public function set_plan_received($vas_sn=0, $gri_sn=null) { - $sql = "UPDATE VendorArrangeState set VAS_IsReceive=1,VAS_ReceiveTime=GETDATE() where VAS_SN=? "; - return $this->HT->query($sql, array($vas_sn)); + $sql = "UPDATE VendorArrangeState set VAS_IsReceive=1,VAS_ReceiveTime=GETDATE() where VAS_SN=$vas_sn "; + if ($gri_sn !== null) { + $sql = "UPDATE VendorArrangeState set VAS_IsReceive=1,VAS_ReceiveTime=GETDATE() where VAS_GRI_SN=$gri_sn "; + } + return $this->HT->query($sql); } /*! From 77cf193cb8a10b22c123f4a40245e4b9d0dc73d2 Mon Sep 17 00:00:00 2001 From: lyt Date: Wed, 19 Jun 2019 16:18:15 +0800 Subject: [PATCH 09/13] =?UTF-8?q?=E5=9C=B0=E6=8E=A5=E8=AE=A1=E5=88=92:?= =?UTF-8?q?=E5=BE=85=E5=8F=91=E9=80=81:=E6=89=80=E6=9C=89=E6=9C=AA?= =?UTF-8?q?=E5=8F=91=E5=9B=A2=E7=9A=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- webht/third_party/vendorPlanSync/models/Group_model.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/webht/third_party/vendorPlanSync/models/Group_model.php b/webht/third_party/vendorPlanSync/models/Group_model.php index d3d0b41a..1f8da255 100644 --- a/webht/third_party/vendorPlanSync/models/Group_model.php +++ b/webht/third_party/vendorPlanSync/models/Group_model.php @@ -26,8 +26,6 @@ class Group_model extends CI_Model { AND VAS_IsSendSucceed=1 AND isnull(VAS_IsReceive,0)=0 -- AND EOI_GetDate between '$start_date' AND '$end_date' AND EOI_GetDate > CONVERT(date, GETDATE()) - -- 上线初期避免已录入的重复 - AND VAS_SN >=1688036 AND isnull(VAS_IsConfirm,0)=0 AND isnull(VAS_SendVary,0)=0 and not exists ( select 1 from VendorPlanSendout where VPS_VAS_SN=VAS_SN From 492438c8d26a9ea69d05fdc8580e3be43cbc2976 Mon Sep 17 00:00:00 2001 From: lyt Date: Fri, 21 Jun 2019 17:29:09 +0800 Subject: [PATCH 10/13] =?UTF-8?q?=E5=9C=B0=E6=8E=A5=E8=AE=A1=E5=88=92:?= =?UTF-8?q?=E5=8F=91=E9=80=81=E5=9C=A8=E7=AD=89=E5=BE=85=E7=AC=AC=E4=B8=80?= =?UTF-8?q?=E6=AC=A1=E5=8F=91=E9=80=81=E6=97=B6=E5=B0=B1=E6=9C=89=E5=8F=98?= =?UTF-8?q?=E6=9B=B4=E7=9A=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- webht/third_party/vendorPlanSync/models/Group_model.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/webht/third_party/vendorPlanSync/models/Group_model.php b/webht/third_party/vendorPlanSync/models/Group_model.php index 1f8da255..531663e5 100644 --- a/webht/third_party/vendorPlanSync/models/Group_model.php +++ b/webht/third_party/vendorPlanSync/models/Group_model.php @@ -26,7 +26,7 @@ class Group_model extends CI_Model { AND VAS_IsSendSucceed=1 AND isnull(VAS_IsReceive,0)=0 -- AND EOI_GetDate between '$start_date' AND '$end_date' AND EOI_GetDate > CONVERT(date, GETDATE()) - AND isnull(VAS_IsConfirm,0)=0 AND isnull(VAS_SendVary,0)=0 + AND isnull(VAS_IsConfirm,0)=0 AND VAS_ConfirmSN IS NULL and not exists ( select 1 from VendorPlanSendout where VPS_VAS_SN=VAS_SN ) From a54d4370bfb29c9be8314629c396b98dc424612d Mon Sep 17 00:00:00 2001 From: lyt Date: Mon, 24 Jun 2019 13:52:20 +0800 Subject: [PATCH 11/13] =?UTF-8?q?=E5=9C=B0=E6=8E=A5=E8=AE=A1=E5=88=92:fixe?= =?UTF-8?q?d=20=E9=A6=96=E7=AB=99=E5=9F=8E=E5=B8=82=E5=9C=A8=E9=80=9A?= =?UTF-8?q?=E5=AE=B5=E7=81=AB=E8=BD=A6=E6=88=96=E6=8E=A5=E6=9C=BA=E6=97=B6?= =?UTF-8?q?=E4=B8=BA=E7=A9=BA=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../vendorPlanSync/libraries/Tulanduo.php | 15 +++++++++++---- .../vendorPlanSync/models/Group_model.php | 11 +++++++++++ 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/webht/third_party/vendorPlanSync/libraries/Tulanduo.php b/webht/third_party/vendorPlanSync/libraries/Tulanduo.php index c7338520..43d75ab8 100644 --- a/webht/third_party/vendorPlanSync/libraries/Tulanduo.php +++ b/webht/third_party/vendorPlanSync/libraries/Tulanduo.php @@ -150,11 +150,18 @@ class Tulanduo } $userId = $this->send_host["1"]["userId"]; $userKey = $this->send_host["1"]["key"]; + $destination = $grd['details'][0]->tocity; + $destination_code = $grd['details'][0]->citycode; + if (empty($destination)) { + $vendor_city = $this->Group_model->get_vendor_city($vas->VAS_VEI_SN); + $destination = $vendor_city->cityname; + $destination_code = $vendor_city->citycode; + } switch ($group_type) { case 'big_pvt': $total_order_index ++; $all_grd = array($grd); - $routeName = "中华游" . $grd['details'][0]->tocity . "常规线路"; + $routeName = "中华游" . $destination . "常规线路"; $routeType = $routeName; $agcOrderNo = $vas->GRI_Name; // $agcOrderNo .= "(" . $vas->operator . ")"; @@ -165,7 +172,7 @@ class Tulanduo $all_grd = array($grd); $routeName = empty($grd['details'][0]->GRD_Landscape) ? $grd['details'][0]->PAG_Title : $grd['details'][0]->GRD_Landscape; $routeName .= "(" . $grd['details'][0]->PAG_Code . ")"; - $routeType = $grd['details'][0]->tocity . "目的地线路"; + $routeType = $destination . "目的地线路"; $agcOrderNo = $vas->GRI_Name; // $agcOrderNo .= "(" . $vas->operator . ")"; $order_type = 1; @@ -183,7 +190,7 @@ class Tulanduo if (empty($routeName)) { $routeName = $vo['details'][0]->GRD_Landscape . "(" . $vo['details'][0]->PAG_Code . ")"; } - $routeType = $vo['details'][0]->tocity . "目的地线路"; + $routeType = $destination . "目的地线路"; $agcOrderNo = $vas->GRI_Name; // $agcOrderNo .= "(" . $vas->operator . ")"; } @@ -199,7 +206,7 @@ class Tulanduo ->setAgcOrderNo($agcOrderNo) ->setAdultNum(intval($vo['details'][0]->ACI_PersonNum)) ->setChildNum(intval(bcadd($vo['details'][0]->ACI_ChildNum, $vo['details'][0]->ACI_BabyNum))) - ->setDestination($vo['details'][0]->tocity) + ->setDestination($destination) ->setTravelDate($first_date) ->setLeavedDate($end_date) // ->setOrderRemark($order_remark) // 订单备注 TODO: diff --git a/webht/third_party/vendorPlanSync/models/Group_model.php b/webht/third_party/vendorPlanSync/models/Group_model.php index 531663e5..80a98169 100644 --- a/webht/third_party/vendorPlanSync/models/Group_model.php +++ b/webht/third_party/vendorPlanSync/models/Group_model.php @@ -364,6 +364,17 @@ class Group_model extends CI_Model { return $query; } + public function get_vendor_city($vei_sn) + { + $sql = "SELECT + CII_PKCode citycode,CII2_Name cityname + from VEndorInfo + inner join CItyInfo on CII_SN=VEI_CII_Name + inner join CItyInfo2 on CII2_CII_SN=VEI_CII_Name and CII2_LGC=2 + where VEI_SN=? "; + return $this->HT->query($sql, array($vei_sn))->row(); + } + } /* End of file Group_model.php */ From 4baf1b8808426f3ddc4588be043df58444b5c63a Mon Sep 17 00:00:00 2001 From: lyt Date: Tue, 25 Jun 2019 10:52:36 +0800 Subject: [PATCH 12/13] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=AE=A2=E6=BA=90?= =?UTF-8?q?=E5=9C=B0;=E5=A2=9E=E5=8A=A0=E5=AE=A2=E4=BA=BA=E6=89=8B?= =?UTF-8?q?=E6=9C=BA=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../vendorPlanSync/libraries/Tulanduo.php | 43 ++++++++++++++----- .../models/BIZ_orders_model.php | 26 +++++++++++ ...uo_addOrUpdateRouteOrderContentBuilder.php | 10 +++++ 3 files changed, 69 insertions(+), 10 deletions(-) diff --git a/webht/third_party/vendorPlanSync/libraries/Tulanduo.php b/webht/third_party/vendorPlanSync/libraries/Tulanduo.php index 43d75ab8..2945d33c 100644 --- a/webht/third_party/vendorPlanSync/libraries/Tulanduo.php +++ b/webht/third_party/vendorPlanSync/libraries/Tulanduo.php @@ -213,17 +213,28 @@ class Tulanduo // ->setRoomStandard($request_info->GCI_HotelRequest) // 住房标准 ->setRouteStandard($request_info->GCI_Request) // 行程服务标准 ; + $from_country = ""; // 客源地 if ($guestlist===null) { $g_cold_str = array_map(function ($ele){return $ele->GRD_COLD_SN;}, $vo['details']); $guestlist = $this->ci->BIZ_order->get_guestlist(implode(',',$g_cold_str)); + $from_country = current(array_filter(array_map(function ($ele){return $ele->Country;},$guestlist))); + if (strval($from_country)==='') { + $biz_contact = $this->ci->BIZ_order->get_customer_contact(implode(',',$g_cold_str)); + $from_country = $biz_contact->Country; + } } foreach ($guestlist as $key => $vg) { $this->ci->tldOrderBuilder->setCustomersName($key, $vg->MemberName ) ->setCustomersPeopleType($key, (calc_age_type($vg->BirthDay)==1 ? "成人" : "儿童")) ->setCustomersDocumentType($key, "护照") // Passport No. ->setCustomersDocumentNo($key, $vg->PassportNo) - ->setCustomersOtherInfo($key, $vg->Country . "; " . $vg->phone); + ->setCustomersPhoneNo($key, $vg->phone); + if (strval($vg->Country) !== '' && strval($from_country) === '') { + $from_country = $vg->Country; + } } + // 客源地 + $this->ci->tldOrderBuilder->setCustomerFromCity($from_country); // 补全空的日期,行程为空 $date1 = new DateTime($first_date); $date_end = new DateTime($end_date); @@ -433,14 +444,18 @@ class Tulanduo ; $train_guest_list = $this->ci->BIZ_order->get_guestlist(implode(',', $train_coldsn_arr)); // 客人列表 + $from_country = ""; // 客源地 foreach ($train_guest_list as $key => $vg) { - $this_otherinfo = ""; - $this->ci->tldOrderBuilder->setCustomersName($key, $vg->BPE_FirstName . " " . $vg->BPE_LastName ) + // $this_otherinfo = ""; + $this->ci->tldOrderBuilder->setCustomersName($key, $vg->MemberName ) ->setCustomersPeopleType($key, ($vg->BPE_GuestType==1 ? "成人" : "儿童")) ->setCustomersDocumentType($key, "护照") // Passport No. - ->setCustomersDocumentNo($key, $vg->BPE_Passport) + ->setCustomersDocumentNo($key, $vg->PassportNo) ; - $this_otherinfo .= $this->ci->BIZ_order->GetNationalityName($vg->BPE_Nationality); + if (strval($vg->Country) !== '' && strval($from_country) === '') { + $from_country = $vg->Country; + } + // $this_otherinfo .= $this->ci->BIZ_order->GetNationalityName($vg->BPE_Nationality); // todo:电话 // if (trim($vf['cold'][0]->GUT_TEL) != "" && $key===0) { // $this_otherinfo .= "; 电话:"; @@ -449,6 +464,7 @@ class Tulanduo // $this->ci->tldOrderBuilder->setCustomersOtherInfo($key, $this_otherinfo); // } } + $this->ci->tldOrderBuilder->setCustomerFromCity($from_country); $s_index = 0; foreach ($train_order as $train) { $this_content = ''; @@ -711,21 +727,28 @@ class Tulanduo // ->setBackTraffic($backTraffic) ; // 客人列表 + $from_country = ''; foreach ($guestlist as $key => $vg) { $this_otherinfo = ""; - $this->ci->tldOrderBuilder->setCustomersName($key, $vg->BPE_FirstName . " " . $vg->BPE_LastName ) + $this->ci->tldOrderBuilder->setCustomersName($key, $vg->MemberName ) ->setCustomersPeopleType($key, ($vg->BPE_GuestType==1 ? "成人" : "儿童")) ->setCustomersDocumentType($key, "护照") // Passport No. - ->setCustomersDocumentNo($key, $vg->BPE_Passport) + ->setCustomersDocumentNo($key, $vg->PassportNo) ; - $this_otherinfo .= $this->ci->BIZ_order->GetNationalityName($vg->BPE_Nationality); if (trim($vf['cold'][0]->GUT_TEL) != "" && $key===0) { - $this_otherinfo .= "; 电话:"; $this_otherinfo .= trim($vf["cold"][0]->GUT_POST)!=="" ? "+".trim($vf["cold"][0]->GUT_POST) : "" ; $this_otherinfo .= " " . trim($vf["cold"][0]->GUT_TEL); - $this->ci->tldOrderBuilder->setCustomersOtherInfo($key, $this_otherinfo); + $this->ci->tldOrderBuilder->setCustomersPhoneNo($key, $this_otherinfo); } + if (strval($from_country) === '' && strval($vg->Country) !== '') { + $from_country = $vg->Country; + } + } + if (strval($from_country)==='') { + $biz_contact = $this->ci->BIZ_order->get_customer_contact($COLD_SN_str); + $from_country = $biz_contact->Country; } + $this->ci->tldOrderBuilder->setCustomerFromCity($from_country); $scheduleDetails = $this->ci->BIZ_order->get_scheduleDetails($COLD_SN_str); $schedule_obj = array(); foreach ($scheduleDetails as $ks => $vs) { diff --git a/webht/third_party/vendorPlanSync/models/BIZ_orders_model.php b/webht/third_party/vendorPlanSync/models/BIZ_orders_model.php index 0b9312da..5132d35f 100644 --- a/webht/third_party/vendorPlanSync/models/BIZ_orders_model.php +++ b/webht/third_party/vendorPlanSync/models/BIZ_orders_model.php @@ -385,4 +385,30 @@ return ; where p.PAGS_SN=$PAGS_SN "; return $this->HT->query($sql)->row(); } + + /*! + * @Author: LYT + * @Date: 2019-06-25 10:12:52 + * @Desc: 商务订单联系人信息 + */ + public function get_customer_contact($COLD_SN_str) + { + $sql = "SELECT + GUT_FirstName + ' '+GUT_LastName as MemberName, + '' as BirthDay, + '' as Gender, + GUT_MoveTel as phone, + (select COI2_Country from V_Country_Info + where LGC_LGC = 2 + and COI_SN = GUT_NationalityID + ) as Country, + GUT_Passport as PassportNo, + '' as PassportValidDate + --,BIZ_GUEST.* + from BIZ_GUEST + inner join BIZ_ConfirmLineInfo on COLI_GUT_SN=GUT_SN + inner join BIZ_ConfirmLineDetail on COLI_SN=COLD_COLI_SN + where COLD_SN IN ($COLD_SN_str) "; + return $this->HT->query($sql)->row(); + } } diff --git a/webht/third_party/vendorPlanSync/models/TuLanDuo_addOrUpdateRouteOrderContentBuilder.php b/webht/third_party/vendorPlanSync/models/TuLanDuo_addOrUpdateRouteOrderContentBuilder.php index bf27da86..04d57bb4 100644 --- a/webht/third_party/vendorPlanSync/models/TuLanDuo_addOrUpdateRouteOrderContentBuilder.php +++ b/webht/third_party/vendorPlanSync/models/TuLanDuo_addOrUpdateRouteOrderContentBuilder.php @@ -146,6 +146,16 @@ class TuLanDuo_addOrUpdateRouteOrderContentBuilder extends CI_Model $this->orderData['leavedDate'] = $leavedDate; return $this; } + public function setOperationUserName($operationUserName) + { + $this->orderData['operationUserName'] = $operationUserName; + return $this; + } + public function setCustomerFromCity($customerFromCity) + { + $this->orderData['customerFromCity'] = $customerFromCity; + return $this; + } /** 团款数组 */ public function setTravelFeesType($index, $type) From 524f2d375371e52441abd8e4489db997d6627372 Mon Sep 17 00:00:00 2001 From: lyt Date: Tue, 25 Jun 2019 15:08:29 +0800 Subject: [PATCH 13/13] =?UTF-8?q?=E5=9C=B0=E6=8E=A5=E8=AE=A1=E5=88=92:?= =?UTF-8?q?=E8=AE=A2=E7=A5=A8=E4=B8=9A=E5=8A=A1=E5=90=8D=E7=A7=B0=E4=BF=AE?= =?UTF-8?q?=E6=94=B9;=E4=BC=A0=E7=BB=9F=E5=9B=A2=E5=AF=BC=E6=B8=B8?= =?UTF-8?q?=E5=A4=87=E6=B3=A8=E7=94=9F=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../vendorPlanSync/libraries/Tulanduo.php | 4 +- .../vendorPlanSync/models/Group_model.php | 48 +++++++++++++++++++ ...uo_addOrUpdateRouteOrderContentBuilder.php | 2 +- 3 files changed, 51 insertions(+), 3 deletions(-) diff --git a/webht/third_party/vendorPlanSync/libraries/Tulanduo.php b/webht/third_party/vendorPlanSync/libraries/Tulanduo.php index 2945d33c..e52605f1 100644 --- a/webht/third_party/vendorPlanSync/libraries/Tulanduo.php +++ b/webht/third_party/vendorPlanSync/libraries/Tulanduo.php @@ -423,7 +423,7 @@ class Tulanduo } if ( ! empty($train_coldsn_arr)) { $route_name .= $route_name==="" ? "" : "+"; - $route_name .= "火车票预订"; + $route_name .= "单订国际列车票服务"; $order_type = 1; $train_order = $this->ci->BIZ_order->get_train_flight_order(implode(',', $train_coldsn_arr)); $agcOrderNo = $vas->GRI_Name; @@ -434,7 +434,7 @@ class Tulanduo ->setKey($userKey) ->setOrderType($order_type) ->setRouteName($route_name) - ->setRouteType("火车票预订") + ->setRouteType("单订国际列车票服务") ->setAgcOrderNo($agcOrderNo) ->setAdultNum($train_order[0]->adult_num) ->setChildNum($train_order[0]->child_num) diff --git a/webht/third_party/vendorPlanSync/models/Group_model.php b/webht/third_party/vendorPlanSync/models/Group_model.php index 80a98169..a61841df 100644 --- a/webht/third_party/vendorPlanSync/models/Group_model.php +++ b/webht/third_party/vendorPlanSync/models/Group_model.php @@ -375,6 +375,54 @@ class Group_model extends CI_Model { return $this->HT->query($sql, array($vei_sn))->row(); } + /*! + * @Author: LYT + * @Date: 2019-06-25 14:56:01 + * @Desc: 生成计划最后的导游备注 + * @return PHP ArrayObject + */ + public function get_plan_remark($gri_sn, $vei_sn) + { + $sql = "DECLARE @StrResult varchar(1000);SET NOCOUNT ON; + EXEC SP_VendorPlan_GetAddFeeProduct $gri_sn, $vei_sn, @StrResult out + SELECT @StrResult as remark + "; + $result_obj = $this->call_sp_fun($sql); + return empty($result_obj) ? '' : $result_obj[0]->remark; + } + + public function call_sp_fun($sql) + { + // SET NOCOUNT ON 才能这样调用, 否则需要遍历结果集 + // $sql = " Tourmanager.dbo.SP_VendorPlan_GetPlanInfo ?, ?, 0 "; + // $grd_info = $this->HT->query($sql, array($gri_sn, $vendor_id))->result(); + include('c:/database_conn.php'); + $connection = array( + 'UID' => $db['HT']['username'], + 'PWD' => $db['HT']['password'], + 'Database' => 'tourmanager', + 'ConnectionPooling' => 1, + 'CharacterSet' => 'utf-8', + 'ReturnDatesAsStrings' => 1 + ); + $conn = sqlsrv_connect($db['HT']['hostname'], $connection); + $stmt = sqlsrv_query($conn, $sql); + $result_object = array(); + if (false !== $stmt ) { // 无权限或执行错误返回false + // 存储过程中每个select都产生结果集 + // 设置了SET NOCOUNT ON;就只有输出的结果集 + $a = true; + while ($a !== false) { + $row = sqlsrv_fetch_object($stmt); // Retrieves the next row of data as a PHP object. + $a = !empty($row); + $a===true ? $result_object[] = $row : null; + } + sqlsrv_free_stmt($stmt); + } + sqlsrv_close($conn); + return $result_object; + } + } /* End of file Group_model.php */ diff --git a/webht/third_party/vendorPlanSync/models/TuLanDuo_addOrUpdateRouteOrderContentBuilder.php b/webht/third_party/vendorPlanSync/models/TuLanDuo_addOrUpdateRouteOrderContentBuilder.php index 04d57bb4..a232cbe4 100644 --- a/webht/third_party/vendorPlanSync/models/TuLanDuo_addOrUpdateRouteOrderContentBuilder.php +++ b/webht/third_party/vendorPlanSync/models/TuLanDuo_addOrUpdateRouteOrderContentBuilder.php @@ -128,7 +128,7 @@ class TuLanDuo_addOrUpdateRouteOrderContentBuilder extends CI_Model } public function setRouteStandard($routeStandard) { - $this->orderData['routeStandard'] = $routeStandard; + $this->orderData['routeStandard'] = "该团按非购物团标准结算 要求/接团小技巧:\r\n" . $routeStandard; return $this; } public function setDestination($destination)