@ -76,14 +76,16 @@ class TulanduoApi extends CI_Controller
*/
public function get_orderlist()
{
$startOrderDate = date('Y-m-d', strtotime("-2 days"));
$endOrderDate = date('Y-m-d');
$this->tld_order->setUserId($this->userId)
->setKey($this->key)
->setPageSize(20)
->setPageIndex(1)
->setStartTravelDate("2018-04-21") // test
->setEndTravelDate("2018-04-21")
// ->setStartOrderDate("2018-04-13" )
// ->setEndOrderDate("2018-04-13" )
// ->setStartTravelDate("2018-04-21") // test
// ->setEndTravelDate("2018-04-21")
->setStartOrderDate($startOrderDate )
->setEndOrderDate($endOrderDate )
;
$resp = $this->excute_curl($this->list_url, $this->tld_order);
$resp_arr = json_decode($resp, true);
@ -124,6 +126,8 @@ class TulanduoApi extends CI_Controller
continue;
}
$unique_order[] = $vo['orderId'];
$this->Orders_model->BIZ_COLI_SN = null;
$this->Orders_model->GRI_SN = null;
$vo['agcOrderNo'] = mb_ereg_replace('( )', '', trim($vo['agcOrderNo'])); // 去掉中文的全角空格
$PAG_Code = $pag_sub = null;
preg_match('/[a-zA-Z]+\-[0-9\-]+/', $this->characet($vo['routeName'], "UTF-8"), $temp_array);
@ -145,7 +149,8 @@ class TulanduoApi extends CI_Controller
$COLD_MemoText = raw_json_encode(array("Pick up"=>$vo['toTraffic'], "Drop off"=>$vo['backTraffic']));
$this->Orders_model->BIZ_COLI_SN = $this->Orders_model->GRI_SN = $this->Orders_model->GCI_SN = null;
$this->Orders_model->get_SN_by_vendorOrderId($vo['orderId']); // 查询订单是否已经录入过
$tmpv = empty($this->city_info[$vo['operationDep']]) ? 1343 : $this->city_info[$vo['operationDep']]['PlanVEI_SN'];
$this->Orders_model->get_SN_by_vendorOrderId($vo['orderId'], $tmpv); // 查询订单是否已经录入过
if ($this->Orders_model->BIZ_COLI_SN === null & & in_array($vo['agcName'], array("D目的地桂林组"))) {
$real_groupCode = $this->analysis_groupCode($vo['agcOrderNo']);
// set BIZ_COLI_SN, GRI_SN at Orders_model
@ -182,7 +187,6 @@ class TulanduoApi extends CI_Controller
$this->Orders_model->BIZ_COLI_OrderDetailText = "来自图兰朵系统同步测试" . $vo["orderId"] . ";线路:" . $vo['routeName'];
$this->Orders_model->BIZ_COLI_GUT_SN = $this->Orders_model->BIZ_GUT_SN ? $this->Orders_model->BIZ_GUT_SN : null;
$coli_sn[] = $this->Orders_model->biz_confirm_save();
log_message('error','new coli ' . $this->Orders_model->BIZ_COLI_ID);
/**BIZ_ConfirmLineDetail*/
$this->Orders_model->COLD_COLI_SN = $this->Orders_model->BIZ_COLI_SN;
$this->Orders_model->COLD_ServiceType = "D";
@ -211,6 +215,7 @@ log_message('error','new coli ' . $this->Orders_model->BIZ_COLI_ID);
/*biz_groupcombineinfo*/
$this->Orders_model->GCI_combineNo = isset($vo['groupOrderNo']) ? $vo['groupOrderNo'] : '';
$this->Orders_model->GCI_GRI_SN = $this->Orders_model->GRI_SN;
$this->Orders_model->GCI_VEI_SN = $this->Orders_model->COLD_PlanVEI_SN;
$this->Orders_model->GCI_VendorOrderId = $vo['orderId'];
$this->Orders_model->GCI_FromAgc = $vo['agcName'];
$this->Orders_model->GCI_groupType = $vo['orderType'];
@ -236,10 +241,10 @@ log_message('error','new coli ' . $this->Orders_model->BIZ_COLI_ID);
if ($coli_sn !== null) {
$to_update_list = $this->Orders_model->get_groupCombineInfo($coli_sn);
} else {
$startDate = ('2018-04-21');
$endDate = ('2018-04-22'); // test
// $startDate = date('Y-m-d');
// $endDate = date('Y-m-d', strtotime("+4 days"));
// $startDate = ('2018-04-21');
// $endDate = ('2018-04-22'); // test
$startDate = date('Y-m-d');
$endDate = date('Y-m-d', strtotime("+4 days"));
$to_update_list = $this->Orders_model->get_groupCombineInfo(0, $startDate, $endDate);
}
$unique_orderGroupCombine = array();
@ -301,6 +306,7 @@ log_message('error','new coli ' . $this->Orders_model->BIZ_COLI_ID);
$this->Order_update->gci_where_update = " GCI_SN=" . $order->GCI_SN;
$gci_update_column = array(
"GCI_combineNo" => $detail_jsonResp->orderDetail->groupOrderNo
,"GCI_VEI_SN" => $this->city_info[$detail_jsonResp->orderDetail->operationDep]['PlanVEI_SN']
,"GCI_travelDate" => $detail_jsonResp->orderDetail->travelDate
,"GCI_leaveDate" => $detail_jsonResp->orderDetail->leaveDate
);
@ -393,6 +399,7 @@ log_message('error','new coli ' . $this->Orders_model->BIZ_COLI_ID);
if (isset($detail_jsonResp->orderDetail->operationDetails->sceneryOperations)) {
foreach ($detail_jsonResp->orderDetail->operationDetails->sceneryOperations as $ks => $vso) {
$this->Orders_model->GCOD_GCI_combineNo = $detail_jsonResp->orderDetail->groupOrderNo;
$this->Orders_model->GCOD_VEI_SN = $this->city_info[$detail_jsonResp->orderDetail->operationDep]['PlanVEI_SN'];
$this->Orders_model->GCOD_operationType = "sceneryOperations";
$this->Orders_model->GCOD_subType = $vso->type;
$this->Orders_model->GCOD_title = $vso->name;
@ -414,6 +421,7 @@ log_message('error','new coli ' . $this->Orders_model->BIZ_COLI_ID);
if (isset($detail_jsonResp->orderDetail->operationDetails->restraurantOperations) ) {
foreach ($detail_jsonResp->orderDetail->operationDetails->restraurantOperations as $vro) {
$this->Orders_model->GCOD_GCI_combineNo = $detail_jsonResp->orderDetail->groupOrderNo ;
$this->Orders_model->GCOD_VEI_SN = $this->city_info[$detail_jsonResp->orderDetail->operationDep]['PlanVEI_SN'];
$this->Orders_model->GCOD_operationType = "restraurantOperations";
$this->Orders_model->GCOD_subType = $vro->type;
$this->Orders_model->GCOD_title = $vro->name;
@ -434,6 +442,7 @@ log_message('error','new coli ' . $this->Orders_model->BIZ_COLI_ID);
if (isset($detail_jsonResp->orderDetail->operationDetails->touristCarOperations)) {
foreach ($detail_jsonResp->orderDetail->operationDetails->touristCarOperations as $vco) {
$this->Orders_model->GCOD_GCI_combineNo = $detail_jsonResp->orderDetail->groupOrderNo ;
$this->Orders_model->GCOD_VEI_SN = $this->city_info[$detail_jsonResp->orderDetail->operationDep]['PlanVEI_SN'];
$this->Orders_model->GCOD_operationType = "touristCarOperations";
$this->Orders_model->GCOD_subType = $vco->type;
$this->Orders_model->GCOD_title = $vco->name;
@ -454,6 +463,7 @@ log_message('error','new coli ' . $this->Orders_model->BIZ_COLI_ID);
if (isset($detail_jsonResp->orderDetail->operationDetails->guiderOperations) ) {
foreach ($detail_jsonResp->orderDetail->operationDetails->guiderOperations as $vgo) {
$this->Orders_model->GCOD_GCI_combineNo = $detail_jsonResp->orderDetail->groupOrderNo ;
$this->Orders_model->GCOD_VEI_SN = $this->city_info[$detail_jsonResp->orderDetail->operationDep]['PlanVEI_SN'];
$this->Orders_model->GCOD_operationType = "guiderOperations";
$this->Orders_model->GCOD_subType = "";
$this->Orders_model->GCOD_title = "";
@ -498,7 +508,7 @@ log_message('error','new coli ' . $this->Orders_model->BIZ_COLI_ID);
*/
public function order_push($COLI_ID="") // test
{
// exit();
exit();
/** 目的地 test */
$this->userId = "358";
$this->key = "a08f26ddc5b1bd4c8e5eafcac28fc1ec";
@ -647,7 +657,8 @@ log_message('error','in GCI ' . json_decode($resp)->responseData->orderId);
{
mb_regex_encoding("UTF-8");
preg_match('/[\w\s\-]+/', $this->characet($groupCode, "UTF-8"), $temp_array);
$tmp_groupCode = explode("-", trim(strrchr($temp_array[0], " ")));
$temp_array[0] = strrchr($temp_array[0], " ") ? strrchr($temp_array[0], " ") : $temp_array[0];
$tmp_groupCode = explode("-", trim($temp_array[0]));
$real_groupCode = $tmp_groupCode[0] . "-";
$real_groupCode .= mb_strstr($tmp_groupCode[1], "( ", true) ? mb_strstr($tmp_groupCode[1], "( ", true) : $tmp_groupCode[1];
$real_groupCode = mb_ereg_replace('( )', '', trim($real_groupCode));