chenrj-PC\chenrj 8 gadi atpakaļ
vecāks
revīzija
2d10c07534

+ 1 - 0
VisualInspection_server/src/main/java/com/xintong/visualinspection/mapper/cluster/UserInfoMapper.xml

@@ -12,6 +12,7 @@
         <result property="idno" column="idno" jdbcType="VARCHAR"/>
         <result property="pic" column="pic" jdbcType="VARCHAR"/>
         <result column="workno" property="workno" jdbcType="VARCHAR" />
+        <result column="fee_station_name" property="fee_station_name" jdbcType="VARCHAR" />
     </resultMap>
     <resultMap id="userMap" type="com.xintong.visualinspection.bean.User">
         <id property="id" column="ID"/>

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

@@ -9,7 +9,7 @@
 			LEFT JOIN check_task ct ON ct.id = t.task_id
 			WHERE 1=1 
 			<if test="start_date!=null and end_date != null">
-		        AND	 ct.start_time &gt;= #{start_date} AND ct.end_time &lt;= #{end_date} 
+		        AND	 ct.start_time &gt;= #{start_date} AND ct.end_time &lt;= #{end_date} AND ct.check_status != 23
 			</if>
 			<if test="dept_id!=null">
 				AND t.checked_dept =#{dept_id}			
@@ -22,7 +22,7 @@
     	SELECT COUNT(1) AS checked_num , t.checked_person AS user_id FROM check_task t 
     	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} 
+		        AND	 t.start_time &gt;= #{start_date} AND t.end_time &lt;= #{end_date}   AND t.check_status != 23
 			</if>
 			<if test="dept_id!=null">
 				AND t.checked_dept =#{dept_id}			
@@ -34,7 +34,7 @@
     	SELECT COUNT(DISTINCT( t.checked_person )) AS checked_people_num , COUNT(t.checked_person) AS checked_num  ,t.checked_dept AS dept_id FROM check_task  t
     	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} 
+		        AND	 t.start_time &gt;= #{start_date} AND t.end_time &lt;= #{end_date}   AND t.check_status != 23
 			</if>
     	 GROUP BY t.checked_dept
     </select>
@@ -46,7 +46,7 @@
     		LEFT JOIN check_task ct ON ct.id = t.task_id
     		WHERE 1=1
     		<if test="start_date!=null and end_date != null">
-		        AND	 ct.start_time &gt;= #{start_date} AND ct.end_time &lt;= #{end_date} 
+		        AND	 ct.start_time &gt;= #{start_date} AND ct.end_time &lt;= #{end_date}  AND ct.check_status != 23
 			</if>
     		GROUP BY t.checked_dept,t.checked_person
     </select>
@@ -58,7 +58,7 @@
 			LEFT JOIN check_task ct ON ct.id = t.task_id
 			WHERE 1=1
 			<if test="start_date!=null and end_date != null">
-		        AND	 ct.start_time &gt;= #{start_date} AND ct.end_time &lt;= #{end_date} 
+		        AND	 ct.start_time &gt;= #{start_date} AND ct.end_time &lt;= #{end_date}  AND ct.check_status != 23
 			</if> )
 			u LEFT JOIN check_item s ON u.parent_id = s.id GROUP  BY dept_id,item_id
     </select>

+ 57 - 22
VisualInspection_server/src/main/java/com/xintong/visualinspection/service/impl/StatisticsServiceImpl.java

@@ -98,12 +98,24 @@ public class StatisticsServiceImpl extends BaseService implements StatisticsServ
 		lists.sort(new Comparator<StatisticsBo>() {
 			@Override
 			public int compare(StatisticsBo o1, StatisticsBo o2) {
-				if (o1.getCheck_all_score() > o2.getCheck_all_score()) {
-					return 1;
-				} else if (o1.getCheck_all_score() < o2.getCheck_all_score()) {
-					return -1;
-				} else {
-					return 0;
+				if(o1.getChecked_num()!=0 && o2.getChecked_num()!=0){
+					double a = o1.getCheck_all_score() / (o1.getChecked_num()+0.00);
+					double b = o2.getCheck_all_score()/(o2.getChecked_num()+0.00);
+					if (a > b ) {
+						return 1;
+					} else if (a < b) {
+						return -1;
+					} else {
+						return 0;
+					}	
+				}else{
+					if(o1.getChecked_num() == 0){
+						return -1 ;
+					}else if(o2.getChecked_num() ==0){
+						return 1;
+					}else{
+						return 0;
+					}
 				}
 			}
 		});
@@ -118,13 +130,14 @@ public class StatisticsServiceImpl extends BaseService implements StatisticsServ
 		Map<Long, StatisticsBean> mapStationInfos = new HashMap<>();
 		int i = 0;
 		for (StatisticsBean sta : lists) {
-			if (i++ < 7) {
+			if (i < 7) {
 				sta.setId(1);
-			} else if (i++ < 13) {
+			} else if (i < 13) {
 				sta.setId(2);
 			} else {
 				sta.setId(3);
 			}
+			i++ ;
 			mapStationInfos.put(sta.getDept_id(), sta);
 		}
 
@@ -160,12 +173,22 @@ public class StatisticsServiceImpl extends BaseService implements StatisticsServ
 				if (o1.getId() > o2.getId()) {
 					return 1;
 				} else if (o1.getId() == o2.getId()) {
-					if (o1.getAll_check_score() > o2.getAll_check_score()) {
-						return 1;
-					} else if (o1.getAll_check_score() < o2.getAll_check_score()) {
-						return -1;
-					} else {
-						return 0;
+					if(o1.getChecked_num()!=0 && o2.getChecked_num()!=0){
+						if (o1.getAll_check_score()/(o1.getChecked_num()+0.0) > o2.getAll_check_score()/(o2.getChecked_num()+0.0) ) {
+							return 1;
+						} else if (o1.getAll_check_score()/(o1.getChecked_num()+0.0) < o2.getAll_check_score()/(o2.getChecked_num()+0.0)) {
+							return -1;
+						} else {
+							return 0;
+						}
+					}else{
+						if(o1.getChecked_num() == 0){
+							return -1 ;
+						}else if(o2.getChecked_num() ==0){
+							return 1;
+						}else{
+							return 0;
+						}
 					}
 				} else {
 					return -1;
@@ -184,13 +207,14 @@ public class StatisticsServiceImpl extends BaseService implements StatisticsServ
 		Map<Long, StatisticsBean> mapStationInfos = new HashMap<>();
 		int i = 0;
 		for (StatisticsBean sta : lists) {
-			if (i++ < 7) {
+			if (i < 7) {
 				sta.setId(1);
-			} else if (i++ < 13) {
+			} else if (i < 13) {
 				sta.setId(2);
 			} else {
 				sta.setId(3);
 			}
+			i++ ;
 			mapStationInfos.put(sta.getDept_id(), sta);
 		}
 
@@ -214,18 +238,29 @@ public class StatisticsServiceImpl extends BaseService implements StatisticsServ
 		}
 
 		List<StatisticsBean> sortList = new ArrayList<>(mapStationInfos.values());
+		
 		sortList.sort(new Comparator<StatisticsBean>() {
 			@Override
 			public int compare(StatisticsBean o1, StatisticsBean o2) {
 				if (o1.getId() > o2.getId()) {
 					return 1;
 				} else if (o1.getId() == o2.getId()) {
-					if (o1.getAll_check_score() > o2.getAll_check_score()) {
-						return 1;
-					} else if (o1.getAll_check_score() < o2.getAll_check_score()) {
-						return -1;
-					} else {
-						return 0;
+					if(o1.getChecked_num()!=0 && o2.getChecked_num()!=0){
+						if (o1.getAll_check_score()/(o1.getChecked_num()+0.0) > o2.getAll_check_score()/(o2.getChecked_num()+0.0) ) {
+							return 1;
+						} else if (o1.getAll_check_score()/(o1.getChecked_num()+0.0) < o2.getAll_check_score()/(o2.getChecked_num()+0.0)) {
+							return -1;
+						} else {
+							return 0;
+						}
+					}else{
+						if(o1.getChecked_num() == 0){
+							return -1 ;
+						}else if(o2.getChecked_num() ==0){
+							return 1;
+						}else{
+							return 0;
+						}
 					}
 				} else {
 					return -1;

BIN
VisualInspection_server/src/main/resources/checked_info.xls


BIN
VisualInspection_server/src/main/resources/checked_item_info.xls


BIN
VisualInspection_server/src/main/resources/employee_order.xls