chenrj-PC\chenrj пре 8 година
родитељ
комит
c74c5f2249

+ 8 - 1
VisualInspection/js/statistics/assess_ranking.js

@@ -705,6 +705,12 @@ function exportExcel() {
     var end_date = $("#end-time").val();
     var end_date = $("#end-time").val();
     var start_score = $("#start-score").val();
     var start_score = $("#start-score").val();
     var end_score = $("#end-score").val();
     var end_score = $("#end-score").val();
+    var parent_dept_id = $("#center-manager").val();
+    var max_score =  $("#end-score").val() ;
+    var min_score = $("#start-score").val() ;
+    var min_check_num = $("#start-num").val() ;
+    var max_check_num = $("#end-num").val() ;
+    var position_id = $("#jobSelect").val() ;
     var flag = param_method(start_score, end_score);
     var flag = param_method(start_score, end_score);
     if (flag == false) {
     if (flag == false) {
         return;
         return;
@@ -722,7 +728,8 @@ function exportExcel() {
     }
     }
     if (!dept_id) dept_id = "";
     if (!dept_id) dept_id = "";
     window.open(getserveraddr() + "/file/employee/order?dept_id=" + dept_id +
     window.open(getserveraddr() + "/file/employee/order?dept_id=" + dept_id +
-        "&start_date=" + start_date + "&end_date=" + end_date + "&start_score=" + start_score + "&end_score=" + end_score);
+        "&start_date=" + start_date + "&end_date=" + end_date + "&start_score=" + start_score + "&end_score=" + end_score +"&parent_dept_id="+ parent_dept_id+
+        "&max_score="+max_score+"&min_score="+min_score+"&min_check_num="+min_check_num+"&max_check_num="+max_check_num+"&position_id="+position_id );
 }
 }
 
 
 
 

+ 19 - 0
VisualInspection_server/src/main/java/com/xintong/visualinspection/bean/StatisticsBeanBO.java

@@ -0,0 +1,19 @@
+package com.xintong.visualinspection.bean;
+
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+@Data
+@EqualsAndHashCode(callSuper=false)
+public class StatisticsBeanBO extends StatisticsBean {
+
+	private Integer max_score ;
+	
+	private Integer min_score ;
+	
+	private Integer min_check_num ;
+	
+	private Integer max_check_num ;
+	
+	private Integer position_id ;
+}

+ 23 - 5
VisualInspection_server/src/main/java/com/xintong/visualinspection/controller/FileExcelController.java

@@ -2,6 +2,7 @@ package com.xintong.visualinspection.controller;
 
 
 import java.text.ParseException;
 import java.text.ParseException;
 import java.text.SimpleDateFormat;
 import java.text.SimpleDateFormat;
+import java.util.Calendar;
 import java.util.Date;
 import java.util.Date;
 import java.util.List;
 import java.util.List;
 
 
@@ -17,6 +18,7 @@ import org.springframework.web.bind.annotation.RestController;
 
 
 import com.xintong.visualinspection.bean.CheckAppealStatistic;
 import com.xintong.visualinspection.bean.CheckAppealStatistic;
 import com.xintong.visualinspection.bean.StatisticsBean;
 import com.xintong.visualinspection.bean.StatisticsBean;
+import com.xintong.visualinspection.bean.StatisticsBeanBO;
 import com.xintong.visualinspection.service.StatisticsService;
 import com.xintong.visualinspection.service.StatisticsService;
 import com.xintong.visualinspection.util.DateUtil;
 import com.xintong.visualinspection.util.DateUtil;
 
 
@@ -41,17 +43,29 @@ public class FileExcelController extends BaseController {
     @RequestMapping(value = "/employee/order",method=RequestMethod.GET)
     @RequestMapping(value = "/employee/order",method=RequestMethod.GET)
     public String getEmployeeOrder(HttpServletRequest req,HttpServletResponse resp,
     public String getEmployeeOrder(HttpServletRequest req,HttpServletResponse resp,
     		@RequestParam Long dept_id,
     		@RequestParam Long dept_id,
+    		@RequestParam Long parent_dept_id ,
+    		@RequestParam Integer max_score ,
+    		@RequestParam Integer min_score ,
+    		@RequestParam Integer min_check_num ,
+    		@RequestParam Integer max_check_num ,
+    		@RequestParam Integer position_id ,
     		@RequestParam String start_date,@RequestParam String end_date,
     		@RequestParam String start_date,@RequestParam String end_date,
     		@RequestParam String start_score,@RequestParam String end_score){
     		@RequestParam String start_score,@RequestParam String end_score){
-    	StatisticsBean obj = new StatisticsBean();
+    	StatisticsBeanBO obj = new StatisticsBeanBO();
     
     
 		Date start =  DateUtil.strParseDate(start_date);
 		Date start =  DateUtil.strParseDate(start_date);
 		Date end =  DateUtil.strParseDate(end_date);
 		Date end =  DateUtil.strParseDate(end_date);
 		obj.setDept_id(dept_id);
 		obj.setDept_id(dept_id);
+		obj.setParent_dept_id(parent_dept_id);
 		obj.setStart_date(start);
 		obj.setStart_date(start);
 		obj.setEnd_date(end);
 		obj.setEnd_date(end);
 		obj.setStart_score(start_score);
 		obj.setStart_score(start_score);
 		obj.setEnd_score(end_score);
 		obj.setEnd_score(end_score);
+		obj.setMax_score(max_score);
+		obj.setMin_score(min_score);
+		obj.setMax_check_num(max_check_num);
+		obj.setMin_check_num(min_check_num);
+		obj.setPosition_id(position_id);
 		
 		
     	statisticsService.getEmployeeCheckedInfo(obj, req, resp);
     	statisticsService.getEmployeeCheckedInfo(obj, req, resp);
     	return super.returnSuccessResult(null);
     	return super.returnSuccessResult(null);
@@ -97,7 +111,7 @@ public class FileExcelController extends BaseController {
      */
      */
     @RequestMapping(value = "/appeal/info",method=RequestMethod.GET)
     @RequestMapping(value = "/appeal/info",method=RequestMethod.GET)
     public String getAppealStatisticExcel(HttpServletRequest req,HttpServletResponse resp,
     public String getAppealStatisticExcel(HttpServletRequest req,HttpServletResponse resp,
-    		@RequestParam Integer month,
+    		@RequestParam String month,
     		@RequestParam(required=false) Integer centerId,
     		@RequestParam(required=false) Integer centerId,
     		@RequestParam(required=false) Integer deptId){
     		@RequestParam(required=false) Integer deptId){
     	CheckAppealStatistic obj = new CheckAppealStatistic();
     	CheckAppealStatistic obj = new CheckAppealStatistic();
@@ -106,9 +120,13 @@ public class FileExcelController extends BaseController {
     	}else if(centerId!=null){
     	}else if(centerId!=null){
     		obj.setParent_dept_id(centerId);
     		obj.setParent_dept_id(centerId);
     	}
     	}
-    	obj.setStart_time(DateUtil.strParseDate("2017-"+(month-1)+"-25 23:00:00"));
-    	obj.setEnd_time(DateUtil.strParseDate("2017-"+month+"-25 23:00:00"));
-    	statisticsService.getExcelAppealInfo(obj,month.toString(), req, resp);
+    	Calendar c = Calendar.getInstance();
+    	Date time = DateUtil.strParseDate(month+"/25 23:00:00","yyyy/MM/dd HH:mm:ss");
+    	c.setTime(time);
+    	c.add(Calendar.MONTH,-1);
+    	obj.setStart_time(c.getTime());
+    	obj.setEnd_time(time);
+    	statisticsService.getExcelAppealInfo(obj, month.replaceAll("/", "") , req, resp);
     	return super.returnSuccessResult(null);
     	return super.returnSuccessResult(null);
     }
     }
     
     

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

@@ -67,5 +67,7 @@ public interface StatisticsDao  {
 	
 	
 	public List<TaskAndScore> selectMList(TaskAndScore obj);
 	public List<TaskAndScore> selectMList(TaskAndScore obj);
 	
 	
+	public Integer selectCheckedNum(StatisticsBean obj);
+	
 	
 	
 }
 }

+ 22 - 0
VisualInspection_server/src/main/java/com/xintong/visualinspection/mapper/master/StatisticsMapper.xml

@@ -27,6 +27,28 @@
     </select>
     </select>
     
     
     
     
+    <select id="selectCheckedNum" parameterType="com.xintong.visualinspection.bean.StatisticsBean" resultType="java.lang.Integer" >
+    	
+    	select sum(num) AS num from (
+    	SELECT COUNT(DISTINCT ct.checked_person) as num FROM check_task ct 
+    		WHERE ct.check_status != 22 
+    		<if test="dept_id!=null">
+	    		AND ct.checked_dept = #{dept_id} 
+    		</if>
+    		<if test="dept_list!=null and queryType == 1 and dept_list.size()>0 ">
+	    		AND	ct.checked_dept IN
+			    	<foreach item="obj"  collection="dept_list" open="("
+			            separator="," close=")">
+			            #{obj.id}  
+			         </foreach>
+	    	</if>
+			<if test="mth!=null and mth!=''">
+				AND monthfunc (ct.start_time) = #{mth}
+				AND monthfunc (ct.end_time) = #{mth}
+			</if>
+			GROUP BY ct.checked_dept
+			) u
+    </select>
     
     
 
 
     <select id="selectCheckedTimes" parameterType="com.xintong.visualinspection.bean.StatisticsBean" resultType="com.xintong.visualinspection.bean.StatisticsBean">
     <select id="selectCheckedTimes" parameterType="com.xintong.visualinspection.bean.StatisticsBean" resultType="com.xintong.visualinspection.bean.StatisticsBean">

+ 47 - 29
VisualInspection_server/src/main/java/com/xintong/visualinspection/service/impl/StatisticsServiceImpl.java

@@ -476,6 +476,34 @@ public class StatisticsServiceImpl extends BaseService implements StatisticsServ
 		List<StatisticsBo> listStatistic = getEmployeeCheckedInfo(obj);
 		List<StatisticsBo> listStatistic = getEmployeeCheckedInfo(obj);
 		double start_score = Double.parseDouble(obj.getStart_score());
 		double start_score = Double.parseDouble(obj.getStart_score());
 		double end_score = Double.parseDouble(obj.getEnd_score());
 		double end_score = Double.parseDouble(obj.getEnd_score());
+		
+		StatisticsBeanBO objs = (StatisticsBeanBO)obj ;
+		
+		for (Iterator<StatisticsBo> it = listStatistic.iterator(); it.hasNext();) {
+			StatisticsBo st = it.next();
+			boolean flag = false ;
+			if(objs.getMax_check_num()!=null  &&  st.getChecked_num()>objs.getMax_check_num() ){
+				flag =true ;
+			}
+			if(objs.getMin_check_num()!=null  &&  st.getChecked_num()<objs.getMin_check_num() ){
+				flag =true ;
+			}
+			double score = (st.getChecked_num() != 0) ? 1000 - (st.getCheck_all_score() / (st.getChecked_num())) :1000;
+			if(objs.getMin_score()!=null  &&  score<objs.getMin_score() ){
+				flag =true ;
+			}
+			if(objs.getMax_score()!=null  &&  score>objs.getMax_score()){
+				flag =true ;
+			}
+			if(objs.getPosition_id()!=null  &&  st.getUser().getPositionid() != objs.getPosition_id()+0 ){
+				flag =true ;
+			}
+			if(flag){
+				it.remove();
+			}
+		}
+		
+		
 		// 处理数据
 		// 处理数据
 		int j = 1;
 		int j = 1;
 		for (Iterator<StatisticsBo> it = listStatistic.iterator(); it.hasNext();) {
 		for (Iterator<StatisticsBo> it = listStatistic.iterator(); it.hasNext();) {
@@ -862,28 +890,16 @@ public class StatisticsServiceImpl extends BaseService implements StatisticsServ
 		int people_num = 0;
 		int people_num = 0;
 		StatisticsBean returnObj = new StatisticsBean();
 		StatisticsBean returnObj = new StatisticsBean();
 		
 		
-		// 获取收费站信息收费站人数
-//		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]));
-//		}
-//		// 检查人数 和 检查次数
-//		obj.setPosition_ids(positionList);
-//		// 检索受检人数
-//		List<StatisticsBean> checkedNumList =  statisticsDao.selectFeeStationCheckNum(obj);
-		
 		if (obj.getQueryType() == 0) {
 		if (obj.getQueryType() == 0) {
 			// 公司
 			// 公司
 			// 公司总人数
 			// 公司总人数
-			List<StatisticsBean> feeStationList = userInfoDao.getUsersCountList();
-			if (feeStationList != null && feeStationList.size() > 0) {
-				for (StatisticsBean sta : feeStationList) {
-					people_num += sta.getPeople_num();
-				}
-			}
+//			List<StatisticsBean> feeStationList = userInfoDao.getUsersCountList();
+//			if (feeStationList != null && feeStationList.size() > 0) {
+//				for (StatisticsBean sta : feeStationList) {
+//					people_num += sta.getPeople_num();
+//				}
+//			}
+			people_num = statisticsDao.selectCheckedNum(obj);
 		} else if (obj.getQueryType() == 1) {
 		} else if (obj.getQueryType() == 1) {
 			// 道管中心
 			// 道管中心
 			Organ organ = new Organ();
 			Organ organ = new Organ();
@@ -894,18 +910,20 @@ public class StatisticsServiceImpl extends BaseService implements StatisticsServ
 			List<Organ> list = departmentDao.getOrgan(organ);
 			List<Organ> list = departmentDao.getOrgan(organ);
 			// 将导管中心下的收费站部门id 列表放入到list中
 			// 将导管中心下的收费站部门id 列表放入到list中
 			obj.setDept_list(list);
 			obj.setDept_list(list);
-
-			people_num = userInfoDao.getUsersCenterManageCount(obj);
+			obj.setDept_id(null);
+			people_num = statisticsDao.selectCheckedNum(obj);
+//			people_num = userInfoDao.getUsersCenterManageCount(obj);
 		} else if (obj.getQueryType() == 2) {
 		} 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> 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();
+//					}
+//				}
+//			}
+			people_num = statisticsDao.selectCheckedNum(obj);
 		}
 		}
 
 
 		List<StatisticsBean> userLostScoreInfoList = statisticsDao.selectCheckedScoreList(obj);
 		List<StatisticsBean> userLostScoreInfoList = statisticsDao.selectCheckedScoreList(obj);

+ 10 - 0
VisualInspection_server/src/main/java/com/xintong/visualinspection/util/DateUtil.java

@@ -20,4 +20,14 @@ public class DateUtil {
 		}
 		}
 		return null;
 		return null;
 	}
 	}
+	
+	public static Date strParseDate(String strDate,String format){
+		SimpleDateFormat sdf = new SimpleDateFormat(format);
+		try {
+			return sdf.parse(strDate);
+		} catch (ParseException e) {
+			e.printStackTrace();
+		}
+		return null;
+	}
 }
 }