From 4f01fdcccf314c12997317b84fd14e471f964b30 Mon Sep 17 00:00:00 2001 From: lyt Date: Wed, 12 Jun 2019 17:19:17 +0800 Subject: [PATCH] released 1.0 --- .../vendorPlanSync/controllers/index.php | 13 +++-- .../vendorPlanSync/libraries/Tulanduo.php | 51 +++++++++---------- .../vendorPlanSync/models/Group_model.php | 23 ++------- 3 files changed, 38 insertions(+), 49 deletions(-) diff --git a/webht/third_party/vendorPlanSync/controllers/index.php b/webht/third_party/vendorPlanSync/controllers/index.php index 076db79e..2506ad81 100644 --- a/webht/third_party/vendorPlanSync/controllers/index.php +++ b/webht/third_party/vendorPlanSync/controllers/index.php @@ -32,14 +32,9 @@ class Index extends CI_Controller { public function push($GRI_SN=0, $vendor_str=null) { -log_message('error',"begin\n\n---------------------------------------------------PUSH------------------------------------------------------------\n"); $start_date = date('Y-m-d'); $end_date = date('Y-m-d 23:59:59', strtotime("+2 months")); - // test - $start_date = '2019-03-27'; - $end_date = '2019-07-27 23:59:59'; $ready_to_send = $this->Group_model->get_plan_not_received(1, $GRI_SN, $vendor_str, $start_date, $end_date); -// log_message('error',var_export($ready_to_send, 1)); if (empty($ready_to_send)) { return $this->output->set_output("empty"); } @@ -57,6 +52,7 @@ log_message('error',"begin\n\n-------------------------------------------------- public function verify_user() { + return false; $open_id = $this->input->post('openId'); $open_key = $this->input->post('key'); $match = $this->UserAuth_model->if_user_key($open_id, $open_key, 1); @@ -85,6 +81,10 @@ log_message('error',"begin\n\n-------------------------------------------------- { $input = $this->input->post(); log_message('error',"Call [Tulanduo>uploadOperation]: " . json_encode($input)); + $ret['status'] = 1; + $ret['errMsg'] = ""; + return $this->output->set_content_type('application/json')->set_output(json_encode($ret)); + ; $ret['status'] = -1; $ret['errMsg'] = "未知错误"; $user_verify = $this->verify_user(); @@ -126,6 +126,7 @@ log_message('error',"begin\n\n-------------------------------------------------- public function plan_confirm($input, $vps) { + return false; $ret['status'] = -1; $ret['errMsg'] = ""; $vendor_manager = $this->Group_model->get_vendorContact($input['openId']); @@ -163,6 +164,7 @@ log_message('error',"begin\n\n-------------------------------------------------- public function fill_tourguide($input, $vps) { + return false; $ret['status'] = -1; $ret['errMsg'] = ""; $eva = $this->Group_model->get_plan_eva($vps->VAS_SN); @@ -201,6 +203,7 @@ log_message('error',"begin\n\n-------------------------------------------------- public function calc_key($userId, $key) { + return false; $default = "b825e39422a54875a95752fc7ed6f5d2"; $ret = md5(hash("sha256", $userId.$default)); return $ret; diff --git a/webht/third_party/vendorPlanSync/libraries/Tulanduo.php b/webht/third_party/vendorPlanSync/libraries/Tulanduo.php index f881458a..52bc8a4c 100644 --- a/webht/third_party/vendorPlanSync/libraries/Tulanduo.php +++ b/webht/third_party/vendorPlanSync/libraries/Tulanduo.php @@ -16,29 +16,29 @@ class Tulanduo $this->userId = "18"; $this->key = "d05c25e6e6c5d4898161e0aaf700d9c7"; */ - // private $send_host = array( - // "30" => array( - // "userId" => 1134 - // ,"key" => "73d180d05d425fd192e1c5b3097e75ff" - // ) - // ,"1" => array( - // "userId" => 18 - // ,"key" => "d05c25e6e6c5d4898161e0aaf700d9c7" - // ) - // ); - /*! - * test: - */ private $send_host = array( "30" => array( - "userId" => 6035 - ,"key" => "3bd16efd5f4165378f144da1f4829996" + "userId" => 1134 + ,"key" => "73d180d05d425fd192e1c5b3097e75ff" ) ,"1" => array( - "userId" => 6035 - ,"key" => "3bd16efd5f4165378f144da1f4829996" + "userId" => 18 + ,"key" => "d05c25e6e6c5d4898161e0aaf700d9c7" ) ); + /*! + * test: + */ + // private $send_host = array( + // "30" => array( + // "userId" => 6035 + // ,"key" => "3bd16efd5f4165378f144da1f4829996" + // ) + // ,"1" => array( + // "userId" => 6035 + // ,"key" => "3bd16efd5f4165378f144da1f4829996" + // ) + // ); // userId key // 1343 2e47c3721e3ff6e816fe6b928d7acc7d @@ -46,14 +46,14 @@ class Tulanduo // 30548 9db75a2dc17156eb122364295804b7a2 // test: - public $list_url = "http://ltdj.ltsoftware.net:19919/action/api/searchRouteOrder/"; - public $detail_url = "http://ltdj.ltsoftware.net:19919/action/api/detailRouteOrder/"; + // public $list_url = "http://ltdj.ltsoftware.net:19919/action/api/searchRouteOrder/"; + // public $detail_url = "http://ltdj.ltsoftware.net:19919/action/api/detailRouteOrder/"; // public $neworder_url = "http://ltdj.ltsoftware.net:19919/action/api/addOrUpdateRouteOrder/"; - public $neworder_url = "http://ltdj.ltsoftware.net:18888/action/api/addOrUpdateRouteOrder/"; + // public $neworder_url = "http://ltdj.ltsoftware.net:18888/action/api/addOrUpdateRouteOrder/"; // Live - // public $list_url = "http://djb3c.ltsoftware.net:9921/action/api/searchRouteOrder/"; - // public $detail_url = "http://djb3c.ltsoftware.net:9921/action/api/detailRouteOrder/"; - // public $neworder_url = "http://djb3c.ltsoftware.net:9921/action/api/addOrUpdateRouteOrder/"; + public $list_url = "http://djb3c.ltsoftware.net:9921/action/api/searchRouteOrder/"; + public $detail_url = "http://djb3c.ltsoftware.net:9921/action/api/detailRouteOrder/"; + public $neworder_url = "http://djb3c.ltsoftware.net:9921/action/api/addOrUpdateRouteOrder/"; private $tulanduo_trippest_pag = array(); private $tulanduo_trippest_code = array(); @@ -271,9 +271,6 @@ class Tulanduo $sync_orderstate = 10; $this->ci->tldOrderBuilder->clearModifyLogInfo(); $resp = $this->excute_curl($this->neworder_url, $this->ci->tldOrderBuilder); - // $resp = '{"status":1,"errMsg":"","responseData":{"orderId":' . rand(1000,9999) . '}}'; // test: -echo $this->ci->tldOrderBuilder->getBizContent(); -log_message('error',$resp); $response = json_decode($resp); if ($response->status == 1) { /** VendorPlanSync */ @@ -904,6 +901,7 @@ log_message('error',$resp); public function tourguide_update($input, $vps, $eva) { + return false; $ret['status'] = -1; $ret['err'] = 100; $ret['errMsg'] = "未知错误"; @@ -977,6 +975,7 @@ log_message('error',$resp); */ public function order_change() { + return false; $this->load->model('Order_update'); $ret['status'] = -1; $ret['errMsg'] = "未知错误"; diff --git a/webht/third_party/vendorPlanSync/models/Group_model.php b/webht/third_party/vendorPlanSync/models/Group_model.php index 782ddad9..f3e90d02 100644 --- a/webht/third_party/vendorPlanSync/models/Group_model.php +++ b/webht/third_party/vendorPlanSync/models/Group_model.php @@ -22,19 +22,13 @@ class Group_model extends CI_Model { inner join GRoupInfo gri on GRI_SN=VAS_GRI_SN where 1=1 AND VAS_VEI_SN in ($vendor_str) "; $sql .= $gri_sn!==0 ? $gri_sql : " - AND VAS_IsCancel=0 AND VAS_Delete=0 AND vas.DeleteFlag=0 - AND VAS_IsSendSucceed=1 AND VAS_IsReceive=0 - AND EOI_GetDate between '$start_date' AND '$end_date' - -- AND EOI_GetDate > CONVERT(date, GETDATE()) -- released - -- Trippest, not confirm, not change -- for Trippest deploy - -- AND GRI_OrderType=227002 - AND VAS_IsConfirm=0 AND VAS_SendVary=0 - -- AND EXISTS ( - -- select 1 from OperatorInfo where OPI_SN=GRI_operator AND OPI_DEI_SN=30 - -- ) + AND isnull(VAS_IsCancel,0)=0 AND isnull(VAS_Delete,0)=0 AND isnull(vas.DeleteFlag,0)=0 + 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 "; $sql .= " order by EOI_GetDate asc,vas.VAS_SendTime asc, vas.VAS_IsConfirm asc"; -log_message('error',$sql); return $this->HT->query($sql)->result(); } @@ -69,7 +63,6 @@ log_message('error',$sql); 'ReturnDatesAsStrings' => 1 ); $conn = sqlsrv_connect($db['HT']['hostname'], $connection); -log_message('error', "SET NOCOUNT ON;EXEC Tourmanager.dbo.SP_VendorPlan_GetPlanInfo $gri_sn, $vendor_id, 0 "); $stmt = sqlsrv_query($conn, "SET NOCOUNT ON;EXEC Tourmanager.dbo.SP_VendorPlan_GetPlanInfo $gri_sn, $vendor_id, 0 "); $result_object = array(); if (false !== $stmt ) { // 无权限或执行错误返回false @@ -177,9 +170,6 @@ log_message('error', "SET NOCOUNT ON;EXEC Tourmanager.dbo.SP_VendorPlan_GetPlanI $vendor_sql $day_no_sql order by ACI_DayNo,ACI_SNInOneDay "; - -log_message('error',$this->HT->compile_binds($sql, $param_arr)); - return $this->HT->query($sql, $param_arr)->result(); } @@ -304,7 +294,6 @@ log_message('error',$this->HT->compile_binds($sql, $param_arr)); public function set_plan_received($vas_sn=0) { $sql = "UPDATE VendorArrangeState set VAS_IsReceive=1,VAS_ReceiveTime=GETDATE() where VAS_SN=? "; -log_message('error',$sql . $vas_sn); return $this->HT->query($sql, array($vas_sn)); } @@ -333,7 +322,6 @@ log_message('error',$sql . $vas_sn); public function insert_VendorPlanSync($sync_arr=array()) { $ss = $this->HT->insert_string('VendorPlanSendout', $sync_arr); // testing -log_message('error',$ss); $this->HT->insert('VendorPlanSendout', $sync_arr); return $this->HT->query("SELECT MAX(VPS_SN) VPS_SN from VendorPlanSendout") ->row()->VPS_SN; @@ -343,7 +331,6 @@ log_message('error',$ss); { $where = " VPS_SN=" . $vps; $update_sql = $this->HT->update_string('VendorPlanSendout', $sync_arr, $where); -log_message('error',$update_sql); return $this->HT->query($update_sql); }