温红权 8 tahun lalu
induk
melakukan
6363bf02eb

+ 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.Date;
 import java.util.List;
 import java.util.List;
 
 
+import com.fasterxml.jackson.annotation.JsonFormat;
 import lombok.Data;
 import lombok.Data;
 
 
+import org.springframework.format.annotation.DateTimeFormat;
 import org.springframework.security.core.GrantedAuthority;
 import org.springframework.security.core.GrantedAuthority;
 import org.springframework.security.core.userdetails.UserDetails;
 import org.springframework.security.core.userdetails.UserDetails;
 
 
@@ -27,6 +29,15 @@ public class User implements UserDetails {
 	private Integer organid;
 	private Integer organid;
 
 
 	private Integer parent_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
 	// 组织机构ID
 	private String organname;
 	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 interface UserInfoDao {
     public List<User> getAll();
     public List<User> getAll();
     public List<User> getUsers(User user);
     public List<User> getUsers(User user);
+    public List<User> getAllUsers(User user);
     public User getOne(Integer id);
     public User getOne(Integer id);
     public void insert(User user);
     public void insert(User user);
     public void update(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 property="pic" column="pic" jdbcType="VARCHAR"/>
         <result column="workno" property="workno" jdbcType="VARCHAR" />
         <result column="workno" property="workno" jdbcType="VARCHAR" />
         <result column="fee_station_name" property="fee_station_name" jdbcType="VARCHAR" />
         <result column="fee_station_name" property="fee_station_name" jdbcType="VARCHAR" />
+        <result column="delete_time" property="delete_time" jdbcType="DATE" />
     </resultMap>
     </resultMap>
     <resultMap id="userMap" type="com.xintong.visualinspection.bean.User">
     <resultMap id="userMap" type="com.xintong.visualinspection.bean.User">
         <id property="id" column="ID"/>
         <id property="id" column="ID"/>
@@ -26,11 +27,30 @@
         <result property="idno" column="idno" jdbcType="VARCHAR"/>
         <result property="idno" column="idno" jdbcType="VARCHAR"/>
         <result property="pic" column="pic" jdbcType="VARCHAR"/>
         <result property="pic" column="pic" jdbcType="VARCHAR"/>
         <result column="workno" property="workno" 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">
         <collection property="roles" ofType="com.xintong.visualinspection.bean.Role">
             <result column="name" property="name"/>
             <result column="name" property="name"/>
         </collection>
         </collection>
     </resultMap>
     </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 id="getAll" resultMap="BaseResultMap"  >
         SELECT
         SELECT
         *
         *
@@ -84,7 +104,7 @@
         UPDATE
         UPDATE
         	t_sys_users
         	t_sys_users
         SET
         SET
-        	status = -1
+        	status = -1,delete_time = now()
         WHERE
         WHERE
         	id = #{id}
         	id = #{id}
     </update>
     </update>
@@ -132,6 +152,36 @@
         	</if>
         	</if>
         order by workno
         order by workno
     </select>
     </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 id="getAllCheckmans" parameterType="com.xintong.visualinspection.bean.User" resultMap="BaseResultMap"  >
         SELECT *
         SELECT *
         FROM t_sys_users
         FROM t_sys_users

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

@@ -1,13 +1,51 @@
 <?xml version="1.0" encoding="UTF-8" ?>
 <?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">
 <!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" >
 <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 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  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 
 			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_item ci ON t.check_item_id = ci.id 
 			LEFT JOIN check_task ct ON ct.id = t.task_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">
 			<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}
 			</if>
 			</if>
@@ -22,7 +60,7 @@
    
    
 	    SELECT * from check_task a LEFT JOIN check_score b on a.id=b.task_id where
 	    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.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>
     </select>
     
     
@@ -31,7 +69,7 @@
     	
     	
     	select sum(num) AS num from (
     	select sum(num) AS num from (
     	SELECT COUNT(DISTINCT ct.checked_person) as num FROM check_task ct 
     	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">
     		<if test="dept_id!=null">
 	    		AND ct.checked_dept = #{dept_id} 
 	    		AND ct.checked_dept = #{dept_id} 
     		</if>
     		</if>
@@ -53,7 +91,7 @@
 
 
     <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">
     	SELECT COUNT(1) AS checked_num , t.checked_person AS user_id FROM check_task t 
     	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">
 			<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} 
 			</if>
 			</if>
@@ -66,7 +104,7 @@
     <select id="selectFeeStationCheckNum" parameterType="com.xintong.visualinspection.bean.StatisticsBean" resultType="com.xintong.visualinspection.bean.StatisticsBean">
     <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 
     	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
     	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">
     		<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}
 			</if>
 			</if>
@@ -85,7 +123,7 @@
     		FROM check_score t 
     		FROM check_score t 
     		LEFT JOIN check_item c ON t.check_item_id = c.id
     		LEFT JOIN check_item c ON t.check_item_id = c.id
     		LEFT JOIN check_task ct ON ct.id = t.task_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">
     		<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}
 			</if>
 			</if>
@@ -98,7 +136,7 @@
 			LEFT JOIN check_item ci ON t.check_item_id = ci.id
 			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 check_task ct ON ct.id = t.task_id
 			LEFT JOIN t_sys_users uu on t.checked_person = uu.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">
 			<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}
 			</if>
 			</if>
@@ -124,7 +162,7 @@
 				FROM 
 				FROM 
 				check_score m INNER JOIN 
 				check_score m INNER JOIN 
 				( select * From check_task t 
 				( 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">
 						<if test="start_date !=null">
 							AND t.start_time >= #{start_date}
 							AND t.start_time >= #{start_date}
 						</if>
 						</if>
@@ -150,7 +188,7 @@
 				check_task t
 				check_task t
 			WHERE
 			WHERE
 				t.checked_person IS NOT NULL
 				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">
 			<if test="start_date !=null">
 				AND t.start_time >= #{start_date}
 				AND t.start_time >= #{start_date}
 			</if>
 			</if>
@@ -193,7 +231,7 @@
      <sql id="selectEveryCheckedInfo">
      <sql id="selectEveryCheckedInfo">
      	SELECT  SUM(sc.check_item_score) AS checkd_all_score , t.checked_person ,t.checked_dept FROM check_task t 
      	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 
 			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
 			GROUP BY t.checked_person
      </sql>
      </sql>
      
      
@@ -215,7 +253,7 @@
      
      
      <select id="selectfeestationChekcedSocre" parameterType="com.xintong.visualinspection.bean.StatisticsBean" resultType="com.xintong.visualinspection.bean.StatisticsBean">
      <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 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.check_item_id = ci.id ) t 
 			LEFT JOIN check_item ci ON t.parent_id = ci.id
 			LEFT JOIN check_item ci ON t.parent_id = ci.id
 			LEFT JOIN t_sys_organ tso ON tso.id = t.checked_dept
 			LEFT JOIN t_sys_organ tso ON tso.id = t.checked_dept
@@ -249,7 +287,7 @@
 			 ) t 
 			 ) t 
 			LEFT JOIN check_item ci ON t.parent_id = ci.id
 			LEFT JOIN check_item ci ON t.parent_id = ci.id
 			) m ON t.id = m.task_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}
 			AND monthfunc( t.start_time ) = #{mth}
 		GROUP BY m.parent_id
 		GROUP BY m.parent_id
      </select>
      </select>
@@ -266,7 +304,7 @@
 				FROM 
 				FROM 
 				check_score m INNER JOIN 
 				check_score m INNER JOIN 
 				( select * From check_task t 
 				( 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">
 						<if test="start_date !=null">
 							AND t.start_time >= #{start_date}
 							AND t.start_time >= #{start_date}
 						</if>
 						</if>
@@ -290,7 +328,7 @@
 				check_task t 
 				check_task t 
 			WHERE
 			WHERE
 				t.checked_person IS NOT NULL
 				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">
 			<if test="start_date !=null">
 				AND t.start_time >= #{start_date}
 				AND t.start_time >= #{start_date}
 			</if>
 			</if>
@@ -319,7 +357,7 @@
 			 ) t 
 			 ) t 
 			LEFT JOIN check_item ci ON t.parent_id = ci.id
 			LEFT JOIN check_item ci ON t.parent_id = ci.id
 			) m ON t.id = m.task_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">
 			<if test="start_date !=null">
 				AND  t.start_time >= #{start_date}
 				AND  t.start_time >= #{start_date}
 			</if>
 			</if>
@@ -345,7 +383,7 @@
          </if>
          </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
          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">
      		<if test="queryType!=null and queryType==0">
      			AND (cs.checked_person = #{user_id} OR t.monitor_user_id = #{user_id}  )
      			AND (cs.checked_person = #{user_id} OR t.monitor_user_id = #{user_id}  )
      		</if>
      		</if>
@@ -383,7 +421,7 @@
 					v_check_task t
 					v_check_task t
 				LEFT JOIN check_score cs ON t.id = cs.task_id
 				LEFT JOIN check_score cs ON t.id = cs.task_id
 				WHERE
 				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!=''">
 				<if test="checkman_id!=null and checkman_id!=''">
 					AND t.checkman = #{checkman_id}				
 					AND t.checkman = #{checkman_id}				
 				</if>
 				</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
 			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
 				FROM
 					check_score cs
 					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
 				WHERE
 				  t.check_time >= #{start_date}
 				  t.check_time >= #{start_date}
 					AND t.check_time &lt; #{end_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  
     	SELECT COUNT(1) AS unable_task_num FROM  v_check_task t WHERE  
     		t.check_time >= #{start_date}
     		t.check_time >= #{start_date}
 			AND t.check_time &lt; #{end_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>
     </select>
     <!--稽查人员工作量统计 end  -->
     <!--稽查人员工作量统计 end  -->
     
     
@@ -468,8 +506,8 @@
     
     
     <select id="selectFsWork" parameterType="com.xintong.visualinspection.bean.StatisticsFsWork" resultMap="statisticsFsWork">
     <select id="selectFsWork" parameterType="com.xintong.visualinspection.bean.StatisticsFsWork" resultMap="statisticsFsWork">
     	SELECT t.* , ct.id AS check_id  FROM sys_user_class t 
     	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" />
     		<include refid="select_Fswork_condition" />
     		ORDER BY t.work_date , t.user_id
     		ORDER BY t.work_date , t.user_id
     </select>
     </select>
@@ -477,7 +515,7 @@
     <select id="selectFsWorkGather" parameterType="com.xintong.visualinspection.bean.StatisticsFsWork" resultType="com.xintong.visualinspection.bean.StatisticsFsWork">
     <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.* 
     	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 
     	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"/>
     	<include refid="select_Fswork_condition"/>
     	GROUP BY t.user_id
     	GROUP BY t.user_id
     </select>
     </select>
@@ -485,16 +523,16 @@
     <select id="selectFsUnregularWork" parameterType="com.xintong.visualinspection.bean.StatisticsFsWork" resultMap="statisticsFsWork">
     <select id="selectFsUnregularWork" parameterType="com.xintong.visualinspection.bean.StatisticsFsWork" resultMap="statisticsFsWork">
     	SELECT t.* , ct.id AS check_id  FROM sys_user_class_unregular t 
     	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  ) )
     		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
     		ORDER BY t.work_date
     </select>
     </select>
     
     
     <select id="selectFsUnregularWorkGather" parameterType="com.xintong.visualinspection.bean.StatisticsFsWork" resultType="com.xintong.visualinspection.bean.StatisticsFsWork">
     <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.* 
     	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 
     	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"/>
     	<include refid="select_Fswork_condition"/>
     	GROUP BY t.user_id
     	GROUP BY t.user_id
     </select>
     </select>
@@ -502,7 +540,7 @@
     <select id="selectFsWorkGatherGroupByWorkType" parameterType="com.xintong.visualinspection.bean.StatisticsFsWork" resultMap="statisticsFsWork" >
     <select id="selectFsWorkGatherGroupByWorkType" parameterType="com.xintong.visualinspection.bean.StatisticsFsWork" resultMap="statisticsFsWork" >
     	SELECT COUNT(DISTINCT(work_date)) AS work_days , t.* 
     	SELECT COUNT(DISTINCT(work_date)) AS work_days , t.* 
     	FROM sys_user_class 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"/>
     	<include refid="select_Fswork_condition"/>
     	GROUP BY t.user_id , t.class_type
     	GROUP BY t.user_id , t.class_type
     </select>
     </select>
@@ -510,7 +548,7 @@
     <select id="selectFsUnregularWorkGatherGroupByWorkType" parameterType="com.xintong.visualinspection.bean.StatisticsFsWork" resultMap="statisticsFsWork">
     <select id="selectFsUnregularWorkGatherGroupByWorkType" parameterType="com.xintong.visualinspection.bean.StatisticsFsWork" resultMap="statisticsFsWork">
     	SELECT COUNT(DISTINCT(work_date)) AS work_days , t.* 
     	SELECT COUNT(DISTINCT(work_date)) AS work_days , t.* 
     	FROM sys_user_class_unregular 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"/>
     	<include refid="select_Fswork_condition"/>
     	GROUP BY t.user_id , t.class_type
     	GROUP BY t.user_id , t.class_type
     </select>
     </select>
@@ -525,7 +563,7 @@
 	
 	
 	<select id="selectCheckAppealNum" parameterType="com.xintong.visualinspection.bean.CheckAppealStatistic" resultMap="appealNum" >
 	<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 
 		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 ">
 			<if test="start_time!=null ">
 	   			AND t.appeal_time >= #{start_time}
 	   			AND t.appeal_time >= #{start_time}
 	   		</if>
 	   		</if>

+ 3 - 1
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) {
 		if (obj.getParent_dept_id() != null) {
 			user.setParent_organid(obj.getParent_dept_id().intValue());
 			user.setParent_organid(obj.getParent_dept_id().intValue());
 		}
 		}
-		List<User> listUserts = userInfoDao.getUsers(user);
+		List<User> listUserts = userInfoDao.getAllUsers(user);
 		for (User u : listUserts) {
 		for (User u : listUserts) {
 			u.setPassword(null);
 			u.setPassword(null);
+			if(u.getInvalidtime()!=null && u.getInvalidtime().getTime() < obj.getEnd_date().getTime())
+			    continue;
 			if (u.getFee_station_name() != null) {
 			if (u.getFee_station_name() != null) {
 				StatisticsBo tmp = new StatisticsBo();
 				StatisticsBo tmp = new StatisticsBo();
 				tmp.setUser(u);
 				tmp.setUser(u);

File diff ditekan karena terlalu besar
+ 812 - 0
VisualInspection_server/visual/visual.log


Beberapa file tidak ditampilkan karena terlalu banyak file yang berubah dalam diff ini