温红权 8 лет назад
Родитель
Сommit
dbea0339ad

+ 6 - 2
VisualInspection_server/src/main/java/com/xintong/visualinspection/mapper/cluster/UserInfoMapper.xml

@@ -129,11 +129,15 @@
 			ORDER BY t.organid 
     </select>
     
-    <select id="getUsers" parameterType="com.xintong.visualinspection.bean.User" resultMap="BaseResultMap"  >
+    <select id="getUsers" parameterType="com.xintong.visualinspection.bean.User" resultMap="BaseResultMapByInvalid"  >
         SELECT
-        t.* , fs.name AS fee_station_name,tso.parentid AS parent_organid
+        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 and t.status>0 
         <if test="organid != null and organid != 0">and t.organid = #{organid} </if>
         <if test="username != null">and t.username = #{username} </if>

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

@@ -1113,6 +1113,8 @@ public class StatisticsServiceImpl extends BaseService implements StatisticsServ
 		List<User> listUserts = userInfoDao.getUsers(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) {
 				StatisticsBean tmp = new StatisticsBean();
 				tmp.setUser(u);
@@ -1178,7 +1180,7 @@ public class StatisticsServiceImpl extends BaseService implements StatisticsServ
 				if(t_mthList.get(i).compare2To(t_mthList.get(i-1)) == 0){
 					 ;
 				}else{
-					seq = i ;
+					seq = i+1 ;
 				}
 			}
             seq=seq==0?1:seq;
@@ -1199,7 +1201,7 @@ public class StatisticsServiceImpl extends BaseService implements StatisticsServ
 				if(prev_mthList.get(i).compare2To(prev_mthList.get(i-1))==0){
 					;
 				}else{
-					seq = i ;
+					seq = i+1 ;
 				}
 			}