Selaa lähdekoodia

访客逻辑修改

fllmoyu 5 vuotta sitten
vanhempi
commit
74124fac0f

+ 2 - 0
common/src/main/java/com/jpsoft/smart/modules/base/dao/PersonInfoDAO.java

@@ -39,4 +39,6 @@ public interface PersonInfoDAO {
     long countByCompanyIds(List<String> companyIds);
 
     PersonInfo findByIdCardAndCompanyId(String idCard,String companyId);
+
+	List<PersonInfo> notGuestList();
 }

+ 2 - 0
common/src/main/java/com/jpsoft/smart/modules/base/service/PersonInfoService.java

@@ -38,4 +38,6 @@ public interface PersonInfoService {
     long countByCompanyIds(List<String> companyIds);
 
     PersonInfo addPersonForCompany(PersonInfo personInfo, String deviceNo);
+
+	List<PersonInfo> notGuestList();
 }

+ 2 - 0
common/src/main/java/com/jpsoft/smart/modules/base/service/impl/PersonDeviceFilterLogServiceImpl.java

@@ -20,6 +20,7 @@ import com.jpsoft.smart.modules.common.utils.TimeZonesUtil;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.scheduling.annotation.Async;
 import org.springframework.stereotype.Component;
 import org.springframework.transaction.annotation.Transactional;
 import sun.misc.BASE64Decoder;
@@ -61,6 +62,7 @@ public class PersonDeviceFilterLogServiceImpl implements PersonDeviceFilterLogSe
     }
 
     @Override
+    @Async
     public void deviceInsertFilterLog(String deviceNo, BigDecimal temperature, JSONObject faceImageJson, JSONObject libMatInfoListJson, JSONObject matchPersonInfo, Date date,Integer maskFlag) {
 
         try {

+ 1 - 0
common/src/main/java/com/jpsoft/smart/modules/base/service/impl/PersonDeviceLogServiceImpl.java

@@ -70,6 +70,7 @@ public class PersonDeviceLogServiceImpl implements PersonDeviceLogService {
 
 
     @Override
+    @Async
     public void deviceInsertLog(String deviceNo, BigDecimal temperature, JSONObject faceImageJson, JSONObject libMatInfoListJson, JSONObject matchPersonInfo, Date date,Integer maskFlag) {
         String retFileUrl = "";
         try {

+ 6 - 0
common/src/main/java/com/jpsoft/smart/modules/base/service/impl/PersonInfoServiceImpl.java

@@ -156,6 +156,7 @@ public class PersonInfoServiceImpl implements PersonInfoService {
 					personInfo2.setPopedom("1");
 					personInfo2.setWechatNoticeEnabled(false);
 					personInfo2.setAllowViewLocal(false);
+					personInfo2.setGuestEnabled(true);
 					personInfoDAO.insert(personInfo2);
 					return personInfo2;
 				}else {
@@ -173,4 +174,9 @@ public class PersonInfoServiceImpl implements PersonInfoService {
 			return personInfo;
 		}
 	}
+
+	@Override
+	public List<PersonInfo> notGuestList() {
+		return personInfoDAO.notGuestList();
+	}
 }

+ 5 - 3
common/src/main/resources/mapper/base/PersonDeviceFilterLog.xml

@@ -326,13 +326,14 @@
         ]]>
     </select>
     <select id="getDayAbnormalNumByCompanyList" resultType="Integer">
+        <![CDATA[
         select count(DISTINCT person_id) from base_person_device_filter_log a left join base_person_info b
         on a.person_id = b.id_
         where a.record_time >=#{startTime}
-        and a.record_time &lt;= #{endTime}
+        and a.record_time <= #{endTime}
         and a.temperature_>#{temperatureMax}
-        and b.company_id in
-        <foreach collection="list" index="index" item="item" open="(" separator="," close=")">#{item.id}
+        ]]>
+        <foreach collection="list" index="index" item="item" open="and b.company_id in(" separator="," close=")">#{item.id}
         </foreach>
         and a.del_flag = 0
     </select>
@@ -342,6 +343,7 @@
         on a.person_id = b.id_
         where a.record_time >=#{startTime}
         and a.record_time &lt;= #{endTime}
+        and b.guest_enabled is not true
         and b.company_id in
         <foreach collection="list" index="index" item="item" open="(" separator="," close=")">#{item.id}
         </foreach>

+ 8 - 4
common/src/main/resources/mapper/base/PersonDeviceLog.xml

@@ -238,7 +238,7 @@
     </select>
     <select id="getDayCheckedVistorNumByDeviceNoList" resultType="Integer">
         <![CDATA[
-            select count(*) from base_person_device_log where person_id = 0
+            select count(*) from base_person_device_log where match_face_id = 0
             and record_time >=#{startTime}
             and record_time <= #{endTime}
             and temperature_ > 0
@@ -284,6 +284,7 @@
             from base_person_device_log m inner join base_person_info n ON m.person_id = n.id_
             where m.record_time>=#{startTime}
             and m.record_time <=#{endTime}
+            and n.guest_enabled is not true
         ]]>
         <foreach collection="companyList" index="index" item="item" open=" and n.company_id in (" separator="," close=")">
             #{item.id}
@@ -297,7 +298,7 @@
     <select id="findVisitorLogByDeviceNoList" resultMap="PersonDeviceLogMap">
         <![CDATA[
             select * from base_person_device_log
-            where person_id = 0
+            where match_face_id = 0
             and record_time >= #{startTime}
             and record_time <= #{endTime}
             and temperature_>0
@@ -315,7 +316,8 @@
             from base_person_device_log m inner join base_person_info n ON m.person_id = n.id_
             where m.record_time>=#{startTime}
             and m.record_time <=#{endTime}
-            and popedom_ like '%2%'
+            and n.popedom_ like '%2%'
+            and n.guest_enabled is not true
         ]]>
         <foreach collection="list" index="index" item="item" open=" and n.company_id in (" separator="," close=")">
             #{item.id}
@@ -353,7 +355,8 @@
             from base_person_device_log m inner join base_person_info n ON m.person_id = n.id_
             where m.record_time>=#{startTime}
             and m.record_time <=#{endTime}
-            and popedom_ = '1'
+            and n.popedom_ = '1'
+            and n.guest_enabled is not true
         ]]>
         <foreach collection="list" index="index" item="item" open=" and n.company_id in (" separator="," close=")">
             #{item.id}
@@ -386,6 +389,7 @@
         on a.person_id = b.id_
         where a.record_time >=#{startTime}
         and a.record_time &lt;= #{endTime}
+        and b.guest_enabled is not true
         <foreach collection="list" index="index" item="item" open=" and b.company_id in (" separator="," close=")">   #{item.id}
         </foreach>
         and a.del_flag = 0

+ 14 - 4
common/src/main/resources/mapper/base/PersonInfo.xml

@@ -317,9 +317,11 @@
     </select>
 
     <select id="countByCompanyList" resultType="Long">
-        select count(*) from base_person_info where del_flag = 0 and
-        company_id in
-        <foreach collection="list" index="index" item="item" open="(" separator="," close=")">
+        <![CDATA[
+        select count(*) from base_person_info where del_flag = 0
+        and guest_enabled is not true
+        ]]>
+        <foreach collection="list" index="index" item="item" open="and company_id in(" separator="," close=")">
             #{item.id}
         </foreach>
     </select>
@@ -327,7 +329,7 @@
     <select id="countByCompanyListAndPopedom" resultType="Long">
         select count(*) from base_person_info where del_flag = 0
         and popedom_ like #{type}
-
+        and guest_enabled is not true
         <foreach collection="list" index="index" item="item" open="and company_id in(" separator="," close=")">
             #{item.id}
         </foreach>
@@ -335,6 +337,7 @@
 
     <select id="countStudentByCompanyListAndPopedom" resultType="Long">
         select count(*) from base_person_info where del_flag = 0
+        and guest_enabled is not true
         and popedom_ = #{type}
         <foreach collection="list" index="index" item="item" open="and company_id in(" separator="," close=")">
             #{item.id}
@@ -368,5 +371,12 @@
                 ]]>
 
 
+</select>
+    <select id="notGuestList" resultMap="PersonInfoMap">
+        <![CDATA[
+        select * from base_person_info where del_flag = 0
+                and guest_enabled is not true
+        ]]>
+
 </select>
 </mapper>

+ 1 - 1
web/src/main/java/com/jpsoft/smart/modules/base/controller/HomePageController.java

@@ -71,7 +71,7 @@ public class HomePageController {
             Integer totalAbnormalNum = 0;
             if (userService.hasRole(subject, "SYSADMIN")) {
                 companyNum = companyInfoService.list().size();
-                personNum = personInfoService.list().size();
+                personNum = personInfoService.notGuestList().size();
                 Integer normalDaysNum =  totalCheckCompanyService.findMinNormalDay();
                 normalDays = normalDaysNum==null?0:normalDaysNum;
                 Integer num = checkNumCompanyService.getDayCheckNum(DateUtil.format(new Date(), "yyyy-MM-dd"));