温红权 8 years ago
parent
commit
dff9d31764

+ 21 - 22
VisualInspection/js/statistics/personal_data_statistics.js

@@ -51,20 +51,26 @@ $(function() {
         var url_t = "/statistics/employee/order/detail"
         post_common_service(url_t, data_t, function(res) {
 
+            $("#c_dept_ranking").html("-");
+            $("#c_com_ranking").html("-");
+            $("#c_score_ranking").html("-");
+            $("#l_dept_ranking").html("-");
+            $("#l_com_ranking").html("-");
+            $("#l_score_ranking").html("-");
 
             var isshow_c = false;
             var isshow_l = false;
             if (typeof(res.currentP) != undefined && res.currentP != null) {
                 var p = res.currentP;
-                $("#c_dept_ranking").html(p.fee_station_ranking);
-                $("#c_com_ranking").html(p.company_ranking);
+                $("#c_dept_ranking").html(p.fee_station_ranking == undefined ? "-" : p.fee_station_ranking);
+                $("#c_com_ranking").html(p.company_ranking == undefined ? "-" : p.company_ranking);
                 $("#c_score_ranking").html(p.check_all_score + p.check_all_m_score);
                 isshow_c = true;
             }
             if (typeof(res.lastP) != undefined && res.lastP != null) {
                 var p = res.lastP;
-                $("#l_dept_ranking").html(p.fee_station_ranking);
-                $("#l_com_ranking").html(p.company_ranking);
+                $("#l_dept_ranking").html(p.fee_station_ranking == undefined ? "-" : p.fee_station_ranking);
+                $("#l_com_ranking").html(p.company_ranking == undefined ? "-" : p.company_ranking);
                 $("#l_score_ranking").html(p.check_all_score + p.check_all_m_score);
                 isshow_l = true;
             }
@@ -72,24 +78,17 @@ $(function() {
             if (isshow_c && isshow_l) {
                 var p_c = res.currentP;
                 var p_l = res.lastP;
-                var dept_r = p_c.fee_station_ranking - p_l.fee_station_ranking;
-                if (dept_r != 0) {
-                    $("#c_dept_ranking").html($("#c_dept_ranking").html() + "<i style='margin-left:10px;color:" + (dept_r > 0 ? "red" : "green") + "' class='icon icon-long-arrow-" + (dept_r > 0 ? "down" : "up") + "'>" + Math.abs(dept_r) + "</i>");
-                }
-                var com_r = p_c.company_ranking - p_l.company_ranking;
-                if (com_r != 0) {
-                    $("#c_com_ranking").html($("#c_com_ranking").html() + "<i style='margin-left:10px;color:" + (com_r > 0 ? "red" : "green") + "' class='icon icon-long-arrow-" + (com_r > 0 ? "down" : "up") + "'>" + Math.abs(com_r) + "</i>");
+                if (p_c.fee_station_ranking != undefined && p_l.fee_station_ranking != undefined) {
+                    var dept_r = p_c.fee_station_ranking - p_l.fee_station_ranking;
+                    if (dept_r != 0) {
+                        $("#c_dept_ranking").html($("#c_dept_ranking").html() + "<i style='margin-left:10px;color:" + (dept_r > 0 ? "red" : "green") + "' class='icon icon-long-arrow-" + (dept_r > 0 ? "down" : "up") + "'>" + Math.abs(dept_r) + "</i>");
+                    }
+                    var com_r = p_c.company_ranking - p_l.company_ranking;
+                    if (com_r != 0) {
+                        $("#c_com_ranking").html($("#c_com_ranking").html() + "<i style='margin-left:10px;color:" + (com_r > 0 ? "red" : "green") + "' class='icon icon-long-arrow-" + (com_r > 0 ? "down" : "up") + "'>" + Math.abs(com_r) + "</i>");
+                    }
                 }
-
-
-
             }
-
-
-
-
-
-
         }, function(error) {})
 
 
@@ -289,9 +288,9 @@ $(function() {
                 for (var i = 0; i < data.length; i++) {
                     for (var j = 33; j <= 53; j++) {
                         if (select_road == j) {
-                            if(data[i].id==userId){
+                            if (data[i].id == userId) {
                                 tempStr += "<option value=" + data[i].id + " selected='selected'>" + data[i].truename + "</option>";
-                            }else{
+                            } else {
                                 tempStr += "<option value=" + data[i].id + ">" + data[i].truename + "</option>";
                             }
                         }

+ 6 - 2
VisualInspection/js/statistics/toll_station_statistics.js

@@ -346,7 +346,7 @@
      	                }
      	            }
      	            for (var i = 0; i < array_score_data.length; i++) {
-     	                array_score_order.push(data[i].user.truename + "\n" + (rank[i]));
+     	                array_score_order.push(data[i].user.truename + "(" + (rank[i]) + ")");
      	            }
 
      	        } else if (type == 5) {
@@ -908,7 +908,11 @@
      	            calculable: true,
      	            xAxis: [{
      	                axisLabel: {
-     	                    interval: 0
+     	                    interval: 0,
+     	                    rotate: 45,
+     	                    textStyle: {
+     	                        fontSize: 10
+     	                    }
      	                },
      	                type: 'category',
      	                data: array_score_order

+ 8 - 6
VisualInspection_server/src/main/java/com/xintong/visualinspection/bean/StatisticsBo.java

@@ -45,11 +45,13 @@ public class StatisticsBo {
     // 比较大小 1 小 , -1 大
     public int compareTo(StatisticsBo o2){
     	double a = 1000.0 ,b=1000.0 ;
-		if((this.getChecked_num()+this.getChecked_m_num())!=0 ){
-			a = (this.getCheck_all_score()+this.getCheck_all_m_score()) / (this.getChecked_num()+this.getChecked_m_num()+0.00);
+    	int a_c = this.getChecked_num()+this.getChecked_m_num();
+    	int b_c = o2.getChecked_num()+o2.getChecked_m_num();
+		if(a_c!=0 ){
+			a = (this.getCheck_all_score()+this.getCheck_all_m_score()) / (a_c+0.00);
 		}
-		if((o2.getChecked_num()+o2.getChecked_m_num())!=0){
-			b = (o2.getCheck_all_score()+o2.getCheck_all_m_score()) /(o2.getChecked_num()+o2.getChecked_m_num()+0.00);
+		if(b_c!=0){
+			b = (o2.getCheck_all_score()+o2.getCheck_all_m_score()) /(b_c+0.00);
 		}
 	
 		if (a > b ) {
@@ -57,9 +59,9 @@ public class StatisticsBo {
 		} else if (a < b) {
 			return -1;
 		} else {
-			if(this.getChecked_num() == 0 && o2.getChecked_num()!=0 ){
+			if(a_c == 0 && b_c!=0 ){
 				return -1 ;
-			}else if(o2.getChecked_num() ==0 && this.getChecked_num() != 0){
+			}else if(b_c ==0 && a_c != 0){
 				return 1;
 			}else{
 				return 0;

+ 1 - 2
VisualInspection_server/src/main/java/com/xintong/visualinspection/service/impl/StatisticsServiceImpl.java

@@ -67,8 +67,7 @@ public class StatisticsServiceImpl extends BaseService implements StatisticsServ
 //        计算上个周期时间   周期时间:00:00:00   ----- 00:00:00       参数:23:00:00
         for (CheckTaskPeriod p:checkTaskPeriods
              ) {
-            if(obj.getStart_date().getTime() > p.getStarttime().getTime() &&
-                    obj.getEnd_date().getTime() > p.getStarttime().getTime()){
+            if(obj.getStart_date().getTime()+1*1000*60*60 == p.getEndtime().getTime()){
                 lastTaskPeriod = p;
                 break;
             }