仅Trippest计划发送

hotfix/远程访问多媒体中心
lyt 6 years ago
parent 646578dc50
commit e1113c1a0e

@ -9,6 +9,7 @@ class Index extends CI_Controller {
parent::__construct(); parent::__construct();
mb_regex_encoding("UTF-8"); mb_regex_encoding("UTF-8");
bcscale(4); bcscale(4);
error_reporting(0);
$GLOBALS['__HAINA_VEI__'] = 30561; $GLOBALS['__HAINA_VEI__'] = 30561;
$this->load->helper('array'); $this->load->helper('array');
$this->load->library('vendor'); $this->load->library('vendor');

@ -7,8 +7,8 @@ class Tulanduo
{ {
protected $ci; protected $ci;
/** Live */ /*! Live */
/** /*!
目的地 目的地
$this->userId = "1134"; $this->userId = "1134";
$this->key = "73d180d05d425fd192e1c5b3097e75ff"; $this->key = "73d180d05d425fd192e1c5b3097e75ff";
@ -16,29 +16,29 @@ class Tulanduo
$this->userId = "18"; $this->userId = "18";
$this->key = "d05c25e6e6c5d4898161e0aaf700d9c7"; $this->key = "d05c25e6e6c5d4898161e0aaf700d9c7";
*/ */
// private $send_host = array(
// "30" => array(
// "userId" => 1134
// ,"key" => "73d180d05d425fd192e1c5b3097e75ff"
// )
// ,"1" => array(
// "userId" => 18
// ,"key" => "d05c25e6e6c5d4898161e0aaf700d9c7"
// )
// );
/**
* test
*/
private $send_host = array( private $send_host = array(
"30" => array( "30" => array(
"userId" => 6035 "userId" => 1134
,"key" => "3bd16efd5f4165378f144da1f4829996" ,"key" => "73d180d05d425fd192e1c5b3097e75ff"
) )
,"1" => array( ,"1" => array(
"userId" => 512 "userId" => 18
,"key" => "4d9bde5ce79d6093e4a98bebbd3892c2" ,"key" => "d05c25e6e6c5d4898161e0aaf700d9c7"
) )
); );
/*!
* test
*/
// private $send_host = array(
// "30" => array(
// "userId" => 6035
// ,"key" => "3bd16efd5f4165378f144da1f4829996"
// )
// ,"1" => array(
// "userId" => 6035
// ,"key" => "3bd16efd5f4165378f144da1f4829996"
// )
// );
// userId key // userId key
// 1343 2e47c3721e3ff6e816fe6b928d7acc7d // 1343 2e47c3721e3ff6e816fe6b928d7acc7d
@ -46,13 +46,13 @@ class Tulanduo
// 30548 9db75a2dc17156eb122364295804b7a2 // 30548 9db75a2dc17156eb122364295804b7a2
// test // test
public $list_url = "http://ltdj.ltsoftware.net:19919/action/api/searchRouteOrder/"; // public $list_url = "http://ltdj.ltsoftware.net:19919/action/api/searchRouteOrder/";
public $detail_url = "http://ltdj.ltsoftware.net:19919/action/api/detailRouteOrder/"; // 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:19919/action/api/addOrUpdateRouteOrder/";
// Live // Live
// public $list_url = "http://djb3c.ltsoftware.net:9921/action/api/searchRouteOrder/"; public $list_url = "http://djb3c.ltsoftware.net:9921/action/api/searchRouteOrder/";
// public $detail_url = "http://djb3c.ltsoftware.net:9921/action/api/detailRouteOrder/"; public $detail_url = "http://djb3c.ltsoftware.net:9921/action/api/detailRouteOrder/";
// public $neworder_url = "http://djb3c.ltsoftware.net:9921/action/api/addOrUpdateRouteOrder/"; public $neworder_url = "http://djb3c.ltsoftware.net:9921/action/api/addOrUpdateRouteOrder/";
public function __construct(){ public function __construct(){
$this->ci =& get_instance(); $this->ci =& get_instance();
@ -78,10 +78,12 @@ class Tulanduo
} }
// 商务 // 商务
if (strval($order->GRI_OrderType) === "227002") { if (strval($order->GRI_OrderType) === "227002") {
return false; // for Trippest deploy
return $this->push_tour($order); return $this->push_tour($order);
} }
// 传统订单 // 传统订单
if (strval($order->GRI_OrderType) === "227001") { if (strval($order->GRI_OrderType) === "227001") {
return false; // for Trippest deploy
return $this->push_tour($order); return $this->push_tour($order);
} }
@ -94,6 +96,7 @@ class Tulanduo
*/ */
public function push_tour($vas=null) public function push_tour($vas=null)
{ {
return false; // for Trippest deploy
$userId = $this->send_host["1"]["userId"]; $userId = $this->send_host["1"]["userId"];
$userKey = $this->send_host["1"]["key"]; $userKey = $this->send_host["1"]["key"];
$gri_sn = $vas->GRI_SN; $gri_sn = $vas->GRI_SN;
@ -155,11 +158,11 @@ class Tulanduo
// ->setTravelFeesUnit(0, 1) // ->setTravelFeesUnit(0, 1)
// ->setTravelFeesSumMoney(0, $travel_fee) // ->setTravelFeesSumMoney(0, $travel_fee)
// ->setTravelFeesRemark(0, ""); // ->setTravelFeesRemark(0, "");
// 补全空的日期,行为空 // 补全空的日期,行为空
$date1 = new DateTime($first_date); $date1 = new DateTime($first_date);
$date_end = new DateTime($end_date); $date_end = new DateTime($end_date);
$date_diff = $date_end->diff($date1); $date_diff = $date_end->diff($date1);
$d = ($date_diff->format("%d")); $d = ($date_diff->format("%a"));
$all_date = array(); $all_date = array();
for ($j=0; $j < ($d+1); $j++) { for ($j=0; $j < ($d+1); $j++) {
$all_date[] = date('Y-m-d', strtotime("+$j day", strtotime($first_date))); $all_date[] = date('Y-m-d', strtotime("+$j day", strtotime($first_date)));
@ -233,7 +236,6 @@ log_message('error',$resp);
*/ */
public function push_trippest($vas=null) public function push_trippest($vas=null)
{ {
// return "[Tulanduo>push_trippest] Done. "; // test
/** 目的地 */ /** 目的地 */
$userId = $this->send_host["30"]["userId"]; $userId = $this->send_host["30"]["userId"];
$userKey = $this->send_host["30"]["key"]; $userKey = $this->send_host["30"]["key"];
@ -266,14 +268,15 @@ log_message('error',$resp);
} }
} }
// 收款合并为一条 // 收款合并为一条
$travel_fees = new stdClass(); if ( ! empty($paid_to_trippest)) {
$travel_fees = $paid_to_trippest[0]; $travel_fees = $paid_to_trippest[0];
$travel_fees->SUM_SSJE = 0; $travel_fees->SUM_SSJE = 0;
foreach ($paid_to_trippest as $ktf => $vtf) { foreach ($paid_to_trippest as $ktf => $vtf) {
$travel_fees->SUM_SSJE = bcadd($travel_fees->SUM_SSJE, $vtf->GAI_SSJE); $travel_fees->SUM_SSJE = bcadd($travel_fees->SUM_SSJE, $vtf->GAI_SSJE);
} }
}
// 代收合并为一条 // 代收合并为一条
$replace_collections = new stdClass(); if ( ! empty($pay_to_vendor)) {
$replace_collections = $pay_to_vendor[0]; $replace_collections = $pay_to_vendor[0];
$replace_collections->SUM_SSJE = 0; $replace_collections->SUM_SSJE = 0;
$replace_collections->ALL_Memo = ""; $replace_collections->ALL_Memo = "";
@ -281,6 +284,7 @@ log_message('error',$resp);
$replace_collections->SUM_SSJE = bcadd($replace_collections->SUM_SSJE, $vtv->GAI_SSJE); $replace_collections->SUM_SSJE = bcadd($replace_collections->SUM_SSJE, $vtv->GAI_SSJE);
$replace_collections->ALL_Memo .= $vtv->ALL_Memo; $replace_collections->ALL_Memo .= $vtv->ALL_Memo;
} }
}
// 按产品拆分 按订单类型拆分? 单团/拼团; 未设置则按产品类型:接送 // 按产品拆分 按订单类型拆分? 单团/拼团; 未设置则按产品类型:接送
$fill_order = array(); $fill_order = array();
$processed_date = array(); $processed_date = array();
@ -368,11 +372,9 @@ log_message('error',$resp);
->setCustomersPeopleType($key, ($vg->BPE_GuestType==1 ? "成人" : "儿童")) ->setCustomersPeopleType($key, ($vg->BPE_GuestType==1 ? "成人" : "儿童"))
->setCustomersDocumentType($key, "护照") // Passport No. ->setCustomersDocumentType($key, "护照") // Passport No.
->setCustomersDocumentNo($key, $vg->BPE_Passport) ->setCustomersDocumentNo($key, $vg->BPE_Passport)
// ->setCustomersOtherInfo($key, $this->ci->BIZ_order->GetNationalityName($vg->BPE_Nationality))
; ;
$this_otherinfo .= $this->ci->BIZ_order->GetNationalityName($vg->BPE_Nationality); $this_otherinfo .= $this->ci->BIZ_order->GetNationalityName($vg->BPE_Nationality);
if (trim($vf['cold'][0]->GUT_TEL) != "" && $key===0) { if (trim($vf['cold'][0]->GUT_TEL) != "" && $key===0) {
// $order_remark = "预定人电话:" . trim($vf["cold"][0]->GUT_TEL);
$this_otherinfo .= "; 电话:"; $this_otherinfo .= "; 电话:";
$this_otherinfo .= trim($vf["cold"][0]->GUT_POST)!=="" ? "+".trim($vf["cold"][0]->GUT_POST) : "" ; $this_otherinfo .= trim($vf["cold"][0]->GUT_POST)!=="" ? "+".trim($vf["cold"][0]->GUT_POST) : "" ;
$this_otherinfo .= " " . trim($vf["cold"][0]->GUT_TEL); $this_otherinfo .= " " . trim($vf["cold"][0]->GUT_TEL);
@ -469,7 +471,7 @@ log_message('error',$resp);
$date1 = new DateTime($first_date); $date1 = new DateTime($first_date);
$date_end = new DateTime($end_date); $date_end = new DateTime($end_date);
$date_diff = $date_end->diff($date1); $date_diff = $date_end->diff($date1);
$d = ($date_diff->format("%d")); $d = ($date_diff->format("%a"));
$all_date = array(); $all_date = array();
for ($j=0; $j < ($d+1); $j++) { for ($j=0; $j < ($d+1); $j++) {
$all_date[] = date('Y-m-d', strtotime("+$j day", strtotime($first_date))); $all_date[] = date('Y-m-d', strtotime("+$j day", strtotime($first_date)));
@ -502,24 +504,25 @@ log_message('error',$resp);
} }
// 拆分的订单团款录第一个 // 拆分的订单团款录第一个
if ($i===1) { if ($i===1) {
if ( ! empty($travel_fees) ) {
$this->ci->tldOrderBuilder->setTravelFeesType(0, "Per Group") $this->ci->tldOrderBuilder->setTravelFeesType(0, "Per Group")
->setTravelFeesMoney(0, $travel_fees->SUM_SSJE) ->setTravelFeesMoney(0, $travel_fees->SUM_SSJE)
->setTravelFeesNum(0, 1) ->setTravelFeesNum(0, 1)
->setTravelFeesUnit(0, 1) ->setTravelFeesUnit(0, 1)
->setTravelFeesSumMoney(0, $travel_fees->SUM_SSJE); ->setTravelFeesSumMoney(0, $travel_fees->SUM_SSJE);
}
if ( ! empty($replace_collections) ) {
$this->ci->tldOrderBuilder->setReplaceCollectionsType(0, "Per Group") $this->ci->tldOrderBuilder->setReplaceCollectionsType(0, "Per Group")
->setReplaceCollectionsMoney(0, $replace_collections->SUM_SSJE) ->setReplaceCollectionsMoney(0, $replace_collections->SUM_SSJE)
->setReplaceCollectionsRemark(0, $replace_collections->ALL_Memo); ->setReplaceCollectionsRemark(0, $replace_collections->ALL_Memo);
} }
}
// 查询是否变更 TODO deprecated // 查询是否变更 TODO deprecated
$sync_orderstate = 10; $sync_orderstate = 10;
$vps_sn = 0; $vps_sn = 0;
$vendor_orderid = 0; $vendor_orderid = 0;
$this->ci->tldOrderBuilder->clearModifyLogInfo(); $this->ci->tldOrderBuilder->clearModifyLogInfo();
// $resp = $this->excute_curl($this->neworder_url, $this->ci->tldOrderBuilder); $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); $response = json_decode($resp);
if ($response->status == 1) { if ($response->status == 1) {
/** VendorPlanSync */ /** VendorPlanSync */
@ -552,6 +555,7 @@ log_message('error',$resp);
public function tourguide_update($input, $vps, $eva) public function tourguide_update($input, $vps, $eva)
{ {
return false; // for Trippest deploy
$ret['status'] = -1; $ret['status'] = -1;
$ret['err'] = 100; $ret['err'] = 100;
$ret['errMsg'] = "未知错误"; $ret['errMsg'] = "未知错误";
@ -625,6 +629,7 @@ log_message('error',$resp);
*/ */
public function order_change() public function order_change()
{ {
return false; // for Trippest deploy
$this->load->model('Order_update'); $this->load->model('Order_update');
$ret['status'] = -1; $ret['status'] = -1;
$ret['errMsg'] = "未知错误"; $ret['errMsg'] = "未知错误";
@ -689,7 +694,8 @@ log_message('error',$resp);
} }
private function excute_curl($url, $content_builder) { private function excute_curl($url, $content_builder)
{
$ch = curl_init(); $ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_FAILONERROR, false); curl_setopt($ch, CURLOPT_FAILONERROR, false);

@ -104,7 +104,6 @@ class BIZ_Orders_model extends CI_Model {
$sql = "SELECT * $sql = "SELECT *
from BIZ_PackageOrderInfo poi from BIZ_PackageOrderInfo poi
where poi.POI_COLD_SN IN ($COLD_SN_str)"; where poi.POI_COLD_SN IN ($COLD_SN_str)";
log_message('error',$sql);
return $this->HT->query($sql)->result(); return $this->HT->query($sql)->result();
} }
@ -129,7 +128,6 @@ log_message('error',$sql);
AND ISNULL(bgai.GAI_VEI_SN,0) in (0,$vei_sn_str) AND ISNULL(bgai.GAI_VEI_SN,0) in (0,$vei_sn_str)
AND bgai.GAI_SQJE > 0 AND bgai.GAI_SQJE > 0
AND coli_ID = '$COLI_ID'"; AND coli_ID = '$COLI_ID'";
log_message('error',$sql);
$query = $this->HT->query($sql); $query = $this->HT->query($sql);
return $query->result(); return $query->result();
} }
@ -1847,8 +1845,6 @@ log_message('error',$sql);
,"BOL_Creator" => 29 ,"BOL_Creator" => 29
,"BOL_CreateTime" => date('Y-m-d H:i:s') ,"BOL_CreateTime" => date('Y-m-d H:i:s')
); );
return log_message('error',$this->HT->insert_string("BIZ_OrderOperationLog", $db_column));
return ;
return $this->HT->insert("BIZ_OrderOperationLog", $db_column); return $this->HT->insert("BIZ_OrderOperationLog", $db_column);
} }

@ -22,18 +22,18 @@ class Group_model extends CI_Model {
inner join GRoupInfo gri on GRI_SN=VAS_GRI_SN inner join GRoupInfo gri on GRI_SN=VAS_GRI_SN
where 1=1 "; where 1=1 ";
$sql .= $gri_sn!==0 ? $gri_sql : " $sql .= $gri_sn!==0 ? $gri_sql : "
and VAS_IsCancel=0 and VAS_Delete=0 and vas.DeleteFlag=0 AND VAS_IsCancel=0 AND VAS_Delete=0 AND vas.DeleteFlag=0
and VAS_IsSendSucceed=1 AND VAS_IsSendSucceed=1 AND VAS_IsReceive=0
-- and VAS_IsConfirm=0 AND EOI_GetDate between '$start_date' AND '$end_date'
and EOI_GetDate between '$start_date' and '$end_date' AND VAS_VEI_SN in ($vendor_str)
and VAS_VEI_SN in ($vendor_str) -- Trippest, not confirm, not change -- for Trippest deploy
and GRI_operator in (161,443,61) -- test AND GRI_OrderType=227002
and GRI_OrderType=227001 -- test AND VAS_IsConfirm=0 AND VAS_SendVary=0
and (VAS_IsReceive=0 -- or (VAS_SendTime > ISNULL(VAS_ReceiveTime,0)) AND EXISTS (
select 1 from OperatorInfo where OPI_SN=GRI_operator AND OPI_DEI_SN=30
) )
"; ";
$sql .= " order by EOI_GetDate asc,vas.VAS_SendTime asc, vas.VAS_IsConfirm asc"; $sql .= " order by EOI_GetDate asc,vas.VAS_SendTime asc, vas.VAS_IsConfirm asc";
log_message('error',$sql);
return $this->HT->query($sql)->result(); return $this->HT->query($sql)->result();
} }
@ -129,9 +129,6 @@ log_message('error',$sql);
$vendor_sql $vendor_sql
$day_no_sql $day_no_sql
order by ACI_DayNo,ACI_SNInOneDay "; order by ACI_DayNo,ACI_SNInOneDay ";
log_message('error',$this->HT->compile_binds($sql, $param_arr));
return $this->HT->query($sql, $param_arr)->result(); return $this->HT->query($sql, $param_arr)->result();
} }
@ -236,8 +233,6 @@ log_message('error',$this->HT->compile_binds($sql, $param_arr));
public function set_plan_received($vas_sn=0) public function set_plan_received($vas_sn=0)
{ {
$sql = "UPDATE VendorArrangeState set VAS_IsReceive=1,VAS_ReceiveTime=GETDATE() where VAS_SN=? "; $sql = "UPDATE VendorArrangeState set VAS_IsReceive=1,VAS_ReceiveTime=GETDATE() where VAS_SN=? ";
log_message('error',$sql);
return $sql; // testing
return $this->HT->query($sql, array($vas_sn)); return $this->HT->query($sql, array($vas_sn));
} }
@ -266,8 +261,6 @@ log_message('error',$sql);
public function insert_VendorPlanSync($sync_arr=array()) public function insert_VendorPlanSync($sync_arr=array())
{ {
$ss = $this->HT->insert_string('VendorPlanSendout', $sync_arr); // testing $ss = $this->HT->insert_string('VendorPlanSendout', $sync_arr); // testing
log_message('error',$ss);
return $ss;
$this->HT->insert('VendorPlanSendout', $sync_arr); $this->HT->insert('VendorPlanSendout', $sync_arr);
return $this->HT->query("SELECT MAX(VPS_SN) VPS_SN from VendorPlanSendout") return $this->HT->query("SELECT MAX(VPS_SN) VPS_SN from VendorPlanSendout")
->row()->VPS_SN; ->row()->VPS_SN;
@ -277,8 +270,6 @@ log_message('error',$ss);
{ {
$where = " VPS_SN=" . $vps; $where = " VPS_SN=" . $vps;
$update_sql = $this->HT->update_string('VendorPlanSendout', $sync_arr, $where); $update_sql = $this->HT->update_string('VendorPlanSendout', $sync_arr, $where);
log_message('error',$update_sql);
return $update_sql; // testing
return $this->HT->query($update_sql); return $this->HT->query($update_sql);
} }

Loading…
Cancel
Save