|
@@ -138,8 +138,8 @@ class tools {
|
|
|
|
|
|
|
|
$sql = "select u.first_name,u.last_name,u.user_login,u.email,EXTRACT(DAY from (now() - u.last_pwd_change)) as last_pwd_change_date,
|
|
$sql = "select u.first_name,u.last_name,u.user_login,u.email,EXTRACT(DAY from (now() - u.last_pwd_change)) as last_pwd_change_date,
|
|
|
ue.date_format,ue.numbers_format
|
|
ue.date_format,ue.numbers_format
|
|
|
- from ra_online_user u
|
|
|
|
|
- left join kln_user_extend ue on u.user_login = ue.user_login
|
|
|
|
|
|
|
+ from public.ra_online_user u
|
|
|
|
|
+ left join public.kln_user_extend ue on u.user_login = ue.user_login
|
|
|
where lower(u.user_login) = '".strtolower(_getLoginName())."' ";
|
|
where lower(u.user_login) = '".strtolower(_getLoginName())."' ";
|
|
|
|
|
|
|
|
$data = common::excuteObjectSql($sql);
|
|
$data = common::excuteObjectSql($sql);
|
|
@@ -453,13 +453,19 @@ class tools {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
if(!empty($v['daily'])){
|
|
if(!empty($v['daily'])){
|
|
|
- //取第一组的第一个显示
|
|
|
|
|
- $dailyFristAndFrist = utils::getDailyAndweeklyFrist($v['daily']);
|
|
|
|
|
- $instant_sum[]= $dailyFristAndFrist;
|
|
|
|
|
|
|
+ $dailys = common::handleDailyWeekedData($v['daily']);
|
|
|
|
|
+ foreach($dailys as $dailyArr){
|
|
|
|
|
+ //取第一组的第一个显示
|
|
|
|
|
+ $dailyFristAndFrist = utils::getDailyAndweeklyFrist($dailyArr);
|
|
|
|
|
+ $instant_sum[]= $dailyFristAndFrist;
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
if(!empty($v['weekly'])){
|
|
if(!empty($v['weekly'])){
|
|
|
- $weeklyFristAndFrist = utils::getDailyAndweeklyFrist($v['weekly']);
|
|
|
|
|
- $instant_sum[]= $weeklyFristAndFrist;
|
|
|
|
|
|
|
+ $weeklys = common::handleDailyWeekedData($v['weekly']);
|
|
|
|
|
+ foreach($weeklys as $weeklyArr){
|
|
|
|
|
+ $weeklyFristAndFrist = utils::getDailyAndweeklyFrist($weeklyArr);
|
|
|
|
|
+ $instant_sum[]= $weeklyFristAndFrist;
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
//根据时间顺序排序
|
|
//根据时间顺序排序
|
|
@@ -481,8 +487,9 @@ class tools {
|
|
|
if($operate == "notifications_see_all"){
|
|
if($operate == "notifications_see_all"){
|
|
|
$rules_type = common::check_input($_REQUEST['rules_type']);
|
|
$rules_type = common::check_input($_REQUEST['rules_type']);
|
|
|
$frequency_type = common::check_input($_REQUEST['frequency_type']); //这个只会传daily 和weekly
|
|
$frequency_type = common::check_input($_REQUEST['frequency_type']); //这个只会传daily 和weekly
|
|
|
|
|
+ $insert_date_format = common::check_input($_REQUEST['insert_date_format']);
|
|
|
|
|
|
|
|
- $notificationsData = $this->getNotifications($rules_type,$frequency_type);
|
|
|
|
|
|
|
+ $notificationsData = $this->getNotifications($rules_type,$frequency_type,$insert_date_format);
|
|
|
$moreData = $notificationsData[$rules_type][strtolower($frequency_type)];
|
|
$moreData = $notificationsData[$rules_type][strtolower($frequency_type)];
|
|
|
|
|
|
|
|
//这个函数里面带有分开计数的信息
|
|
//这个函数里面带有分开计数的信息
|
|
@@ -490,6 +497,7 @@ class tools {
|
|
|
|
|
|
|
|
$returnData = array();
|
|
$returnData = array();
|
|
|
$notificationList = array();
|
|
$notificationList = array();
|
|
|
|
|
+ $ids = array();
|
|
|
foreach($moreData as $key => $data){
|
|
foreach($moreData as $key => $data){
|
|
|
$eventCard = $this->getEventCard($data);
|
|
$eventCard = $this->getEventCard($data);
|
|
|
//sea all的数据格式和查询全部的格式有区别
|
|
//sea all的数据格式和查询全部的格式有区别
|
|
@@ -505,19 +513,18 @@ class tools {
|
|
|
//移除不需要的字段
|
|
//移除不需要的字段
|
|
|
unset($eventCard["title"]);
|
|
unset($eventCard["title"]);
|
|
|
$notificationList[] = $eventCard;
|
|
$notificationList[] = $eventCard;
|
|
|
|
|
+ $ids[] = $data['id'];
|
|
|
}
|
|
}
|
|
|
if(!empty($notificationList)){
|
|
if(!empty($notificationList)){
|
|
|
$returnData["notificationList"] = $notificationList;
|
|
$returnData["notificationList"] = $notificationList;
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
//点击seall会默认全部标记为已读
|
|
//点击seall会默认全部标记为已读
|
|
|
- $all_id = $notificationsData[$rules_type][strtolower($frequency_type."_all_id")];
|
|
|
|
|
- $returnData["all_id"] = $all_id;
|
|
|
|
|
- if(!empty($all_id)){
|
|
|
|
|
- $more_param = common::getInNotInSqlForSearch(strtolower(utils::implode(';',$all_id)));
|
|
|
|
|
|
|
+ if(!empty($ids)){
|
|
|
|
|
+ $more_param = common::getInNotInSqlForSearch(strtolower(utils::implode(';',$ids)));
|
|
|
$markReadSql = "update public.kln_notifiation_info set is_send_message = true where id in ($more_param)";
|
|
$markReadSql = "update public.kln_notifiation_info set is_send_message = true where id in ($more_param)";
|
|
|
//common::excuteUpdateSql($markReadSql);
|
|
//common::excuteUpdateSql($markReadSql);
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
common::echo_json_encode(200,$returnData);
|
|
common::echo_json_encode(200,$returnData);
|
|
|
exit();
|
|
exit();
|
|
|
}
|
|
}
|
|
@@ -546,7 +553,15 @@ class tools {
|
|
|
if ($operate == "notifications_message_init"){
|
|
if ($operate == "notifications_message_init"){
|
|
|
$rules_type = common::check_input($_REQUEST['rules_type']);
|
|
$rules_type = common::check_input($_REQUEST['rules_type']);
|
|
|
//查询所有情况得未读情况 查询最近一年的情况
|
|
//查询所有情况得未读情况 查询最近一年的情况
|
|
|
- //"select * from public.kln_notifiation_info where ";
|
|
|
|
|
|
|
+ "select
|
|
|
|
|
+ sum(case when (1<>1 or (notifiation_type='Milestone_Update')) then 1 else 0 end) as sea_rc,
|
|
|
|
|
+ sum(case when (1<>1 or (notifiation_type='sea')) then 1 else 0 end) as sea_rc,
|
|
|
|
|
+ sum(case when (1<>1 or (notifiation_type='sea')) then 1 else 0 end) as sea_rc,
|
|
|
|
|
+ sum(case when (1<>1 or (notifiation_type='sea')) then 1 else 0 end) as sea_rc,
|
|
|
|
|
+ sum(case when (1<>1 or (notifiation_type='sea')) then 1 else 0 end) as sea_rc
|
|
|
|
|
+ from public.kln_notifiation_info
|
|
|
|
|
+ where insert_date > NOW() - INTERVAL '1 year'
|
|
|
|
|
+ and notifications_method = 'true' and is_send_message = 'false'";
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -929,7 +944,7 @@ class tools {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
- public function getNotifications($notifiation_type,$frequency_type){
|
|
|
|
|
|
|
+ public function getNotifications($notifiation_type,$frequency_type,$insert_date_format = null){
|
|
|
if ($frequency_type == "all"){
|
|
if ($frequency_type == "all"){
|
|
|
$sql_where = " and (ni.frequency_type = 'Instant'
|
|
$sql_where = " and (ni.frequency_type = 'Instant'
|
|
|
or (ni.frequency_type = 'Daily' and timezone(ni.daily_time_zone, NOW()::time) > ni.daily_time::time)
|
|
or (ni.frequency_type = 'Daily' and timezone(ni.daily_time_zone, NOW()::time) > ni.daily_time::time)
|
|
@@ -941,22 +956,36 @@ class tools {
|
|
|
$sql_where = " and (ni.frequency_type = 'Weekly' and timezone(ni.weekly_time_zone, NOW()::time) > ni.weekly_time::time
|
|
$sql_where = " and (ni.frequency_type = 'Weekly' and timezone(ni.weekly_time_zone, NOW()::time) > ni.weekly_time::time
|
|
|
and ni.weekly_week ilike '%'|| EXTRACT(dow FROM timezone(ni.weekly_time_zone, NOW())) ||'%')";
|
|
and ni.weekly_week ilike '%'|| EXTRACT(dow FROM timezone(ni.weekly_time_zone, NOW())) ||'%')";
|
|
|
}
|
|
}
|
|
|
|
|
+ //这里的查询会把不同日期的但hbol相同的信息,过滤掉只剩下最新的那一条。所以移除
|
|
|
|
|
+ $aa_where = "";
|
|
|
|
|
+ if (!empty($insert_date_format)){
|
|
|
|
|
+ $aa_where = " where insert_date_format = '$insert_date_format'";
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
$more_param = common::getInNotInSqlForSearch($notifiation_type);
|
|
$more_param = common::getInNotInSqlForSearch($notifiation_type);
|
|
|
-
|
|
|
|
|
- $sql = "select ni.*,
|
|
|
|
|
|
|
+ $sql = "select *
|
|
|
|
|
+ from (select ni.*,
|
|
|
case when ni.notifiation_type = 'Departure/Arrival_Delay' and ni.delay_unit = 'days'
|
|
case when ni.notifiation_type = 'Departure/Arrival_Delay' and ni.delay_unit = 'days'
|
|
|
then (EXTRACT(DAY FROM ((delay_act_date||' '||delay_act_time)::timestamp - (delay_est_date||' '||delay_est_time)::timestamp)))
|
|
then (EXTRACT(DAY FROM ((delay_act_date||' '||delay_act_time)::timestamp - (delay_est_date||' '||delay_est_time)::timestamp)))
|
|
|
when ni.notifiation_type = 'Departure/Arrival_Delay' and ni.delay_unit = 'hours'
|
|
when ni.notifiation_type = 'Departure/Arrival_Delay' and ni.delay_unit = 'hours'
|
|
|
then (EXTRACT(HOUR FROM ((delay_act_date||' '||delay_act_time)::timestamp - (delay_est_date||' '||delay_est_time)::timestamp)))
|
|
then (EXTRACT(HOUR FROM ((delay_act_date||' '||delay_act_time)::timestamp - (delay_est_date||' '||delay_est_time)::timestamp)))
|
|
|
else 0
|
|
else 0
|
|
|
end as delay_diff,
|
|
end as delay_diff,
|
|
|
|
|
+
|
|
|
case when COALESCE(ni.frequency_type,'') = 'Daily'
|
|
case when COALESCE(ni.frequency_type,'') = 'Daily'
|
|
|
- then to_char(timezone(ni.daily_time_zone, now()),'Mon DD, YYYY')
|
|
|
|
|
- when COALESCE(ni.frequency_type,'') = 'Weekly'
|
|
|
|
|
- then to_char(timezone(ni.weekly_time_zone, now()),'Mon DD, YYYY')
|
|
|
|
|
|
|
+ then to_char(timezone(ni.daily_time_zone, ni.insert_date),'Mon DD, YYYY')
|
|
|
|
|
+ when COALESCE(ni.frequency_type,'') = 'Weekly'
|
|
|
|
|
+ then (select to_char(timezone(ni.weekly_time_zone, ni.insert_date) - (week - 1 || 'day')::INTERVAL,'Mon DD, YYYY')|| ' - ' || to_char(timezone(ni.weekly_time_zone, ni.insert_date) + (7-week || 'day')::INTERVAL,'Mon DD, YYYY')
|
|
|
|
|
+ from (select case when EXTRACT(dow FROM timezone(ni.weekly_time_zone, ni.insert_date)) = 0 then 7
|
|
|
|
|
+ else EXTRACT(dow FROM timezone(ni.weekly_time_zone, ni.insert_date)) end as week) as a)
|
|
|
else ''
|
|
else ''
|
|
|
end as insert_date_format,
|
|
end as insert_date_format,
|
|
|
|
|
+
|
|
|
|
|
+ case when ni.notifiation_type ='Milestone_Update'
|
|
|
|
|
+ then public.getPreviousMilestone(ni.serial_no,ni.milestone_code,ccc.transport_mode,ccc.order_from)
|
|
|
|
|
+ else ''
|
|
|
|
|
+ end as milestone_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
|
|
@@ -964,7 +993,7 @@ class tools {
|
|
|
where oo.serial_no = ni.serial_no limit 1) ccc on true
|
|
where oo.serial_no = ni.serial_no limit 1) ccc on true
|
|
|
where lower(ni.user_login) = '".strtolower(_getLoginName())."'
|
|
where lower(ni.user_login) = '".strtolower(_getLoginName())."'
|
|
|
and lower(ni.notifiation_type) in ($more_param)
|
|
and lower(ni.notifiation_type) in ($more_param)
|
|
|
- ".$sql_where." and ni.notifications_method = true order by ni.insert_date desc";
|
|
|
|
|
|
|
+ ".$sql_where." and ni.notifications_method = true order by ni.insert_date desc) aa $aa_where";
|
|
|
error_log($sql);
|
|
error_log($sql);
|
|
|
|
|
|
|
|
$data_all_type = common::excuteListSql($sql);
|
|
$data_all_type = common::excuteListSql($sql);
|
|
@@ -989,57 +1018,39 @@ class tools {
|
|
|
$instant = array();
|
|
$instant = array();
|
|
|
$daily = array();
|
|
$daily = array();
|
|
|
$daily_uniqe = array();
|
|
$daily_uniqe = array();
|
|
|
- $daily_all_id = array();
|
|
|
|
|
|
|
|
|
|
$weekly = array();
|
|
$weekly = array();
|
|
|
$weekly_uniqe = array();
|
|
$weekly_uniqe = array();
|
|
|
- $weekly_all_id = array();
|
|
|
|
|
foreach($data as $d){
|
|
foreach($data as $d){
|
|
|
if ($d['frequency_type'] == "Instant"){
|
|
if ($d['frequency_type'] == "Instant"){
|
|
|
$instant[] = $d;
|
|
$instant[] = $d;
|
|
|
}
|
|
}
|
|
|
- //类型为这个时才用这个去重,否则要加上描述(转船的情况,会让相同的HBOL显示)
|
|
|
|
|
|
|
+ //Daily 或者 Weekly类型为这个时才用这个去重,否则要加上描述(转船的情况,会让相同的HBOL显示)
|
|
|
$uniqe_str = $d['serial_no'];
|
|
$uniqe_str = $d['serial_no'];
|
|
|
- if ($notifiation_type_db == "Departure/Arrival_Delay"){
|
|
|
|
|
- $uniqe_str = $d['serial_no']."_".$d['delay_name'];
|
|
|
|
|
- } else if($notifiation_type_db == "ETD/ETA_Change"){
|
|
|
|
|
- $uniqe_str = $d['serial_no']."_".$d['date_change_name'];
|
|
|
|
|
|
|
+ if ($notifiation_type_db == "Milestone_Update"){
|
|
|
|
|
+ $uniqe_str = $d['serial_no']."_".$d['insert_date_format']."_".$d['milestone_code'];
|
|
|
|
|
+ }else if ($notifiation_type_db == "Container_Status_Update"){
|
|
|
|
|
+ $uniqe_str = $d['ctnr']."_".$d['insert_date_format']."_".$d['ctnr_status_code'];
|
|
|
|
|
+ }else if($notifiation_type_db == "Departure/Arrival_Delay"){
|
|
|
|
|
+ $uniqe_str = $d['serial_no']."_".$d['insert_date_format']."_".$d['delay_name'];
|
|
|
|
|
+ }else if($notifiation_type_db == "ETD/ETA_Change"){
|
|
|
|
|
+ $uniqe_str = $d['serial_no']."_".$d['insert_date_format']."_".$d['date_change_name'];
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
if ($d['frequency_type'] == "Daily"){
|
|
if ($d['frequency_type'] == "Daily"){
|
|
|
- if($d["is_send_message"] <> 't'){
|
|
|
|
|
- $daily_all_id[] = $d["id"];
|
|
|
|
|
- }
|
|
|
|
|
- if(utils::in_array($uniqe_str,$daily_uniqe)){
|
|
|
|
|
- $temp = $daily[$uniqe_str];
|
|
|
|
|
- //previous只更新最近的一次,并且是需要查询详细的时候,才放开previous的查询
|
|
|
|
|
- if(empty($temp['previous']) && $frequency_type <> "all"){
|
|
|
|
|
- $temp['previous'] = $d;
|
|
|
|
|
- }
|
|
|
|
|
- $daily[$uniqe_str] = $temp;
|
|
|
|
|
- } else {
|
|
|
|
|
|
|
+ if(!utils::in_array($uniqe_str,$daily_uniqe)){
|
|
|
$daily[$uniqe_str] = $d;
|
|
$daily[$uniqe_str] = $d;
|
|
|
$daily_uniqe[] = $uniqe_str;
|
|
$daily_uniqe[] = $uniqe_str;
|
|
|
- }
|
|
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
if ($d['frequency_type'] == "Weekly"){
|
|
if ($d['frequency_type'] == "Weekly"){
|
|
|
- if($d["is_send_message"] <> 't'){
|
|
|
|
|
- $weekly_all_id[] = $d["id"];
|
|
|
|
|
- }
|
|
|
|
|
- if(utils::in_array($uniqe_str,$weekly_uniqe)){
|
|
|
|
|
- $temp = $weekly[$uniqe_str];
|
|
|
|
|
- //previous只更新最近的一次,并且是需要查询详细的时候,才放开previous的查询
|
|
|
|
|
- if(empty($temp['previous']) && $frequency_type <> "all"){
|
|
|
|
|
- $temp['previous'] = $d;
|
|
|
|
|
- }
|
|
|
|
|
- $weekly[$uniqe_str] = $temp;
|
|
|
|
|
- } else {
|
|
|
|
|
|
|
+ if(!utils::in_array($uniqe_str,$weekly_uniqe)){
|
|
|
$weekly[$uniqe_str] = $d;
|
|
$weekly[$uniqe_str] = $d;
|
|
|
$weekly_uniqe[] = $uniqe_str;
|
|
$weekly_uniqe[] = $uniqe_str;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- $retData[$key]= array("instant" =>$instant,"daily" =>utils::arrayKeyToInt($daily),"weekly"=>utils::arrayKeyToInt($weekly),
|
|
|
|
|
- "daily_all_id" =>$daily_all_id,"weekly_all_id"=>$weekly_all_id);
|
|
|
|
|
|
|
+ $retData[$key]= array("instant" =>$instant,"daily" =>utils::arrayKeyToInt($daily),"weekly"=>utils::arrayKeyToInt($weekly));
|
|
|
}
|
|
}
|
|
|
return $retData;
|
|
return $retData;
|
|
|
}
|
|
}
|
|
@@ -1062,21 +1073,26 @@ class tools {
|
|
|
"previous"=>"",
|
|
"previous"=>"",
|
|
|
"frequency_type"=>$mInfo["frequency_type"],
|
|
"frequency_type"=>$mInfo["frequency_type"],
|
|
|
"serial_no"=>$mInfo["serial_no"],
|
|
"serial_no"=>$mInfo["serial_no"],
|
|
|
- "order_from"=>$mInfo["order_from"],
|
|
|
|
|
|
|
+ "order_from"=>$mInfo["order_from"],
|
|
|
"id"=>$mInfo["id"],
|
|
"id"=>$mInfo["id"],
|
|
|
|
|
+ "insert_date_format"=>'',
|
|
|
"info"=>new stdClass());
|
|
"info"=>new stdClass());
|
|
|
|
|
|
|
|
if ($mInfo["frequency_type"] == "Daily"){
|
|
if ($mInfo["frequency_type"] == "Daily"){
|
|
|
$eventCard["numericRecords"] = !empty($mInfo["numericRecords"]) ? $mInfo["numericRecords"] : 0;
|
|
$eventCard["numericRecords"] = !empty($mInfo["numericRecords"]) ? $mInfo["numericRecords"] : 0;
|
|
|
$eventCard["title"] = "Milestone Update Daily Summary(".$mInfo["insert_date_format"].")";
|
|
$eventCard["title"] = "Milestone Update Daily Summary(".$mInfo["insert_date_format"].")";
|
|
|
- if(!empty($mInfo["previous"])){
|
|
|
|
|
- $eventCard["previous"] = array("tag" =>"Previous:".$mInfo["previous"]["milestone_description"]." from ".$mInfo["previous"]["milestone_locations"],
|
|
|
|
|
- "time" => $mInfo["previous"]["milestone_time"],
|
|
|
|
|
- "timezone" =>$mInfo["previous"]["milestone_timezone"]);
|
|
|
|
|
|
|
+ $eventCard["insert_date_format"] = $mInfo["insert_date_format"];
|
|
|
|
|
+ $eventCard["previous"] = '';
|
|
|
|
|
+ $milestone_previous = json_decode($mInfo["milestone_previous_json"],true);
|
|
|
|
|
+ if(!empty($milestone_previous['milestone'])){
|
|
|
|
|
+ $eventCard["previous"] = array("tag" =>"Previous:".$milestone_previous['milestone']['milestone_description']." from ".$milestone_previous['milestone']['locations'],
|
|
|
|
|
+ "time" => $milestone_previous['milestone']['milestone_time'],
|
|
|
|
|
+ "timezone" =>$milestone_previous['milestone']['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"] = "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"];
|
|
|
if(!empty($mInfo["previous"])){
|
|
if(!empty($mInfo["previous"])){
|
|
|
$eventCard["previous"] = array("tag" =>"Previous:".$mInfo["previous"]["milestone_desc"]." from ".$mInfo["previous"]["milestone_description"],
|
|
$eventCard["previous"] = array("tag" =>"Previous:".$mInfo["previous"]["milestone_desc"]." from ".$mInfo["previous"]["milestone_description"],
|
|
|
"time" => $mInfo["previous"]["milestone_time"],
|
|
"time" => $mInfo["previous"]["milestone_time"],
|
|
@@ -1103,11 +1119,13 @@ class tools {
|
|
|
"serial_no"=>$mInfo["serial_no"],
|
|
"serial_no"=>$mInfo["serial_no"],
|
|
|
"order_from"=>$mInfo["order_from"],
|
|
"order_from"=>$mInfo["order_from"],
|
|
|
"id"=>$mInfo["id"],
|
|
"id"=>$mInfo["id"],
|
|
|
|
|
+ "insert_date_format"=>'',
|
|
|
"info"=>new stdClass());
|
|
"info"=>new stdClass());
|
|
|
|
|
|
|
|
if ($mInfo["frequency_type"] == "Daily"){
|
|
if ($mInfo["frequency_type"] == "Daily"){
|
|
|
$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"];
|
|
|
if(!empty($mInfo["previous"])){
|
|
if(!empty($mInfo["previous"])){
|
|
|
//当前状态 前一个的描述
|
|
//当前状态 前一个的描述
|
|
|
$previousCtnrStatusdesc = $this->getContainerStatusDesc($mInfo["previous"]["ctnr_status_code"]);
|
|
$previousCtnrStatusdesc = $this->getContainerStatusDesc($mInfo["previous"]["ctnr_status_code"]);
|
|
@@ -1118,6 +1136,7 @@ class tools {
|
|
|
} 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"];
|
|
|
if(!empty($mInfo["previous"])){
|
|
if(!empty($mInfo["previous"])){
|
|
|
//当前状态 前一个的描述
|
|
//当前状态 前一个的描述
|
|
|
$previousCtnrStatusdesc = $this->getContainerStatusDesc($mInfo["previous"]["ctnr_status_code"]);
|
|
$previousCtnrStatusdesc = $this->getContainerStatusDesc($mInfo["previous"]["ctnr_status_code"]);
|
|
@@ -1182,6 +1201,7 @@ class tools {
|
|
|
"serial_no"=>$mInfo["serial_no"],
|
|
"serial_no"=>$mInfo["serial_no"],
|
|
|
"order_from"=>$mInfo["order_from"],
|
|
"order_from"=>$mInfo["order_from"],
|
|
|
"id"=>$mInfo["id"],
|
|
"id"=>$mInfo["id"],
|
|
|
|
|
+ "insert_date_format"=>'',
|
|
|
"info"=>array("route"=>$route,
|
|
"info"=>array("route"=>$route,
|
|
|
"leg"=>$leg,
|
|
"leg"=>$leg,
|
|
|
"etdOrdeparturNum"=>0,
|
|
"etdOrdeparturNum"=>0,
|
|
@@ -1197,11 +1217,13 @@ class tools {
|
|
|
$eventCard["info"]["etdOrdeparturNum"] = !empty($mInfo["numericRecords_one"]) ? $mInfo["numericRecords_one"] : 0;
|
|
$eventCard["info"]["etdOrdeparturNum"] = !empty($mInfo["numericRecords_one"]) ? $mInfo["numericRecords_one"] : 0;
|
|
|
$eventCard["info"]["etaOrarrivalNum"] = !empty($mInfo["numericRecords_two"]) ? $mInfo["numericRecords_two"] : 0;
|
|
$eventCard["info"]["etaOrarrivalNum"] = !empty($mInfo["numericRecords_two"]) ? $mInfo["numericRecords_two"] : 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"];
|
|
|
} 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["info"]["etdOrdeparturNum"] = !empty($mInfo["numericRecords_one"]) ? $mInfo["numericRecords_one"] : 0;
|
|
$eventCard["info"]["etdOrdeparturNum"] = !empty($mInfo["numericRecords_one"]) ? $mInfo["numericRecords_one"] : 0;
|
|
|
$eventCard["info"]["etaOrarrivalNum"] = !empty($mInfo["numericRecords_two"]) ? $mInfo["numericRecords_two"] : 0;
|
|
$eventCard["info"]["etaOrarrivalNum"] = !empty($mInfo["numericRecords_two"]) ? $mInfo["numericRecords_two"] : 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"];
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
if($notifiation_type == "ETD/ETA_Change"){
|
|
if($notifiation_type == "ETD/ETA_Change"){
|
|
@@ -1242,6 +1264,7 @@ class tools {
|
|
|
"serial_no"=>$mInfo["serial_no"],
|
|
"serial_no"=>$mInfo["serial_no"],
|
|
|
"order_from"=>$mInfo["order_from"],
|
|
"order_from"=>$mInfo["order_from"],
|
|
|
"id"=>$mInfo["id"],
|
|
"id"=>$mInfo["id"],
|
|
|
|
|
+ "insert_date_format"=>'',
|
|
|
"info"=>array("route"=>$route,
|
|
"info"=>array("route"=>$route,
|
|
|
"leg"=>$leg,
|
|
"leg"=>$leg,
|
|
|
"etdOrdeparturNum"=>0,
|
|
"etdOrdeparturNum"=>0,
|
|
@@ -1257,11 +1280,13 @@ class tools {
|
|
|
$eventCard["info"]["etdOrdeparturNum"] = !empty($mInfo["numericRecords_one"]) ? $mInfo["numericRecords_one"] : 0;
|
|
$eventCard["info"]["etdOrdeparturNum"] = !empty($mInfo["numericRecords_one"]) ? $mInfo["numericRecords_one"] : 0;
|
|
|
$eventCard["info"]["etaOrarrivalNum"] = !empty($mInfo["numericRecords_two"]) ? $mInfo["numericRecords_two"] : 0;
|
|
$eventCard["info"]["etaOrarrivalNum"] = !empty($mInfo["numericRecords_two"]) ? $mInfo["numericRecords_two"] : 0;
|
|
|
$eventCard["title"] = "ETD/ETA Change Daily Summary(".$mInfo["insert_date_format"].")";
|
|
$eventCard["title"] = "ETD/ETA Change Daily Summary(".$mInfo["insert_date_format"].")";
|
|
|
|
|
+ $eventCard["insert_date_format"] = $mInfo["insert_date_format"];
|
|
|
} 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["info"]["etdOrdeparturNum"] = !empty($mInfo["numericRecords_one"]) ? $mInfo["numericRecords_one"] : 0;
|
|
$eventCard["info"]["etdOrdeparturNum"] = !empty($mInfo["numericRecords_one"]) ? $mInfo["numericRecords_one"] : 0;
|
|
|
$eventCard["info"]["etaOrarrivalNum"] = !empty($mInfo["numericRecords_two"]) ? $mInfo["numericRecords_two"] : 0;
|
|
$eventCard["info"]["etaOrarrivalNum"] = !empty($mInfo["numericRecords_two"]) ? $mInfo["numericRecords_two"] : 0;
|
|
|
$eventCard["title"] = "ETD/ETA Change Weekly Summary(".$mInfo["insert_date_format"].")";
|
|
$eventCard["title"] = "ETD/ETA Change Weekly Summary(".$mInfo["insert_date_format"].")";
|
|
|
|
|
+ $eventCard["insert_date_format"] = $mInfo["insert_date_format"];
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
return $eventCard;
|
|
return $eventCard;
|