ソースを参照

Merge branch 'master' of http://git_xt.jsxt.jsjtyxt.com/wenhongquan/VisualInspection

minitiger 8 年 前
コミット
3a6933d14c

+ 5 - 3
VisualInspection/js/statistics/assess_ranking.js

@@ -127,7 +127,7 @@ function initQueryEmp(parent_dept_id, dept_id) {
     var endD = new Date();
     var startD = new Date();
     // var startD = new Date(now.getTime() - 7 * 24 * 3600 * 1000);
-    var start_time = startD.getFullYear() + "-" + (startD.getMonth() > 10 ? startD.getMonth() : "0" + startD.getMonth()) + "-25";
+    var start_time = startD.getFullYear() + "-" + (startD.getMonth() > 10 ? startD.getMonth() : "0" + startD.getMonth()) + "-26";
     var end_time = endD.getFullYear() + "-" + (endD.getMonth() + 1 > 10 ? endD.getMonth() + 1 : "0" + (endD.getMonth() + 1)) + "-25";
     var start_score = $("#start-score").val();
     var end_score = $("#end-score").val();
@@ -140,7 +140,7 @@ function initQueryEmp(parent_dept_id, dept_id) {
     var start_date = start_time + " 23:00:00";
     var end_date = end_time + " 23:00:00";
 
-    var start = moment(start_date);
+    var start = moment(start_date).subtract(1, "day");
     //开始日期取前一天的23:00
 
     start_date = start.toDate().Format("yyyy-MM-dd HH:mm:ss");
@@ -152,7 +152,7 @@ function initQueryEmp(parent_dept_id, dept_id) {
         "end_date": end_date,
     }
 
-    console.log(param)
+
 
     var url = "statistics/employee/order";
     getEmployeeInfosClick(url, param, start_score, end_score, start_num, end_num);
@@ -165,6 +165,8 @@ function initQueryEmp(parent_dept_id, dept_id) {
 function getEmployeeInfosClick(url, param, start_score, end_score, start_num, end_num) {
     post_common_service(url, param, function(data) {
 
+        console.log(data)
+
         var strTbody = '';
         var count = 0;
         var start_date_time = moment(param.end_date + "Z");

+ 7 - 7
VisualInspection/js/statistics/road_manage_statistics.js

@@ -244,7 +244,7 @@ $(function() {
                 if (data.list[i][propertyname] != 0)
                     array_points2.push({
                         "value": (data.list[i][propertyname]),
-                        "name": data.list[i].name + names,
+                        "name": data.list[i].name,
                         "itemStyle": { "normal": { "color": color.hexStr() } }
                     });
             } else if (i > 6 && i < 13 && center_id == 31) {
@@ -253,7 +253,7 @@ $(function() {
                 if (data.list[i][propertyname] != 0)
                     array_points2.push({
                         "value": (data.list[i][propertyname]),
-                        "name": data.list[i].name + names,
+                        "name": data.list[i].name,
                         "itemStyle": { "normal": { "color": color.hexStr() } }
                     });
             } else if (i > 12 && i < 21 && center_id == 32) {
@@ -262,7 +262,7 @@ $(function() {
                 if (data.list[i][propertyname] != 0)
                     array_points2.push({
                         "value": (data.list[i][propertyname]),
-                        "name": data.list[i].name + names,
+                        "name": data.list[i].name,
                         "itemStyle": { "normal": { "color": color.hexStr() } }
                     });
             }
@@ -347,7 +347,7 @@ $(function() {
                         array_points2.push({
                             "value": (data.list[i].checked_people_num - data.list[i].score_fifteen -
                                 data.list[i].score_fifty - data.list[i].score_over_fifty),
-                            "name": data.list[i].name + '满分',
+                            "name": data.list[i].name,
                             "itemStyle": { "normal": { "color": color.hexStr() } }
                         });
                     } else if (i > 6 && i < 13 && center_id == 31) {
@@ -356,7 +356,7 @@ $(function() {
                         array_points2.push({
                             "value": (data.list[i].checked_people_num - data.list[i].score_fifteen -
                                 data.list[i].score_fifty - data.list[i].score_over_fifty),
-                            "name": data.list[i].name + '满分',
+                            "name": data.list[i].name,
                             "itemStyle": { "normal": { "color": color.hexStr() } }
                         });
                     } else if (i > 12 && i < 21 && center_id == 32) {
@@ -365,7 +365,7 @@ $(function() {
                         array_points2.push({
                             "value": (data.list[i].checked_people_num - data.list[i].score_fifteen -
                                 data.list[i].score_fifty - data.list[i].score_over_fifty),
-                            "name": data.list[i].name + '满分',
+                            "name": data.list[i].name,
                             "itemStyle": { "normal": { "color": color.hexStr() } }
                         });
                     }
@@ -795,7 +795,7 @@ $(function() {
                         normal: {
                             label: {
                                 show: true,
-                                formatter: '{b} :\n{c}人 ({d}%)'
+                                formatter: '{b}:{c}人({d}%)'
                             },
                             labelLine: {
                                 show: true

+ 7 - 7
VisualInspection/js/statistics/total_company_statistics.js

@@ -219,13 +219,13 @@ $(function() {
 
 
         if (temp[0] != 0) {
-            array_points2.push({ "value": temp[0], "name": '连云港道管' + appendname, "itemStyle": { "normal": { "color": color1 } } });
+            array_points2.push({ "value": temp[0], "name": '连云港道管', "itemStyle": { "normal": { "color": color1 } } });
         }
         if (temp[1] != 0) {
-            array_points2.push({ "value": temp[1], "name": '盐城道管' + appendname, "itemStyle": { "normal": { "color": color2 } } });
+            array_points2.push({ "value": temp[1], "name": '盐城道管', "itemStyle": { "normal": { "color": color2 } } });
         }
         if (temp[2] != 0) {
-            array_points2.push({ "value": temp[2], "name": '南通道管' + appendname, "itemStyle": { "normal": { "color": color3 } } });
+            array_points2.push({ "value": temp[2], "name": '南通道管', "itemStyle": { "normal": { "color": color3 } } });
         }
     }
 
@@ -282,13 +282,13 @@ $(function() {
                     }
                 }
                 if (temp[0] != 0) {
-                    array_points2.push({ "value": temp[0], "name": '连云港道管满分', "itemStyle": { "normal": { "color": '#7BCCB5' } } });
+                    array_points2.push({ "value": temp[0], "name": '连云港道管', "itemStyle": { "normal": { "color": '#7BCCB5' } } });
                 }
                 if (temp[1] != 0) {
-                    array_points2.push({ "value": temp[1], "name": '盐城道管满分', "itemStyle": { "normal": { "color": '#3EA99F' } } });
+                    array_points2.push({ "value": temp[1], "name": '盐城道管', "itemStyle": { "normal": { "color": '#3EA99F' } } });
                 }
                 if (temp[2] != 0) {
-                    array_points2.push({ "value": temp[2], "name": '南通道管满分', "itemStyle": { "normal": { "color": '#008080' } } });
+                    array_points2.push({ "value": temp[2], "name": '南通道管', "itemStyle": { "normal": { "color": '#008080' } } });
                 }
                 pushDate(data, 'score_fifteen', '0-15分');
                 pushDate(data, 'score_fifty', '15-50分');
@@ -670,7 +670,7 @@ $(function() {
                         normal: {
                             label: {
                                 show: true,
-                                formatter: '{b} :\n{c}人 ({d}%)'
+                                formatter: '{b}:{c}人({d}%)'
                             },
                             labelLine: {
                                 show: true

+ 11 - 0
VisualInspection_server/src/main/java/com/xintong/visualinspection/bean/User.java

@@ -4,8 +4,10 @@ import java.util.Collection;
 import java.util.Date;
 import java.util.List;
 
+import com.fasterxml.jackson.annotation.JsonFormat;
 import lombok.Data;
 
+import org.springframework.format.annotation.DateTimeFormat;
 import org.springframework.security.core.GrantedAuthority;
 import org.springframework.security.core.userdetails.UserDetails;
 
@@ -27,6 +29,15 @@ public class User implements UserDetails {
 	private Integer organid;
 
 	private Integer parent_organid;
+
+    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
+    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
+    private Date delete_time;
+
+    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
+    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
+    private Date invalidtime;
+
 	
 	// 组织机构ID
 	private String organname;

+ 1 - 0
VisualInspection_server/src/main/java/com/xintong/visualinspection/dao/cluster/UserInfoDao.java

@@ -14,6 +14,7 @@ import java.util.List;
 public interface UserInfoDao {
     public List<User> getAll();
     public List<User> getUsers(User user);
+    public List<User> getAllUsers(User user);
     public User getOne(Integer id);
     public void insert(User user);
     public void update(User user);

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

@@ -14,6 +14,7 @@
         <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" />
+        <result column="delete_time" property="delete_time" jdbcType="DATE" />
     </resultMap>
     <resultMap id="userMap" type="com.xintong.visualinspection.bean.User">
         <id property="id" column="ID"/>
@@ -26,11 +27,30 @@
         <result property="idno" column="idno" jdbcType="VARCHAR"/>
         <result property="pic" column="pic" jdbcType="VARCHAR"/>
         <result column="workno" property="workno" jdbcType="VARCHAR" />
+        <result column="delete_time" property="delete_time" jdbcType="DATE" />
         <collection property="roles" ofType="com.xintong.visualinspection.bean.Role">
             <result column="name" property="name"/>
         </collection>
     </resultMap>
 
+    <resultMap id="BaseResultMapByInvalid" type="com.xintong.visualinspection.bean.User" >
+        <id column="id" property="id" jdbcType="INTEGER" />
+        <result column="username" property="username" jdbcType="VARCHAR" />
+        <result column="password" property="password" jdbcType="VARCHAR" />
+        <result column="organid" property="organid" jdbcType="INTEGER" />
+        <result column="workno" property="workno" jdbcType="VARCHAR" />
+        <result property="truename" column="truename" jdbcType="VARCHAR"/>
+        <result property="positionid" column="positionid" jdbcType="INTEGER"/>
+        <result property="position_name" column="position_name" jdbcType="INTEGER"/>
+        <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" />
+        <result column="delete_time" property="delete_time" jdbcType="DATE" />
+        <result column="invalidtime" property="invalidtime" jdbcType="VARCHAR" />
+    </resultMap>
+
+
     <select id="getAll" resultMap="BaseResultMap"  >
         SELECT
         *
@@ -84,7 +104,7 @@
         UPDATE
         	t_sys_users
         SET
-        	status = -1
+        	status = -1,delete_time = now()
         WHERE
         	id = #{id}
     </update>
@@ -132,6 +152,36 @@
         	</if>
         order by workno
     </select>
+
+
+    <select id="getAllUsers" parameterType="com.xintong.visualinspection.bean.User" resultMap="BaseResultMapByInvalid"  >
+        SELECT
+        t.* , fs.name  AS fee_station_name,tso.parentid AS parent_organid ,deleted_user.starttime AS invalidtime
+        FROM t_sys_users t LEFT JOIN t_br_layer_fee_station fs ON t.organid = fs.organ_id
+        LEFT JOIN t_sys_organ tso ON t.organid = tso.id
+        LEFT JOIN  (select t_s_y.id,date_sub(t_p.starttime,interval 1 hour) as starttime from t_sys_users t_s_y
+                       LEFT join (select starttime,endtime from check_task_period ) t_p on DELETE_TIME &gt;= starttime and DELETE_TIME &lt; endtime
+                     WHERE STATUS =-1 and DELETE_TIME &gt;= t_p.starttime and DELETE_TIME &lt; t_p.endtime ) deleted_user
+                 on deleted_user.id = t.id
+
+        where 1=1
+        <if test="organid != null and organid != 0">and t.organid = #{organid} </if>
+        <if test="username != null">and t.username = #{username} </if>
+        <if test="positionid != null and positionid != 0">and t.positionid = #{positionid} </if>
+        <if test="classid != null and classid != 0">and t.classid = #{classid} </if>
+        <if test="teamid != null and teamid != 0">and t.teamid = #{teamid} </if>
+        <if test="parent_organid!=null and parent_organid!=0">
+            and t.organid in ( select id from t_sys_organ where parentid = #{parent_organid}  )
+        </if>
+        <if test="position_ids != null and position_ids.size() > 0">AND
+            t.positionid in
+            <foreach collection="position_ids" item="position_id" index="index"
+                     open="(" close=")" separator=",">
+                #{position_id}
+            </foreach>
+        </if>
+        order by workno
+    </select>
     <select id="getAllCheckmans" parameterType="com.xintong.visualinspection.bean.User" resultMap="BaseResultMap"  >
         SELECT *
         FROM t_sys_users

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

@@ -1,13 +1,51 @@
 <?xml version="1.0" encoding="UTF-8" ?>
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.xintong.visualinspection.dao.master.StatisticsDao" >
+
+    <sql id="deletedUser">
+        (select t_s_y.id,date_sub(t_p.starttime,interval 1 hour) as starttime from t_sys_users t_s_y
+         LEFT join (select starttime,endtime from check_task_period ) t_p on DELETE_TIME &gt;= starttime and DELETE_TIME &lt; endtime
+         WHERE STATUS =-1 and DELETE_TIME &gt;= t_p.starttime and DELETE_TIME &lt; t_p.endtime ) deleted_user
+    </sql>
+
+    <sql id="taskexclouddeleteUser">
+
+
+      (  select id from (  select check_task.*,deleted_user.starttime as u_delet_time from check_task left join
+       <include refid="deletedUser"/>
+        on check_task.checked_person = deleted_user.id ) v_task where v_task.u_delet_time is not null and v_task.end_time &gt; v_task.u_delet_time
+     )
+
+    </sql>
+
+    <sql id="classexclouddeleteUser">
+
+
+        (select id from (  select sys_user_class.*,deleted_user.starttime as u_delet_time from sys_user_class left join
+        <include refid="deletedUser"/>
+        on sys_user_class.user_id = deleted_user.id ) v_user_class where v_user_class.u_delet_time is not null and v_user_class.end_time &gt; v_user_class.u_delet_time
+        )
+
+    </sql>
+
+    <sql id="unregularclassexclouddeleteUser">
+
+
+        (select id from (  select sys_user_class_unregular.*,deleted_user.starttime as u_delet_time from sys_user_class_unregular left join
+        <include refid="deletedUser"/>
+        on sys_user_class_unregular.user_id = deleted_user.id ) v_user_class where v_user_class.u_delet_time is not null and v_user_class.end_time &gt; v_user_class.u_delet_time
+        )
+
+    </sql>
+
+
     
     <select id="selectStatistics" 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.check_item_score AS score FROM check_score t 
 			LEFT JOIN check_item ci ON t.check_item_id = ci.id 
 			LEFT JOIN check_task ct ON ct.id = t.task_id
-			WHERE 1=1 and ct.check_status!=22
+			WHERE 1=1 and ct.check_status!=22 and ct.id not in <include refid="taskexclouddeleteUser"/>
 			<if test="start_date!=null and end_date != null">
 		        AND	 ct.start_time &gt;= #{start_date} AND ct.end_time &lt; #{end_date}
 			</if>
@@ -22,7 +60,7 @@
    
 	    SELECT * from check_task a LEFT JOIN check_score b on a.id=b.task_id where
 	          a.monitor_user_id != -1 and a.monitor_user_id != 0 and 
-	       a.start_time &gt;= #{start_time} and a.end_time &lt; #{end_time} and a.check_status !=22
+	       a.start_time &gt;= #{start_time} and a.end_time &lt; #{end_time} and a.check_status !=22 and a.id not in <include refid="taskexclouddeleteUser"/>
 	    
     </select>
     
@@ -31,7 +69,7 @@
     	
     	select sum(num) AS num from (
     	SELECT COUNT(DISTINCT ct.checked_person) as num FROM check_task ct 
-    		WHERE ct.check_status != 22 
+    		WHERE ct.check_status != 22  and ct.id not in <include refid="taskexclouddeleteUser"/>
     		<if test="dept_id!=null">
 	    		AND ct.checked_dept = #{dept_id} 
     		</if>
@@ -53,7 +91,7 @@
 
     <select id="selectCheckedTimes" parameterType="com.xintong.visualinspection.bean.StatisticsBean" resultType="com.xintong.visualinspection.bean.StatisticsBean">
     	SELECT COUNT(1) AS checked_num , t.checked_person AS user_id FROM check_task t 
-    	WHERE 1=1 and t.check_status!=22
+    	WHERE 1=1 and t.check_status!=22  and t.id not in <include refid="taskexclouddeleteUser"/>
 			<if test="start_date!=null and end_date != null">
 		        AND	 t.start_time &gt;= #{start_date} AND t.end_time &lt; #{end_date} 
 			</if>
@@ -66,7 +104,7 @@
     <select id="selectFeeStationCheckNum" parameterType="com.xintong.visualinspection.bean.StatisticsBean" resultType="com.xintong.visualinspection.bean.StatisticsBean">
     	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 left join t_sys_users u on t.checked_person = u.id
-    	WHERE 1=1 and t.check_status!=22
+    	WHERE 1=1 and t.check_status!=22 and  t.id not in <include refid="taskexclouddeleteUser"/>
     		<if test="start_date!=null and end_date != null">
 		        AND	 t.start_time &gt;= #{start_date} AND t.end_time &lt; #{end_date}
 			</if>
@@ -81,11 +119,11 @@
     </select>
     
     <select id="selectFeeStationCheckedScore" parameterType="com.xintong.visualinspection.bean.StatisticsBean" resultType="com.xintong.visualinspection.bean.StatisticsBean">
-    	SELECT sum(t.check_item_score) AS score ,t.checked_dept AS dept_id 
+    	SELECT sum(t.check_item_score) AS score ,t.checked_dept AS dept_id ,t.checked_person AS user_id
     		FROM check_score t 
     		LEFT JOIN check_item c ON t.check_item_id = c.id
     		LEFT JOIN check_task ct ON ct.id = t.task_id
-    		WHERE 1=1 and ct.check_status!=22
+    		WHERE 1=1 and ct.check_status!=22 and  ct.id not in <include refid="taskexclouddeleteUser"/>
     		<if test="start_date!=null and end_date != null">
 		        AND	 ct.start_time &gt;= #{start_date} AND ct.end_time &lt; #{end_date}
 			</if>
@@ -98,7 +136,7 @@
 			LEFT JOIN check_item ci ON t.check_item_id = ci.id
 			LEFT JOIN check_task ct ON ct.id = t.task_id
 			LEFT JOIN t_sys_users uu on t.checked_person = uu.id
-			WHERE 1=1  AND ct.check_status!=22 AND t.check_item_score is not null
+			WHERE 1=1  AND ct.check_status!=22 AND t.check_item_score is not null and ct.id not in <include refid="taskexclouddeleteUser"/>
 			<if test="start_date!=null and end_date != null">
 		        AND	 ct.start_time &gt;= #{start_date} AND ct.end_time &lt; #{end_date}
 			</if>
@@ -124,7 +162,7 @@
 				FROM 
 				check_score m INNER JOIN 
 				( select * From check_task t 
-						where t.check_status != 22 
+						where t.check_status != 22 and t.id not in <include refid="taskexclouddeleteUser"/>
 						<if test="start_date !=null">
 							AND t.start_time >= #{start_date}
 						</if>
@@ -150,7 +188,7 @@
 				check_task t
 			WHERE
 				t.checked_person IS NOT NULL
-			AND t.check_status != 22
+			AND t.check_status != 22  and t.id not in <include refid="taskexclouddeleteUser"/>
 			<if test="start_date !=null">
 				AND t.start_time >= #{start_date}
 			</if>
@@ -193,7 +231,7 @@
      <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}
+			WHERE monthfunc( t.start_time ) = #{mth} and t.id not in <include refid="taskexclouddeleteUser"/>
 			GROUP BY t.checked_person
      </sql>
      
@@ -215,7 +253,7 @@
      
      <select id="selectfeestationChekcedSocre" parameterType="com.xintong.visualinspection.bean.StatisticsBean" resultType="com.xintong.visualinspection.bean.StatisticsBean">
      	select tso.parentid , ci.name AS check_item_name ,sum(t.check_item_score) AS all_check_score, t.checked_dept   FROM
-			(  SELECT ci.parent_id, t.* from check_score t INNER JOIN check_task ct ON ct.check_status !=22 	AND monthfunc( ct.start_time ) = '2017/07' AND ct.id = t.task_id
+			(  SELECT ci.parent_id, t.* from check_score t INNER JOIN check_task ct ON ct.check_status !=22 and ct.id not in <include refid="taskexclouddeleteUser"/> 	AND monthfunc( ct.start_time ) = '2017/07' AND ct.id = t.task_id
 				LEFT JOIN check_item  ci ON t.check_item_id = ci.id ) t 
 			LEFT JOIN check_item ci ON t.parent_id = ci.id
 			LEFT JOIN t_sys_organ tso ON tso.id = t.checked_dept
@@ -249,7 +287,7 @@
 			 ) t 
 			LEFT JOIN check_item ci ON t.parent_id = ci.id
 			) m ON t.id = m.task_id
-			where t.check_status !=22
+			where t.check_status !=22 and t.id not in <include refid="taskexclouddeleteUser"/>
 			AND monthfunc( t.start_time ) = #{mth}
 		GROUP BY m.parent_id
      </select>
@@ -266,7 +304,7 @@
 				FROM 
 				check_score m INNER JOIN 
 				( select * From check_task t 
-						where t.check_status != 22 
+						where t.check_status != 22  and t.id not in <include refid="taskexclouddeleteUser"/>
 						<if test="start_date !=null">
 							AND t.start_time >= #{start_date}
 						</if>
@@ -290,7 +328,7 @@
 				check_task t 
 			WHERE
 				t.checked_person IS NOT NULL
-			AND t.check_status != 22
+			AND t.check_status != 22 and t.id not in <include refid="taskexclouddeleteUser"/>
 			<if test="start_date !=null">
 				AND t.start_time >= #{start_date}
 			</if>
@@ -319,7 +357,7 @@
 			 ) t 
 			LEFT JOIN check_item ci ON t.parent_id = ci.id
 			) m ON t.id = m.task_id
-			where t.check_status !=22
+			where t.check_status !=22 and t.id not in <include refid="taskexclouddeleteUser"/>
 			<if test="start_date !=null">
 				AND  t.start_time >= #{start_date}
 			</if>
@@ -345,7 +383,7 @@
          </if>
 
          LEFT JOIN (SELECT ci.* ,cp.name AS parent_name FROM check_item  ci LEFT JOIN check_item cp ON ci.parent_id = cp.id) ci ON ci.id = cs.check_item_id
-     		where   t.check_status !=22
+     		where   t.check_status !=22 and t.id not in <include refid="taskexclouddeleteUser"/>
      		<if test="queryType!=null and queryType==0">
      			AND (cs.checked_person = #{user_id} OR t.monitor_user_id = #{user_id}  )
      		</if>
@@ -383,7 +421,7 @@
 					v_check_task t
 				LEFT JOIN check_score cs ON t.id = cs.task_id
 				WHERE
-				t.check_status != 22 
+				t.check_status != 22 and t.id not in <include refid="taskexclouddeleteUser"/>
 				<if test="checkman_id!=null and checkman_id!=''">
 					AND t.checkman = #{checkman_id}				
 				</if>
@@ -412,7 +450,7 @@
 			SUM(cs.check_item_score ) AS all_checked_score , COUNT(DISTINCT cs.checked_person) AS checked_people_num , COUNT(DISTINCT cs.task_id) AS checked_task_num , count(1) AS all_checkman
 				FROM
 					check_score cs
-				LEFT JOIN v_check_task t  ON t.id = cs.task_id AND t.check_status != 22
+				LEFT JOIN v_check_task t  ON t.id = cs.task_id AND t.check_status != 22 and t.id not in <include refid="taskexclouddeleteUser"/>
 				WHERE
 				  t.check_time >= #{start_date}
 					AND t.check_time &lt; #{end_date}
@@ -422,7 +460,7 @@
     	SELECT COUNT(1) AS unable_task_num FROM  v_check_task t WHERE  
     		t.check_time >= #{start_date}
 			AND t.check_time &lt; #{end_date}
-    		AND t.check_status = 22
+    		AND t.check_status = 22 and t.id not in <include refid="taskexclouddeleteUser"/>
     </select>
     <!--稽查人员工作量统计 end  -->
     
@@ -468,8 +506,8 @@
     
     <select id="selectFsWork" parameterType="com.xintong.visualinspection.bean.StatisticsFsWork" resultMap="statisticsFsWork">
     	SELECT t.* , ct.id AS check_id  FROM sys_user_class t 
-    		LEFT JOIN check_task ct ON t.id = ct.user_class_id AND ct.check_status != 22 AND t.class_type = ct.class_type AND t.user_id = ct.checked_person
-    		WHERE 1=1 AND t.user_id IS NOT NULL
+    		LEFT JOIN check_task ct ON t.id = ct.user_class_id AND ct.check_status != 22 and ct.id not in <include refid="taskexclouddeleteUser"/> AND t.class_type = ct.class_type AND t.user_id = ct.checked_person
+    		WHERE 1=1 AND t.user_id IS NOT NULL  and t.id not in <include refid="classexclouddeleteUser"/>
     		<include refid="select_Fswork_condition" />
     		ORDER BY t.work_date , t.user_id
     </select>
@@ -477,7 +515,7 @@
     <select id="selectFsWorkGather" parameterType="com.xintong.visualinspection.bean.StatisticsFsWork" resultType="com.xintong.visualinspection.bean.StatisticsFsWork">
     	SELECT COUNT(DISTINCT(work_date)) AS work_days , SUM( TIMESTAMPDIFF(MINUTE, t.start_time,t.end_time)) AS work_minutes , t.* 
     	FROM sys_user_class t 
-    	WHERE 1=1 AND t.user_id IS NOT NULL
+    	WHERE 1=1 AND t.user_id IS NOT NULL  and t.id not in <include refid="classexclouddeleteUser"/>
     	<include refid="select_Fswork_condition"/>
     	GROUP BY t.user_id
     </select>
@@ -485,16 +523,16 @@
     <select id="selectFsUnregularWork" parameterType="com.xintong.visualinspection.bean.StatisticsFsWork" resultMap="statisticsFsWork">
     	SELECT t.* , ct.id AS check_id  FROM sys_user_class_unregular t 
     		LEFT JOIN check_task ct ON (t.id = ct.user_class_unregular_id OR ( ct.start_time > t.start_time AND ct.end_time  &lt; t.end_time  ) )
-    		AND ct.check_status != 22 AND t.class_type = ct.class_type AND t.user_id = ct.checked_person
-    		WHERE 1=1   AND t.user_id IS NOT NULL
-    		<include refid="select_Fswork_condition" />
+    		AND ct.check_status != 22 and ct.id not in <include refid="taskexclouddeleteUser"/> AND t.class_type = ct.class_type AND t.user_id = ct.checked_person
+    		WHERE 1=1   AND t.user_id IS NOT NULL and t.id not in <include refid="unregularclassexclouddeleteUser"/>
+        <include refid="select_Fswork_condition" />
     		ORDER BY t.work_date
     </select>
     
     <select id="selectFsUnregularWorkGather" parameterType="com.xintong.visualinspection.bean.StatisticsFsWork" resultType="com.xintong.visualinspection.bean.StatisticsFsWork">
     	SELECT COUNT(DISTINCT(work_date)) AS work_days , SUM( TIMESTAMPDIFF(MINUTE, t.start_time,t.end_time)) AS work_minutes , t.* 
     	FROM sys_user_class_unregular t 
-    	WHERE 1=1 AND t.user_id IS NOT NULL
+    	WHERE 1=1 AND t.user_id IS NOT NULL and t.id not in <include refid="unregularclassexclouddeleteUser"/>
     	<include refid="select_Fswork_condition"/>
     	GROUP BY t.user_id
     </select>
@@ -502,7 +540,7 @@
     <select id="selectFsWorkGatherGroupByWorkType" parameterType="com.xintong.visualinspection.bean.StatisticsFsWork" resultMap="statisticsFsWork" >
     	SELECT COUNT(DISTINCT(work_date)) AS work_days , t.* 
     	FROM sys_user_class t 
-    	WHERE 1=1 AND t.user_id IS NOT NULL
+    	WHERE 1=1 AND t.user_id IS NOT NULL  and t.id not in <include refid="classexclouddeleteUser"/>
     	<include refid="select_Fswork_condition"/>
     	GROUP BY t.user_id , t.class_type
     </select>
@@ -510,7 +548,7 @@
     <select id="selectFsUnregularWorkGatherGroupByWorkType" parameterType="com.xintong.visualinspection.bean.StatisticsFsWork" resultMap="statisticsFsWork">
     	SELECT COUNT(DISTINCT(work_date)) AS work_days , t.* 
     	FROM sys_user_class_unregular t 
-    	WHERE 1=1  AND t.user_id IS NOT NULL
+    	WHERE 1=1  AND t.user_id IS NOT NULL and t.id not in <include refid="classexclouddeleteUser"/>
     	<include refid="select_Fswork_condition"/>
     	GROUP BY t.user_id , t.class_type
     </select>
@@ -525,7 +563,7 @@
 	
 	<select id="selectCheckAppealNum" parameterType="com.xintong.visualinspection.bean.CheckAppealStatistic" resultMap="appealNum" >
 		SELECT COUNT(t.appeal_dept) AS appeal_num ,t.appeal_dept AS dept_id,t.appeal_result FROM check_appeal t 
-			INNER JOIN check_task ct ON t.task_id = ct.id WHERE 1=1
+			INNER JOIN check_task ct ON t.task_id = ct.id WHERE 1=1  and t.task_id not in <include refid="taskexclouddeleteUser"/> and t.task_id not in (select id from check_task where check_task.check_status = 22)
 			<if test="start_time!=null ">
 	   			AND t.appeal_time >= #{start_time}
 	   		</if>

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

@@ -129,9 +129,11 @@ public class StatisticsServiceImpl extends BaseService implements StatisticsServ
 		if (obj.getParent_dept_id() != null) {
 			user.setParent_organid(obj.getParent_dept_id().intValue());
 		}
-		List<User> listUserts = userInfoDao.getUsers(user);
+		List<User> listUserts = userInfoDao.getAllUsers(user);
 		for (User u : listUserts) {
 			u.setPassword(null);
+			if(u.getInvalidtime()!=null && u.getInvalidtime().getTime() < obj.getEnd_date().getTime())
+			    continue;
 			if (u.getFee_station_name() != null) {
 				StatisticsBo tmp = new StatisticsBo();
 				tmp.setUser(u);
@@ -211,11 +213,12 @@ public class StatisticsServiceImpl extends BaseService implements StatisticsServ
 
 		for (int i = 0; i < lists.size(); i++) {
 			
-			if(lists.get(i).getChecked_num() == 0 ){
-				continue;
-			}
+
 
             StatisticsBo statisticsBo = lists.get(i);
+            if(statisticsBo.getChecked_num()+statisticsBo.getChecked_m_num() == 0 ){
+                continue;
+            }
 			//计算平均扣分
             DecimalFormat df = new DecimalFormat(".##");
             double count = statisticsBo.getChecked_num()+statisticsBo.getChecked_m_num();
@@ -320,14 +323,27 @@ public class StatisticsServiceImpl extends BaseService implements StatisticsServ
 			}
 		}
 
+
+
+        List<StatisticsBo> list = getEmployeeCheckedInfo(obj);
+        Map<Integer,StatisticsBo> listmap = new HashMap<>();
+		for(StatisticsBo b:list){
+            listmap.put(b.getUser().getId(),b);
+        }
+
+
 		List<StatisticsBean> listCheckedScore = statisticsDao.selectFeeStationCheckedScore(obj);
 		for (StatisticsBean sta : listCheckedScore) {
 			if (mapStationInfos.containsKey(sta.getDept_id())) {
+
+                StatisticsBo bo= listmap.get(sta.getUser_id().intValue());
+
 				StatisticsBean statis = mapStationInfos.get(sta.getDept_id());
 				statis.setAll_check_score(statis.getAll_check_score() + sta.getScore());
-				if (sta.getScore() <= 15) {
+				double sc = Double.parseDouble(bo.getCheck_score_avg());
+				if (sc <= 15) {
 					statis.setScore_fifteen(statis.getScore_fifteen() + 1);
-				} else if (sta.getScore() <= 50) {
+				} else if (sc <= 50) {
 					statis.setScore_fifty(statis.getScore_fifty() + 1);
 				} else {
 					statis.setScore_over_fifty(statis.getScore_over_fifty() + 1);
@@ -335,6 +351,10 @@ public class StatisticsServiceImpl extends BaseService implements StatisticsServ
 			}
 		}
 
+
+
+
+
 		List<StatisticsBean> sortList = new ArrayList<>(mapStationInfos.values());
 
 		sortList.sort(new Comparator<StatisticsBean>() {
@@ -1123,6 +1143,7 @@ public class StatisticsServiceImpl extends BaseService implements StatisticsServ
 					seq = i ;
 				}
 			}
+            seq=seq==0?1:seq;
 			t_mthList.get(i).setRanking(seq);	
 			t_map.put(t_mthList.get(i).getUser().getId(), t_mthList.get(i));
 		}
@@ -1144,6 +1165,7 @@ public class StatisticsServiceImpl extends BaseService implements StatisticsServ
 			}
 			
 			if (t_map.containsKey(uid)) {
+                seq = seq==0?1:seq;
 				t_map.get(uid).setRanking_change(seq - t_map.get(uid).getRanking());
 			}
 			

ファイルの差分が大きいため隠しています
+ 3077 - 17
VisualInspection_server/visual/visual.log


この差分においてかなりの量のファイルが変更されているため、一部のファイルを表示していません