|
@@ -101,8 +101,8 @@ switch ($action) {
|
|
|
// "children"=>array(array("index" =>$index.'-1',"label" =>"Operation Log","path"=>"/Operationlog")));
|
|
// "children"=>array(array("index" =>$index.'-1',"label" =>"Operation Log","path"=>"/Operationlog")));
|
|
|
$systemManagement = array("index"=>"$index","label"=>"System Management","icon"=>"icon_system__management_fill_b","type"=>"list");
|
|
$systemManagement = array("index"=>"$index","label"=>"System Management","icon"=>"icon_system__management_fill_b","type"=>"list");
|
|
|
$children = array();
|
|
$children = array();
|
|
|
- //$children[] = array("index" =>$index.'-1',"label" =>"System Message","path"=>"/system-message");
|
|
|
|
|
- //$children[] = array("index" =>$index.'-2',"label" =>"System Settings","path"=>"/SystemSettings");
|
|
|
|
|
|
|
+ $children[] = array("index" =>$index.'-1',"label" =>"System Message","path"=>"/system-message");
|
|
|
|
|
+ $children[] = array("index" =>$index.'-2',"label" =>"System Settings","path"=>"/SystemSettings");
|
|
|
//只有chud的账户可以看日志记录
|
|
//只有chud的账户可以看日志记录
|
|
|
if(_getLoginName() == "chud" || _getLoginName() == "IT.Andywu" || _getLoginName() == "ra.admin"){
|
|
if(_getLoginName() == "chud" || _getLoginName() == "IT.Andywu" || _getLoginName() == "ra.admin"){
|
|
|
$children[] = array("index" =>$index.'-3',"label" =>"Operation Log","path"=>"/Operationlog");
|
|
$children[] = array("index" =>$index.'-3',"label" =>"Operation Log","path"=>"/Operationlog");
|
|
@@ -121,6 +121,9 @@ switch ($action) {
|
|
|
exit();
|
|
exit();
|
|
|
break;
|
|
break;
|
|
|
case 'main_report':
|
|
case 'main_report':
|
|
|
|
|
+ //分担查询
|
|
|
|
|
+ include ONLINE_ROOT . 'libs' . DS . 'map_config.ini.php';
|
|
|
|
|
+
|
|
|
//这里只剩下r3,r4的查询
|
|
//这里只剩下r3,r4的查询
|
|
|
$type = $_REQUEST["r_type"];
|
|
$type = $_REQUEST["r_type"];
|
|
|
|
|
|
|
@@ -129,8 +132,11 @@ switch ($action) {
|
|
|
$sqlWhere .= common::getDashboardTransportationSqlWhere();
|
|
$sqlWhere .= common::getDashboardTransportationSqlWhere();
|
|
|
$sqlWhere = common::check_input($sqlWhere);
|
|
$sqlWhere = common::check_input($sqlWhere);
|
|
|
|
|
|
|
|
- $list = common::excuteListSql("select * from public.online_order_status_date_kln_pending('$type'::text, '$sqlWhere'::text) "
|
|
|
|
|
- . "r (c bigint, e integer, b integer, d text)");
|
|
|
|
|
|
|
+ // $list = common::excuteListSql("select * from public.online_order_status_date_kln_pending('$type'::text, '$sqlWhere'::text) "
|
|
|
|
|
+ // . "r (c bigint, e integer, b integer, d text)");
|
|
|
|
|
+ $sql = "select * from public.online_order_status_date_kln_pending('$type'::text, '$sqlWhere'::text) "
|
|
|
|
|
+ . "r (c bigint, e integer, b integer, d text)";
|
|
|
|
|
+ $list = $mapdb->GetAll($sql) or ( (!$mapdb->ErrorMsg()) or error_log(common::dbLog($mapdb, $sql), 0));
|
|
|
|
|
|
|
|
$key = "[";
|
|
$key = "[";
|
|
|
$value = "[";
|
|
$value = "[";
|
|
@@ -140,7 +146,7 @@ switch ($action) {
|
|
|
$key .= ",";
|
|
$key .= ",";
|
|
|
$value .= ",";
|
|
$value .= ",";
|
|
|
}
|
|
}
|
|
|
- if ($type == "r2" || $type == "r3" || $type == "r3_1" || $type == "r4" || $type == "r4_1") {
|
|
|
|
|
|
|
+ if ($type == "r2" || $type == "r3" || $type == "r4") {
|
|
|
$key .= '"' . $vv["d"] . '"';
|
|
$key .= '"' . $vv["d"] . '"';
|
|
|
$value .= '{"value":"' . $vv["c"] . '","name":"' . $vv["d"] . '" }';
|
|
$value .= '{"value":"' . $vv["c"] . '","name":"' . $vv["d"] . '" }';
|
|
|
$totalValue = $totalValue + $vv["c"];
|
|
$totalValue = $totalValue + $vv["c"];
|
|
@@ -157,12 +163,15 @@ switch ($action) {
|
|
|
}
|
|
}
|
|
|
$key .= "]";
|
|
$key .= "]";
|
|
|
$value .= "]";
|
|
$value .= "]";
|
|
|
- //处理返回原表数据格式
|
|
|
|
|
|
|
+ //处理返回原表数据格式 r1 r3 r4的数据返回
|
|
|
$data = common::mian_repot_do($value,$type,$totalValue);
|
|
$data = common::mian_repot_do($value,$type,$totalValue);
|
|
|
common::echo_json_encode(200, $data);
|
|
common::echo_json_encode(200, $data);
|
|
|
exit();
|
|
exit();
|
|
|
break;
|
|
break;
|
|
|
case 'main_report_etd':
|
|
case 'main_report_etd':
|
|
|
|
|
+ //分担查询
|
|
|
|
|
+ include ONLINE_ROOT . 'libs' . DS . 'map_config.ini.php';
|
|
|
|
|
+
|
|
|
//这里只有r1查询
|
|
//这里只有r1查询
|
|
|
$type = "r1";
|
|
$type = "r1";
|
|
|
$container_type = "";
|
|
$container_type = "";
|
|
@@ -184,8 +193,12 @@ switch ($action) {
|
|
|
$sqlWhere = $sqlWhere . common::getDashboardTransportationSqlWhere();
|
|
$sqlWhere = $sqlWhere . common::getDashboardTransportationSqlWhere();
|
|
|
$sqlWhere = common::check_input($sqlWhere);
|
|
$sqlWhere = common::check_input($sqlWhere);
|
|
|
|
|
|
|
|
- $list = common::excuteListSql("select * from public.online_order_status_date_kln_r1_r2('$type'::text, 'eta'::text, 'etd'::text, $bdate, $edate, '$sqlWhere'::text, '$container_type'::text,'$date_type'::text) "
|
|
|
|
|
- . "r (c bigint, e integer, b integer, d text)");
|
|
|
|
|
|
|
+ // $list = common::excuteListSql("select * from public.online_order_status_date_kln_r1_r2('$type'::text, 'eta'::text, 'etd'::text, $bdate, $edate, '$sqlWhere'::text, '$container_type'::text,'$date_type'::text) "
|
|
|
|
|
+ // . "r (c bigint, e integer, b integer, d text)");
|
|
|
|
|
+ $sql = "select * from public.online_order_status_date_kln_r1_r2('$type'::text, 'eta'::text, 'etd'::text, $bdate, $edate, '$sqlWhere'::text, '$container_type'::text,'$date_type'::text) "
|
|
|
|
|
+ . "r (c bigint, e integer, b integer, d text)";
|
|
|
|
|
+ $list = $mapdb->GetAll($sql) or ( (!$mapdb->ErrorMsg()) or error_log(common::dbLog($mapdb, $sql), 0));
|
|
|
|
|
+
|
|
|
$key = "[";
|
|
$key = "[";
|
|
|
$value = "[";
|
|
$value = "[";
|
|
|
$totalValue = 0;
|
|
$totalValue = 0;
|
|
@@ -194,7 +207,7 @@ switch ($action) {
|
|
|
$key .= ",";
|
|
$key .= ",";
|
|
|
$value .= ",";
|
|
$value .= ",";
|
|
|
}
|
|
}
|
|
|
- if ($type == "r2" || $type == "r3" || $type == "r3_1" || $type == "r4" || $type == "r4_1") {
|
|
|
|
|
|
|
+ if ($type == "r2" || $type == "r3" || $type == "r4") {
|
|
|
$key .= '"' . $vv["d"] . '"';
|
|
$key .= '"' . $vv["d"] . '"';
|
|
|
$value .= '{"value":"' . $vv["c"] . '","name":"' . $vv["d"] . '" }';
|
|
$value .= '{"value":"' . $vv["c"] . '","name":"' . $vv["d"] . '" }';
|
|
|
$totalValue = $totalValue + $vv["c"];
|
|
$totalValue = $totalValue + $vv["c"];
|
|
@@ -211,12 +224,15 @@ switch ($action) {
|
|
|
}
|
|
}
|
|
|
$key .= "]";
|
|
$key .= "]";
|
|
|
$value .= "]";
|
|
$value .= "]";
|
|
|
- //处理返回原表数据格式
|
|
|
|
|
|
|
+ //处理返回原表数据格式 r1 r3 r4的数据返回
|
|
|
$data = common::mian_repot_do($value,$type,$totalValue);
|
|
$data = common::mian_repot_do($value,$type,$totalValue);
|
|
|
common::echo_json_encode(200, $data);
|
|
common::echo_json_encode(200, $data);
|
|
|
exit();
|
|
exit();
|
|
|
break;
|
|
break;
|
|
|
case 'main_report_kpi':
|
|
case 'main_report_kpi':
|
|
|
|
|
+ //分担查询
|
|
|
|
|
+ include ONLINE_ROOT . 'libs' . DS . 'map_config.ini.php';
|
|
|
|
|
+
|
|
|
$type = $_REQUEST["r_type"];
|
|
$type = $_REQUEST["r_type"];
|
|
|
$sqlWhere = ' and ' . common::searchExtendHand_KLN("ocean", $_SESSION["ONLINE_USER"]);
|
|
$sqlWhere = ' and ' . common::searchExtendHand_KLN("ocean", $_SESSION["ONLINE_USER"]);
|
|
|
$sqlWhere = " " . $sqlWhere;
|
|
$sqlWhere = " " . $sqlWhere;
|
|
@@ -229,8 +245,11 @@ switch ($action) {
|
|
|
if (isset($_REQUEST['date_end']) && !empty($_REQUEST['date_end']))
|
|
if (isset($_REQUEST['date_end']) && !empty($_REQUEST['date_end']))
|
|
|
$sqlWhere .= " and $date_type <= ''" . common::usDate2sqlDate($_REQUEST['date_end']) . " 23:59:59''";
|
|
$sqlWhere .= " and $date_type <= ''" . common::usDate2sqlDate($_REQUEST['date_end']) . " 23:59:59''";
|
|
|
|
|
|
|
|
- $list = common::excuteListSql("select * from public.online_order_status_date_kln_kpi('$type'::text,'$sqlWhere'::text) "
|
|
|
|
|
- . "r (c bigint, d text)");
|
|
|
|
|
|
|
+ // $list = common::excuteListSql("select * from public.online_order_status_date_kln_kpi('$type'::text,'$sqlWhere'::text) "
|
|
|
|
|
+ // . "r (c bigint, d text)");
|
|
|
|
|
+ $sql = "select * from public.online_order_status_date_kln_kpi('$type'::text,'$sqlWhere'::text) "
|
|
|
|
|
+ . "r (c bigint, d text)";
|
|
|
|
|
+ $list = $mapdb->GetAll($sql) or ( (!$mapdb->ErrorMsg()) or error_log(common::dbLog($mapdb, $sql), 0));
|
|
|
|
|
|
|
|
$key = "[";
|
|
$key = "[";
|
|
|
$value = "[";
|
|
$value = "[";
|
|
@@ -273,80 +292,48 @@ switch ($action) {
|
|
|
exit();
|
|
exit();
|
|
|
break;
|
|
break;
|
|
|
case 'main_report_container_bar':
|
|
case 'main_report_container_bar':
|
|
|
- //新UI 要ALL 20 40 45 四份数据同时查询,且是柱状图,所以与r3 r4查询分开
|
|
|
|
|
- $container_type_arr = array("20","40","45");
|
|
|
|
|
- $container_type_param = "all";
|
|
|
|
|
|
|
+ //新UI 20 40 45 3份数据同时查询,且是柱状图,所以与r3 r4查询分开
|
|
|
|
|
+ $container_type ='';
|
|
|
$ContainerCounSeries = array();
|
|
$ContainerCounSeries = array();
|
|
|
|
|
|
|
|
- foreach($container_type_arr as $_container_type){
|
|
|
|
|
- $container_type = $_container_type;
|
|
|
|
|
- $date_type = strtolower($_REQUEST["date_type"]);
|
|
|
|
|
- $type = $_REQUEST["r_type"];
|
|
|
|
|
- if (empty($_REQUEST["date_start"])) {
|
|
|
|
|
- $bdate = "null";
|
|
|
|
|
- } else {
|
|
|
|
|
- $bdate = $_REQUEST["date_start"];
|
|
|
|
|
- $bdate = "'$bdate'";
|
|
|
|
|
- }
|
|
|
|
|
- if (empty($_REQUEST["date_end"])) {
|
|
|
|
|
- $edate = "null";
|
|
|
|
|
- } else {
|
|
|
|
|
- $edate = $_REQUEST["date_end"];
|
|
|
|
|
- $edate = "'$edate'";
|
|
|
|
|
- }
|
|
|
|
|
- $list= array();
|
|
|
|
|
- //all 查询所有
|
|
|
|
|
- $sqlWhere = ' and ' . common::searchExtendHandNew("ocean", $_SESSION["ONLINE_USER"]);
|
|
|
|
|
- $sqlWhere = common::check_input($sqlWhere);
|
|
|
|
|
- $sqlWhere = " " . $sqlWhere;
|
|
|
|
|
- //如果页面查询的是ALL 这个20 40 45都查询出来。否则值查询都对应的size,其他的不查询
|
|
|
|
|
- if(strtolower($container_type_param) == "all"){
|
|
|
|
|
- $list = common::excuteListSql("select * from public.online_order_status_date_new_r1_r2('$type'::text, 'eta'::text, 'etd'::text, $bdate, $edate, '$sqlWhere'::text, '$container_type'::text, '$date_type'::text) "
|
|
|
|
|
- . "r (c bigint, e integer, b integer, d text)");
|
|
|
|
|
- }else{
|
|
|
|
|
- if($container_type_param == $_container_type){
|
|
|
|
|
- $list = common::excuteListSql("select * from public.online_order_status_date_new_r1_r2('$type'::text, 'eta'::text, 'etd'::text, $bdate, $edate, '$sqlWhere'::text, '$container_type'::text, '$date_type'::text) "
|
|
|
|
|
- . "r (c bigint, e integer, b integer, d text)");
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- $key = "[";
|
|
|
|
|
- $value = "[";
|
|
|
|
|
- $totalValue = 0;
|
|
|
|
|
- foreach ($list as $vv) {
|
|
|
|
|
- if ($key != "[") {
|
|
|
|
|
- $key .= ",";
|
|
|
|
|
- $value .= ",";
|
|
|
|
|
- }
|
|
|
|
|
- if ($type == "r2" || $type == "r3" || $type == "r3_1" || $type == "r4" || $type == "r4_1") {
|
|
|
|
|
- $key .= '"' . $vv["d"] . '"';
|
|
|
|
|
- $value .= '{"value":"' . $vv["c"] . '","name":"' . $vv["d"] . '" }';
|
|
|
|
|
- $totalValue = $totalValue + $vv["c"];
|
|
|
|
|
- } else {
|
|
|
|
|
- if ($vv["e"] == -1) {
|
|
|
|
|
- $key .= '"Over 80 Days"';
|
|
|
|
|
- $value .= '{"value":"' . $vv["c"] . '","name":"Over 80 Days"}';
|
|
|
|
|
- } else {
|
|
|
|
|
- $key .= '"' . $vv["b"] . '-' . $vv["e"] . ' Days"';
|
|
|
|
|
- $value .= '{"value":"' . $vv["c"] . '","name":"' . $vv["b"] . '-' . $vv["e"] . ' Days"}';
|
|
|
|
|
- }
|
|
|
|
|
- $totalValue = $totalValue + $vv["c"];
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- $key .= "]";
|
|
|
|
|
- $value .= "]";
|
|
|
|
|
- $key_arr = json_decode($key,true);
|
|
|
|
|
- $value_arr = json_decode($value,true);
|
|
|
|
|
|
|
+ $date_type = strtolower($_REQUEST["date_type"]);
|
|
|
|
|
+ $type = $_REQUEST["r_type"];
|
|
|
|
|
+ if (empty($_REQUEST["date_start"])) {
|
|
|
|
|
+ $bdate = "null";
|
|
|
|
|
+ } else {
|
|
|
|
|
+ $bdate = $_REQUEST["date_start"];
|
|
|
|
|
+ $bdate = "'$bdate'";
|
|
|
|
|
+ }
|
|
|
|
|
+ if (empty($_REQUEST["date_end"])) {
|
|
|
|
|
+ $edate = "null";
|
|
|
|
|
+ } else {
|
|
|
|
|
+ $edate = $_REQUEST["date_end"];
|
|
|
|
|
+ $edate = "'$edate'";
|
|
|
|
|
+ }
|
|
|
|
|
+ $list= array();
|
|
|
|
|
+ $sqlWhere = ' and ' . common::searchExtendHandNew("ocean", $_SESSION["ONLINE_USER"]);
|
|
|
|
|
+ $sqlWhere = common::check_input($sqlWhere);
|
|
|
|
|
+ $sqlWhere = " " . $sqlWhere;
|
|
|
|
|
+ //这个20 40 45都查询出来。否则值查询都对应的size,其他的不查询
|
|
|
|
|
+ $value_arr = common::excuteListSql("select * from public.online_order_status_date_kln_r1_r2('$type'::text, 'eta'::text, 'etd'::text, $bdate, $edate, '$sqlWhere'::text, '$container_type'::text, '$date_type'::text) "
|
|
|
|
|
+ . "r (month_group text, _20_rc numeric, _40_rc numeric, _45_rc numeric)");
|
|
|
|
|
|
|
|
|
|
+ $key_arr = array();
|
|
|
|
|
+ $container_type_arr = array("20","40","45");
|
|
|
|
|
+ foreach($container_type_arr as $_container_type){
|
|
|
$data = array();
|
|
$data = array();
|
|
|
//每一个size 的所有月份总计
|
|
//每一个size 的所有月份总计
|
|
|
$total = 0;
|
|
$total = 0;
|
|
|
//每一个size 对应的最大值
|
|
//每一个size 对应的最大值
|
|
|
$max = 0;
|
|
$max = 0;
|
|
|
foreach($value_arr as $arr){
|
|
foreach($value_arr as $arr){
|
|
|
- $data[] = intval($arr['value']);
|
|
|
|
|
- $total = $total + intval($arr['value']);
|
|
|
|
|
- $max = $max < intval($arr['value']) ? intval($arr['value']) : $max;
|
|
|
|
|
|
|
+ $data[] = intval($arr['_'.$_container_type.'_rc']);
|
|
|
|
|
+ $total = $total + intval($arr['_'.$_container_type.'_rc']);
|
|
|
|
|
+ $max = $max < intval($arr['_'.$_container_type.'_rc']) ? intval($arr['_'.$_container_type.'_rc']) : $max;
|
|
|
|
|
+
|
|
|
|
|
+ if ($_container_type == '20'){
|
|
|
|
|
+ $key_arr[] = $arr['month_group'];
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
$ContainerCounSeries[$container_type] = array("data"=>$data,"total"=>$total,"max"=>$max);
|
|
$ContainerCounSeries[$container_type] = array("data"=>$data,"total"=>$total,"max"=>$max);
|
|
|
}
|
|
}
|