|
@@ -45,14 +45,14 @@ class ocean_order {
|
|
|
}
|
|
}
|
|
|
/*
|
|
/*
|
|
|
* ocean order search
|
|
* ocean order search
|
|
|
- */
|
|
|
|
|
|
|
+ */
|
|
|
if ($operate == "search") {
|
|
if ($operate == "search") {
|
|
|
$this->_ocean_search();
|
|
$this->_ocean_search();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
/*
|
|
|
* ocean order detail
|
|
* ocean order detail
|
|
|
- */
|
|
|
|
|
|
|
+ */
|
|
|
if ($operate == "detail") {
|
|
if ($operate == "detail") {
|
|
|
$this->_ocean_detail();
|
|
$this->_ocean_detail();
|
|
|
}
|
|
}
|
|
@@ -63,7 +63,7 @@ class ocean_order {
|
|
|
|
|
|
|
|
/*
|
|
/*
|
|
|
* export ocean order to excel
|
|
* export ocean order to excel
|
|
|
- */
|
|
|
|
|
|
|
+ */
|
|
|
if ($operate == "excel") {
|
|
if ($operate == "excel") {
|
|
|
$this->_ocean_excel();
|
|
$this->_ocean_excel();
|
|
|
}
|
|
}
|
|
@@ -74,7 +74,7 @@ class ocean_order {
|
|
|
|
|
|
|
|
/*
|
|
/*
|
|
|
* download document
|
|
* download document
|
|
|
- */
|
|
|
|
|
|
|
+ */
|
|
|
if ($operate == "download") {
|
|
if ($operate == "download") {
|
|
|
$this->_download();
|
|
$this->_download();
|
|
|
}
|
|
}
|
|
@@ -195,10 +195,10 @@ class ocean_order {
|
|
|
$detail_information_column[] = array("title" =>"SN","field" =>"sn","formatter" =>"","type" =>"normal");
|
|
$detail_information_column[] = array("title" =>"SN","field" =>"sn","formatter" =>"","type" =>"normal");
|
|
|
$detail_information_column[] = array("title" =>"Carrier Booking No.","field" =>"carrier_booking_no","formatter" =>"","type" =>"normal");
|
|
$detail_information_column[] = array("title" =>"Carrier Booking No.","field" =>"carrier_booking_no","formatter" =>"","type" =>"normal");
|
|
|
$detail_information_column[] = array("title" =>"Container No","field" =>"ctnr","formatter" =>"","type" =>"normal");
|
|
$detail_information_column[] = array("title" =>"Container No","field" =>"ctnr","formatter" =>"","type" =>"normal");
|
|
|
- $detail_information_column[] = array("title" =>"VGM Weight","field" =>"vgm_weight","formatter" =>"","type" =>"normal");
|
|
|
|
|
- $detail_information_column[] = array("title" =>"VGM Unit","field" =>"unit","formatter" =>"","type" =>"normal");
|
|
|
|
|
- $detail_information_column[] = array("title" =>"VGM Time","field" =>"vgm_time","formatter" =>"","type" =>"normal");
|
|
|
|
|
- $detail_information_column[] = array("title" =>"VGM Method","field" =>"vgm_method","formatter" =>"","type" =>"normal");
|
|
|
|
|
|
|
+ $detail_information_column[] = array("title" =>"VGM Weight","field" =>"vgm_weight","formatter" =>"","type" =>"input");
|
|
|
|
|
+ $detail_information_column[] = array("title" =>"VGM Unit","field" =>"unit","formatter" =>"","type" =>"select");
|
|
|
|
|
+ $detail_information_column[] = array("title" =>"VGM Time","field" =>"vgm_time","formatter" =>"","type" =>"dateTime");
|
|
|
|
|
+ $detail_information_column[] = array("title" =>"VGM Method","field" =>"vgm_method","formatter" =>"","type" =>"input");
|
|
|
foreach($rs as $rk => $rv){
|
|
foreach($rs as $rk => $rv){
|
|
|
$log[$rk]['sn'] = $rk +1;
|
|
$log[$rk]['sn'] = $rk +1;
|
|
|
}
|
|
}
|
|
@@ -232,7 +232,7 @@ class ocean_order {
|
|
|
"Vessel"=>$ocean_info["m_vessel"],"Voyage"=>$ocean_info["m_voyage"],
|
|
"Vessel"=>$ocean_info["m_vessel"],"Voyage"=>$ocean_info["m_voyage"],
|
|
|
"ETD"=>$ocean_info["f_etd"],"ETA"=>$ocean_info["m_eta"],
|
|
"ETD"=>$ocean_info["f_etd"],"ETA"=>$ocean_info["m_eta"],
|
|
|
"Last updated User"=>$ocean_info["modify_user"],"Last updated Time"=>$ocean_info["modify_time"],
|
|
"Last updated User"=>$ocean_info["modify_user"],"Last updated Time"=>$ocean_info["modify_time"],
|
|
|
- "Submitter" =>$Submitter,"$signature" =>$signature,"authorized_email" =>$authorized_email,"authorized_tel" =>$authorized_tel,"is_send" =>$ocean_info['is_send']);
|
|
|
|
|
|
|
+ "Submitter" =>$Submitter,"signature" =>$signature,"authorized_email" =>$authorized_email,"authorized_tel" =>$authorized_tel,"is_send" =>$ocean_info['is_send']);
|
|
|
|
|
|
|
|
$data["detail_information"] = $detail_information;
|
|
$data["detail_information"] = $detail_information;
|
|
|
$data["schemas"] = $schemas;
|
|
$data["schemas"] = $schemas;
|
|
@@ -300,8 +300,27 @@ class ocean_order {
|
|
|
$sqlWhere .= " and ($_sqlwhere)";
|
|
$sqlWhere .= " and ($_sqlwhere)";
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+ //取消全文检索
|
|
|
|
|
+ // if (!empty($_POST["_textSearch"])) {
|
|
|
|
|
+ // $sqlWhere .= " and text_search @@ (str_to_tsquery('" . common::check_input($_POST["_textSearch"]) . "'))";
|
|
|
|
|
+ // }
|
|
|
|
|
+
|
|
|
|
|
+ //处理reference类型的组合查询 Search booking No./HBL No./PO No./Carrier Booking No.
|
|
|
if (!empty($_POST["_textSearch"])) {
|
|
if (!empty($_POST["_textSearch"])) {
|
|
|
- $sqlWhere .= " and text_search @@ (str_to_tsquery('" . common::check_input($_POST["_textSearch"]) . "'))";
|
|
|
|
|
|
|
+ $textSearch_arr = $_POST['_textSearch'];
|
|
|
|
|
+ if(!is_array($textSearch_arr)){
|
|
|
|
|
+ $textSearch_arr = array($textSearch_arr);
|
|
|
|
|
+ }
|
|
|
|
|
+ $more_sql = "1<>1";
|
|
|
|
|
+ foreach($textSearch_arr as $tsv){
|
|
|
|
|
+ $more_sql .= " or booking_no ilike '%" . common::check_input(trim($tsv)) . "%'";
|
|
|
|
|
+ $more_sql .= " or h_bol ilike '%" . common::check_input(trim($tsv)) . "%'";
|
|
|
|
|
+ $more_sql .= " or po_no ilike '%" . common::check_input(trim($tsv)) . "%'";
|
|
|
|
|
+ $more_sql .= " or carrier_booking ilike '%" . common::check_input(trim($tsv)) . "%'";
|
|
|
|
|
+ }
|
|
|
|
|
+ if ($more_sql <> "1<>1"){
|
|
|
|
|
+ $sqlWhere .= " and ($more_sql)";
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
$rc = $_POST ['rc'];
|
|
$rc = $_POST ['rc'];
|
|
@@ -321,6 +340,7 @@ class ocean_order {
|
|
|
select regexp_split_to_table('Booking Confirmation,Cargo Pickup,Cargo Arrived at Origin,Departure,Arrived at Final Destination Port,Arrived at Final Destination', ','))
|
|
select regexp_split_to_table('Booking Confirmation,Cargo Pickup,Cargo Arrived at Origin,Departure,Arrived at Final Destination Port,Arrived at Final Destination', ','))
|
|
|
order by id desc limit 1) dd on true" . $sqlWhere;
|
|
order by id desc limit 1) dd on true" . $sqlWhere;
|
|
|
$rc = common::excuteOneSql($sql);
|
|
$rc = common::excuteOneSql($sql);
|
|
|
|
|
+ error_log($sql);
|
|
|
|
|
|
|
|
//Booked
|
|
//Booked
|
|
|
$sql = $this->getOcanOrderSearchSql("Booked",$sqlWhere);
|
|
$sql = $this->getOcanOrderSearchSql("Booked",$sqlWhere);
|
|
@@ -400,17 +420,17 @@ class ocean_order {
|
|
|
" order by $order_by limit " . $ps . " offset " . ($cp - 1) * $ps;
|
|
" order by $order_by limit " . $ps . " offset " . ($cp - 1) * $ps;
|
|
|
|
|
|
|
|
$rs = common::excuteListSql($sql);
|
|
$rs = common::excuteListSql($sql);
|
|
|
- error_log($sql);
|
|
|
|
|
|
|
+
|
|
|
//对查询的结果做特殊处理,比如要拼接某个值,合并值等
|
|
//对查询的结果做特殊处理,比如要拼接某个值,合并值等
|
|
|
foreach($rs as $index => $val) {
|
|
foreach($rs as $index => $val) {
|
|
|
//返回加密serial_no
|
|
//返回加密serial_no
|
|
|
$rs[$index]["__serial_no"] = common::deCode($val['__serial_no'], 'E');
|
|
$rs[$index]["__serial_no"] = common::deCode($val['__serial_no'], 'E');
|
|
|
- $rs[$index]["mode"] = "Ocean Frieght";
|
|
|
|
|
- $rs[$index]["status"] = $rs[$index]["new_status"];
|
|
|
|
|
|
|
+ $rs[$index]["mode"] = "Ocean Freight";
|
|
|
|
|
+ $rs[$index]["Status"] = $rs[$index]["new_status"];
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
$arrTmp = array('searchData' => $rs,
|
|
$arrTmp = array('searchData' => $rs,
|
|
|
- 'tagsList' => array(),
|
|
|
|
|
|
|
+ 'tagsList' => $tagsList,
|
|
|
'TransportList' => $TransportList,
|
|
'TransportList' => $TransportList,
|
|
|
'allColums' => $allBookingColumns,
|
|
'allColums' => $allBookingColumns,
|
|
|
'canEdiVgm' => _canEdiVgm(),
|
|
'canEdiVgm' => _canEdiVgm(),
|
|
@@ -422,7 +442,7 @@ class ocean_order {
|
|
|
'type' => common::check_input($_POST ['_ntype']));
|
|
'type' => common::check_input($_POST ['_ntype']));
|
|
|
} else {
|
|
} else {
|
|
|
$arrTmp = array('searchData' => array(),
|
|
$arrTmp = array('searchData' => array(),
|
|
|
- 'tagsList' => array(),
|
|
|
|
|
|
|
+ 'tagsList' => $tagsList,
|
|
|
'TransportList' => $TransportList,
|
|
'TransportList' => $TransportList,
|
|
|
'allColums' => $allBookingColumns,
|
|
'allColums' => $allBookingColumns,
|
|
|
'allColcanEdiVgmums' => _canEdiVgm(),
|
|
'allColcanEdiVgmums' => _canEdiVgm(),
|
|
@@ -439,12 +459,23 @@ class ocean_order {
|
|
|
|
|
|
|
|
private function _ocean_detail() {
|
|
private function _ocean_detail() {
|
|
|
$serial_no = common::deCode($_GET['a'], 'D');
|
|
$serial_no = common::deCode($_GET['a'], 'D');
|
|
|
- $status = $_GET['status'];
|
|
|
|
|
$sql = "SELECT m_eta as _m_eta, h_bol as _h_bol, m_bol as _m_bol,job_no as _job_bol,
|
|
$sql = "SELECT m_eta as _m_eta, h_bol as _h_bol, m_bol as _m_bol,job_no as _job_bol,
|
|
|
public.z_get_eta_dest(o.final_eta::date, o.eta_dest::text, o.service::text, o.m_eta::date, o.place_of_delivery::text, o.mport_of_discharge::text) as _eta_dest,
|
|
public.z_get_eta_dest(o.final_eta::date, o.eta_dest::text, o.service::text, o.m_eta::date, o.place_of_delivery::text, o.mport_of_discharge::text) as _eta_dest,
|
|
|
to_char(final_eta, 'MM/DD/YYYY') as _final_eta,
|
|
to_char(final_eta, 'MM/DD/YYYY') as _final_eta,
|
|
|
- o.* ,sh.*, cn.* ,aa.*,dd.*
|
|
|
|
|
|
|
+ o.* ,sh.*, cn.* ,aa.*,dd.*,ee.status as new_status
|
|
|
from ocean o
|
|
from ocean o
|
|
|
|
|
+ left join LATERAL (select case when a.description='Booking Confirmation' then 'Booked'
|
|
|
|
|
+ when a.description='Cargo Pickup' then 'Cargo Received'
|
|
|
|
|
+ when a.description='Cargo Arrived at Origin' then 'Cargo Received'
|
|
|
|
|
+ when a.description='Departure' then 'Departed'
|
|
|
|
|
+ when a.description='Arrived at Final Destination Port Arrived' then 'Arrived'
|
|
|
|
|
+ when a.description='Arrived at Final Destination' then 'Completed'
|
|
|
|
|
+ else 'Booked' END as status
|
|
|
|
|
+ from ocean_milestone a
|
|
|
|
|
+ where a.serial_no=online_ocean.serial_no
|
|
|
|
|
+ and a.description in (
|
|
|
|
|
+ select regexp_split_to_table('Booking Confirmation,Cargo Pickup,Cargo Arrived at Origin,Departure,Arrived at Final Destination Port,Arrived at Final Destination', ','))
|
|
|
|
|
+ order by id desc limit 1) ee on true
|
|
|
LEFT JOIN LATERAL ( SELECT company as cn_company,
|
|
LEFT JOIN LATERAL ( SELECT company as cn_company,
|
|
|
address_1 as cn_address_1,
|
|
address_1 as cn_address_1,
|
|
|
address_2 as cn_address_2,
|
|
address_2 as cn_address_2,
|
|
@@ -500,8 +531,7 @@ class ocean_order {
|
|
|
$mostStatus = common::excuteObjectSql($mostStatusSql);
|
|
$mostStatus = common::excuteObjectSql($mostStatusSql);
|
|
|
$state = -1;
|
|
$state = -1;
|
|
|
if (!empty($mostStatus["last_status_315_code"])) {
|
|
if (!empty($mostStatus["last_status_315_code"])) {
|
|
|
- $desc = $mostStatus["last_status_315_code"] . "(" . common::getStatusDesc($mostStatus["last_status_315_code"]) . "): " . $mostStatus["last_status_315_date"];
|
|
|
|
|
- $mostStatus = $desc;
|
|
|
|
|
|
|
+ //desc 逻辑处理取消
|
|
|
$state = common::getStatusStage($mostStatus["last_status_315_code"]);
|
|
$state = common::getStatusStage($mostStatus["last_status_315_code"]);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -536,7 +566,7 @@ class ocean_order {
|
|
|
|
|
|
|
|
|
|
|
|
|
//处理transportInfo信息数据
|
|
//处理transportInfo信息数据
|
|
|
- $transportInfo = array("Tracking No." =>$ocean['tracking_no'],"status"=>$status,"mode" => "Ocean Frieght",
|
|
|
|
|
|
|
+ $transportInfo = array("Tracking No." =>$ocean['tracking_no'],"status"=>$ocean['new_status'],"mode" => "Ocean Freight",
|
|
|
"origin" =>$ocean['origin_station'],"destination" =>$ocean['destination_station'],
|
|
"origin" =>$ocean['origin_station'],"destination" =>$ocean['destination_station'],
|
|
|
"etd" =>$ocean['f_etd'],"atd" =>"","eta" =>$ocean['m_eta'],"ata" =>"");
|
|
"etd" =>$ocean['f_etd'],"atd" =>"","eta" =>$ocean['m_eta'],"ata" =>"");
|
|
|
|
|
|
|
@@ -646,10 +676,11 @@ class ocean_order {
|
|
|
|
|
|
|
|
//Milestones 数据信息待定
|
|
//Milestones 数据信息待定
|
|
|
$Milestones_data = array();
|
|
$Milestones_data = array();
|
|
|
- $Milestones_data_arr = common::excuteListSql("select description,act_date||act_time as date_time, remark from ocean_milestone a
|
|
|
|
|
|
|
+ $Milestones_data_arr = common::excuteListSql("select description,act_date||' '||act_time as date_time, remark,timezone from ocean_milestone a
|
|
|
where a.serial_no='".$ocean["serial_no"]."' order by id");
|
|
where a.serial_no='".$ocean["serial_no"]."' order by id");
|
|
|
foreach($Milestones_data_arr as $mda){
|
|
foreach($Milestones_data_arr as $mda){
|
|
|
- $Milestones_data[] = array("milestones"=>$mda['description'],"date_time"=>$mda['date_time'],"locations" => "", "remarks" =>$mda['remark']);
|
|
|
|
|
|
|
+ $Milestones_data[] = array("milestones"=>$mda['description'],"date_time"=>$mda['date_time'],"timezone" =>$mda['timezone'],
|
|
|
|
|
+ "locations" => "", "remarks" =>$mda['remark']);
|
|
|
}
|
|
}
|
|
|
$Milestones = array("Milestones_column"=>$Milestones_column,"Milestones_data" =>$Milestones_data);
|
|
$Milestones = array("Milestones_column"=>$Milestones_column,"Milestones_data" =>$Milestones_data);
|
|
|
|
|
|
|
@@ -749,6 +780,7 @@ class ocean_order {
|
|
|
'ams_ss' => md5(md5($ocean['serial_no'])),
|
|
'ams_ss' => md5(md5($ocean['serial_no'])),
|
|
|
'isf_ss' => $isf_ss,
|
|
'isf_ss' => $isf_ss,
|
|
|
'_schemas' =>$_schemas,
|
|
'_schemas' =>$_schemas,
|
|
|
|
|
+ 'uncode' =>$uncode,
|
|
|
'can_upload_doc' => strtolower($_SESSION['ONLINE_USER']['can_upload_doc']) == 't' || strtolower($_SESSION['ONLINE_USER']['can_view_doc']) == 't',
|
|
'can_upload_doc' => strtolower($_SESSION['ONLINE_USER']['can_upload_doc']) == 't' || strtolower($_SESSION['ONLINE_USER']['can_view_doc']) == 't',
|
|
|
'canEdiVgm' => _canEdiVgm(),
|
|
'canEdiVgm' => _canEdiVgm(),
|
|
|
'copyright' =>$_COPYRIGHT);
|
|
'copyright' =>$_COPYRIGHT);
|