chenrj-PC\chenrj 8 лет назад
Родитель
Сommit
3f075d9be2

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

@@ -78,7 +78,7 @@ $(function(){
         // 查询图四
 		init_people_score_rank("statistics/stuff/score/info",select_month+'',select_station);
         // 查询图五
-		console.log(select_month+","+select_station);
+		// console.log(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);
@@ -93,7 +93,7 @@ $(function(){
 			"dept_id":select_station,
 			"queryType":2
 		}		
-		console.log(param);
+		// console.log(param);
 		initRqueset(url,param,1);
 	}
 	

+ 2 - 1
VisualInspection_server/src/main/java/com/xintong/visualinspection/mapper/master/StatisticsMapper.xml

@@ -176,7 +176,8 @@
      </sql>
      
      <select id="selectCheckedScoreList" parameterType="com.xintong.visualinspection.bean.StatisticsBean" resultType="com.xintong.visualinspection.bean.StatisticsBean">
-     	SELECT tab.checkd_all_score AS all_check_score,tab.checked_person AS user_id , tab.checked_dept AS dept_id ,tab.checked_num  FROM (  <include refid="selectAllCheckedInfo"/> ) tab 
+     	SELECT tab.checkd_all_score AS all_check_score,tab.checked_person AS user_id , tab.checked_dept AS dept_id ,tab.checked_num  
+     		FROM (  <include refid="selectAllCheckedInfo"/> ) tab 
      	WHERE 1=1 
      	<if test="dept_list!=null and queryType == 1 and dept_list.size()>0 ">
     		AND	tab.checked_dept IN

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

@@ -957,18 +957,44 @@ public class StatisticsServiceImpl extends BaseService implements StatisticsServ
 		obj.setQueryType(2);
 		List<StatisticsBean> t_mthList = getPersonalScoreInfo(obj);
 		Map<Integer, StatisticsBean> t_map = new HashMap<>();
+		
+		int seq =0 ;
+		
 		for (int i = 0; i < t_mthList.size(); i++) {
-			t_mthList.get(i).setRanking(i);
+			if( i == 0 ){
+				seq = 0 	;		
+			}else{
+				if(t_mthList.get(i).compare2To(t_mthList.get(i-1)) == 0){
+					 ;
+				}else{
+					seq = i ;
+				}
+			}
+			t_mthList.get(i).setRanking(seq);	
 			t_map.put(t_mthList.get(i).getUser().getId(), t_mthList.get(i));
 		}
+		
+		 seq = 0 ;
 		// 查询上一个月
 		obj.setMth(obj.getPrev_mth());
 		List<StatisticsBean> prev_mthList = getPersonalScoreInfo(obj);
 		for (int i = 0; i < prev_mthList.size(); i++) {
 			Integer uid = prev_mthList.get(i).getUser().getId();
+			if(i == 0 ){
+				;
+			}else{
+				if(prev_mthList.get(i).compare2To(prev_mthList.get(i-1))==0){
+					;
+				}else{
+					seq = i ;
+				}
+			}
+			
 			if (t_map.containsKey(uid)) {
-				t_map.get(uid).setRanking_change(i - t_map.get(uid).getRanking());
+				t_map.get(uid).setRanking_change(seq - t_map.get(uid).getRanking());
 			}
+			
+			
 		}
 
 		// 这边按照名词变化进行排名