From 0fd19df71a469b766181003fefda5fdb691428d2 Mon Sep 17 00:00:00 2001 From: lyt Date: Wed, 25 Apr 2018 13:54:45 +0800 Subject: [PATCH] =?UTF-8?q?trippest=20=E7=94=9F=E6=88=90=E9=A2=84=E5=AE=9A?= =?UTF-8?q?=E4=BC=A0=E7=9C=9F=E6=93=8D=E4=BD=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controllers/TulanduoApi.php | 23 ++---- .../trippestOrderSync/models/orders_model.php | 73 ++++--------------- 2 files changed, 20 insertions(+), 76 deletions(-) diff --git a/webht/third_party/trippestOrderSync/controllers/TulanduoApi.php b/webht/third_party/trippestOrderSync/controllers/TulanduoApi.php index b038519d..8652f49e 100644 --- a/webht/third_party/trippestOrderSync/controllers/TulanduoApi.php +++ b/webht/third_party/trippestOrderSync/controllers/TulanduoApi.php @@ -73,8 +73,8 @@ class TulanduoApi extends CI_Controller ->setKey($this->key) ->setPageSize(20) ->setPageIndex(1) - ->setStartTravelDate("2018-04-19") // test - ->setEndTravelDate("2018-04-19") + ->setStartTravelDate("2018-04-20") // test + ->setEndTravelDate("2018-04-20") // ->setStartOrderDate("2018-04-13") // ->setEndOrderDate("2018-04-13") ; @@ -189,26 +189,17 @@ log_message('error','new coli ' . $this->Orders_model->BIZ_COLI_ID); $this->Orders_model->COLD_PlanVEI_SN = empty($this->city_info[$vo['operationDep']]) ? 1343 : $this->city_info[$vo['operationDep']]['PlanVEI_SN']; $this->Orders_model->COLD_MemoText = $COLD_MemoText; $this->Orders_model->biz_confirm_detail_save(); - /** VendorArrangeState */ - $vendor_contact = $this->Orders_model->get_vendorContact($this->Orders_model->COLD_PlanVEI_SN); - $this->Orders_model->VAS_GRI_SN = $this->Orders_model->GRI_SN ? $this->Orders_model->GRI_SN : null; - $this->Orders_model->VAS_VEI_SN = $this->Orders_model->COLD_PlanVEI_SN; - $this->Orders_model->VAS_IsSendSucceed = 1; - $this->Orders_model->VAS_IsConfirm = $vo['orderStatus']; - $this->Orders_model->VAS_IsCancel = 0; - $this->Orders_model->VAS_SendTime = $vo['orderDate']; - $this->Orders_model->VAS_ConfirmTime = $vo['orderStatus'] == 1 ? $vo['orderDate'] : null; - $this->Orders_model->VAS_LMI_SN = !empty($vendor_contact) ? $vendor_contact->LMI_SN : null; - $this->Orders_model->VAS_FaxNo = !empty($vendor_contact) ? $vendor_contact->LMI_AutoFax : null; - $this->Orders_model->VAS_VendorEmail = !empty($vendor_contact) ? $vendor_contact->LMI_ListMail : null; - $this->Orders_model->vendorarrangestate_save(); + /** SP_BIZ_Arrange */ + if ($this->Orders_model->GRI_SN) { + $this->Orders_model->sp_biz_arrange(); + } $cnt++; } if ($this->Orders_model->GCI_SN === null) { /*biz_groupcombineinfo*/ $this->Orders_model->GCI_combineNo = isset($vo['groupOrderNo']) ? $vo['groupOrderNo'] : ''; - $this->Orders_model->GCI_COLI_SN = $this->Orders_model->BIZ_COLI_SN; + $this->Orders_model->GCI_GRI_SN = $this->Orders_model->GRI_SN; $this->Orders_model->GCI_VendorOrderId = $vo['orderId']; $this->Orders_model->GCI_FromAgc = $vo['agcName']; $this->Orders_model->GCI_groupType = $vo['orderType']; diff --git a/webht/third_party/trippestOrderSync/models/orders_model.php b/webht/third_party/trippestOrderSync/models/orders_model.php index 54f68579..6c8772f3 100644 --- a/webht/third_party/trippestOrderSync/models/orders_model.php +++ b/webht/third_party/trippestOrderSync/models/orders_model.php @@ -128,11 +128,11 @@ class Orders_model extends CI_Model { { $sql = "SELECT top 1000 coli.COLI_GRI_SN, cold.COLD_SN, coli.COLI_OrderDetailText, coli.COLI_Memo, gci.* FROM BIZ_GroupCombineInfo gci - INNER JOIN BIZ_ConfirmLineInfo coli ON coli.COLI_SN=gci.GCI_COLI_SN + INNER JOIN BIZ_ConfirmLineInfo coli ON coli.COLI_GRI_SN=gci.GCI_GRI_SN INNER JOIN BIZ_ConfirmLineDetail cold ON cold.COLD_COLI_SN=coli.COLI_SN WHERE 1=1 "; if ($coli_sn !== 0) { - $sql .= " and gci.GCI_COLI_SN='$coli_sn' "; + $sql .= " and coli.COLI_SN='$coli_sn' "; } if ($startDate !== NULL) { // $sql .= " and gci.GCI_travelDate between '$startDate' and '$endDate' "; // test @@ -141,60 +141,14 @@ class Orders_model extends CI_Model { return $query->result(); } - public $VAS_GRI_SN; - public $VAS_VEI_SN; - public $VAS_IsSendSucceed; - public $VAS_IsConfirm; - public $VAS_SendTime; - public $VAS_ConfirmTime; - public $VAS_IsCancel; - public $VAS_LMI_SN; - public $VAS_FaxNo; - public $VAS_VendorEmail; - public function vendorarrangestate_save() + /*! + * 生成预定传真 + */ + public function sp_biz_arrange() { - $sql = "INSERT INTO VendorArrangeState - (VAS_GRI_SN - ,VAS_VEI_SN - ,VAS_IsSendSucceed - ,VAS_IsConfirm - ,VAS_SendTime - ,VAS_ConfirmTime - ,VAS_IsCancel - ,VAS_LMI_SN - ,VAS_FaxNo - ,VAS_VendorEmail - ,Creator - ,LastEditTime - ,DeleteFlag - ) VALUES - (? - ,? - ,? - ,? - ,? - ,? - ,? - ,? - ,? - ,? - ,0 - ,GETDATE() - ,0 - )"; - $query = $this->HT->query($sql, array( - $this->VAS_GRI_SN - ,$this->VAS_VEI_SN - ,$this->VAS_IsSendSucceed - ,$this->VAS_IsConfirm - ,$this->VAS_SendTime - ,$this->VAS_ConfirmTime - ,$this->VAS_IsCancel - ,$this->VAS_LMI_SN - ,$this->VAS_FaxNo - ,$this->VAS_VendorEmail - )); - return $query; + $sql = "SP_BIZ_Arrange ?"; + $query = $this->HT->query($sql, array($this->GRI_SN)); + return $query->result(); } public $GRI_SN=0; // 团号 @@ -232,7 +186,7 @@ class Orders_model extends CI_Model { public $GCI_SN; public $GCI_combineNo=''; // 拼团团号 - public $GCI_COLI_SN; // 订单key + public $GCI_GRI_SN; // 团key public $GCI_VendorOrderId; // 地接社系统订单id public $GCI_FromAgc; // 组团社来源 public $GCI_groupType; // 组团社来源 @@ -249,7 +203,7 @@ class Orders_model extends CI_Model { ) INSERT INTO BIZ_GroupCombineInfo (GCI_combineNo - ,GCI_COLI_SN + ,GCI_GRI_SN ,GCI_VendorOrderId ,GCI_FromAgc ,GCI_groupType @@ -268,9 +222,8 @@ class Orders_model extends CI_Model { "; $query = $this->HT->query($sql, array( $this->GCI_VendorOrderId - // ,$this->GCI_COLI_SN ,$this->GCI_combineNo - ,$this->GCI_COLI_SN + ,$this->GCI_GRI_SN ,$this->GCI_VendorOrderId ,$this->GCI_FromAgc ,$this->GCI_groupType @@ -438,7 +391,7 @@ class Orders_model extends CI_Model { { $sql = "SELECT TOP 1 coli.COLI_GRI_SN,coli.COLI_SN,gci.GCI_SN FROM BIZ_GroupCombineInfo gci - INNER JOIN BIZ_ConfirmLineInfo coli ON coli.COLI_SN=gci.GCI_COLI_SN + INNER JOIN BIZ_ConfirmLineInfo coli ON coli.COLI_GRI_SN=gci.GCI_GRI_SN WHERE gci.GCI_VendorOrderId='$vendorOrderId'"; $query = $this->HT->query($sql); if ($query->row()) {