Merge branch 'feature/plan-auto-send-release'

hotfix/远程访问多媒体中心
lyt 6 years ago
commit 312d4c4704

@ -111,7 +111,9 @@ class Tulanduo
return false;
}
$guestlist = $this->ci->orders_model->get_customer_list($gri_sn);
$request_info = $this->ci->Group_model->get_plan_request($vas->GRI_SN);
$request_info = $this->ci->Group_model->get_plan_request($gri_sn);
$plan_remark = $this->ci->Group_model->get_plan_remark($gri_sn, $vei_sn);
$plan_remark = strval($plan_remark)==='' ? '' : "请导游准备: " . $plan_remark;
/**
* TODO:团队类型? 先写2
* ??是否同一天含多个包价项目
@ -129,7 +131,7 @@ class Tulanduo
$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_a) {
$big_order_index = $this->tour_apart_order_exec($group_key, $vas, $request_info, $guestlist, $grd_a, $big_order_index);
$big_order_index = $this->tour_apart_order_exec($group_key, $vas, $request_info, $guestlist, $grd_a, $big_order_index, $plan_remark);
}
if ($big_order_index === $expect_order_cnt) {
/** VendorArrangeState VAS_IsReceive */
@ -143,7 +145,7 @@ class Tulanduo
* @Date: 2019-05-30 16:11:34
* @Desc: 执行发送订单计划信息. 参数已拆分归类好的行程
*/
public function tour_apart_order_exec($group_type, $vas, $request_info, $guestlist=null, $grd, $total_order_index)
public function tour_apart_order_exec($group_type, $vas, $request_info, $guestlist=null, $grd, $total_order_index, $plan_remark=null)
{
if (empty($grd)) {
return $total_order_index;
@ -153,7 +155,7 @@ class Tulanduo
$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);
$vendor_city = $this->ci->Group_model->get_vendor_city($vas->VAS_VEI_SN);
$destination = $vendor_city->cityname;
$destination_code = $vendor_city->citycode;
}
@ -209,10 +211,13 @@ class Tulanduo
->setDestination($destination)
->setTravelDate($first_date)
->setLeavedDate($end_date)
// ->setOrderRemark($order_remark) // 订单备注 TODO:
// ->setRoomStandard($request_info->GCI_HotelRequest) // 住房标准
->setRouteStandard($request_info->GCI_Request) // 行程服务标准
;
// 订单备注
if (strval($plan_remark) !== '') {
$this->ci->tldOrderBuilder->setOrderRemark($plan_remark);
}
$from_country = ""; // 客源地
if ($guestlist===null) {
$g_cold_str = array_map(function ($ele){return $ele->GRD_COLD_SN;}, $vo['details']);
@ -224,6 +229,7 @@ class Tulanduo
}
}
foreach ($guestlist as $key => $vg) {
$this_otherinfo = "";
$this->ci->tldOrderBuilder->setCustomersName($key, $vg->MemberName )
->setCustomersPeopleType($key, (calc_age_type($vg->BirthDay)==1 ? "成人" : "儿童"))
->setCustomersDocumentType($key, "护照") // Passport No.
@ -231,7 +237,15 @@ class Tulanduo
->setCustomersPhoneNo($key, $vg->phone);
if (strval($vg->Country) !== '' && strval($from_country) === '') {
$from_country = $vg->Country;
$this_otherinfo .= $vg->Country;
}
if (strval($vg->BirthDay) !== '') {
$this_otherinfo .= "; 生日:". $vg->BirthDay;
}
if (strval($vg->PassportValidDate) !== '') {
$this_otherinfo .= "; 护照有效期:" . $vg->PassportValidDate;
}
$this->ci->tldOrderBuilder->setCustomersOtherInfo($key, $this_otherinfo);
}
// 客源地
$this->ci->tldOrderBuilder->setCustomerFromCity($from_country);
@ -423,7 +437,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 +448,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)
@ -446,7 +460,7 @@ class Tulanduo
// 客人列表
$from_country = ""; // 客源地
foreach ($train_guest_list as $key => $vg) {
// $this_otherinfo = "";
$this_otherinfo = "";
$this->ci->tldOrderBuilder->setCustomersName($key, $vg->MemberName )
->setCustomersPeopleType($key, ($vg->BPE_GuestType==1 ? "成人" : "儿童"))
->setCustomersDocumentType($key, "护照") // Passport No.
@ -454,8 +468,15 @@ class Tulanduo
;
if (strval($vg->Country) !== '' && strval($from_country) === '') {
$from_country = $vg->Country;
$this_otherinfo .= $vg->Country;
}
if (strval($vg->BirthDay) !== '') {
$this_otherinfo .= "; 生日:". $vg->BirthDay;
}
if (strval($vg->PassportValidDate) !== '') {
$this_otherinfo .= "; 护照有效期:" . $vg->PassportValidDate;
}
// $this_otherinfo .= $this->ci->BIZ_order->GetNationalityName($vg->BPE_Nationality);
$this->ci->tldOrderBuilder->setCustomersOtherInfo($key, $this_otherinfo);
// todo:电话
// if (trim($vf['cold'][0]->GUT_TEL) != "" && $key===0) {
// $this_otherinfo .= "; 电话:";
@ -742,7 +763,15 @@ class Tulanduo
}
if (strval($from_country) === '' && strval($vg->Country) !== '') {
$from_country = $vg->Country;
$this_otherinfo .= "; " . $vg->Country;
}
if (strval($vg->BirthDay) !== '') {
$this_otherinfo .= "; 生日:". $vg->BirthDay;
}
if (strval($vg->PassportValidDate) !== '') {
$this_otherinfo .= "; 护照有效期:" . $vg->PassportValidDate;
}
$this->ci->tldOrderBuilder->setCustomersOtherInfo($key, $this_otherinfo);
}
if (strval($from_country)==='') {
$biz_contact = $this->ci->BIZ_order->get_customer_contact($COLD_SN_str);
@ -902,7 +931,7 @@ class Tulanduo
->setTravelFeesRemark($fee_index, "代收; " . $replace_collections->ALL_Memo);
}
}
// 查询是否变更 TODO: deprecated
// 查询是否变更 deprecated
$sync_orderstate = 10;
$vps_sn = 0;
$vendor_orderid = 0;

@ -53,34 +53,8 @@ class Group_model extends CI_Model {
public function get_vendor_plan_info($gri_sn, $vendor_id, $from_cold=false)
{
// 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, "SET NOCOUNT ON;EXEC Tourmanager.dbo.SP_VendorPlan_GetPlanInfo $gri_sn, $vendor_id, 0 ");
$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);
$grd_info = $result_object;
$sql = "SET NOCOUNT ON;EXEC Tourmanager.dbo.SP_VendorPlan_GetPlanInfo $gri_sn, $vendor_id, 0 ";
$grd_info = $this->call_sp_fun($sql);
$all_day_no = array_map(function($ele){return $ele->GRD_DayNo;}, $grd_info);
$day_no_str = implode(",", $all_day_no);
$cold_sn_str = implode(",", array_map(function ($ele){return $ele->GRD_COLD_SN;}, $grd_info));
@ -375,6 +349,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 */

@ -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)

Loading…
Cancel
Save