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

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

@@ -1,6 +1,8 @@
 package com.xintong.visualinspection.bean;
 
+import java.util.ArrayList;
 import java.util.Date;
+import java.util.List;
 
 import org.springframework.format.annotation.DateTimeFormat;
 
@@ -48,4 +50,8 @@ public class StatisticsBean {
     private int score_over_fifty ;
     
     private int all_check_score ;
+    
+    private List<String> checked_socre_name = new ArrayList<>() ;
+    
+    private List<Integer> checked_score = new ArrayList<>() ;
 }

+ 8 - 0
VisualInspection_server/src/main/java/com/xintong/visualinspection/controller/StatisticsController.java

@@ -46,4 +46,12 @@ public class StatisticsController extends BaseController {
     	return super.returnSuccessResult(lists);
     }
     
+    /**
+     * 温馨服务检查情况统计表
+     */
+    @RequestMapping(value = "/score/Item/info")
+    public String getScoreItemInfo(@RequestBody StatisticsBean obj){
+    	List<StatisticsBean> lists=  statisticsService.getFeeStationCheckItemScore(obj);
+    	return super.returnSuccessResult(lists);
+    }
 }

+ 5 - 6
VisualInspection_server/src/main/java/com/xintong/visualinspection/mapper/master/StatisticsMapper.xml

@@ -49,15 +49,14 @@
     </select>
     
     <select id="selectFeeStationCheckedPersonScoreDetail" parameterType="com.xintong.visualinspection.bean.StatisticsBean" resultType="com.xintong.visualinspection.bean.StatisticsBean">
-    	SELECT  u.checked_person AS user_id , u.checked_dept AS dept_id ,u.parent_id AS item_id ,sum(u.score) AS score ,s.name  FROM (
-			SELECT t.checked_person , t.checked_dept,ci.parent_id, t.score  FROM check_score t 
+    	    SELECT  u.checked_dept AS dept_id ,u.parent_id AS item_id ,sum(u.score) AS score ,s.name  FROM (
+			SELECT  t.checked_dept,ci.parent_id, t.score  FROM check_score t 
 			LEFT JOIN check_item ci ON t.check_item_id = ci.id
 			WHERE 1=1
 			<if test="start_date!=null and end_date != null">
 		        AND	 t.start_time &gt;= #{start_date} AND t.end_time &lt;= #{end_date} 
-			</if>
-			 )
-			u LEFT JOIN check_item s ON u.parent_id = s.id GROUP  BY checked_person,id
+			</if> )
+			u LEFT JOIN check_item s ON u.parent_id = s.id GROUP  BY dept_id,item_id
     </select>
-    
+       
 </mapper>

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

@@ -129,8 +129,34 @@ public class StatisticsServiceImpl extends BaseService implements StatisticsServ
 
 	@Override
 	public List<StatisticsBean> getFeeStationCheckItemScore(StatisticsBean obj) {
-		// TODO Auto-generated method stub
-		return null;
+
+		// 获取收费站信息收费站人数
+		List<StatisticsBean> lists = departmentDao.selectFeeStationGroup(obj);
+		Map<Long,StatisticsBean> mapStationInfos = new HashMap<>();
+		for(StatisticsBean sta:lists){
+			mapStationInfos.put(sta.getDept_id(), sta);
+		}
+		
+		// 检索受检次数
+		List<StatisticsBean> listCheckNum = statisticsDao.selectFeeStationCheckNum(obj);
+		for(StatisticsBean sta:listCheckNum){
+			if(mapStationInfos.containsKey(sta.getDept_id())){
+				mapStationInfos.get(sta.getDept_id()).setChecked_num(sta.getChecked_num());
+			}
+		}
+		
+		List<StatisticsBean> listCheckedScore = statisticsDao.selectFeeStationCheckedPersonScoreDetail(obj);
+		for(StatisticsBean sta:listCheckedScore){
+			if(mapStationInfos.containsKey(sta.getDept_id())){
+				StatisticsBean statis = mapStationInfos.get(sta.getDept_id());
+				statis.setAll_check_score( statis.getAll_check_score()+sta.getScore());
+				statis.getChecked_socre_name().add(sta.getName());
+				statis.getChecked_score().add(sta.getScore());
+			}
+		}
+		
+		return new ArrayList<>(mapStationInfos.values());
+	
 	}
     
 }