|
@@ -305,7 +305,10 @@ class tools {
|
|
|
|
|
|
|
|
//Milestone Update的结构处理
|
|
//Milestone Update的结构处理
|
|
|
//这里基准event 写死, 根据online查询页面的通用的来, 这里需提问确定
|
|
//这里基准event 写死, 根据online查询页面的通用的来, 这里需提问确定
|
|
|
- $event =common::getEDICtnrEvent();
|
|
|
|
|
|
|
+ //$event =common::getEDICtnrEvent();
|
|
|
|
|
+ $event = common::excuteListSql("select ra_name as event_name,ra_order,description
|
|
|
|
|
+ from public.ra_online_edi_event e
|
|
|
|
|
+ where e.ra_name in('I','VD','VA','UV','AL','AR','OA','RD') order by e.ra_order desc");
|
|
|
$ctnrStatus = array();
|
|
$ctnrStatus = array();
|
|
|
foreach($event as $e){
|
|
foreach($event as $e){
|
|
|
$ctnrStatus[] = array("label"=>$e['description'],"value"=>$e['event_name']);
|
|
$ctnrStatus[] = array("label"=>$e['description'],"value"=>$e['event_name']);
|
|
@@ -605,7 +608,10 @@ class tools {
|
|
|
//Milestone Update的结构处理
|
|
//Milestone Update的结构处理
|
|
|
if($rule_name == "Container_Status_Update"){
|
|
if($rule_name == "Container_Status_Update"){
|
|
|
//这里基准event 写死, 根据online查询页面的通用的来, 这里需提问确定
|
|
//这里基准event 写死, 根据online查询页面的通用的来, 这里需提问确定
|
|
|
- $event =common::getEDICtnrEvent();
|
|
|
|
|
|
|
+ //$event =common::getEDICtnrEvent();
|
|
|
|
|
+ $event = common::excuteListSql("select ra_name as event_name,ra_order,description
|
|
|
|
|
+ from public.ra_online_edi_event e
|
|
|
|
|
+ where e.ra_name in('I','VD','VA','UV','AL','AR','OA','RD') order by e.ra_order desc");
|
|
|
$ctnrStatus = array();
|
|
$ctnrStatus = array();
|
|
|
foreach($event as $e){
|
|
foreach($event as $e){
|
|
|
$ctnrStatus[] = array("label"=>$e['description'],"value"=>$e['event_name']);
|
|
$ctnrStatus[] = array("label"=>$e['description'],"value"=>$e['event_name']);
|
|
@@ -718,18 +724,6 @@ class tools {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
if ($rules_type == "Milestone_Update"){
|
|
if ($rules_type == "Milestone_Update"){
|
|
|
- //提交的description 的转换code
|
|
|
|
|
- $milestones = common::excuteListSql("select * from public.customer_service_milestone_sno order by type, sno");
|
|
|
|
|
- $oceanMilestone = array();
|
|
|
|
|
- $airMilestone = array();
|
|
|
|
|
- foreach($milestones as $milestone){
|
|
|
|
|
- if($milestone['type'] == "air"){
|
|
|
|
|
- $airMilestone[] = $milestone;
|
|
|
|
|
- }
|
|
|
|
|
- if($milestone['type'] == "sea"){
|
|
|
|
|
- $oceanMilestone[] = $milestone;
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
$ocean_milestone = utils::implode(";",$_POST['ocean_milestone']);
|
|
$ocean_milestone = utils::implode(";",$_POST['ocean_milestone']);
|
|
|
$air_milestone = utils::implode(";",$_POST['air_milestone']);
|
|
$air_milestone = utils::implode(";",$_POST['air_milestone']);
|
|
|
|
|
|
|
@@ -747,7 +741,6 @@ class tools {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
if ($rules_type == "Container_Status_Update"){
|
|
if ($rules_type == "Container_Status_Update"){
|
|
|
- $event = common::getEDICtnrEvent();
|
|
|
|
|
$ocean_ctnr_status = utils::implode(";",$_POST['ocean_ctnr_status']);
|
|
$ocean_ctnr_status = utils::implode(";",$_POST['ocean_ctnr_status']);
|
|
|
|
|
|
|
|
$sql.="INSERT INTO public.notifications_rules(
|
|
$sql.="INSERT INTO public.notifications_rules(
|
|
@@ -984,6 +977,11 @@ class tools {
|
|
|
else ''
|
|
else ''
|
|
|
end as milestone_previous_json,
|
|
end as milestone_previous_json,
|
|
|
|
|
|
|
|
|
|
+ case when ni.notifiation_type ='Container_Status_Update'
|
|
|
|
|
+ then public.getPreviousCtnrStatus(ni.serial_no,ni.ctnr,ni.ctnr_status_code)
|
|
|
|
|
+ else ''
|
|
|
|
|
+ end as ctnr_previous_json,
|
|
|
|
|
+
|
|
|
ccc.order_from,ccc.h_bol,ccc.transport_mode
|
|
ccc.order_from,ccc.h_bol,ccc.transport_mode
|
|
|
from public.kln_notifiation_info ni
|
|
from public.kln_notifiation_info ni
|
|
|
left join LATERAL (select oo.h_bol,oo.transport_mode,oo.order_from
|
|
left join LATERAL (select oo.h_bol,oo.transport_mode,oo.order_from
|
|
@@ -1081,9 +1079,11 @@ class tools {
|
|
|
$eventCard["title"] = "Milestone Update Daily Summary(".$mInfo["insert_date_format"].")";
|
|
$eventCard["title"] = "Milestone Update Daily Summary(".$mInfo["insert_date_format"].")";
|
|
|
$eventCard["insert_date_format"] = $mInfo["insert_date_format"];
|
|
$eventCard["insert_date_format"] = $mInfo["insert_date_format"];
|
|
|
$eventCard["previous"] = '';
|
|
$eventCard["previous"] = '';
|
|
|
|
|
+
|
|
|
$milestone_previous = json_decode($mInfo["milestone_previous_json"],true);
|
|
$milestone_previous = json_decode($mInfo["milestone_previous_json"],true);
|
|
|
- if(!empty($milestone_previous['milestone'])){
|
|
|
|
|
|
|
+ if(!empty($milestone_previous['milestone']['milestone_date'])){
|
|
|
$eventCard["previous"] = array("tag" =>"Previous:".$milestone_previous['milestone']['milestone_description']." from ".$milestone_previous['milestone']['locations'],
|
|
$eventCard["previous"] = array("tag" =>"Previous:".$milestone_previous['milestone']['milestone_description']." from ".$milestone_previous['milestone']['locations'],
|
|
|
|
|
+ "date" => $milestone_previous['milestone']['milestone_date'],
|
|
|
"time" => $milestone_previous['milestone']['milestone_time'],
|
|
"time" => $milestone_previous['milestone']['milestone_time'],
|
|
|
"timezone" =>$milestone_previous['milestone']['timezone']);
|
|
"timezone" =>$milestone_previous['milestone']['timezone']);
|
|
|
}
|
|
}
|
|
@@ -1091,10 +1091,13 @@ class tools {
|
|
|
$eventCard["numericRecords"] = !empty($mInfo["numericRecords"]) ? $mInfo["numericRecords"] : 0;
|
|
$eventCard["numericRecords"] = !empty($mInfo["numericRecords"]) ? $mInfo["numericRecords"] : 0;
|
|
|
$eventCard["title"] = "Milestone Update Weekly Summary(".$mInfo["insert_date_format"].")";
|
|
$eventCard["title"] = "Milestone Update Weekly Summary(".$mInfo["insert_date_format"].")";
|
|
|
$eventCard["insert_date_format"] = $mInfo["insert_date_format"];
|
|
$eventCard["insert_date_format"] = $mInfo["insert_date_format"];
|
|
|
- if(!empty($mInfo["previous"])){
|
|
|
|
|
- $eventCard["previous"] = array("tag" =>"Previous:".$mInfo["previous"]["milestone_desc"]." from ".$mInfo["previous"]["milestone_description"],
|
|
|
|
|
- "time" => $mInfo["previous"]["milestone_time"],
|
|
|
|
|
- "timezone" =>$mInfo["previous"]["milestone_timezone"]);
|
|
|
|
|
|
|
+
|
|
|
|
|
+ $milestone_previous = json_decode($mInfo["milestone_previous_json"],true);
|
|
|
|
|
+ if(!empty($milestone_previous['milestone']['milestone_date'])){
|
|
|
|
|
+ $eventCard["previous"] = array("tag" =>"Previous:".$milestone_previous['milestone']['milestone_description']." from ".$milestone_previous['milestone']['locations'],
|
|
|
|
|
+ "date" => $milestone_previous['milestone']['milestone_date'],
|
|
|
|
|
+ "time" => $milestone_previous['milestone']['milestone_time'],
|
|
|
|
|
+ "timezone" =>$milestone_previous['milestone']['timezone']);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -1124,23 +1127,27 @@ class tools {
|
|
|
$eventCard["numericRecords"] = !empty($mInfo["numericRecords"]) ? $mInfo["numericRecords"] : 0;
|
|
$eventCard["numericRecords"] = !empty($mInfo["numericRecords"]) ? $mInfo["numericRecords"] : 0;
|
|
|
$eventCard["title"] = "Container Status Update Daily Summary(".$mInfo["insert_date_format"].")";
|
|
$eventCard["title"] = "Container Status Update Daily Summary(".$mInfo["insert_date_format"].")";
|
|
|
$eventCard["insert_date_format"] = $mInfo["insert_date_format"];
|
|
$eventCard["insert_date_format"] = $mInfo["insert_date_format"];
|
|
|
- if(!empty($mInfo["previous"])){
|
|
|
|
|
- //当前状态 前一个的描述
|
|
|
|
|
- $previousCtnrStatusdesc = $this->getContainerStatusDesc($mInfo["previous"]["ctnr_status_code"]);
|
|
|
|
|
- $eventCard["previous"] = array("tag" =>"Previous:" .$previousCtnrStatusdesc. " from " .$mInfo["previous"]["ctnr_status_locations"],
|
|
|
|
|
- "time" => $mInfo["previous"]["ctnr_status_time"],
|
|
|
|
|
- "timezone" =>$mInfo["previous"]["ctnr_status_timezone"]);
|
|
|
|
|
|
|
+
|
|
|
|
|
+ $ctnr_previous = json_decode($mInfo["ctnr_previous_json"],true);
|
|
|
|
|
+ if(!empty($ctnr_previous["ctnrStatus"]["date"])){
|
|
|
|
|
+ //当前状态 前一个的描述
|
|
|
|
|
+ $eventCard["previous"] = array("tag" =>"Previous:" .$ctnr_previous["ctnrStatus"]["description"]. " from " .$ctnr_previous["ctnrStatus"]["locations"],
|
|
|
|
|
+ "date" => $ctnr_previous["ctnrStatus"]["date"],
|
|
|
|
|
+ "time" => $ctnr_previous["ctnrStatus"]["time"],
|
|
|
|
|
+ "timezone" =>$ctnr_previous["ctnrStatus"]["timezone"]);
|
|
|
}
|
|
}
|
|
|
} else if($mInfo["frequency_type"] == "Weekly"){
|
|
} else if($mInfo["frequency_type"] == "Weekly"){
|
|
|
$eventCard["numericRecords"] = !empty($mInfo["numericRecords"]) ? $mInfo["numericRecords"] : 0;
|
|
$eventCard["numericRecords"] = !empty($mInfo["numericRecords"]) ? $mInfo["numericRecords"] : 0;
|
|
|
$eventCard["title"] = "Container Status Update Weekly Summary(".$mInfo["insert_date_format"].")";
|
|
$eventCard["title"] = "Container Status Update Weekly Summary(".$mInfo["insert_date_format"].")";
|
|
|
$eventCard["insert_date_format"] = $mInfo["insert_date_format"];
|
|
$eventCard["insert_date_format"] = $mInfo["insert_date_format"];
|
|
|
- if(!empty($mInfo["previous"])){
|
|
|
|
|
- //当前状态 前一个的描述
|
|
|
|
|
- $previousCtnrStatusdesc = $this->getContainerStatusDesc($mInfo["previous"]["ctnr_status_code"]);
|
|
|
|
|
- $eventCard["previous"] = array("tag" =>"Previous:" .$previousCtnrStatusdesc. " from " .$mInfo["previous"]["ctnr_status_locations"],
|
|
|
|
|
- "time" => $mInfo["previous"]["ctnr_status_time"],
|
|
|
|
|
- "timezone" =>$mInfo["previous"]["ctnr_status_timezone"]);
|
|
|
|
|
|
|
+
|
|
|
|
|
+ $ctnr_previous = json_decode($mInfo["ctnr_previous_json"],true);
|
|
|
|
|
+ if(!empty($ctnr_previous["ctnrStatus"]["date"])){
|
|
|
|
|
+ //当前状态 前一个的描述
|
|
|
|
|
+ $eventCard["previous"] = array("tag" =>"Previous:" .$ctnr_previous["ctnrStatus"]["description"]. " from " .$ctnr_previous["ctnrStatus"]["locations"],
|
|
|
|
|
+ "date" => $ctnr_previous["ctnrStatus"]["date"],
|
|
|
|
|
+ "time" => $ctnr_previous["ctnrStatus"]["time"],
|
|
|
|
|
+ "timezone" =>$ctnr_previous["ctnrStatus"]["timezone"]);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -1293,7 +1300,7 @@ class tools {
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
- * 返回当前柜子的status信息描述
|
|
|
|
|
|
|
+ * 返回当前柜子的status信息描述,目前作废
|
|
|
*/
|
|
*/
|
|
|
public static function getContainerStatusDesc($ctnr_status_code){
|
|
public static function getContainerStatusDesc($ctnr_status_code){
|
|
|
$event =common::getEDICtnrEvent();
|
|
$event =common::getEDICtnrEvent();
|