Ver Fonte

Revert "修改bug"

This reverts commit 597bfdb63734eb2806c05236540b862ddab95be8.
chenrj-PC\chenrj há 8 anos atrás
pai
commit
0fd9ea4ee3

+ 1 - 2
VisualInspection/js/statistics/business_promotion_feedback.js

@@ -200,7 +200,7 @@ function getEmployeeInfosClick(url, param, start_score, end_score, start_num, en
                     "<td width='4%;'>" + filter(data[i].check_x_score, '0') + "</td><td width='4%'>" + filter(data[i].check_s_num, '0') + "</td><td width='4%;'>" +
                     filter(data[i].check_s_score, '0') + "</td><td width='4%;'>" + filter(data[i].check_all_num, '0') + "</td>" +
                     "<td width='4%;'>" +  filter(data[i].check_all_score, '0') + "</td><td width='4%;'>" + filterSlash(filterByZeroHandle(data[i].check_score_avg, '0'), filter(data[i].checked_num  + data[i].check_t_num  + data[i].check_x_num + data[i].check_s_num, '0')) + "</td>" +
-                    "<td width='4%;'>" + filterSlash(score.toFixed(2), filter(data[i].score + data[i].check_t_score + data[i].check_x_score + data[i].check_s_score, '0')) + "</td>" + "<td width='4%;'>" + "</td></tr>";
+                    "<td width='4%;'>" + filterSlash(score, filter(data[i].score + data[i].check_t_score + data[i].check_x_score + data[i].check_s_score, '0')) + "</td>" + "<td width='4%;'>" + "</td></tr>";
                 count++;
             }
         }
@@ -298,7 +298,6 @@ function getItemScore(obj, check_item_name) {
  * @param {*} default_display_value
  */
 function filterByZeroHandle(value, default_display_value) {
-    debugger
     if (isNaN(value)) {
         return default_display_value;
     } else {

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

@@ -85,29 +85,4 @@ public class StatisticsBo {
 		}	
     }
     
-    public int compareTo2(StatisticsBo o2){
-    	double a = 1000.0 ,b=1000.0 ;
-    	int a_c = this.getCheck_all_num() ;
-    	int b_c = o2.getCheck_all_num();
-		if(a_c!=0 ){
-			a = (this.getCheck_all_score()) / (a_c+0.00);
-		}
-		if(b_c!=0){
-			b = (o2.getCheck_all_score()) /(b_c+0.00);
-		}
-	
-		if (a > b ) {
-			return 1;
-		} else if (a < b) {
-			return -1;
-		} else {
-			if(a_c == 0 && b_c!=0 ){
-				return -1 ;
-			}else if(b_c ==0 && a_c != 0){
-				return 1;
-			}else{
-				return 0;
-			}
-		}	
-    }
 }

+ 7 - 23
VisualInspection_server/src/main/java/com/xintong/visualinspection/mapper/master/StatisticsMapper.xml

@@ -40,25 +40,10 @@
 
 	
    <select id="selectBFStatistics" parameterType="com.xintong.visualinspection.bean.StatisticsBean" resultType="com.xintong.visualinspection.bean.StatisticsBean">
-	SELECT y.user_id,y.dept_id,IFNULL(x.checked_num,0)+IFNULL(o1.check_a_num,0) checked_num,IFNULL(x.score,0)+IFNULL(o1.check_a_score,0) score,o2.check_t_num,o2.check_t_score,o3.check_x_num,o3.check_x_score,o4.check_s_num,o4.check_s_score  
+	SELECT x.user_id,x.dept_id,IFNULL(x.checked_num,0)+IFNULL(o1.check_a_num,0) checked_num,IFNULL(x.score,0)+IFNULL(o1.check_a_score,0) score,o2.check_t_num,o2.check_t_score,o3.check_x_num,o3.check_x_score,o4.check_s_num,o4.check_s_score  
 		,IFNULL(x.checked_num,0)+IFNULL(o1.check_a_num,0)+IFNULL(o2.check_t_num,0)+IFNULL(o3.check_x_num,0)+IFNULL(o4.check_s_num,0) check_all_num
 		,IFNULL(x.score,0)+IFNULL(o1.check_a_score,0)+IFNULL(o2.check_t_score,0)+IFNULL(o3.check_x_score,0)+IFNULL(o4.check_s_score,0) check_all_score
-		FROM
-		
-		 ( select ORGANID AS dept_id , id AS user_id from t_sys_users t where 1=1  
-		  <if test="position_ids != null and position_ids.size() > 0">
-            AND t.positionid in
-            <foreach collection="position_ids" item="position_id" index="index"
-                     open="(" close=")" separator=",">
-                #{position_id}
-            </foreach>
-        </if>
-		  <if test="dept_id!=null">
-			AND t.ORGANID =#{dept_id}			
-		</if>
-		  ) y LEFT JOIN
-		
-		(SELECT  u.checked_person AS user_id , u.checked_dept AS dept_id,count(1) AS checked_num,sum(u.score) AS score  FROM (
+		FROM(SELECT  u.checked_person AS user_id , u.checked_dept AS dept_id,count(1) AS checked_num,sum(u.score) AS score  FROM (
 		SELECT t.checked_person , t.checked_dept,ci.parent_id, t.check_item_score AS score FROM check_score t 
 		LEFT JOIN check_item ci ON t.check_item_id = ci.id 
 		LEFT JOIN check_task ct ON ct.id = t.task_id
@@ -70,12 +55,11 @@
 			AND t.checked_dept =#{dept_id}			
 		</if>
 		 ) 
-		u LEFT JOIN check_item s ON u.parent_id = s.id GROUP  BY checked_person) x
-		ON y.user_id = x.user_id AND y.dept_id =  x.dept_id
-		LEFT JOIN (SELECT user_id,dept_id,COUNT(1) check_a_num,SUM(check_score) check_a_score FROM other_check WHERE check_type = 1 GROUP BY user_id,dept_id)  o1 ON o1.user_id = y.user_id AND y.dept_id = o1.dept_id
-		LEFT JOIN (SELECT user_id,dept_id,COUNT(1) check_t_num,SUM(check_score) check_t_score FROM other_check WHERE check_type = 2 GROUP BY user_id,dept_id)  o2 ON o2.user_id = y.user_id AND y.dept_id = o2.dept_id
-		LEFT JOIN (SELECT user_id,dept_id,COUNT(1) check_x_num,SUM(check_score) check_x_score FROM other_check WHERE check_type = 3 GROUP BY user_id,dept_id)  o3 ON o3.user_id = y.user_id AND y.dept_id = o3.dept_id
-		LEFT JOIN (SELECT user_id,dept_id,COUNT(1) check_s_num,SUM(check_score) check_s_score FROM other_check WHERE check_type = 4 GROUP BY user_id,dept_id)  o4 ON o4.user_id = y.user_id AND y.dept_id = o4.dept_id
+		u LEFT JOIN check_item s ON u.parent_id = s.id GROUP  BY checked_person)x
+		LEFT JOIN (SELECT user_id,dept_id,COUNT(1) check_a_num,SUM(check_score) check_a_score FROM other_check WHERE check_type = 1 GROUP BY user_id,dept_id)  o1 ON o1.user_id = x.user_id AND x.dept_id = o1.dept_id
+		LEFT JOIN (SELECT user_id,dept_id,COUNT(1) check_t_num,SUM(check_score) check_t_score FROM other_check WHERE check_type = 2 GROUP BY user_id,dept_id)  o2 ON o2.user_id = x.user_id AND x.dept_id = o2.dept_id
+		LEFT JOIN (SELECT user_id,dept_id,COUNT(1) check_x_num,SUM(check_score) check_x_score FROM other_check WHERE check_type = 3 GROUP BY user_id,dept_id)  o3 ON o3.user_id = x.user_id AND x.dept_id = o3.dept_id
+		LEFT JOIN (SELECT user_id,dept_id,COUNT(1) check_s_num,SUM(check_score) check_s_score FROM other_check WHERE check_type = 4 GROUP BY user_id,dept_id)  o4 ON o4.user_id = x.user_id AND x.dept_id = o4.dept_id
 		
 		
     </select>

+ 10 - 12
VisualInspection_server/src/main/java/com/xintong/visualinspection/service/impl/StatisticsServiceImpl.java

@@ -2044,16 +2044,6 @@ public class StatisticsServiceImpl extends BaseService implements StatisticsServ
 
 	@Override
 	public List<StatisticsBo> getBusinessFeedbackInfo(StatisticsBean obj) {
-		
-		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);
-		
 		// 查看是否有部门id
 		Long organId = obj.getDept_id();
 		// 道管中心 id
@@ -2061,7 +2051,6 @@ public class StatisticsServiceImpl extends BaseService implements StatisticsServ
 //		obj.setParent_dept_id(null);
 //		obj.setDept_id(null);
 		// 将检索出来的数据放到如map中
-		obj.setPosition_ids(positionList);
 		List<StatisticsBean> list = statisticsDao.selectBFStatistics(obj);
 
 //		List<StatisticsBean> timesList = statisticsDao.selectCheckedTimes(obj);
@@ -2069,6 +2058,15 @@ 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) {
 			user.setOrganid(obj.getDept_id().intValue());
 		}
@@ -2110,7 +2108,7 @@ public class StatisticsServiceImpl extends BaseService implements StatisticsServ
 		lists.sort(new Comparator<StatisticsBo>() {
 			@Override
 			public int compare(StatisticsBo o1, StatisticsBo o2) {
-				return o1.compareTo2(o2);
+				return o1.compareTo(o2);
 			}
 		});