浏览代码

Merge remote-tracking branch 'origin/V1' into V1

tomatozq 5 年之前
父节点
当前提交
e4f4e2d42b

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

@@ -49,4 +49,6 @@ public interface PersonDeviceFilterLogDAO {
     long countByTimeRangeAndCompanyCode(String companyCode,int status, Date startDate, Date endDate);
 
     List<PersonInfo> queryUnmeasuredList(String companyId, Date startTime, Date endTime);
+
+    long countUndetectedByCompanyCode(String companyCode, Date startTime, Date endTime);
 }

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

@@ -50,4 +50,6 @@ public interface PersonDeviceFilterLogService {
     long countByTimeRangeAndCompanyCode(String companyCode,int status,Date startTime, Date endTime);
 
     List<PersonInfo> queryUnmeasuredList(String companyId, Date startTime, Date endTime);
+
+    long countUndetectedByCompanyCode(String companyCode, Date startTime, Date endTime);
 }

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

@@ -202,4 +202,9 @@ public class PersonDeviceFilterLogServiceImpl implements PersonDeviceFilterLogSe
     public List<PersonInfo> queryUnmeasuredList(String companyId, Date startTime, Date endTime) {
         return personDeviceFilterLogDAO.queryUnmeasuredList(companyId,startTime,endTime);
     }
+
+    @Override
+    public long countUndetectedByCompanyCode(String companyCode, Date startTime, Date endTime) {
+        return personDeviceFilterLogDAO.countUndetectedByCompanyCode(companyCode,startTime,endTime);
+    }
 }

+ 1 - 1
common/src/main/java/com/jpsoft/smart/modules/common/utils/WechatMessageUtil.java

@@ -445,7 +445,7 @@ public class WechatMessageUtil {
 		sendData.put("remark", remark);
 
 		//w8Zk_VQMFIEVSIBPZid7zSrvHmBdrgnqF76u8PLCZEs cs
-		boolean ret = sendTemplate(sendData, appId,appSecret,templateId,openId, TEMPERATURE_ALARM_PRE_URL);
+		boolean ret = sendTemplate(sendData, appId,appSecret,templateId,openId, "");
 
 		return ret;
 	}

+ 15 - 0
common/src/main/resources/mapper/base/PersonDeviceFilterLog.xml

@@ -276,4 +276,19 @@
             )
         ]]>
     </select>
+    <select id="countUndetectedByCompanyCode" resultType="long">
+        <![CDATA[
+            select count(*) from base_person_info a,base_company_info b
+            where b.code_ like #{companyCode}
+            and a.company_id = b.id_
+            and b.del_flag=0
+            and a.del_flag=0
+            and a.face_bound=1
+            and a.id_ not in (
+                select person_id from base_person_device_filter_log
+                where record_time>=#{startTime}
+                and record_time <= #{endTime}
+            )
+        ]]>
+    </select>
 </mapper>

+ 15 - 0
web/src/main/java/com/jpsoft/smart/modules/mobile/controller/PersonDeviceLogApiController.java

@@ -43,6 +43,9 @@ public class PersonDeviceLogApiController {
     @Autowired
     private DeviceInfoService deviceInfoService;
 
+    @Autowired
+    private AlarmConfigService alarmConfigService;
+
     @PostMapping("queryTemperatureRawRecordList")
     @ApiOperation(value="根据实时数据查看企业人员温度数据")
     @ApiImplicitParams({
@@ -420,6 +423,7 @@ public class PersonDeviceLogApiController {
 
             long normalCount = personDeviceFilterLogService.countByTimeRangeAndCompanyCode(companyInfo.getCode() + "%",1,startTime,endTime);
             long abnormalCount = personDeviceFilterLogService.countByTimeRangeAndCompanyCode(companyInfo.getCode() + "%",-1,startTime,endTime);
+            long undetectedCount = personDeviceFilterLogService.countUndetectedByCompanyCode(companyInfo.getCode() + "%", startTime,endTime);
 
             Map<String,Object> map1 = new HashMap();
 
@@ -435,6 +439,13 @@ public class PersonDeviceLogApiController {
 
             listMap.add(map2);
 
+            Map<String,Object> map3 = new HashMap();
+
+            map3.put("name","未测量体温");
+            map3.put("value",undetectedCount);
+
+            listMap.add(map3);
+
             msgResult.setResult(true);
             msgResult.setData(listMap);
         }
@@ -561,8 +572,12 @@ public class PersonDeviceLogApiController {
                 }
             }
 
+            long undetectedCount = personDeviceFilterLogService.countUndetectedByCompanyCode(companyInfo.getCode() + "%",startTime,endTime);
+
             map.put("companyTotalCount",companyTotalCount);
             map.put("personTotalCount",personTotalCount);
+            map.put("undetectedCount",undetectedCount);
+
             map.put("list",list);
 
             msgResult.setResult(true);

+ 8 - 6
web/src/main/java/com/jpsoft/smart/schduled/UnmeasureTemperatureAlarmTask.java

@@ -44,6 +44,13 @@ public class UnmeasureTemperatureAlarmTask {
 
         List<AlarmConfig> configList = alarmConfigService.list();
 
+        try {
+            //停100毫秒,以便后续时间比endTime大
+            Thread.sleep(100);
+        } catch (InterruptedException e) {
+            e.printStackTrace();
+        }
+
         DateTime now = DateTime.now();
 
         String date = now.toString("yyyy-MM-dd");
@@ -58,15 +65,10 @@ public class UnmeasureTemperatureAlarmTask {
                 DateTime endTime = new DateTime(sdf.parse(date + " " + alarmConfig.getEndTime()));
 
                 if (weekdays.indexOf(String.valueOf(weekday)) != -1) {
-                    if (now.compareTo(endTime)>=0) {
-                        int minutes = Minutes.minutesBetween(endTime,now).getMinutes();
-
-                        if (minutes<=intervalMinute){
+                    if (now.compareTo(endTime)>0 && now.compareTo(endTime.plusMinutes(intervalMinute))<0) {
                             //todo 进行通知
                             notice(alarmConfig.getCompanyId(),startTime,endTime);
-
                             break;
-                        }
                     }
                 }
             }