소스 검색

chart statictis

chenrj-PC\chenrj 8 년 전
부모
커밋
9d2d5a9134

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

@@ -74,7 +74,7 @@ public class StatisticsController extends BaseController {
     }
     }
     
     
     /**
     /**
-     * 管中心3
+     * 管中心3
      */
      */
     @RequestMapping(value = "/score/center/manage/info")
     @RequestMapping(value = "/score/center/manage/info")
     public String selectCentermanageScoreChange(@RequestBody StatisticsBean obj){
     public String selectCentermanageScoreChange(@RequestBody StatisticsBean obj){
@@ -83,7 +83,7 @@ public class StatisticsController extends BaseController {
     }
     }
     
     
     /**
     /**
-     * 管下收费站
+     * 管下收费站
      */
      */
     @RequestMapping(value = "/score/manage/tollgate/info")
     @RequestMapping(value = "/score/manage/tollgate/info")
     public String selectCentermanageTollgateScoreChange(@RequestBody StatisticsBean obj){
     public String selectCentermanageTollgateScoreChange(@RequestBody StatisticsBean obj){
@@ -91,4 +91,14 @@ public class StatisticsController extends BaseController {
     	return super.returnSuccessResult(lists);
     	return super.returnSuccessResult(lists);
     }
     }
     
     
+    
+    /**
+     * 考核粘粉情况比
+     */
+    @RequestMapping(value = "/lost/score/rate")
+    public String getCheckedInfoRate(@RequestBody StatisticsBean obj){
+    	StatisticsBean returnObj=  statisticsService.getCheckedScoreInfo(obj);
+    	return super.returnSuccessResult(returnObj);
+    }
+    
 }
 }

+ 2 - 0
VisualInspection_server/src/main/java/com/xintong/visualinspection/dao/master/StatisticsDao.java

@@ -26,4 +26,6 @@ public interface StatisticsDao  {
 	public List<StatisticsBean> selectYearScoreInfo(StatisticsBean obj);
 	public List<StatisticsBean> selectYearScoreInfo(StatisticsBean obj);
 	
 	
 	public List<StatisticsBean> selectFeeStationScoreInfo(StatisticsBean obj);
 	public List<StatisticsBean> selectFeeStationScoreInfo(StatisticsBean obj);
+	
+	public List<StatisticsBean> selectCheckedScoreList(StatisticsBean obj);
 }
 }

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

@@ -122,14 +122,14 @@
     <select id="selectYearScoreInfo" parameterType="com.xintong.visualinspection.bean.StatisticsBean" resultType="com.xintong.visualinspection.bean.StatisticsBean">
     <select id="selectYearScoreInfo" parameterType="com.xintong.visualinspection.bean.StatisticsBean" resultType="com.xintong.visualinspection.bean.StatisticsBean">
     	SELECT sum(tab.checkd_all_score) AS all_check_score  , sum(tab.checked_num) AS checked_num  , tab.mth FROM ( <include refid="selectAllCheckedInfo" />  ) tab 
     	SELECT sum(tab.checkd_all_score) AS all_check_score  , sum(tab.checked_num) AS checked_num  , tab.mth FROM ( <include refid="selectAllCheckedInfo" />  ) tab 
     	WHERE 1=1 
     	WHERE 1=1 
-    	<if test="dept_list!=null and queryType == 2 and dept_list.size()>0 ">
+    	<if test="dept_list!=null and queryType == 1 and dept_list.size()>0 ">
     		AND	tab.checked_dept IN
     		AND	tab.checked_dept IN
 		    	<foreach item="obj"  collection="dept_list" open="("
 		    	<foreach item="obj"  collection="dept_list" open="("
 		            separator="," close=")">
 		            separator="," close=")">
 		            #{obj.id}  
 		            #{obj.id}  
 		         </foreach>
 		         </foreach>
     	</if>
     	</if>
-    	<if test="dept_id!=null and queryType ==3">
+    	<if test="dept_id!=null and queryType ==2">
     		AND tab.checked_dept=#{dept_id}
     		AND tab.checked_dept=#{dept_id}
     	</if>
     	</if>
     	GROUP BY tab.mth
     	GROUP BY tab.mth
@@ -141,4 +141,28 @@
     	GROUP BY tab.checked_dept
     	GROUP BY tab.checked_dept
     </select>
     </select>
      
      
+     
+     <sql id="selectEveryCheckedInfo">
+     	SELECT  SUM(sc.check_item_score) AS checkd_all_score , t.checked_person ,t.checked_dept FROM check_task t 
+			INNER JOIN check_score sc ON sc.task_id = t.id 
+			WHERE monthfunc( t.start_time ) = #{mth}
+			GROUP BY t.checked_person
+     </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   FROM (  <include refid="selectEveryCheckedInfo"/> ) tab 
+     	WHERE 1=1 
+     	<if test="dept_list!=null and queryType == 1 and dept_list.size()>0 ">
+    		AND	tab.checked_dept IN
+		    	<foreach item="obj"  collection="dept_list" open="("
+		            separator="," close=")">
+		            #{obj.id}  
+		         </foreach>
+    	</if>
+    	<if test="dept_id!=null and queryType ==2">
+    		AND tab.checked_dept=#{dept_id}
+    	</if>
+     	
+     </select>
+     
 </mapper>
 </mapper>

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

@@ -42,5 +42,6 @@ public interface StatisticsService {
 	
 	
 	public List<StatisticsBean> getSingleFeeStationScoreInfo(StatisticsBean obj);
 	public List<StatisticsBean> getSingleFeeStationScoreInfo(StatisticsBean obj);
 	
 	
-	
+	// 考核扣分情况占比
+	public StatisticsBean getCheckedScoreInfo(StatisticsBean obj);
 }
 }

+ 54 - 0
VisualInspection_server/src/main/java/com/xintong/visualinspection/service/impl/StatisticsServiceImpl.java

@@ -481,6 +481,7 @@ public class StatisticsServiceImpl extends BaseService implements StatisticsServ
 			}else{
 			}else{
 				sta.setAll_check_score(0);
 				sta.setAll_check_score(0);
 				sta.setChecked_num(0);
 				sta.setChecked_num(0);
+				sta.setFeeStationName(sta.getName());
 				reList.add(sta);
 				reList.add(sta);
 			}
 			}
 		}
 		}
@@ -603,4 +604,57 @@ public class StatisticsServiceImpl extends BaseService implements StatisticsServ
 		
 		
 		return centerManageList;
 		return centerManageList;
 	}
 	}
+	
+	/**
+	 * 考核情况占比
+	 */
+	@Override
+	public StatisticsBean getCheckedScoreInfo(StatisticsBean obj) {
+		int people_num = 0 ;
+		StatisticsBean returnObj =  new StatisticsBean();
+		if(obj.getQueryType() ==0){
+			// 公司
+			// 公司总人数
+			List<StatisticsBean> feeStationList = userInfoDao.getUsersCountList();
+			if(feeStationList!=null && feeStationList.size()>0){
+				for(StatisticsBean sta : feeStationList){
+					people_num += sta.getPeople_num();
+				}
+			}
+		}else if(obj.getQueryType() == 1){
+			// 道管中心
+			Organ organ =new Organ();
+			organ.setParentid(obj.getDept_id().intValue());
+			List<Organ> list = departmentDao.getOrgan(organ);
+			// 将导管中心下的收费站部门id 列表放入到list中
+			obj.setDept_list(list);
+			
+			people_num = userInfoDao.getUsersCenterManageCount(obj);
+		}else if(obj.getQueryType() == 2){
+			// 收费站
+			List<StatisticsBean> feeStationList = userInfoDao.getUsersCountList();
+			if(feeStationList!=null && feeStationList.size()>0){
+				for(StatisticsBean sta : feeStationList){
+					if(obj.getDept_id()+0L == sta.getDept_id()){
+						people_num = sta.getPeople_num();
+					}
+				}
+			}
+		}
+		
+		List<StatisticsBean> userLostScoreInfoList = statisticsDao.selectCheckedScoreList(obj);
+		
+		for (StatisticsBean sta : userLostScoreInfoList) {
+			if (sta.getAll_check_score()  <= 15) {
+				returnObj.setScore_fifteen(returnObj.getScore_fifteen() + 1);
+			} else if (sta.getAll_check_score() <= 50) {
+				returnObj.setScore_fifty(returnObj.getScore_fifty() + 1);
+			} else {
+				returnObj.setScore_over_fifty(returnObj.getScore_over_fifty() + 1);
+			}
+		}
+		returnObj.setPeople_num(people_num);
+		
+		return returnObj;
+	}
 }
 }