Bladeren bron

code commit

ShuanghongS 1 jaar geleden
bovenliggende
commit
120205636b

+ 25 - 46
main_new_version.php

@@ -51,48 +51,7 @@ switch ($action) {
     
     /* display index page */
     case 'main':
-        if (_isAdmin())
-            $sql = "select f_column, min(menu_id) as menu_id, max(menu_icon_font) as menu_icon_font from public.ra_online_permission where has_new_version=true group by f_column order by min(order_by)";
-        elseif (_isNewUser())
-            $sql = "select f_column, min(menu_id) as menu_id, max(menu_icon_font) as menu_icon_font from public.ra_online_permission where has_new_version=true and customer_check = true group by f_column ORDER BY min(order_by)";
-        else
-            $sql = "select p.f_column, min(menu_id) as menu_id, max(menu_icon_font) as menu_icon_font from public.ra_online_user_permission up left join public.ra_online_permission p on up.p_id = p.id where  has_new_version=true and lower(user_name) = '" . common::check_input(strtolower(_getLoginName())) . "' group by p.f_column ORDER BY min(p.order_by)";
-        $rs = common::excuteListSql($sql);
-        if (empty($rs) && _isApexLogin()) {
-            $sql = "select f_column, min(menu_id) as menu_id, max(menu_icon_font) as menu_icon_font from public.ra_online_permission where has_new_version=true and default_check = true group by f_column ORDER BY min(order_by)";
-            $rs = common::excuteListSql($sql);
-        }
-        $msg = "";
-        foreach ($rs as $value) {
-            $msg .= '<div class="menu_first with_second" id="' . $value['menu_id'] . '" class="' . $value['menu_id'] . '_section"><div class="menu_icon_left"><span class="icon iconfont ' . $value['menu_icon_font'] . '"></span></div><div class="menu_title"><span>&nbsp;' . $value['f_column'] . '</span></div><div class="menu_icon_right icon_right"><span class="icon iconfont icon-you"></span>
-                </div></div><ul class="menu_second" >';
-            if (_isAdmin())
-                $ll = common::excuteListSql("select s_column, url_action, sub_menu_id from public.ra_online_permission where has_new_version=true and f_column = '" . common::check_input($value['f_column']) . "' ORDER BY order_by");
-            elseif (_isNewUser())
-                $ll = common::excuteListSql("select s_column, url_action, sub_menu_id from public.ra_online_permission where has_new_version=true and customer_check = true and f_column = '" . common::check_input($value['f_column']) . "' ORDER BY order_by");
-            else
-                $ll = common::excuteListSql("select s_column, url_action, sub_menu_id from public.ra_online_permission p left join public.ra_online_user_permission gp on gp.p_id = p.id where has_new_version=true and f_column = '" . common::check_input($value['f_column']) . "' and lower(gp.user_name) = '" . common::check_input(strtolower(_getLoginName())) . "' ORDER BY p.order_by");
-            if (empty($ll) && _isApexLogin()) {
-                $ll = common::excuteListSql("select s_column, url_action, sub_menu_id from public.ra_online_permission where has_new_version=true and f_column = '" . common::check_input($value['f_column']) . "' and default_check = true ORDER BY order_by");
-            }
-            foreach ($ll as $v) {
-                //非maria 帐号的全部移除Ocean Gross Profit Repor 权限
-                if((strtolower(_getLoginName()) != "maria" && strtolower(_getLoginName()) != "doc.yuki") && $v["url_action"] == "ocean_gross_profit"){
-                    continue;
-                }
-                $msg .= '<li class="' . $v['sub_menu_id'] . '" onclick="commonRedirect(this, \'main_new_version.php?action=' . $v['url_action'] . '\', \'' . $v['sub_menu_id'] . '_section\')"><span class="menu_second_span">' . $v['s_column'] . '</span></li>';
-            }
-            $msg .= '</ul>';
-        }
-        //处理返回的格式
-        $data = array();
-        if (_isCustomerLogin()) {
-            $data["isCustomerLogin"] = "yes";
-        }
-
-        $data["msg"] = $msg;
-        $data["redirectTarget"] = $_SESSION['redirectTarget'];
-        common::echo_json_encode("200",$data);
+        //todo
         break;
     case 'main_report':
         $type = $_REQUEST["r_type"];
@@ -438,6 +397,9 @@ switch ($action) {
             )
             select * from rr order by sort, stime";
         $rss = common::excuteListSql($sql);
+        //先固定死
+        $json = '[{"lng":"100.78594000","lat":"13.68521000","infor":"Place of receipt: LAT KRABANG, THAILAND","sort":"0","stime":null,"ptype":"por"},{"lng":"100.88333333","lat":"13.08333333","infor":"POL: LAEM CHABANG PORT,THAILAND","sort":"1","stime":null,"ptype":"pol"},{"lng":"-122.28640000","lat":"37.79784000","infor":"POD: OAKLAND, CA, USA","sort":"2","stime":null,"ptype":"pod"},{"lng":"93.78333333","lat":"37.68333333","infor":"Place of delivery: STOCKTON, CA, USA","sort":"3","stime":null,"ptype":"poe"}]';
+        $rss = json_decode($json,true);
         common::echo_json_encode("200", $rss);
         exit();
         break;
@@ -457,8 +419,12 @@ switch ($action) {
                 $sqlWhere .= " and $date_type >= '" . common::usDate2sqlDate($_POST['date_start']) . " 00:00:00'";
             if (isset($_POST['date_end']) && !empty($_POST['date_end']))
                 $sqlWhere .= " and $date_type <= '" . common::usDate2sqlDate($_POST['date_end']) . " 23:59:59'";
-
         }
+        if (isset($_POST['customer']) && !empty($_POST['customer'])){
+            $sqlWhere .= " and (shipper ilike '%".common::check_input($_POST['customer'])."%' or shipper_id ilike '%".common::check_input($_POST['customer'])."%' 
+                or consignee ilike '%".common::check_input($_POST['customer'])."%' or consignee_id ilike '%".common::check_input($_POST['customer'])."%')";
+        }
+
 
         $rc = $_POST ['rc'];
         if ($rc == - 1) {
@@ -471,9 +437,22 @@ switch ($action) {
             $sql = "SELECT serial_no,last_status_city, consignee, shipper, h_bol, 
                     to_char(etd, 'MM/DD/YYYY'::text) as etd, to_char(eta, 'MM/DD/YYYY'::text) AS eta, 
                     fport_of_loading_un, mport_of_discharge_un, place_of_receipt_un, place_of_delivery_un, ctnrs, count_cntr, last_status_ctnr,booking_no,
-                    to_char(last_status_315_date, 'MM/DD/YYYY'::text) as last_status_315_date,last_status_315_code, last_status_loc, last_status_city, order_from
+                    to_char(last_status_315_date, 'MM/DD/YYYY'::text) as last_status_315_date,last_status_315_code, last_status_loc, last_status_city, order_from,
+                    dd.status
                     FROM public.online_ocean 
-                        $sqlWhere  and last_status_315_update_time is not null";
+                    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) dd on true
+                    $sqlWhere  and last_status_315_update_time is not null";
             if (_isDemo()) {
                 $sql .= " ORDER BY eta DESC limit " . $ps . " offset " . ($cp - 1) * $ps;
             } else {
@@ -494,7 +473,7 @@ switch ($action) {
                     "endStation"=>$value['mport_of_discharge_un'],
                     "ETD"=>$value['etd'],
                     "ETA"=>$value['eta'],
-                    "type"=>"Completed",
+                    "type"=>$value['status'],
                     "Arrived"=>$Arrived,
                     "Time"=>$value["last_status_315_date"],
                     "a" =>common::deCode($value['serial_no'], 'E'));

+ 21 - 50
service/login.class.php

@@ -967,18 +967,18 @@ class login {
         $loginName = common::check_input($_POST['uname']);
         $old_password = common::check_input($_POST['old_password']);
         $password = common::check_input($_POST['password']);
-        $verifcation_code = 
-
-        //首先校验验证码
-        $verifcation_code = common::check_input($_POST['verifcation_code']);
-        if (strtolower($_SESSION['captcha']) != strtolower($verifcation_code)) {    
-            $data = array(
-                'msg' => 'verifcation_error',
-                'data' => ''
-            );
-            common::echo_json_encode(400, $data);
-            exit();
-        }
+    
+        //首先校验验证码 展示注销掉
+        // $verifcation_code = 
+        // $verifcation_code = common::check_input($_POST['verifcation_code']);
+        // if (strtolower($_SESSION['captcha']) != strtolower($verifcation_code)) {    
+        //     $data = array(
+        //         'msg' => 'verifcation_error',
+        //         'data' => ''
+        //     );
+        //     common::echo_json_encode(400, $data);
+        //     exit();
+        // }
         
         $sql = "select ra_password as password from ra_online_user where lower(user_login) = '" . strtolower($loginName) . "'";
         $rs = common::excuteObjectSql($sql);
@@ -995,7 +995,7 @@ class login {
                 'msg' => $str,
                 'data' => ''
             );
-            common::echo_json_encode(400, $data);
+            common::echo_json_encode(200, $data);
             exit();
         }
 
@@ -1010,18 +1010,17 @@ class login {
             exit();
         } else {
             $data = array(
-                'msg' => $str,
+                'msg' => $msg,
                 'data' => ''
             );
-            common::echo_json_encode(400, $data);
+            common::echo_json_encode(200, $data);
             exit();
         }
     }
 
     //更新密码
     public function updateExpirePassword($login,$new_password) {
-        $str = $this->checkPasswordRule($login, $new_password);
-
+        $str = common::checkPasswordRule($login, $new_password);
         //更新密码,擦除expire pwd痕迹
         if (empty($str)) {
             $sql = "UPDATE public.ra_online_user SET ra_password = '" . common::check_input($new_password) . "',password_new=redant_encode('".$new_password."'),
@@ -1036,35 +1035,6 @@ class login {
                 $str = "success";
             }
         }
-
-        return $str;
-    }
-
-    //密码规则验证
-    public function checkPasswordRule($login, $new_password){
-        $sql="select item_value from config where item='passwordCheckRules'";
-        $rs = common::excuteObjectSql($sql);
-
-        $str =  "";
-        if (!empty($rs)) {
-            $passwordCheckRules = json_decode($rs["item_value"],true);
-            //校验使用次数
-            if (!empty($passwordCheckRules["pastPasswordCheckNum"])) {
-                $sql = "select password from public.ra_online_user_password_history where lower(user_login)='".common::check_input(strtolower($login))."' order by id desc limit ".$passwordCheckRules["pastPasswordCheckNum"];
-                $passwords = common::excuteListSql($sql);
-                foreach ($passwords as $pwd) {
-                    if ($pwd['password'] == $new_password) {
-                        $str = "This password has been recently used";
-                    }
-                }
-            }
-            if(empty($str)){
-                $str = utils::checkPassword($new_password,$passwordCheckRules,$login);
-            }
-        }else{
-            $str = utils::checkPassword($new_password);
-        }
-
         return $str;
     }
 
@@ -1163,7 +1133,7 @@ class login {
     }
 
     private function getTrackingInfo($reference_number){
-        $sql = "SELECT o.* ,sh.*, cn.* ,aa.*,dd.* ,cc.status
+        $sql = "SELECT o.* ,sh.*, cn.* ,aa.*,dd.* ,cc.status as new_status
                 from ocean o 
                 left join LATERAL (select case when a.description='Booking Confirmation' then 'Booked'
 							when a.description='Cargo Pickup' then 'Cargo Received'
@@ -1229,7 +1199,7 @@ class login {
 
         $ocean = $ocean_arr[0];
         //处理transportInfo信息数据
-        $transportInfo = array("Tracking No." =>$ocean['tracking_no'],"status"=>$ocean['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'],
             "etd" =>$ocean['f_etd'],"atd" =>"","eta" =>$ocean['m_eta'],"ata" =>"");
 
@@ -1285,10 +1255,11 @@ class login {
 
         //Milestones 数据信息待定
         $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");           
         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);
 

+ 21 - 2
service/ocean_booking.class.php

@@ -153,8 +153,27 @@ class ocean_booking {
                 $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"])) {
-            $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'];
@@ -245,7 +264,7 @@ class ocean_booking {
                     $status = "Cancelled";
                 }
                 $rs[$index]["Status"] = $status;
-                $rs[$index]["Transportation Mode"] = "Ocean Frieght";
+                $rs[$index]["Transportation Mode"] = "Ocean Freight";
             }
 
             

+ 54 - 22
service/ocean_order.class.php

@@ -45,14 +45,14 @@ class ocean_order {
         }
         /*
          * ocean order search
-         */
+        */
         if ($operate == "search") {
             $this->_ocean_search();
         }
 
         /*
          * ocean order detail
-         */
+        */
         if ($operate == "detail") {
             $this->_ocean_detail();
         }
@@ -63,7 +63,7 @@ class ocean_order {
 
         /*
          * export ocean order to excel
-         */
+        */
         if ($operate == "excel") {
             $this->_ocean_excel();
         }
@@ -74,7 +74,7 @@ class ocean_order {
 
         /*
          * download document
-         */
+        */
         if ($operate == "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" =>"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" =>"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){
                 $log[$rk]['sn'] = $rk +1;
             }
@@ -232,7 +232,7 @@ class ocean_order {
                 "Vessel"=>$ocean_info["m_vessel"],"Voyage"=>$ocean_info["m_voyage"],
                 "ETD"=>$ocean_info["f_etd"],"ETA"=>$ocean_info["m_eta"],
                 "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["schemas"] = $schemas;
@@ -300,8 +300,27 @@ class ocean_order {
                 $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"])) {
-            $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'];
@@ -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', ','))
 				 order by id desc limit 1) dd on true" . $sqlWhere;
             $rc = common::excuteOneSql($sql);
+            error_log($sql);
 
             //Booked
             $sql = $this->getOcanOrderSearchSql("Booked",$sqlWhere);
@@ -400,17 +420,17 @@ class ocean_order {
                 " order by $order_by limit " . $ps . " offset " . ($cp - 1) * $ps;
             
             $rs = common::excuteListSql($sql);
-            error_log($sql);
+            
             //对查询的结果做特殊处理,比如要拼接某个值,合并值等
             foreach($rs as $index => $val) {
                 //返回加密serial_no
                 $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, 
-               'tagsList' => array(),
+               'tagsList' => $tagsList,
                'TransportList' => $TransportList,
                'allColums' => $allBookingColumns,
                'canEdiVgm' => _canEdiVgm(),
@@ -422,7 +442,7 @@ class ocean_order {
                'type' => common::check_input($_POST ['_ntype']));
         } else {
             $arrTmp = array('searchData' => array(), 
-                'tagsList' => array(),
+                'tagsList' => $tagsList,
                 'TransportList' => $TransportList,
                 'allColums' => $allBookingColumns,
                 'allColcanEdiVgmums' => _canEdiVgm(),
@@ -439,12 +459,23 @@ class ocean_order {
 
     private function _ocean_detail() {
         $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,
                     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,
-                    o.* ,sh.*, cn.* ,aa.*,dd.* 
+                    o.* ,sh.*, cn.* ,aa.*,dd.*,ee.status as new_status
                 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,
                     address_1 as cn_address_1,
                     address_2 as cn_address_2,
@@ -500,8 +531,7 @@ class ocean_order {
             $mostStatus = common::excuteObjectSql($mostStatusSql);
             $state = -1;
             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"]);
             }
 
@@ -536,7 +566,7 @@ class ocean_order {
 
 
         //处理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'],
             "etd" =>$ocean['f_etd'],"atd" =>"","eta" =>$ocean['m_eta'],"ata" =>"");
 
@@ -646,10 +676,11 @@ class ocean_order {
 
         //Milestones 数据信息待定
         $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");           
         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);
 
@@ -749,6 +780,7 @@ class ocean_order {
                         'ams_ss' =>  md5(md5($ocean['serial_no'])),
                         'isf_ss' => $isf_ss,
                         '_schemas' =>$_schemas,
+                        'uncode' =>$uncode,
                         'can_upload_doc' => strtolower($_SESSION['ONLINE_USER']['can_upload_doc']) == 't' || strtolower($_SESSION['ONLINE_USER']['can_view_doc']) == 't',
                         'canEdiVgm' => _canEdiVgm(),
                         'copyright' =>$_COPYRIGHT);

+ 2 - 1
service/operation_log.class.php

@@ -84,12 +84,13 @@ class operation_log{
         $rc = $_POST ['rc'];
         if ($rc == - 1) {
             $sql = "SELECT count(1) from public.customer_service_operation_log" . $sqlWhere;
+            error_log($sql);
             $rc = common::excuteOneSql($sql);
         }
         $tp = ceil($rc / $ps);
         $order_by = " id";
         if ($rc > 0) {
-            $sql = "SELECT * from public.customer_service_operation_log " . $sqlWhere . 
+            $sql = "SELECT ".column::getInstance()->getSearchSqlForDisplay('Operation_Search')." from public.customer_service_operation_log " . $sqlWhere . 
                         " order by $order_by limit " . $ps . " offset " . ($cp - 1) * $ps;
             $rs = common::excuteListSql($sql);
 

+ 0 - 11
service/search.class.php

@@ -121,17 +121,6 @@ class search {
                         if (isset($_POST[$e]) && !empty($_POST[$e])) {
                             $result .= " and " . $v['value_name'] . " <= '" . common::check_input(common::usDate2sqlDate($_POST[$e]) . ' 23:59:59') . "'";
                         }
-                    } elseif ($v['search_condition'] == 'year') {
-                        $s = $v['value_name'] . '_start';
-                        $e = $v['value_name'] . '_end';
-                        if (isset($_POST[$s]) && !empty($_POST[$s])) {
-                            $result .= " and " . $v['value_name'] . " >= " . common::check_input($_POST[$s]);
-                        }
-                        if (isset($_POST[$e]) && !empty($_POST[$e])) {
-                            $result .= " and " . $v['value_name'] . " <= " . common::check_input($_POST[$e]);
-                        }
-                    } elseif ($v['search_condition'] == "in") {
-                        $result .= " and lower(" . $v['value_name'] . ") " . common::getInNotInSql($_POST[$v['value_name']]);
                     } else {
                         //处理多个输入查询情况包含一个 数组类型,也有可能单个字符串
                         $value_arr = $_POST[$v['value_name']];

+ 6 - 3
service/tools.class.php

@@ -30,8 +30,11 @@ class tools {
         } else {
             $opsw = common::check_input($_POST ['opsw']);
             $npsw = common::check_input($_POST ['npsw']);
-            if (empty(utils::checkPassword($npsw))) {
-                $username = _getLoginName();
+            $username = _getLoginName();
+
+            $msg = common::checkPasswordRule($username, $npsw);
+            //为空代表验证通过
+            if (empty($msg)) {
                 $sql = "select ra_password as password from ra_online_user where lower(user_login) = '" . strtolower($username) . "'";
                 $rs = common::excuteObjectSql($sql);
                 $str = '';
@@ -51,7 +54,7 @@ class tools {
                     $str = "Old password is incorrect!";
                 }
             } else {
-                $str = "The new password is too simple(must include numbers and letters)";
+                $str = $msg;
             }
         }
         $returnData = array("msg" => $str);

+ 28 - 0
utils/common.class.php

@@ -1362,5 +1362,33 @@ class common {
         }
         return 'insert into ' . $table_name . '(' . $field . ') values (' . $value . ')';
     }
+
+    //密码规则验证
+    public static function checkPasswordRule($login, $new_password){
+        $sql="select item_value from config where item='passwordCheckRules'";
+        $rs = common::excuteObjectSql($sql);
+
+        $str =  "";
+        if (!empty($rs)) {
+            $passwordCheckRules = json_decode($rs["item_value"],true);
+            //校验使用次数
+            if (!empty($passwordCheckRules["pastPasswordCheckNum"])) {
+                $sql = "select password from public.ra_online_user_password_history where lower(user_login)='".common::check_input(strtolower($login))."' order by id desc limit ".$passwordCheckRules["pastPasswordCheckNum"];
+                $passwords = common::excuteListSql($sql);
+                foreach ($passwords as $pwd) {
+                    if ($pwd['password'] == $new_password) {
+                        $str = "This password has been recently used";
+                    }
+                }
+            }
+            if(empty($str)){
+                $str = utils::checkPassword($new_password,$passwordCheckRules,$login);
+            }
+        }else{
+            $str = utils::checkPassword($new_password);
+        }
+
+        return $str;
+    }
 }
 ?>