ShuanghongS пре 1 година
родитељ
комит
c367625417
3 измењених фајлова са 53 додато и 15 уклоњено
  1. 18 4
      main_new_version.php
  2. 13 6
      service/ocean_order.class.php
  3. 22 5
      utils/common.class.php

+ 18 - 4
main_new_version.php

@@ -506,23 +506,37 @@ switch ($action) {
                     "_schemas"=>$value["_schemas"],
                     "a" =>common::deCode($value['serial_no'], 'E'));
             }
+            $data  = common::getManagement();
             $arrTmp = array('searchData' => $RecentStatusList, 
-               'Management' => common::getManagement(),
+               'Management' => $data['Management'],
+               'dashboard_filter' => $data['dashboard_filter'],
                'is_customer' =>_isCustomerLogin(),
                'rc' => $rc,
                'ps' => $ps,
                'cp' => $cp,
                'tp' => $tp);
         } else {
-           $arrTmp = array('searchData' => array(),
-                'Management' => common::getManagement());
+            $data  = common::getManagement();
+            $arrTmp = array('searchData' => array(),
+                'Management' => $data['Management'],
+                'dashboard_filter' => $data['dashboard_filter']);
         }
         common::echo_json_encode(200,$arrTmp);
         exit();
         break;
     case 'save_layout':
         $management = json_encode($_POST["management"]);
-        common::excuteUpdateSql("update public.ra_online_user set management = '$management' where lower(user_login) = '" . strtolower(_getLoginName()) . "'");
+        $dashboard_filter = json_encode($_POST["dashboard_filter"]);
+        $_param = "";
+        if(!empty($_POST["management"])){
+            $_param = " management = '$management' ";
+        }
+        if(!empty($_POST["dashboard_filter"])){
+            $_param = ",dashboard_filter = '$dashboard_filter' ";
+        }
+        if(!empty($_param)){
+            common::excuteUpdateSql("update public.ra_online_user set $_param where lower(user_login) = '" . strtolower(_getLoginName()) . "'");
+        }
         $returnData = array("msg" => "success");
         common::echo_json_encode(200, $returnData);
         exit();

+ 13 - 6
service/ocean_order.class.php

@@ -329,10 +329,17 @@ class ocean_order {
             } else if ($_reportType == "top") {
                 if (!empty($_reportRef)) {
                     $_reportStationType = $_REQUEST["_reportStationType"];
-                    //先固定pol pod
-                    if($_reportStationType == 'origin'){
-                        $sqlWhere .= " and  fport_of_loading_un = '$_reportRef'";
-                    }else{
+                    
+                    if($_reportStationType == 'shippr_uncode'){
+                        $sqlWhere = " and shippr_uncode  = '$_reportRef'";
+                    }
+                    if($_reportStationType == 'fport_of_loading_un'){
+                        $sqlWhere = " and fport_of_loading_un  = '$_reportRef'";
+                    }
+                    if($_reportStationType == 'consignee_uncode'){
+                        $sqlWhere .= " and  consignee_uncode = '$_reportRef'";
+                    }
+                    if($_reportStationType == 'mport_of_discharge_un'){
                         $sqlWhere .= " and  mport_of_discharge_un = '$_reportRef'";
                     }
                     
@@ -345,9 +352,9 @@ class ocean_order {
                 if (!empty($_reportRef) && $_reportDataType == "sea") {
                     $_reportStationType = $_REQUEST["_reportStationType"];
                     if($_reportStationType == 'origin'){
-                        $sqlWhere .= " and  origin = '$_reportRef'";
+                        $sqlWhere .= " and  shippr_uncode = '$_reportRef'";
                     }else{
-                        $sqlWhere .= " and  agent = '$_reportRef'";
+                        $sqlWhere .= " and  consignee_uncode = '$_reportRef'";
                     }
                     
                 } else {

+ 22 - 5
utils/common.class.php

@@ -1066,8 +1066,9 @@ class common {
 
     public static function getManagement(){
         //Management 自己配置需要创建表保存
-        $user_management = common::excuteOneSql("select management from ra_online_user where user_login = '"._getLoginName()."'");
+        $user_management_data = common::excuteObjectSql("select management,dashboard_filter from ra_online_user where user_login = '"._getLoginName()."'");
         //为空,配置使用默认值
+        $user_management = $user_management_data['management'];
         if(empty($user_management)){
             $Management = common::getdefaultManagement();
         }else{
@@ -1077,7 +1078,7 @@ class common {
                 $Management[$key]['switchValue'] = $val['switchValue'] == "true" ? true : false;
             }
         }
-        return  $Management;
+        return  array("Management" => $Management,"dashboard_filter" =>$user_management_data['dashboard_filter']);
     }
 
     public static function getItemStyle($type,$code){
@@ -1309,10 +1310,16 @@ class common {
                     "value" =>$orgin['num'],
                     "textcolor" =>"#FFF");
             }
+            //查询uncode,对应的city
             if($toporiginType == "shippr_uncode"){
-                
+                $public_ports_sql = "select uncity as city from public.ports where uncode = '".$orgin['shippr_uncode']."' order by id limit 1";
+                $city = common::excuteObjectSql($public_ports_sql);
+                if(empty($city)){
+                    $sfs_ports_sql = "select uncity as city from sfs.ports where uncode = '".$orgin['shippr_uncode']."' order by id limit 1";
+                    $city = common::excuteObjectSql($sfs_ports_sql);
+                }
             }
-            $toporigin[] = array("name"=>$orgin['shippr_uncode'],"city_name"=>"","value"=>$orgin['num'],"color"=>common::getItemStyle("top",$i));
+            $toporigin[] = array("name"=>$orgin['shippr_uncode'],"city_name"=>$city['city'],"value"=>$orgin['num'],"color"=>common::getItemStyle("top",$i));
             $origiNunMax = $origiNunMax < $orgin['num'] ? $orgin['num'] : $origiNunMax;
         }
 
@@ -1337,7 +1344,17 @@ class common {
                     "value" =>$agent['num'],
                     "textcolor" =>"#FFF");
             }
-            $topdestination[] = array("name"=>$agent['consignee_uncode'],"value"=>$agent['num'],"color"=>common::getItemStyle("top",$i));
+
+            //查询uncode,对应的city
+            if($topdestinationinType == "consignee_uncode"){
+                $public_ports_sql = "select uncity as city from public.ports where uncode = '".$agent['consignee_uncode']."' order by id limit 1";
+                $city = common::excuteObjectSql($public_ports_sql);
+                if(empty($city)){
+                    $sfs_ports_sql = "select uncity as city from sfs.ports where uncode = '".$agent['consignee_uncode']."' order by id limit 1";
+                    $city = common::excuteObjectSql($sfs_ports_sql);
+                }
+            }
+            $topdestination[] = array("name"=>$agent['consignee_uncode'],"city_name"=>$city['city'],"value"=>$agent['num'],"color"=>common::getItemStyle("top",$i));
             $agentiNunMax = $agentiNunMax < $agent['num'] ? $agent['num'] : $agentiNunMax;
         }