Selaa lähdekoodia

Merge branch 'master' of http://git_xt.jsxt.jsjtyxt.com/wenhongquan/VisualInspection

wenhongquan 8 vuotta sitten
vanhempi
commit
e6ef05a65f
20 muutettua tiedostoa jossa 812 lisäystä ja 340 poistoa
  1. 23 9
      VisualInspection/css/statistics/personal_data_statistics.css
  2. 17 5
      VisualInspection/css/statistics/road_manage_statistics.css
  3. 38 10
      VisualInspection/css/statistics/toll_station_statistics.css
  4. 9 5
      VisualInspection/css/statistics/total_company_statistics.css
  5. 11 10
      VisualInspection/js/statistics/assess_ranking.js
  6. 108 23
      VisualInspection/js/statistics/check_workload_statistics.js
  7. 76 29
      VisualInspection/js/statistics/personal_data_statistics.js
  8. 78 46
      VisualInspection/js/statistics/road_manage_statistics.js
  9. 254 65
      VisualInspection/js/statistics/toll_station_statistics.js
  10. 62 26
      VisualInspection/js/statistics/total_company_statistics.js
  11. 3 27
      VisualInspection/view/statistics/check_workload_statistics.html
  12. 22 16
      VisualInspection/view/statistics/emp_ranking.html
  13. 8 7
      VisualInspection/view/statistics/personal_data_statistics.html
  14. 3 1
      VisualInspection/view/statistics/toll_station_statistics.html
  15. 24 0
      VisualInspection_server/src/main/java/com/xintong/visualinspection/bean/StatisticsBean.java
  16. 28 0
      VisualInspection_server/src/main/java/com/xintong/visualinspection/bean/StatisticsBo.java
  17. 2 1
      VisualInspection_server/src/main/java/com/xintong/visualinspection/controller/StatisticsController.java
  18. 2 1
      VisualInspection_server/src/main/java/com/xintong/visualinspection/mapper/cluster/UserInfoMapper.xml
  19. 44 59
      VisualInspection_server/src/main/java/com/xintong/visualinspection/service/impl/StatisticsServiceImpl.java
  20. BIN
      VisualInspection_server/src/main/resources/employee_order.xls

+ 23 - 9
VisualInspection/css/statistics/personal_data_statistics.css

@@ -97,11 +97,10 @@
     width:20px;
     height:50px;
     float:left;
-    margin-left: 15px;
     line-height: 50px;
 }
 .div-start input,.div-end input{
-    width:120px;
+    width:100px;
     height:30px;
     border: 1px solid #ccc;
     font-size: 14px;
@@ -116,36 +115,51 @@
     line-height: 50px;
 }
 .div-check{
-    width:190px;
+    width:160px;
     height:50px;
     float:left;
-    margin-left: 50px;
+    margin-left: 10px;
     line-height: 50px;
     border-radius: 4px;
 }
 .div-check select{
-    width:190px;
+    width:160px;
     height:30px;
     border: 1px solid #ccc;
     border-radius: 4px;
 }
 .div-select{
-    width:80px;
+    width:100px;
     height:50px;
     float:left;
-    margin-left: 20px;
+    margin-left: 5px;
+    line-height: 50px;
+}
+.div-select select{
+    width:100px; 
+    height:30px;
+    border: 1px solid #ccc;
+    border-radius: 4px;
 }
+
+.name1{
+    width:98px;
+    height:50px;
+    float:left;
+    margin-left: 10px;
+    line-height: 50px;
+} 
 .query{
     width:80px;
     height:50px;
     float:left;
-    margin-left: 40px;
+    margin-left: 20px;
 }
 .export{
     width:80px;
     height:50px;
     float:right;
-    margin-right: 40px;
+    margin-right: 20px;
 }
 
 .div-button button{

+ 17 - 5
VisualInspection/css/statistics/road_manage_statistics.css

@@ -5,7 +5,7 @@
     border:1px solid #d9d9d9;
     font-family: '宋体';
     border-radius: 4px;
-    font-size: 15px;
+    font-size: 12px;
 }
 .row-1{
     width:100%;
@@ -47,6 +47,15 @@
     margin-left: 20px;
     line-height: 50px;
 }
+.div-roadManage select{
+    width:80px;
+    height:30px;
+    border: 1px solid #ccc;
+    border-radius: 4px;
+    font-size: 13px;
+    font-size: 14px;
+}
+
 .div-button{
     width:80px;
     height:50px;
@@ -157,6 +166,13 @@
    float:left;
    margin-left: 20px;
 }
+.div-month select{
+    width: 80px;
+    height: 30px;
+    border: 1px solid #ccc;
+    border-radius: 4px; 
+    font-size: 14px;
+}
 .query-total{
    width:70px;
    height:20px; 
@@ -164,10 +180,6 @@
    float:right;
    margin-right: 20px;
 }
-.row-2 select{
-    width:80px;
-    height:25px;
-}
 .row-7{
     width:100%;
     height:40px;

+ 38 - 10
VisualInspection/css/statistics/toll_station_statistics.css

@@ -5,7 +5,7 @@
     border:1px solid #d9d9d9;
     font-family: '宋体';
     border-radius: 4px;
-    font-size: 15px;
+    font-size: 12px;
 }
 .row-1{
     width:100%;
@@ -54,15 +54,32 @@
     margin-left: 20px;
     line-height: 50px;
 }
-#second{
-    width:120px;
-    height:25px;
+.div-roadManage select{
+    width:80px;
+    height:30px;
+    border: 1px solid #ccc;
+    border-radius: 4px;
+    font-size: 14px;
+}
+.div-station select{
+    width:110px;
+    height:30px;
+    border: 1px solid #ccc;
+    border-radius: 4px;
+    font-size: 14px;
+}
+.div-month select{
+    width:80px;
+    height:30px;
+    border: 1px solid #ccc;
+    border-radius: 4px;
+    font-size: 14px;
 }
 .div-button{
     width:80px;
     height:50px;
     float:left;
-    margin-left: 20px;
+    margin-left: 10px;
 }
 
 .div-button button{
@@ -75,6 +92,22 @@
     border-radius: 4px;
     margin-top: 10px;
 }
+.btn-change{
+    width:60px;
+    height:40px;
+    float:right;
+}
+.view_change{
+    width:60px;
+    height:40px;
+    color: #fff;
+    background-color: #00ced1;
+    border-color: #1970fc;
+    border:1px solid transparent;
+    border-radius: 4px;
+    font-weight: bolder;
+}
+
 .row-3,.row-4,.row-6,.row-7{
     width:100%;
     height:40px;
@@ -99,7 +132,6 @@
     height:40px;
     float:left;
     line-height: 40px;
-    text-align: center;
     font-weight: bold;
 }
 .line-2{
@@ -175,10 +207,6 @@
    float:right;
    margin-right: 20px;
 }
-.row-2 select{
-    width:80px;
-    height:25px;
-}
 .row-7{
     width:100%;
     height:40px;

+ 9 - 5
VisualInspection/css/statistics/total_company_statistics.css

@@ -5,7 +5,7 @@
     border:1px solid #d9d9d9;
     font-family: '宋体';
     border-radius: 4px;
-    font-size: 15px;
+    font-size: 12px;
 }
 .row-1{
     width:100%;
@@ -40,6 +40,13 @@
     margin-left: 20px;
     line-height: 50px;
 }
+.div-month select{
+    width: 80px;
+    height: 30px;
+    border: 1px solid #ccc;
+    border-radius: 4px; 
+    font-size: 14px;
+}
 .div-button{
     width:80px;
     height:50px;
@@ -157,10 +164,7 @@
    float:right;
    margin-right: 20px;
 }
-.row-2 select{
-    width:80px;
-    height:25px;
-}
+
 .row-7{
     width:100%;
     height:40px;

+ 11 - 10
VisualInspection/js/statistics/assess_ranking.js

@@ -62,17 +62,18 @@ function getEmployeeInfosClick(url,param,start_score,end_score){
         for(var i=0;i<data.length;i++){
             var score = 1000-filterByZeroHandle(average(data[i]).toFixed(2),'0');
             var flag=judgeParamFilter(data, i,score, start_score,end_score)
-            console.log("职位是是:"+flag)
             if(flag){
-                strTbody+="<tr><td width='67px;'>"+(count+1)+"</td><td width='87px;'>"+data[i].user.fee_station_name+"</td>"
-                +"<td width='67px;'>"+data[i].user.truename+"</td><td width='67px;'>"+data[i].user.position_name+"</td>"
-                +"<td width='87px;'>"+data[i].user.workno+"</td><td width='58px;'>"+ getItemScore(data[i], '环境') +"</td>"
-                +"<td width='58px;'>"+getItemScore(data[i], '仪容仪表')+"</td><td width='58px;'>"+getItemScore(data[i], '表情')+"</td>"
-                +"<td width='58px;'>"+getItemScore(data[i], '动作')+"</td><td width='58px;'>"+getItemScore(data[i], '文明用语')+"</td>"
-                +"<td width='58px;'>"+ getItemScore(data[i], '工作纪律') +"</td><td width='58px'>"+getItemScore(data[i], '便民服务')+"</td><td width='58px'>"
-                +getItemScore(data[i], '安全管理')+"</td><td width='58px;'>"+data[i].check_all_score+"</td>"
-                +"<td width='67px;'>"+filter(data[i].checked_num,'0')+"</td><td width='67px;'>"+filterByZeroHandle(average(data[i]).toFixed(2),'0')+"</td>"
-                +"<td width='55px;'>"+score+"</td><td width='58px;'>"+"</td><td width='58px;'>"+"</td></tr>";
+                strTbody+="<tr><td width='4%;'>"+(count+1)+"</td><td width='6%;'>"+data[i].user.fee_station_name+"</td>"
+                +"<td width='6%;'>"+data[i].user.truename+"</td><td width='6%;'>"+data[i].user.position_name+"</td>"
+                +"<td width='6%;'>"+data[i].user.workno+"</td><td width='4%;'>"+data[i].company_ranking+"</td>"
+                +"<td width='4%;'>"+data[i].center_ranking+"</td><td width='4%;'>"+data[i].fee_station_ranking
+                +"</td><td width='4%;'>"+ getItemScore(data[i], '环境') +"</td>"
+                +"<td width='4%;'>"+getItemScore(data[i], '仪容仪表')+"</td><td width='4%;'>"+getItemScore(data[i], '表情')+"</td>"
+                +"<td width='4%;'>"+getItemScore(data[i], '动作')+"</td><td width='4%;'>"+getItemScore(data[i], '文明用语')+"</td>"
+                +"<td width='4%;'>"+ getItemScore(data[i], '工作纪律') +"</td><td width='4%'>"+getItemScore(data[i], '便民服务')+"</td><td width='4%;'>"
+                +getItemScore(data[i], '安全管理')+"</td><td width='4%;'>"+data[i].check_all_score+"</td>"
+                +"<td width='4%;'>"+filter(data[i].checked_num,'0')+"</td><td width='4%;'>"+filterByZeroHandle(average(data[i]).toFixed(2),'0')+"</td>"
+                +"<td width='4%;'>"+score+"</td><td width='4%;'>"+"</td><td width='4%;'>"+"</td></tr>";
                 count++;
             }
         }

+ 108 - 23
VisualInspection/js/statistics/check_workload_statistics.js

@@ -11,11 +11,38 @@ $(function(){
 
     //*************************************数据表格******************************************
 	function initAppealPage(start_date,end_date,user_id) {
+		
 		initQueryParams();
 		queryAppeal(start_date,end_date,user_id);
     }
 
 	function initQueryParams() {
+		 // 仅选择日期
+        $(".div-start input").datetimepicker(
+        {
+            language:  "zh-CN",
+            weekStart: 1,
+            todayBtn:  1,
+            autoclose: 1,
+            todayHighlight: 1,
+            startView: 2,
+            minView: 2,
+            forceParse: 0,
+            format: "yyyy-mm-dd"
+        });
+        // 仅选择日期
+        $(".div-end input").datetimepicker(
+        {
+            language:  "zh-CN",
+            weekStart: 1,
+            todayBtn:  1,
+            autoclose: 1,
+            todayHighlight: 1,
+            startView: 2,
+            minView: 2,
+            forceParse: 0,
+            format: "yyyy-mm-dd"
+        });
 		//获取页面参数
 		var page_params = $.zui.store.get("page_params");
 		if(page_params && page_params.status) {
@@ -24,11 +51,13 @@ $(function(){
 	}
 
 	function queryAppeal(start_date,end_date,user_id){
+		
 		var data = {
-			"start_date":start_date,
+			    "start_date":start_date,
 				"end_date":end_date,
 				"user_id":user_id,
-				"queryType":1
+				"queryType":1,
+				"check_status": cur_status,
 		}
 		if(hasRole(ROLE_STATION_ADMIN) || hasRole(ROLE_STATION) ||  hasRole(ROLE_JICHA) || roleContains('STATION')) {
 			hide = true;
@@ -36,37 +65,25 @@ $(function(){
 		
 		var cols = [
 					{width: 40,height:60, text: '序号', flex: true, colClass: 'text-center',field:'num'},
-                    {width: 40,height:60, text: '稽查人员', flex: true,colClass: '',field:'checkman_name' },
-                    {width: 100,height:60, text: '任务名称', flex: true,colClass: '',field:'start_date' },
-					{width: 100,height:60, text: '时间段', flex: true,colClass: '',field:'start_date' },
-                    {width: 40,height:60, text: '考核人员', flex: true,colClass: '',field:'checked_name' },
-                    {width: 40,height:60, text: '考核部门', flex: true,colClass: '',field:'feeStationName' },
-					{width: 40,height:60, text: '扣分数',  flex: true, colClass: '',field:'score'},
-					{width: 100,height:60, text: '考核项',  flex: true, colClass: '',sort: 'down',field:'name'},
-					{width: 100,height:60, text: '扣分凭证', type: 'imagedd', flex: true, hide:hide,field:'pics'},
+                    {width: 40,height:60, text: '稽查人员', flex: true,colClass: 'text-center',field:'checkman_name' },
+                    {width: 100,height:60, text: '任务名称', flex: true,colClass: 'text-center',field:'check_task_name' },
+					{width: 100,height:60, text: '时间段', flex: true,colClass: 'text-center',field:'check_task_time_name' },
+                    {width: 40,height:60, text: '考核人员', flex: true,colClass: 'text-center',field:'checked_name' },
+                    {width: 60,height:60, text: '考核部门', flex: true,colClass: 'text-center',field:'feeStationName' },
+					{width: 40,height:60, text: '扣分数',  flex: true, colClass: 'text-center',field:'score'},
+					{width: 100,height:60, text: '考核项',  flex: true, colClass: 'text-center',field:'name'},
+					{width: 100,height:60, text: '扣分凭证', type: 'imagedd', flex: true,field:'pics'},
 		];
 		if(cur_status==12 || cur_status==13){
 			data.check_status_arr = [12,13];
 		}
+		
 		$('.datatable').mytable({'cols':cols,
 								'url':"/statistics/one/checkedItem/detail/info",
 								'param':data}
 								);
 	}
 
-	function queryUnAssignedTable(){
-		var cols = [
-					{width: 40,height:60, text: '序号', type: 'number', flex: true, colClass: 'text-center',field: 'num'},
-					{width: 40,height:60, text: '稽查人员', type: 'string', flex: true, sort: 'down',field: 'checkman_name'},
-                    {width: 100,height:60, text: '任务名称', type: 'string', flex: true, sort: 'down',field: 'name'},
-                    {width: 100,height:60, text: '时间段', type: 'string', flex: true, sort: 'down',field: 'name'},
-                    {width: 40,height:60, text: '考核人员', type: 'string', flex: true, sort: 'down',field: 'checked_name'},
-                    {width: 40,height:60, text: '考核部门', type: 'string', flex: true, sort: 'down',field: 'feeStationName'},
-					{width: 40,height:60, text: '扣分数', type: 'string', flex: true, field: 'checked_person_name'},
-					{width: 100,height:60, text: '考核项', type: 'string', flex: true, sort: 'down',field: 'checked_dept_name'},
-					{width: 100,height:60, text: '扣分凭证', type: 'imagedd', flex: true, field: 'checkman_name'},
-		] ;
-	}
 
 
     $(".query button").click(function(){
@@ -83,6 +100,7 @@ $(function(){
 		var user_id = $("#select-personal").val(); 
         // 表格
         initAppealPage(start_date,end_date,user_id);
+		checkman_info(start_date,end_date,user_id);
 	});
     
     /**
@@ -103,11 +121,78 @@ $(function(){
                 var user_id = $("#select-personal").val(); 
                 // 初始化表格
                 initAppealPage(start_date,end_date,user_id);
+				checkman_info(start_date,end_date,user_id);
         },function(error){
         	return "" ;
     	});
     }
     select_personal();
+	
+	/**
+	 * 稽查人员信息
+	 * @param {*} start_date 
+	 * @param {*} end_date 
+	 * @param {*} user_id 
+	 */
+	function checkman_info(start_date,end_date,user_id){
+		var param = {
+					"start_date": start_date,
+					"end_date": end_date,
+					"checkman_id":user_id
+					}
+		post_common_service("statistics/checkman/info",param,function(data){
+			if(data!=''){
+				if(data.all_checkman!='' && data.all_checkman!=undefined){
+				 	$(".all_check_personal").text(data.all_checkman);
+				}else{
+					$(".all_check_personal").text(0);
+				}
+				if(data.all_task_num!='' && data.all_task_num!=undefined){
+				 	$(".all_check_task").text(data.all_task_num);
+				}else{
+					$(".all_check_task").text(0);
+				}
+				if(data.all_check_minute!='' && data.all_check_minute!=undefined){
+				    $(".all_check_minute").text(Math.floor(data.all_check_minute/60) + "小时" + (data.all_check_minute%60) + "分");
+				}else{
+					$(".all_check_minute").text(0);
+				}
+				if(data.all_checked_num!='' && data.all_checked_num!=undefined){
+				    $(".all_checkman").text(data.all_checked_num);
+				}else{
+					$(".all_checkman").text(0);
+				}
+				if(data.all_checked_score!='' && data.all_checked_score!=undefined){
+				    $(".all_check_score").text(data.all_checked_score);
+				}else{
+					$(".all_check_score").text(0);
+				}
+				if(data.all_checked_score!='' && data.all_checked_score!=undefined && data.all_checked_num!='' && data.all_checked_num!=undefined){
+				    $(".check_score_avg").text(filter(data.all_checked_score,data.all_checked_num,0));
+				}else{
+					$(".check_score_avg").text(0);
+				}
+            }else{
+				$(".all_check_personal").text(0);
+				$(".all_check_task").text(0);
+				$(".all_check_minute").text(0);
+				$(".all_checkman").text(0);
+				$(".all_check_score").text(0);
+				$(".check_score_avg").text(0);
+            }
+        },function(error){
+        	return "" ;
+    	});
+    }
+
+	function filter(num,num1,num2){
+		if(num1 == 0){
+			return num2;
+		}else{
+			return (num/num1).toFixed(2);
+		}
+	}
+	
 
 
 });

+ 76 - 29
VisualInspection/js/statistics/personal_data_statistics.js

@@ -22,9 +22,9 @@ var end_date = $(".div-end input").val()+" 23:59:59";
 $(function(){
 
 //*************************************数据表格******************************************
-	function initAppealPage(start_date,end_date) {
+	function initAppealPage(start_date,end_date,user_id) {
 		initQueryParams();
-		queryAppeal(start_date,end_date);
+		queryAppeal(start_date,end_date,user_id);
     }
 
 	function initQueryParams() {
@@ -35,7 +35,7 @@ $(function(){
 		}
 	}
 
-	function queryAppeal(start_date,end_date){
+	function queryAppeal(start_date,end_date,user_id){
 		var data = {
 			"start_date":start_date,
 				"end_date":end_date,
@@ -48,9 +48,9 @@ $(function(){
 		
 		var cols = [
 					{width: 50, text: '序号', flex: true, colClass: 'text-center',field:'num'},
-					{width: 100, text: '时间段', flex: true,colClass: '',field:'start_date' },
-					{width: 60, text: '扣分数',  flex: true, colClass: '',field:'score'},
-					{width: 100, text: '考核项',  flex: true, colClass: '',sort: 'down',field:'name'},
+					{width: 100, text: '时间段', flex: true,colClass: 'text-center',field:'check_task_time_name' },
+					{width: 60, text: '扣分数',  flex: true, colClass: 'text-center',field:'score'},
+					{width: 100, text: '考核项',  flex: true, colClass: 'text-center',sort: 'down',field:'name'},
 					{width: 100, text: '扣分凭证', type: 'imagedd', flex: true, hide:hide,field:'pics'},
 		];
 		if(cur_status==12 || cur_status==13){
@@ -62,18 +62,9 @@ $(function(){
 								);
 	}
 
-	function queryUnAssignedTable(){
-			var cols = [
-					{width: 50, text: '序号', type: 'number', flex: true, colClass: 'text-center',field: 'num'},
-					{width: 100, text: '时间段', type: 'string', flex: true, sort: 'down',field: 'start_date'},
-					{width: 60, text: '扣分数', type: 'string', flex: true, field: 'score'},
-					{width: 100, text: '考核项', type: 'string', flex: true, sort: 'down',field: 'name'},
-					{width: 100, text: '扣分凭证', type: 'imagedd', flex: true, field: 'pics'},
-						] ;
-	}
 
-    // 表格
-	initAppealPage(start_date,end_date);
+
+    
 
 //*************************************画图******************************************
 
@@ -81,6 +72,7 @@ $(function(){
 	echart();
 
 	$(".query button").click(function(){
+        var user_id = $("#select-personal").val();
 		var start_date = $(".div-start input").val()+" 00:00:00";
 		var end_date = $(".div-end input").val()+" 23:59:59";
 		var startStr = start_date.replace(/-/g, '/');
@@ -91,14 +83,18 @@ $(function(){
 			tip("开始时间不能比结束时间大");
 			return;
 		}
+		if($("#select-personal").text()==''){
+             tip("请选择收费站");
+			 return;
+		}
 		// 查询图一
 		init_personal_score_statistics("statistics/one/person/year/info",user_id);
 		// 查询图二
 		init_personal_check_type("statistics/one/person/checkedItem/info",user_id,start_date,end_date);
+		// 表格
+	    initAppealPage(start_date,end_date,user_id);
 		// 加载图配置
 		echart();
-		// 表格
-	    initAppealPage(start_date,end_date);
 	});
     /**
 	 * 初始化图一
@@ -109,11 +105,11 @@ $(function(){
 		var param = {
 			"start_date":year+"-01-01 00:00:00",
 			"end_date":(year+1)+"-01-01 00:00:00",
-			"dept_id":user_id
+			"user_id":user_id
 		}
 		initRqueset(url,param,1);
 	}
-	init_personal_score_statistics("statistics/one/person/year/info",user_id);
+	
 
     /**
 	 * 初始化图二
@@ -124,11 +120,11 @@ $(function(){
 		var param = {
 			"start_date":start_date,
 			"end_date":end_date,
-			"dept_id":user_id,
+			"user_id":user_id,
 		}
 		initRqueset(url,param,2);
 	}
-	init_personal_check_type("statistics/one/person/checkedItem/info",user_id,start_date,end_date);
+	
     
 	/**
 	 * 请求
@@ -170,7 +166,7 @@ $(function(){
 					if(months.indexOf(parseInt(data[i].mth.substr(5)))){
 						// 指定位置插入值
 						array_year_score.splice(parseInt(data[i].mth.substr(5))-1,0,
-						(1000-(filter_handler(data[i].all_check_score,data[i].checked_num,data[i].people_num,0)).toFixed(1)));
+						(1000-(filter(data[i].all_check_score,data[i].checked_num,0))));
 					}
 				}
 		    }else{
@@ -189,6 +185,54 @@ $(function(){
 		}
 	}
 
+	$("#select-personal").click(function(){
+		if($("#select-personal").text()==''){
+             tip("请选择收费站");
+			 return;
+		}
+	});
+	// 收费站下拉框
+	setFeSelect("#select-dept");
+	/**
+	 * 部门人员下拉框
+	 */
+	function setSecond(){ 
+        var select_road = $("#select-dept").val();
+		var sec = document.getElementById('select-personal');
+		var tempStr = ''
+		var param = {
+			 "organid":select_road
+		}
+		post_common_service("user/getFsUserList",param,function(data){
+			if(data.length!=0){
+				for(var i=0;i<data.length;i++){
+					for(var j=33;j<=53;j++){
+						if(select_road==j){
+							tempStr += "<option value="+data[i].id+">"+data[i].truename+"</option>";  
+						}
+					}
+				sec.innerHTML=tempStr;
+				}
+			}else{
+				sec.innerHTML='';	
+			}
+            var start_date = $(".div-start input").val()+" 00:00:00";
+            var end_date = $(".div-end input").val()+" 23:59:59";
+            var user_id = $("#select-personal").val();
+			// 页面初始化
+            initAppealPage(start_date,end_date,user_id);
+            init_personal_score_statistics("statistics/one/person/year/info",user_id);
+            init_personal_check_type("statistics/one/person/checkedItem/info",user_id,start_date,end_date);
+		},function(error){
+        	return "" ;
+    	});
+    }
+	$("#select-dept").change(function(){
+		setSecond();
+	});
+
+	
+
 	 /**
 	 * 除数为0处理
 	 * @param {*} num 
@@ -196,11 +240,11 @@ $(function(){
 	 * @param {*} num2 
 	 * @param {*} num4 
 	 */
-	function filter_handler(num,num1,num2,num4){
-		if(num1 == 0 || num2 == 0){
-			return num4;
+	function filter(num,num1,num2){
+		if(num1 == 0){
+			return num2;
 		}else{
-			return (num/num1)/num2;
+			return (num/num1).toFixed(2);
 		}
 	}
 
@@ -235,6 +279,9 @@ $(function(){
 					tooltip : {
 						trigger: 'axis'
 					},
+					grid:{
+                    width:"80%"
+                    },
 					legend: {
 						data:['平均分']
 					},
@@ -290,7 +337,7 @@ $(function(){
 			option = {
 				tooltip : {
 					trigger: 'item',
-					formatter: "{a} <br/>{b} : {c} ({d}%)"
+					formatter:  "个人服务检查问题占比 <br/>{b} : {d}%"
 				},
 				toolbox: {
 					show : true,

+ 78 - 46
VisualInspection/js/statistics/road_manage_statistics.js

@@ -27,6 +27,11 @@
 		var people_points;
 		var rank_pre;
 		var rank_suf;
+		var min_year;
+		var min_station;
+		var min_pre
+		var min_suff;
+		var flag = true;
 $(function(){
     // 显示当前月份
 	$(".div-month select").val(month);
@@ -34,8 +39,7 @@ $(function(){
 	$(".div-button button").click(function(){	
 		var select_month = $(".div-month select").val();
 		var select_road = $(".div-roadManage select").val();
-		// 查询图一
-		init_company_year_assess("statistics/score/year/info",select_road);
+		flag = false;
 		// 查询图二
 		init_company_points_assess("statistics/lost/score/rate",select_month+'',select_road);
 		// 查询图三
@@ -154,7 +158,13 @@ $(function(){
 	 * 初始化图七
 	 */
     function init_each_people_points(url,mon,select_road){
-		var prev_mth = (mon-1)+'';		
+		var yearPre = year;
+		if(mon==1){
+			prev_mth = 12+'';
+			yearPre = yearPre-1;
+		}else{
+		var prev_mth = (mon-1)+'';	
+		}	
 		if(mon.length==1){
 			mon = "0" +mon;
 		}
@@ -163,7 +173,7 @@ $(function(){
 		}
 		var param = {
 			"mth":year + "/" + mon,
-			"prev_mth": year + "/" + prev_mth,
+			"prev_mth": yearPre + "/" + prev_mth,
 			"dept_id":select_road,
 			"queryType":1
 		};
@@ -214,24 +224,28 @@ $(function(){
 		if(type == 1){
 			array_year_score.length = 0;
 			months.length = 0;
-			if(data!=''){
-			if(data.length<12){
-				for(var i=0;i<12-data.length;i++){
-					// 不足月份补0
-					array_year_score.push(0);
-				}
-			}		
-			for(var i=0;i<data.length;i++){
-				if(months.indexOf(parseInt(data[i].mth.substr(5)))){
-					// 指定位置插入值
-					array_year_score.splice(parseInt(data[i].mth.substr(5))-1,0,
-					(1000-(filter_handler(data[i].all_check_score,data[i].checked_num,data[i].people_num,0)).toFixed(1)));
+		    if(data!='' && data.length!=0){
+				if(data.length<12){
+					for(var i=0;i<12-data.length;i++){
+						// 不足月份补0
+						array_year_score.push(0);
+					}
+					}		
+				for(var i=0;i<data.length;i++){
+					if(months.indexOf(parseInt(data[i].mth.substr(5)))){
+						// 指定位置插入值
+						array_year_score.splice(parseInt(data[i].mth.substr(5))-1,0,
+						(1000-(filter_handler(data[i].all_check_score,data[i].checked_num,data[i].people_num,0))));
+					}
 				}
-			}
 			}else{
 					array_year_score.length = 0;
 					months.length = 0;
-			}	
+			}
+			if(eval("Math.min(" + array_year_score.toString() + ")")==0)
+			min_year = 0;
+			else
+			min_year = 	eval("Math.min(" + array_year_score.toString() + ")").toFixed(0)-10;	
 		}else if(type == 2){
 			array_points.length=0;
 				if(data!=''){
@@ -246,39 +260,51 @@ $(function(){
 		}else if(type == 3){
 			array_allStation_score.length=0;
 			array_allStation.length=0;
-            for(var i=0;i<data.length;i++){
-				if(data!=''){
+			if(data!='' && data.length!=0){
+				for(var i=0;i<data.length;i++){
 					array_allStation.push(data[i].feeStationName.substr(0,data[i].feeStationName.length-3));
-					array_allStation_score.push((1000-(filter_handler(data[i].all_check_score,data[i].checked_num,data[i].people_num,0)).toFixed(1)));
-				}else{
-					array_allStation_score.length=0;
-			        array_allStation.length=0;	
+					array_allStation_score.push((1000-(filter_handler(data[i].all_check_score,data[i].checked_num,data[i].people_num,0))));
 				}
-	        }
+			}else{
+				array_allStation_score.length=0;
+				array_allStation.length=0;	
+			}
+			    if(eval("Math.min(" + array_allStation_score.toString() + ")")==0)
+				min_station = 0;
+				else
+				min_station = 	eval("Math.min(" + array_allStation_score.toString() + ")").toFixed(0)-10;
 		}else if(type == 4){
 			array_score_order.length=0;
 			array_score_data.length=0;
-				if(data!=''){
+				if(data!='' && data.length!=0){
 					for(var i=0;i<data.length;i++){
 						array_score_order.push(data[i].user.truename+"\n"+"("+data[i].user.fee_station_name.substr(0,data[i].user.fee_station_name.length-3)+")");
-						array_score_data.push((1000-filter(data[i].all_check_score,data[i].checked_num,0)).toFixed(1));
+						array_score_data.push((1000-filter(data[i].all_check_score,data[i].checked_num,0)));
 				    }
 				 }else{
 					array_score_order.length=0;
 			        array_score_data.length=0;	
 				}
+				if(eval("Math.min(" + array_score_data.toString() + ")")==0)
+				min_pre = 0;
+				else
+				min_pre = eval("Math.min(" + array_score_data.toString() + ")").toFixed(0)-10;
 	    }else if(type == 5){
 			array_score_last.length=0;
 			array_get_score.length=0;
-				if(data!=''){
+				if(data!='' && data.length!=0){
 					for(var i=0;i<data.length;i++){
 						array_score_last.push(data[i].user.truename+"\n"+"("+data[i].user.fee_station_name.substr(0,data[i].user.fee_station_name.length-3)+")");
-						array_get_score.push((1000-filter(data[i].all_check_score,data[i].checked_num,0)).toFixed(1));
+						array_get_score.push((1000-filter(data[i].all_check_score,data[i].checked_num,0)));
 				    }
 				 }else{
 					array_score_last.length=0;
 			        array_get_score.length=0;	
 				}
+				if(eval("Math.min(" + array_get_score.toString() + ")")==0)
+				min_suff = 0;
+				else
+				min_suff = eval("Math.min(" + array_get_score.toString() + ")").toFixed(0)-10;
 	    }else if(type == 6){
 			array_check_type.length=0;
                 if(data.length != 0){
@@ -292,7 +318,13 @@ $(function(){
 			array_points_name.length=0;
 			array_points_pre.length=0;
 			arrar_points_month.length=0;
-			data_each_people_points(data);
+			if(data!='' && data.Pmth.length!=0 || data.Tmth.length!=0){
+			   data_each_people_points(data);
+			}else{
+				array_points_name.length=0;
+				array_points_pre.length=0;
+				arrar_points_month.length=0;
+			}   
 		}
 	}
 
@@ -310,7 +342,7 @@ $(function(){
 				if(Tmth.length > 0){
 					for(var j= 0; j< Tmth.length;j++){
 						if(name[i] == Tmth[j].name && Tmth[j].all_check_score != null){
-							Ttemp[i] = Tmth[j].all_check_score;
+							Ttemp[i] = filter_handler(Tmth[j].all_check_score,Tmth[j].checked_num,Tmth[j].people_num,0);
 							break;
 						}else{
 							Ttemp[i] = 0;
@@ -322,7 +354,7 @@ $(function(){
 				if(Pmth.length > 0){
 					for(var m= 0; m< Pmth.length;m++){
 						if(name[i] == Pmth[m].name && Pmth[m].all_check_score != null){
-							Ptemp[i] = Pmth[m].all_check_score;
+							Ptemp[i] = filter_handler(Pmth[m].all_check_score,Pmth[m].checked_num,Pmth[m].people_num,0);
 							break;
 						}else{
 							Ptemp[i] = 0;
@@ -363,7 +395,7 @@ $(function(){
 		if(num1 == 0 || num2 == 0){
 			return num4;
 		}else{
-			return (num/num1)/num2;
+			return ((num/num1)/num2).toFixed(2);
 		}
 	}
 
@@ -371,7 +403,7 @@ $(function(){
 		if(num1 == 0){
 			return num2;
 		}else{
-			return (num/num1);
+			return (num/num1).toFixed(2);
 		}
 	}
     
@@ -392,7 +424,9 @@ $(function(){
 		],
 	function (ec) {
 			// 基于准备好的dom,初始化echarts图表
+			if(flag){
 			year_assess = ec.init(document.getElementById('roadManager-year-assess')); 
+		    }
 			points_assess = ec.init(document.getElementById('roadManager-points-assess'));
 		    score_rank = ec.init(document.getElementById('tollStation-score-rank'));
 			rank_pre = ec.init(document.getElementById('people-rank-pre'));
@@ -430,7 +464,7 @@ $(function(){
 					yAxis : [
 						{
 							type : 'value',
-							min : 700 ,
+							min : min_year ,
 						    max : 1000,
 							axisLabel : {
 								formatter: '{value}'
@@ -468,7 +502,7 @@ $(function(){
 			option = {
 				tooltip : {
 					trigger: 'item',
-					formatter: "{a} <br/>{b} : {c} ({d}%)"
+					formatter:  "道管中心考核扣分占比 <br/>{b} : {d}%"
 				},
 				toolbox: {
 					show : true,
@@ -513,7 +547,7 @@ $(function(){
 					trigger: 'axis'
 				},
 				grid:{
-                    width:420  // 图表宽度
+                    width:"80%",	
                 },
 				calculable : true,
 				xAxis : [
@@ -525,7 +559,7 @@ $(function(){
 				yAxis : [
 					{
 						type : 'value',
-						min : 900 ,
+						min : min_station ,
 						max : 1000
 					}
 				],
@@ -564,8 +598,7 @@ $(function(){
 					trigger: 'axis'
 				},
 				grid:{
-                    width:470,  // 图表宽度
-					x:40
+                    width:"80%",	
                 },
 				legend: {
 					data:['平均分']
@@ -583,7 +616,7 @@ $(function(){
 				yAxis : [
 					{
 						type : 'value',
-						min : 900 ,
+						min : min_pre ,
 						max : 1000
 					}
 				],
@@ -629,8 +662,7 @@ $(function(){
 					trigger: 'axis'
 				},
 				grid:{
-                    width:470,  // 图表宽度
-					x:40
+                    width:"80%",	
                 },
 				legend: {
 					data:['平均分']
@@ -648,7 +680,7 @@ $(function(){
 				yAxis : [
 					{
 						type : 'value',
-						min : 900 ,
+						min : min_suff ,
 						max : 1000
 					}
 				],
@@ -690,7 +722,7 @@ $(function(){
 			option = {
 				tooltip : {
 					trigger: 'item',
-					formatter: "{a} <br/>{b} : {c} ({d}%)"
+					formatter:  "温馨服务检查占比 <br/>{b} : {d}%"
 				},
 				toolbox: {
 					show : true,
@@ -733,7 +765,7 @@ $(function(){
 				trigger: 'axis'
 			},
 			grid:{
-                    width:420  // 图表宽度
+                    width:"80%"
                 },
 			legend: {
 				data:['上月','本月']

+ 254 - 65
VisualInspection/js/statistics/toll_station_statistics.js

@@ -15,12 +15,21 @@
 		var array_score_data = new Array();
 		var array_five_name = new Array();
 		var array_five_score = new Array();
+		var array_five_name_back = new Array();
+		var array_five_score_back = new Array();
 		var year_assess;
 		var points_assess;
 		var check_type;
 		var people_points;
 		var score_rank;
 		var rank_assess;
+		var rank_assess_back;
+		var min_year;
+		var min_five;
+		var min_five_back;
+		var min_score;
+		var flag = true;
+		var change_echart = 1;
 $(function(){     
 	setSecond();
     // 显示当前月份
@@ -29,20 +38,21 @@ $(function(){
 	$(".div-button button").click(function(){	
 		var select_month = $(".div-month select").val();
 		var select_station = $(".div-station select").val();
-		// 查询图一
-		init_tollStation_year_assess("statistics/score/year/info",select_station);
+		flag = false;
+		// 加载图配置
+		echart();
 		// 查询图二
 		init_company_points_assess("statistics/lost/score/rate",select_month+'',select_station);
         // 查询图三
-		init_progress_rank_assess("statistics/fs/up/five",month+'',select_station)
+		init_progress_rank_assess("statistics/fs/up/five",select_month+'',select_station)
         // 查询图四
 		init_people_score_rank("statistics/stuff/score/info",select_month+'',select_station);
         // 查询图五
 		init_server_check_type("statistics/lost/itemscore/rate",select_month+"",select_station);
         // 查询图六
 		init_each_people_points("statistics/lost/twice/itemscore/rate",select_month+"",select_station);
-		// 加载图配置
-		echart();
+
+		init_backward_rank_assess("statistics/fs/up/five",select_month+'',select_station);
 	});
 
 	// 加载图配置
@@ -78,10 +88,16 @@ $(function(){
 	}
 
 	/**
-	 * 初始化图三
+	 * 初始化图三 前5名
 	 */
 	function init_progress_rank_assess(url,mon,select_station){
-		var prev_mth = (mon-1)+'';		
+		var yearPre = year;
+		if(mon==1){
+			prev_mth = 12+'';
+			yearPre = yearPre-1;
+		}else{
+		var prev_mth = (mon-1)+'';	
+		}	
 		if(mon.length==1){
 			mon = "0" +mon;
 		}
@@ -91,7 +107,7 @@ $(function(){
 		var param = {
 			"mth":year + "/" + mon,
 			"dept_id":select_station,
-			"prev_mth": year + "/" + prev_mth,
+			"prev_mth": yearPre + "/" + prev_mth,
 			"order_type":0
 		};
 		initRqueset(url,param,3);
@@ -133,7 +149,13 @@ $(function(){
 	 * 初始化图六
 	 */
     function init_each_people_points(url,mon,select_station){
-		var prev_mth = (mon-1)+'';		
+		var yearPre = year;
+		if(mon==1){
+			prev_mth = 12+'';
+			yearPre = yearPre-1;
+		}else{
+		var prev_mth = (mon-1)+'';	
+		}	
 		if(mon.length==1){
 			mon = "0" +mon;
 		}
@@ -142,12 +164,38 @@ $(function(){
 		}
 		var param = {
 			"mth":year + "/" + mon,
-			"prev_mth": year + "/" + prev_mth,
+			"prev_mth": yearPre + "/" + prev_mth,
 			"dept_id":select_station,
-			"queryType":1
+			"queryType":2
 		};
 		initRqueset(url,param,6);
 	}
+
+	/**
+	 * 图切换后5名
+	 */
+	function init_backward_rank_assess(url,mon,select_station){
+		var yearPre = year;
+		if(mon==1){
+			prev_mth = 12+'';
+			yearPre = yearPre-1;
+		}else{
+		var prev_mth = (mon-1)+'';	
+		}	
+		if(mon.length==1){
+			mon = "0" +mon;
+		}
+		if(prev_mth.length==1){
+			prev_mth = "0" + prev_mth;
+		}
+		var param = {
+			"mth":year + "/" + mon,
+			"dept_id":select_station,
+			"prev_mth": yearPre + "/" + prev_mth,
+			"order_type":1
+		};
+		initRqueset(url,param,7);
+	} 
 	
 
 	/**
@@ -169,6 +217,7 @@ $(function(){
 				// 画图
 				rank_assess.setOption(progress_rank_assess());
 			}else if(type == 4){
+				console.log(array_score_order+"hello"+array_score_data);
 				// 画图
 				score_rank.setOption(people_score_rank());
 			}else if(type == 5){
@@ -177,6 +226,9 @@ $(function(){
 			}else if(type == 6){
 				// 画图
 				people_points.setOption(each_people_points());
+			}else if(type == 7){
+				// 画图
+				rank_assess_back.setOption(backward_rank_assess());
 			}
 		},function(error){
         	return "" ;
@@ -192,24 +244,28 @@ $(function(){
 		if(type == 1){
 			array_year_score.length = 0;
 			months.length = 0;
-			if(data!=''){
-			if(data.length<12){
-				for(var i=0;i<12-data.length;i++){
-					// 不足月份补0
-					array_year_score.push(0);
-				}
-			}		
+			if(data!='' && data.length!=0){
+				if(data.length<12){
+					for(var i=0;i<12-data.length;i++){
+						// 不足月份补0
+						array_year_score.push(0);
+					}
+				}		
 			for(var i=0;i<data.length;i++){
 				if(months.indexOf(parseInt(data[i].mth.substr(5)))){
 					// 指定位置插入值
 					array_year_score.splice(parseInt(data[i].mth.substr(5))-1,0,
-					(1000-(filter_handler(data[i].all_check_score,data[i].checked_num,data[i].people_num,0)).toFixed(1)));
+					(1000-(filter_handler(data[i].all_check_score,data[i].checked_num,data[i].people_num,0))));
 				}
 			}
 			}else{
 					array_year_score.length = 0;
 					months.length = 0;
-			}	
+			}
+			if(eval("Math.min(" + array_year_score.toString() + ")")==0)
+			min_year = 0;
+			else
+			min_year = 	eval("Math.min(" + array_year_score.toString() + ")").toFixed(0)-10;		
 		}else if(type == 2){
 			array_points.length=0;
 				if(data!=''){
@@ -223,27 +279,35 @@ $(function(){
 		}else if(type == 3){
 			array_five_name.length=0;
 			array_five_score.length=0;
-			if(data!=''){
+			if(data!='' && data.length!=0){
 				for(var i=0;i<data.length;i++){
 					array_five_name.push(data[i].user.truename);
 					array_five_score.push(data[i].ranking_change);
 				}
-				}else{
+			}else{
 					array_five_name.length=0;
 			        array_five_score.length=0;
-			    }
+			}
+			if(eval("Math.min(" + array_five_score.toString() + ")")==0)
+			min_five = 0;
+			else
+			min_five = 	eval("Math.min(" + array_five_score.toString() + ")").toFixed(0)-1;	
 		}else if(type == 4){
-		array_score_order.length=0;
-		array_score_data.length=0;
-			if(data!=''){
+			array_score_order.length=0;
+			array_score_data.length=0;
+			if(data!='' && data.length!=0){
 				for(var i=0;i<data.length;i++){
-					array_score_order.push(data[i].user.truename);
-					array_score_data.push((1000-filter(data[i].all_check_score,data[i].checked_num,0)).toFixed(1));
+					array_score_order.push(data[i].user.truename +"\n"+ (i+1));
+					array_score_data.push((1000-filter(data[i].all_check_score,data[i].checked_num,0)));
 				}
-				}else{
+			}else{
 					array_score_order.length=0;
 					array_score_data.length=0;	
-			    }
+			}
+			if(eval("Math.min(" + array_score_data.toString() + ")")==0)
+			min_score = 0;
+			else
+			min_score = eval("Math.min(" + array_score_data.toString() + ")").toFixed(0)-10;
 		}else if(type == 5){
 		array_check_type.length=0;
 				if(data.length != 0){
@@ -254,10 +318,38 @@ $(function(){
 					array_check_type.length=0;	
 				}
 		}else if(type == 6){
-		array_points_name.length=0;
-		array_points_pre.length=0;
-		arrar_points_month.length=0;
-		data_each_people_points(data);
+			array_points_name.length=0;
+			array_points_pre.length=0;
+			arrar_points_month.length=0;
+		if(data!='' && data.Pmth.length!=0 || data.Tmth.length!=0){
+			data_each_people_points(data);
+		}else{
+			array_points_name.length=0;
+			array_points_pre.length=0;
+			arrar_points_month.length=0;
+		}
+		}else if(type == 7){
+			array_five_name_back.length=0;
+			array_five_score_back.length=0;
+			if(data!=''){
+				for(var i=0;i<data.length;i++){
+					array_five_name_back.push(data[i].user.truename);
+					if(data[i].ranking_change<0){
+					array_five_score_back.push((data[i].ranking_change+'').substr(1));
+				}else{
+					array_five_score_back.push((data[i].ranking_change+''));
+					}
+				}
+				
+			}else{
+					array_five_name_back.length=0;
+			        array_five_score_back.length=0;
+			}
+			if(eval("Math.min(" + array_five_score_back.toString() + ")")==0){
+				min_five_back = 0;		
+			}else{
+				min_five_back = eval("Math.min(" + array_five_score_back.toString() + ")").toFixed(0)-1;
+			}
 		}
 	}
   
@@ -275,7 +367,7 @@ $(function(){
 				if(Tmth.length > 0){
 					for(var j= 0; j< Tmth.length;j++){
 						if(name[i] == Tmth[j].name && Tmth[j].all_check_score != null){
-							Ttemp[i] = Tmth[j].all_check_score;
+							Ttemp[i] = filter_handler(Tmth[j].all_check_score,Tmth[j].checked_num,Tmth[j].people_num,0);
 							break;
 						}else{
 							Ttemp[i] = 0;
@@ -287,7 +379,7 @@ $(function(){
 				if(Pmth.length > 0){
 					for(var m= 0; m< Pmth.length;m++){
 						if(name[i] == Pmth[m].name && Pmth[m].all_check_score != null){
-							Ptemp[i] = Pmth[m].all_check_score;
+							Ptemp[i] = filter_handler(Pmth[m].all_check_score,Pmth[m].checked_num,Pmth[m].people_num,0);
 							break;
 						}else{
 							Ptemp[i] = 0;
@@ -316,7 +408,7 @@ $(function(){
 				}
 			}
 	    }
-		
+
     /**
 	 * 根据道管中心获取收费站列表(下拉框)
 	 */
@@ -346,17 +438,47 @@ $(function(){
 				sec.innerHTML='';	
 			}
 			var select_station = $("#second").val();
+			var select_month = $(".div-month select").val();
+			echart();
 			// 页面初始化
 			init_tollStation_year_assess("statistics/score/year/info",select_station);
-			init_company_points_assess("statistics/lost/score/rate",month+'',select_station);
-			init_progress_rank_assess("statistics/fs/up/five",month+'',select_station)
-			init_people_score_rank("statistics/stuff/score/info",month+'',select_station);
-			init_server_check_type("statistics/lost/itemscore/rate",month+"",select_station);
-			init_each_people_points("statistics/lost/twice/itemscore/rate",month+"",select_station);
+			init_company_points_assess("statistics/lost/score/rate",select_month+'',select_station);
+			init_progress_rank_assess("statistics/fs/up/five",select_month+'',select_station)
+			init_people_score_rank("statistics/stuff/score/info",select_month+'',select_station);
+			init_server_check_type("statistics/lost/itemscore/rate",select_month+"",select_station);
+			init_each_people_points("statistics/lost/twice/itemscore/rate",select_month+"",select_station);
+			//init_backward_rank_assess("statistics/fs/up/five",select_month+'',select_station)
 		},function(error){
         	return "" ;
     	});
     }
+
+	/**
+	 * 进步前5名后退步前五名切换
+	 */
+	$(".view_change").click(function(){
+		    var select_station = $("#second").val();
+			var select_month = $(".div-month select").val();
+		if(change_echart==1){
+			$("#progress span").text("考核退步Top5排行榜");
+			$("#progress-rank-assess").css("display","none");
+			$("#backward-rank-assess").css("display","block");
+			//flag=false;
+			echart_change();	
+			init_backward_rank_assess("statistics/fs/up/five",select_month+'',select_station);
+			change_echart = 2
+			
+		}else if(change_echart==2){
+			$("#progress span").text("考核进步Top5排行榜");
+			$("#progress-rank-assess").css("display","block");
+			$("#backward-rank-assess").css("display","none");
+			//init_progress_rank_assess("statistics/fs/up/five",select_month+'',select_station);
+			// document.getElementById("progress-rank-assess").style.display="";
+			// document.getElementById("progress-rank-assess-back").style.display="none";
+			change_echart = 1
+		}
+		
+	});	
 	
     /**
 	 * 除数为0处理
@@ -369,7 +491,7 @@ $(function(){
 		if(num1 == 0 || num2 == 0){
 			return num3;
 		}else{
-			return (num/num1)/num2;
+			return ((num/num1)/num2).toFixed(2);
 		}
 	}
 
@@ -377,7 +499,7 @@ $(function(){
 		if(num1 == 0){
 			return num2;
 		}else{
-			return (num/num1);
+			return (num/num1).toFixed(2);
 		}
 	}
 
@@ -396,15 +518,35 @@ $(function(){
 			'echarts/chart/bar',
 			'echarts/chart/pie'
 		],
-		function (ec) {
-				// 基于准备好的dom,初始化echarts图表
-				year_assess = ec.init(document.getElementById('tollStation-year-assess')); 
-				points_assess = ec.init(document.getElementById('tollStation-points-assess'));
-				rank_assess = ec.init(document.getElementById('progress-rank-assess'));
-				score_rank = ec.init(document.getElementById('people-score-rank'));
-				check_type = ec.init(document.getElementById('server-check-type'));
-				people_points = ec.init(document.getElementById('each-people-points'));
-				}
+			function (ec) {
+					// 基于准备好的dom,初始化echarts图表
+					if(flag){
+						year_assess = ec.init(document.getElementById('tollStation-year-assess'));
+					} 
+						points_assess = ec.init(document.getElementById('tollStation-points-assess'));
+						rank_assess = ec.init(document.getElementById('progress-rank-assess'));
+						score_rank = ec.init(document.getElementById('people-score-rank'));
+						check_type = ec.init(document.getElementById('server-check-type'));
+						people_points = ec.init(document.getElementById('each-people-points'));
+						rank_assess_back = ec.init(document.getElementById('backward-rank-assess'));
+			}
+	    ); 
+	}
+
+	function echart_change(){
+        require.config({
+            paths: {
+                echarts: '/js/lib/echarts/build/dist'
+            }
+        }); 
+	    require(
+		[
+			'echarts',
+			'echarts/chart/bar'
+		],
+			function (ec) {
+				rank_assess_back = ec.init(document.getElementById('backward-rank-assess'));
+			}
 	    ); 
 	}
 			/**
@@ -434,7 +576,7 @@ $(function(){
 					yAxis : [
 						{
 							type : 'value',
-							min : 700 ,
+							min : min_year ,
 						    max : 1000,
 							axisLabel : {
 								formatter: '{value}'
@@ -472,7 +614,7 @@ $(function(){
 			option = {
 				tooltip : {
 					trigger: 'item',
-					formatter: "{a} <br/>{b} : {c} ({d}%)"
+					formatter:  "收费站考核扣分占比 <br/>{b} : {d}%"
 				},
 				toolbox: {
 					show : true,
@@ -508,7 +650,7 @@ $(function(){
 		}
 
         /**
-		 * 图三 
+		 * 图三 前5名 
 		 */
 		function progress_rank_assess(){
 			option = {
@@ -517,7 +659,7 @@ $(function(){
 					trigger: 'axis'
 				},
 				grid:{
-                    width:420  // 图表宽度
+                    width:"80%"
                 },
 				legend: {
 					data:['进步名次']
@@ -531,7 +673,8 @@ $(function(){
 				],
 				yAxis : [
 					{
-						type : 'value'
+						type : 'value',
+						min : min_five
 					}
 				],
 				series : [
@@ -554,19 +697,65 @@ $(function(){
 					return option;
 	   }
 
+	   /**
+		 * 图三 后5名
+		 */
+		function backward_rank_assess(){
+			option = {
+				color : [ '#00ced1' ],// 条形图颜色
+				tooltip : {
+					trigger: 'axis'
+				},
+				grid:{
+                    width:"80%"
+                },
+				legend: {
+					data:['退步名次']
+				},
+				calculable : true,
+				xAxis : [
+					{
+						type : 'category',
+						data : array_five_name_back
+					}
+				],
+				yAxis : [
+					{
+						type : 'value',
+						min : min_five_back
+					}
+				],
+				series : [
+					{
+						name:'退步名次',
+						type:'bar',
+						data: array_five_score_back,
+					    itemStyle: {
+						normal: {
+							label: {
+								show: true,
+								position: 'insideTop'
+							}
+						}
+					},  						
+					}   
+				]
+			};
+                    		
+					return option;
+	   }
+
+
         /**
 		 * 图四
 		 */
 		function people_score_rank(){
+			console.log(array_score_order+"-----"+array_score_data)
 					option = {
 				color : [ '#00ced1' ],// 条形图颜色
 				tooltip : {
 					trigger: 'axis'
 				},
-				grid:{
-                    width:1010,  // 图表宽度
-					x:40
-                },
 				legend: {
 					data:['平均分']
 				},
@@ -580,7 +769,7 @@ $(function(){
 				yAxis : [
 					{
 						type : 'value',
-						min : 900 ,
+						min : min_score ,
 						max : 1000
 					}
 				],
@@ -616,7 +805,7 @@ $(function(){
 			option = {
 				tooltip : {
 					trigger: 'item',
-					formatter: "{a} <br/>{b} : {c} ({d}%)"
+					formatter:  "温馨服务检查占比 <br/>{b} : {d}%"
 				},
 				toolbox: {
 					show : true,
@@ -659,7 +848,7 @@ $(function(){
 				trigger: 'axis'
 			},
 			grid:{
-                    width:420  // 图表宽度
+                    width:"80%"
                 },
 			legend: {
 				data:['上月','本月']

+ 62 - 26
VisualInspection/js/statistics/total_company_statistics.js

@@ -19,14 +19,18 @@
 		var stationAll_rank;
 		var check_type;
 		var people_points;
+		var flag = true;
+		var min_year;
+		var min_road;
+		var min_allStation;
+		var score_ranking = new Array();
 $(function(){
 	// 显示当前月份
 	$(".div-month select").val(month);
 
 	$(".query-company").click(function(){	
 		var select_month = $(".div-month select").val();
-		// 查询图一
-		init_company_year_assess();
+		flag = false;
 		// 查询图二
 		init_company_points_assess("statistics/lost/score/rate",select_month+'');
 		// 查询图三
@@ -118,7 +122,13 @@ $(function(){
 	 * 初始化图六
 	 */
     function init_each_people_points_six(url,mon){
-		var prev_mth = (mon-1)+'';		
+		var yearPre = year;
+		if(mon==1){
+			prev_mth = 12+'';
+			yearPre = yearPre-1;
+		}else{
+		var prev_mth = (mon-1)+'';	
+		}	
 		if(mon.length==1){
 			mon = "0" +mon;
 		}
@@ -127,7 +137,7 @@ $(function(){
 		}
 		var param = {
 			"mth":year + "/" + mon,
-			"prev_mth": year + "/" + prev_mth,
+			"prev_mth": yearPre + "/" + prev_mth,
 			"queryType":0
 		};
 		initRqueset(url,param,6);
@@ -177,24 +187,28 @@ $(function(){
 		if(type == 1){
 			array_year_score.length = 0;
 			months.length = 0;
-			if(data!=''){
+			if(data!='' && data.length!=0){
 			if(data.length<12){
 				for(var i=0;i<12-data.length;i++){
 					// 不足月份补0
 					array_year_score.push(0);
 				}
 			}		
-			for(var i=0;i<data.length;i++){
-				if(months.indexOf(parseInt(data[i].mth.substr(5)))){
-					// 指定位置插入值
-					array_year_score.splice(parseInt(data[i].mth.substr(5))-1,0,
-					(1000-(filter_handler(data[i].all_check_score,data[i].checked_num,data[i].people_num,0)).toFixed(1)));
+				for(var i=0;i<data.length;i++){
+					if(months.indexOf(parseInt(data[i].mth.substr(5)))){
+						// 指定位置插入值
+						array_year_score.splice(parseInt(data[i].mth.substr(5))-1,0,
+						(1000-(filter_handler(data[i].all_check_score,data[i].checked_num,data[i].people_num,0))));
+					}
 				}
-			}
 			}else{
 					array_year_score.length = 0;
 					months.length = 0;
-			}	
+			}
+			if(eval("Math.min(" + array_year_score.toString() + ")")==0)
+			min_year = 0;
+			else
+			min_year = 	eval("Math.min(" + array_year_score.toString() + ")").toFixed(0)-10;
 		}else if(type == 2){
 			array_points.length=0;
 			    if(data!=''){
@@ -211,24 +225,32 @@ $(function(){
 			for(var i=0;i<data.length;i++){
 				if(data!=''){
 					array_road.push(data[i].feeStationName);
-					array_road_score.push((1000-(filter_handler(data[i].all_check_score,data[i].checked_num,data[i].people_num,0)).toFixed(1)));
+					array_road_score.push((1000-(filter_handler(data[i].all_check_score,data[i].checked_num,data[i].people_num,0))));
 		        }else{
 					array_road.length=0;
 			        array_road_score.length=0;	
 				}	
 		    }
+			    if(eval("Math.min(" + array_road_score.toString() + ")")==0)
+				min_road = 0;
+				else
+				min_road = 	eval("Math.min(" + array_road_score.toString() + ")").toFixed(0)-10;
 		}else if(type == 4){
 			array_allStation_score.length=0;
 			array_allStation.length=0;
             for(var i=0;i<data.length;i++){
-				if(data!=''){
+				if(data!='' && data.length!=0){
 					array_allStation.push(data[i].feeStationName.substr(0,data[i].feeStationName.length-3));
-					array_allStation_score.push((1000-(filter_handler(data[i].all_check_score,data[i].checked_num,data[i].people_num,0)).toFixed(1)));
+					array_allStation_score.push((1000-(filter_handler(data[i].all_check_score,data[i].checked_num,data[i].people_num,0))));
 				}else{
 					array_allStation_score.length=0;
 			        array_allStation.length=0;	
 				}
 	        }
+			    if(eval("Math.min(" + array_allStation_score.toString() + ")")==0)
+				min_allStation = 0;
+				else
+				min_allStation = eval("Math.min(" + array_allStation_score.toString() + ")").toFixed(0)-10;
 		}else if(type == 5){
 			array_check_type = [];
                 if(data.length != 0){
@@ -242,7 +264,13 @@ $(function(){
 			array_points_name.length=0;
 			array_points_pre.length=0;
 			arrar_points_month.length=0;
-			data_each_people_points(data);
+			if(data!='' && data.Pmth.length!=0 || data.Tmth.length!=0){
+			  	data_each_people_points(data);
+			}else{
+				array_points_name.length=0;
+				array_points_pre.length=0;
+				arrar_points_month.length=0;
+			}   
 		}
 	}
 
@@ -260,7 +288,7 @@ $(function(){
 				if(Tmth.length > 0){
 					for(var j= 0; j< Tmth.length;j++){
 						if(name[i] == Tmth[j].name && Tmth[j].all_check_score != null){
-							Ttemp[i] = Tmth[j].all_check_score;
+							Ttemp[i] = filter_handler(Tmth[j].all_check_score,Tmth[j].checked_num,Tmth[j].people_num,0);
 							break;
 						}else{
 							Ttemp[i] = 0;
@@ -272,7 +300,7 @@ $(function(){
 				if(Pmth.length > 0){
 					for(var m= 0; m< Pmth.length;m++){
 						if(name[i] == Pmth[m].name && Pmth[m].all_check_score != null){
-							Ptemp[i] = Pmth[m].all_check_score;
+							Ptemp[i] = filter_handler(Pmth[m].all_check_score,Pmth[m].checked_num,Pmth[m].people_num,0);
 							break;
 						}else{
 							Ptemp[i] = 0;
@@ -313,7 +341,7 @@ $(function(){
 		if(num1 == 0 || num2 == 0){
 			return num4;
 		}else{
-			return (num/num1)/num2;
+			return ((num/num1)/num2).toFixed(2);
 		}
 	}
 	
@@ -337,7 +365,9 @@ $(function(){
 			],
 		function (ec) {
 				// 基于准备好的dom,初始化echarts图表
-				year_assess = ec.init(document.getElementById('company-year-assess')); 
+				if(flag){
+					year_assess = ec.init(document.getElementById('company-year-assess')); 
+				}
 				points_assess = ec.init(document.getElementById('company-points-assess'));
 				score_rank = ec.init(document.getElementById('roadManager-score-rank'));
 				stationAll_rank = ec.init(document.getElementById('company-stationAll-rank'));
@@ -375,7 +405,7 @@ $(function(){
 					yAxis : [
 						{
 							type : 'value',
-							min : 900 ,
+							min : min_year ,
 						    max : 1000,
 							axisLabel : {
 								formatter: '{value}'
@@ -413,7 +443,7 @@ $(function(){
 			option = {
 				tooltip : {
 					trigger: 'item',
-					formatter: "{a} <br/>{b} : {c} ({d}%)"
+					formatter:  "公司考核扣分占比 <br/>{b} : {d}%"
 				},
 				toolbox: {
 					show : true,
@@ -457,7 +487,10 @@ $(function(){
 				tooltip : {
 					trigger: 'axis'
 				},
-				
+				grid:{
+                    width:"80%",
+					
+                },
 				calculable : true,
 				xAxis : [
 					{
@@ -468,7 +501,7 @@ $(function(){
 				yAxis : [
 					{
 						type : 'value',
-						min : 900 ,
+						min : min_road ,
 						max : 1000
 					}
 				],
@@ -519,7 +552,7 @@ $(function(){
 				yAxis : [
 					{
 						type : 'value',
-						min : 900 ,
+						min : min_allStation ,
 						max : 1000
 					}
 				],
@@ -555,7 +588,7 @@ $(function(){
 			option = {
 				tooltip : {
 					trigger: 'item',
-					formatter: "{a} <br/>{b} : {c} ({d}%)"
+					formatter:  "温馨服务检查占比 <br/>{b} : {d}%"
 				},
 				toolbox: {
 					show : true,
@@ -597,6 +630,9 @@ $(function(){
 			tooltip : {
 				trigger: 'axis'
 			},
+			grid:{
+                    width:"80%",	
+                },
 			legend: {
 				data:['上月','本月']
 			},

+ 3 - 27
VisualInspection/view/statistics/check_workload_statistics.html

@@ -18,7 +18,8 @@
     <div class="row-3">
        <table class="table table-bordered" style="text-align:center;">
            <tr><td>总稽查人数</td><td>总稽查任务数</td><td>总稽查时长</td><td>考核人员数量</td><td>总扣分数</td><td>平均人次扣分数</td></tr>
-           <tr><td>15</td><td>150</td><td>1小时20分</td><td>20</td><td>3000</td><td>200</td></tr>
+           <tr><td class="all_check_personal"></td><td class="all_check_task"></td><td class="all_check_minute"></td>
+               <td class="all_checkman"></td><td class="all_check_score"></td><td class="check_score_avg"></td></tr>
        </table>
     </div>
 
@@ -31,32 +32,7 @@
 <script>
     $(document).ready(function() {
 
-        // 仅选择日期
-        $(".div-start input").datetimepicker(
-        {
-            language:  "zh-CN",
-            weekStart: 1,
-            todayBtn:  1,
-            autoclose: 1,
-            todayHighlight: 1,
-            startView: 2,
-            minView: 2,
-            forceParse: 0,
-            format: "yyyy-mm-dd"
-        });
-        // 仅选择日期
-        $(".div-end input").datetimepicker(
-        {
-            language:  "zh-CN",
-            weekStart: 1,
-            todayBtn:  1,
-            autoclose: 1,
-            todayHighlight: 1,
-            startView: 2,
-            minView: 2,
-            forceParse: 0,
-            format: "yyyy-mm-dd"
-        });
+       
     });
 </script>
 

+ 22 - 16
VisualInspection/view/statistics/emp_ranking.html

@@ -55,16 +55,19 @@
                     <table border="1" width="100%"  align="center">
                         <thead class="table-thead" align="center">
                             <tr>
-                            <th rowspan="2" width="67px;">序号</th><th rowspan="2" width="87px">站名</th><th rowspan="2" width="67px">姓名</th>
-                            <th rowspan="2" width="67px">岗位</th><th rowspan="2" width="87px">工号</th><th colspan="9" height="40px">考核扣分</th>
-                            <th rowspan="2" width="67px">受检次数</th><th rowspan="2" width="67px">平均扣分(千分制)</th><th rowspan="2" width="55px">得分</th>
-                            <th rowspan="2" width="58px">服务评价</th><th rowspan="2"  width="58px">备注</th>
+                            <th rowspan="2" width="4%;">序号</th><th rowspan="2" width="6%">站名</th>
+                            <th rowspan="2" width="6%">姓名</th><th rowspan="2" width="6%">岗位</th>
+                            <th rowspan="2" width="7%">工号</th><th rowspan="2" width="4%">公司排名</th>
+                            <th rowspan="2" width="4%">道管排名</th><th rowspan="2" width="4%">收费站排名</th>
+                            <th colspan="9" height="40px">考核扣分</th><th rowspan="2" width="4%">受检次数</th>
+                            <th rowspan="2" width="4%">平均扣分(千分制)</th><th rowspan="2" width="4%">得分</th>
+                            <th rowspan="2" width="4%">服务评价</th><th rowspan="2" width="4%">备注</th>
                             </tr>
                             <tr> 
-                            <th width="58px">环境卫生</th><th width="58px">仪容仪表</th><th width="58px">表情</th>
-                            <th width="58px">收费动作</th><th width="58px">文明用语</th><th width="58px">工作纪律</th>
-                            <th width="58px">便民服务</th><th width="58px">安全管理</th>
-                            <th width="58px">扣分合计</th>
+                            <th width="4%">环境卫生</th><th width="4%">仪容仪表</th><th width="4%">表情</th>
+                            <th width="4%">收费动作</th><th width="4%">文明用语</th><th width="4%">工作纪律</th>
+                            <th width="4%">便民服务</th><th width="4%">安全管理</th>
+                            <th width="4%">扣分合计</th>
                             </tr>
                         </thead>
                     </table>
@@ -74,16 +77,19 @@
                  <table style="border-top:0;" border="1" width="100%"  align="center">
                     <thead class="table-thead" style="height:0;" align="center">
                         <tr style="display:none;">
-                            <th rowspan="2" width="67px;">序号</th><th rowspan="2" width="87px">站名</th><th rowspan="2" width="67px">姓名</th>
-                            <th rowspan="2" width="67px">岗位</th><th rowspan="2" width="87px">工号</th><th colspan="9" height="40px">考核扣分</th>
-                            <th rowspan="2" width="67px">受检次数</th><th rowspan="2" width="67px">平均扣分(千分制)</th><th rowspan="2" width="55px">得分</th>
-                            <th rowspan="2" width="58px">服务评价</th><th rowspan="2"  width="58px">备注</th>
+                            <th rowspan="2" width="4%;">序号</th><th rowspan="2" width="6%">站名</th>
+                            <th rowspan="2" width="6%">姓名</th><th rowspan="2" width="6%">岗位</th>
+                            <th rowspan="2" width="7%">工号</th><th rowspan="2" width="4%">公司排名</th>
+                            <th rowspan="2" width="4%">道管排名</th><th rowspan="2" width="4%">收费站排名</th>
+                            <th colspan="9" height="40px">考核扣分</th><th rowspan="2" width="4%">受检次数</th>
+                            <th rowspan="2" width="4%">平均扣分(千分制)</th><th rowspan="2" width="4%">得分</th>
+                            <th rowspan="2" width="4%">服务评价</th><th rowspan="2" width="4%">备注</th>
                         </tr>
                         <tr style="display:none;"> 
-                            <th width="58px">环境卫生</th><th width="58px">仪容仪表</th><th width="58px">表情</th>
-                            <th width="58px">收费动作</th><th width="58px">文明用语</th><th width="58px">工作纪律</th>
-                            <th width="58px">便民服务</th><th width="58px">安全管理</th>
-                            <th width="58px">扣分合计</th>
+                            <th width="4%">环境卫生</th><th width="4%">仪容仪表</th><th width="4%">表情</th>
+                            <th width="4%">收费动作</th><th width="4%">文明用语</th><th width="4%">工作纪律</th>
+                            <th width="4%">便民服务</th><th width="4%">安全管理</th>
+                            <th width="4%">扣分合计</th>
                         </tr>
                     </thead>
                     <tbody class="table-tbody" style="background:white; " align="center">

+ 8 - 7
VisualInspection/view/statistics/personal_data_statistics.html

@@ -6,18 +6,20 @@
     <div class="line-1"></div>
     <div class="row-2">
         <div>
-            <div class="name"><span>刘娟</span></div>
-            <div class="div-select div-button"><button>选择人员</button></div>
+            <!--<div class="name"><span>刘娟</span></div>
+            <div class="div-select div-button"><button>选择人员</button></div>-->
+            <div class="name1"><span>请选择收费站:</span></div>
+            <div class="div-select"><select id="select-dept"></select></button></div>
+            <div class="div-select"><select id="select-personal"></select></button></div>
             <div class="div-start"><input placeholder="请选择考核开始时间"></input></div>
             <div class="div-to"><label>-</label></div>
             <div class="div-end"><input placeholder="请选择考核结束时间"></input></div>
-            <div class="div-check"><select><option>请选择温馨服务检查类别</option></select></div>
             <div class="query div-button"><button>查询</button></div>
             <div class="export div-button"><button>导出</button></div>
         </div>
     </div> 
     <div class="line-1"></div>
-    <div class="row-3">
+    <!--<div class="row-3">
         <div class="dept">
             <div style="margin-top:14px;">
             <span>部门</span><br/><br/>   
@@ -47,8 +49,7 @@
             <span style="margin-left:50px;">总扣分:</span><span>120</span>
             <span style="margin-left:50px;">平均单项扣分:</span><span>11</span>
         </div>
-    </div>
-    <div class="line-1"></div>
+    </div>-->
 
     <div class="row" style="width:100%;margin:0 auto;">
             <!-- 使用一个div来显示数据表格 -->
@@ -69,7 +70,7 @@
 </div>
 <script>
     $(document).ready(function() {
-
+        
         // 仅选择日期
         $(".div-start input").datetimepicker(
         {

+ 3 - 1
VisualInspection/view/statistics/toll_station_statistics.html

@@ -37,12 +37,14 @@
     <div class="border-line">
     <div class="row-4">
         <div class="col-1"><span>收费站考核扣分情况占比</span></div><div class="line-2"></div>
-        <div class="col-1"><span>考核进步Top5排行榜</span></div>
+        <div class="col-1" id="progress"><span>考核进步Top5排行榜</span><div class="btn-change"><button class="view_change">切换</button></div></div>
+        <div class="col-1" id="backward" style="display:none;"><span>考核退步Top5排行榜</span></div>
     </div>
     <div class="row-5">
         <div id="tollStation-points-assess" style="width:49%;height:400px;float:left;"></div>
         <div class="line-3"></div>
         <div id="progress-rank-assess" style="width:49%;height:400px;float:left;"></div>
+        <div id="backward-rank-assess" style="display:none;width:49%;height:400px;float:left;"></div>
     </div>
     </div>
 

+ 24 - 0
VisualInspection_server/src/main/java/com/xintong/visualinspection/bean/StatisticsBean.java

@@ -113,4 +113,28 @@ public class StatisticsBean {
     private String check_task_name ;
     
     private String check_task_time_name ;
+    
+    // 比较大小 1 小 , -1 大
+    public int compareTo(StatisticsBean o2){
+    	if(this.getChecked_num()!=0 && o2.getChecked_num()!=0){
+			double a = this.getAll_check_score() / (this.getChecked_num()+0.00) / this.getPeople_num();
+			double b = o2.getAll_check_score() /(o2.getChecked_num()+0.00) / o2.getPeople_num();
+			if (a > b ) {
+				return 1;
+			} else if (a < b) {
+				return -1;
+			} else {
+				return 0;
+			}	
+		}else{
+			if(this.getChecked_num() == 0){
+				return -1 ;
+			}else if(o2.getChecked_num() ==0){
+				return 1;
+			}else{
+				return 0;
+			}
+		}
+    }
+    
 }

+ 28 - 0
VisualInspection_server/src/main/java/com/xintong/visualinspection/bean/StatisticsBo.java

@@ -4,6 +4,8 @@ import java.util.ArrayList;
 import java.util.Date;
 import java.util.List;
 
+import org.mockito.internal.matchers.CompareTo;
+
 import lombok.Data;
 
 /**
@@ -31,4 +33,30 @@ public class StatisticsBo {
     
     private String check_score;
     
+    // 公司排名
+    private Integer company_ranking;
+    // 道管排名
+    private Integer center_ranking;
+    
+    // 收费站排名
+    private Integer fee_station_ranking;
+    
+    // 比较大小 1 小 , -1 大
+    public int compareTo(StatisticsBo o2){
+    	double a = 1000.0 ,b=1000.0 ;
+		if(this.getChecked_num()!=0 ){
+			a = this.getCheck_all_score() / (this.getChecked_num()+0.00);
+		}
+		if(o2.getChecked_num()!=0){
+			b = o2.getCheck_all_score()/(o2.getChecked_num()+0.00);
+		}
+		if (a > b ) {
+			return 1;
+		} else if (a < b) {
+			return -1;
+		} else {
+			return 0;
+		}	
+    }
+    
 }

+ 2 - 1
VisualInspection_server/src/main/java/com/xintong/visualinspection/controller/StatisticsController.java

@@ -166,7 +166,8 @@ public class StatisticsController extends BaseController {
      */
     @RequestMapping(value = "/one/checkedItem/detail/info/{page}/{size}")
     public String getFsOnePersonCheckedItemDetailInfo(@RequestBody StatisticsBean obj,@PathVariable Integer page,@PathVariable Integer size){
-    	PageHelper.offsetPage(page, size);
+    	//PageHelper.offsetPage(page, size);
+    	PageHelper.startPage(page, size);
     	List<StatisticsBean> returnList=  statisticsService.getOneCheckedDetailInfo(obj);
     	return super.returnSuccessResult(new PageInfo(returnList));
     }

+ 2 - 1
VisualInspection_server/src/main/java/com/xintong/visualinspection/mapper/cluster/UserInfoMapper.xml

@@ -102,8 +102,9 @@
     
     <select id="getUsers" parameterType="com.xintong.visualinspection.bean.User" resultMap="BaseResultMap"  >
         SELECT
-        t.* , fs.name AS fee_station_name
+        t.* , fs.name AS fee_station_name,tso.parentid AS parent_organid
         FROM t_sys_users t LEFT JOIN t_br_layer_fee_station fs ON t.organid = fs.organ_id
+        LEFT JOIN t_sys_organ tso ON t.organid = tso.id
         where 1=1 and t.status>0 
         <if test="organid != null and organid != 0">and t.organid = #{organid} </if>
         <if test="username != null">and t.username = #{username} </if>

+ 44 - 59
VisualInspection_server/src/main/java/com/xintong/visualinspection/service/impl/StatisticsServiceImpl.java

@@ -69,16 +69,14 @@ public class StatisticsServiceImpl extends BaseService implements StatisticsServ
 
 		Map<Long, StatisticsBo> statisticBoMap = new HashMap<Long, StatisticsBo>();
 
+		// 检索收费站的人员
 		Constant t =  CodeUtil.getCodeByFlagAndValue("feestation_check_jobs", "1");
-		
 		String[] postions = t.getCode_name().split(",");
-		
 		User user = new User();
 		List<Integer> positionList = new ArrayList<Integer>();
 		for(int i =0 ;i<postions.length;i++){
 			positionList.add(Integer.parseInt(postions[i]));
 		}
-
 		user.setPosition_ids(positionList);
 
 		if (obj.getDept_id() != null)
@@ -105,6 +103,7 @@ public class StatisticsServiceImpl extends BaseService implements StatisticsServ
 			}
 		}
 
+		
 		for (StatisticsBean statisticsBean : timesList) {
 			if (statisticBoMap.containsKey(statisticsBean.getUser_id())) {
 				StatisticsBo tmp = statisticBoMap.get(statisticsBean.getUser_id());
@@ -117,28 +116,38 @@ public class StatisticsServiceImpl extends BaseService implements StatisticsServ
 		lists.sort(new Comparator<StatisticsBo>() {
 			@Override
 			public int compare(StatisticsBo o1, StatisticsBo o2) {
-				if(o1.getChecked_num()!=0 && o2.getChecked_num()!=0){
-					double a = o1.getCheck_all_score() / (o1.getChecked_num()+0.00);
-					double b = o2.getCheck_all_score()/(o2.getChecked_num()+0.00);
-					if (a > b ) {
-						return 1;
-					} else if (a < b) {
-						return -1;
-					} else {
-						return 0;
-					}	
-				}else{
-					if(o1.getChecked_num() == 0){
-						return -1 ;
-					}else if(o2.getChecked_num() ==0){
-						return 1;
-					}else{
-						return 0;
-					}
-				}
+				return o1.compareTo(o2);
 			}
 		});
-
+		// 道管Map
+		Map<String,Integer> center_ranking = new HashMap<>();
+		center_ranking.put("30",1);
+		center_ranking.put("31",1);
+		center_ranking.put("32",1);
+		
+		Map<String,Integer> fee_ranking= new HashMap<>();
+		// 这边需要对道管和收费站内的员工进行排名
+		List<FeeStation> list_feeStation = departmentDao.getAllFS();
+		for(FeeStation fee: list_feeStation){
+			fee_ranking.put(fee.getDeptid(), 1);
+		}
+		
+		for(int i=0;i<lists.size();i++){
+			// 累计道管排名
+			String centerId= lists.get(i).getUser().getParent_organid().toString();
+			lists.get(i).setCenter_ranking(center_ranking.get(centerId));
+			center_ranking.put(centerId,center_ranking.get(centerId) +1 );
+
+			// 累计收费站的排名
+			String feeStationId= lists.get(i).getUser().getOrganid().toString();
+			lists.get(i).setFee_station_ranking(fee_ranking.get(feeStationId));
+			fee_ranking.put(feeStationId, fee_ranking.get(feeStationId)+1);
+			
+			// 公司排名
+			lists.get(i).setCompany_ranking(i+1);
+			
+		}
+		
 		return lists;
 	}
 
@@ -527,23 +536,7 @@ public class StatisticsServiceImpl extends BaseService implements StatisticsServ
 		scoreList.sort(new Comparator<StatisticsBean>() {
 			@Override
 			public int compare(StatisticsBean o1, StatisticsBean o2) {
-				if(o1.getChecked_num()!=0 && o2.getChecked_num()!=0){
-					if (o1.getAll_check_score()/(o1.getChecked_num()+0.0) > o2.getAll_check_score()/(o2.getChecked_num()+0.0) ) {
-						return 1;
-					} else if (o1.getAll_check_score()/(o1.getChecked_num()+0.0) < o2.getAll_check_score()/(o2.getChecked_num()+0.0)) {
-						return -1;
-					} else {
-						return 0;
-					}
-				}else{
-					if(o1.getChecked_num() == 0){
-						return -1 ;
-					}else if(o2.getChecked_num() ==0){
-						return 1;
-					}else{
-						return 0;
-					}
-				}
+				return o1.compareTo(o2);
 			}
 		});
 		
@@ -574,6 +567,13 @@ public class StatisticsServiceImpl extends BaseService implements StatisticsServ
 			}
 		}
 		
+		resultList.sort(new Comparator<StatisticsBean>() {
+			@Override
+			public int compare(StatisticsBean o1, StatisticsBean o2) {
+				return o1.compareTo(o2);
+			}
+		});
+		
 		return resultList;
 	}
 	
@@ -643,25 +643,7 @@ public class StatisticsServiceImpl extends BaseService implements StatisticsServ
 		centerManageList.sort(new Comparator<StatisticsBean>() {
 			@Override
 			public int compare(StatisticsBean o1, StatisticsBean o2) {
-				if(o1.getChecked_num()!=0 && o2.getChecked_num()!=0){
-					double a = o1.getAll_check_score() / (o1.getChecked_num()+0.00) / o1.getPeople_num();
-					double b = o2.getAll_check_score() /(o2.getChecked_num()+0.00) / o2.getPeople_num();
-					if (a > b ) {
-						return 1;
-					} else if (a < b) {
-						return -1;
-					} else {
-						return 0;
-					}	
-				}else{
-					if(o1.getChecked_num() == 0){
-						return -1 ;
-					}else if(o2.getChecked_num() ==0){
-						return 1;
-					}else{
-						return 0;
-					}
-				}
+				return o1.compareTo(o2);
 			}
 		});
 		
@@ -951,6 +933,9 @@ public class StatisticsServiceImpl extends BaseService implements StatisticsServ
 				sta.setCheckman_name( CacheUtil.getUserFromMap(sta.getCheckman_id()+0L).getTruename()  ); 
 				sta.setChecked_name( CacheUtil.getUserFromMap(sta.getUser_id()+0L).getTruename());
 				sta.setFeeStationName( CacheUtil.getOrganFromMap(sta.getDept_id()).getOrganname() );
+				SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm");
+				SimpleDateFormat formatter2 = new SimpleDateFormat("- HH:mm");
+				sta.setCheck_task_time_name( formatter.format(sta.getStart_date())+formatter2.format(sta.getEnd_date()));
 			}
 		}else{
 			for(StatisticsBean sta : list){

BIN
VisualInspection_server/src/main/resources/employee_order.xls