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

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

@@ -81,6 +81,9 @@ public class StatisticsBean {
     // 月份
     private String mth ;
     
+    // 上月
+    private String prev_mth ;
+    
     // 收费站名称
     private String feeStationName ;
 }

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

@@ -1,6 +1,7 @@
 package com.xintong.visualinspection.controller;
 
 import java.util.List;
+import java.util.Map;
 
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.RequestBody;
@@ -93,7 +94,7 @@ public class StatisticsController extends BaseController {
     
     
     /**
-     * 考核粘粉情况比
+     * 考核扣分情况比
      */
     @RequestMapping(value = "/lost/score/rate")
     public String getCheckedInfoRate(@RequestBody StatisticsBean obj){
@@ -101,4 +102,22 @@ public class StatisticsController extends BaseController {
     	return super.returnSuccessResult(returnObj);
     }
     
+    /**
+     * 考核扣分项情况比
+     */
+    @RequestMapping(value = "/lost/itemscore/rate")
+    public String getCheckedItemInfoRate(@RequestBody StatisticsBean obj){
+    	List<StatisticsBean> returnList=  statisticsService.getCheckedItemScoreInfo(obj);
+    	return super.returnSuccessResult(returnList);
+    }
+    
+    /**
+     * 考核扣分项两次占比
+     */
+    @RequestMapping(value = "/lost/twice/itemscore/rate")
+    public String getTwiceCheckedItemInfoRate(@RequestBody StatisticsBean obj){
+    	Map<String,List<StatisticsBean>> returnMap=  statisticsService.get2CheckedItemScoreInfo(obj);
+    	return super.returnSuccessResult(returnMap);
+    }
+    
 }

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

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

+ 7 - 0
VisualInspection_server/src/main/java/com/xintong/visualinspection/service/StatisticsService.java

@@ -1,6 +1,7 @@
 package com.xintong.visualinspection.service;
 
 import java.util.List;
+import java.util.Map;
 
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
@@ -44,4 +45,10 @@ public interface StatisticsService {
 	
 	// 考核扣分情况占比
 	public StatisticsBean getCheckedScoreInfo(StatisticsBean obj);
+	
+	// 分项考核情况占比
+	public List<StatisticsBean> getCheckedItemScoreInfo(StatisticsBean obj);
+	
+	// 分项具体考核情况占比
+	public Map<String,List<StatisticsBean>> get2CheckedItemScoreInfo(StatisticsBean obj);
 }

+ 77 - 3
VisualInspection_server/src/main/java/com/xintong/visualinspection/service/impl/StatisticsServiceImpl.java

@@ -462,7 +462,6 @@ public class StatisticsServiceImpl extends BaseService implements StatisticsServ
 			}
 		}
 		
-		
 		List<StatisticsBean> lists = statisticsDao.selectYearScoreInfo(obj);
 		for(StatisticsBean sta:lists){
 			sta.setPeople_num(people_num);
@@ -654,9 +653,9 @@ public class StatisticsServiceImpl extends BaseService implements StatisticsServ
 		List<StatisticsBean> userLostScoreInfoList = statisticsDao.selectCheckedScoreList(obj);
 		
 		for (StatisticsBean sta : userLostScoreInfoList) {
-			if (sta.getAll_check_score()  <= 15) {
+			if (sta.getAll_check_score() / sta.getChecked_num()  <= 15) {
 				returnObj.setScore_fifteen(returnObj.getScore_fifteen() + 1);
-			} else if (sta.getAll_check_score() <= 50) {
+			} else if (sta.getAll_check_score()/sta.getChecked_num() <= 50) {
 				returnObj.setScore_fifty(returnObj.getScore_fifty() + 1);
 			} else {
 				returnObj.setScore_over_fifty(returnObj.getScore_over_fifty() + 1);
@@ -666,4 +665,79 @@ public class StatisticsServiceImpl extends BaseService implements StatisticsServ
 		
 		return returnObj;
 	}
+
+	@Override
+	public List<StatisticsBean> getCheckedItemScoreInfo(StatisticsBean obj) {
+		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);
+		}else if(obj.getQueryType() ==2){
+			// 收费站
+		}
+		return statisticsDao.selectCheckedItemScoreInfo(obj);
+	}
+
+	@Override
+	public Map<String, List<StatisticsBean>> get2CheckedItemScoreInfo(StatisticsBean obj) {
+		
+		Map<String,List<StatisticsBean>> map = new HashMap<>();
+		
+		int people_num = 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();
+				}
+			}
+		}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> objList = statisticsDao.selectCheckedItemScoreInfo(obj);
+		
+		for(int i=0;i < objList.size();i++){
+			objList.get(0).setPeople_num(people_num);
+		}
+		
+		map.put("Tmth",objList ) ;
+		
+		obj.setMth(obj.getPrev_mth());
+		
+		objList = statisticsDao.selectCheckedItemScoreInfo(obj);
+		
+		for(int i=0;i < objList.size();i++){
+			objList.get(0).setPeople_num(people_num);
+		}
+		
+		map.put("Pmth",objList );
+		
+		return map;
+	}
+
+	
 }