|
@@ -197,7 +197,6 @@ public class AdminDataShowServiceImpl implements AdminDataShowService {
|
|
}
|
|
}
|
|
map.put("query", data);
|
|
map.put("query", data);
|
|
faceLogs = faceLogDao.getFaceLogs(map);
|
|
faceLogs = faceLogDao.getFaceLogs(map);
|
|
- log.info("【facelogs长度】:{}", faceLogs.size());
|
|
|
|
|
|
|
|
totalNum+=faceLogs.size();
|
|
totalNum+=faceLogs.size();
|
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
@@ -205,43 +204,49 @@ public class AdminDataShowServiceImpl implements AdminDataShowService {
|
|
Date date = new Date();
|
|
Date date = new Date();
|
|
long parse = 0;
|
|
long parse = 0;
|
|
try {
|
|
try {
|
|
- parse = sdfToday.parse(sdfToday.format(date)).getTime();
|
|
+ parse = sdfToday.parse(sdfToday.format(date)).getTime();
|
|
} catch (ParseException e) {
|
|
} catch (ParseException e) {
|
|
e.printStackTrace();
|
|
e.printStackTrace();
|
|
}
|
|
}
|
|
|
|
|
|
- LinkedHashSet<Long> red = new LinkedHashSet<>();
|
|
+
|
|
- LinkedHashSet<Long> yellow = new LinkedHashSet<>();
|
|
+
|
|
|
|
|
|
for (FaceLogVO faceLog : faceLogs) {
|
|
for (FaceLogVO faceLog : faceLogs) {
|
|
if(faceLog.getLogId().intValue() > biggerNum){
|
|
if(faceLog.getLogId().intValue() > biggerNum){
|
|
biggerNum = faceLog.getLogId().intValue();
|
|
biggerNum = faceLog.getLogId().intValue();
|
|
}
|
|
}
|
|
- if(faceLog.getCreateTime().getTime()>parse){
|
|
+ Long parse1 = null;
|
|
|
|
+ try {
|
|
|
|
+ parse1 = sdf.parse(faceLog.getFaceTime()).getTime();
|
|
|
|
+ } catch (ParseException e) {
|
|
|
|
+ e.printStackTrace();
|
|
|
|
+ }
|
|
|
|
+ if(parse1>parse){
|
|
todayNum++;
|
|
todayNum++;
|
|
|
|
|
|
if (faceLog.getJkmStatus().equals("10")) {
|
|
if (faceLog.getJkmStatus().equals("10")) {
|
|
redNum++;
|
|
redNum++;
|
|
-
|
|
+
|
|
- long createTime = faceLog.getCreateTime().getTime();
|
|
+
|
|
- String startTime = sdf.format(new Date(createTime - (5 * 60 * 1000)-(8*60*60*1000)));
|
|
+
|
|
- String endTime = sdf.format(new Date(createTime + (5 * 60 * 1000)-(8*60*60*1000)));
|
|
+
|
|
- List<Long> cbs = adminDataShowDao.getCountByTimeAndSn(startTime, endTime, faceLog.getDeviceSn(),faceLog.getLogId());
|
|
+
|
|
- for (Long cb : cbs) {
|
|
+
|
|
- red.add(cb);
|
|
+
|
|
- }
|
|
+
|
|
}
|
|
}
|
|
|
|
|
|
else if (faceLog.getJkmStatus().equals("01")){
|
|
else if (faceLog.getJkmStatus().equals("01")){
|
|
yellowNum++;
|
|
yellowNum++;
|
|
-
|
|
+
|
|
- long createTime = faceLog.getCreateTime().getTime();
|
|
+
|
|
- String startTime = sdf.format(new Date(createTime - (5 * 60 * 1000)-(8*60*60*1000)));
|
|
+
|
|
- String endTime = sdf.format(new Date(createTime + (5 * 60 * 1000)-(8*60*60*1000)));
|
|
+
|
|
- List<Long> cbs = adminDataShowDao.getCountByTimeAndSn(startTime, endTime, faceLog.getDeviceSn(),faceLog.getLogId());
|
|
+
|
|
- for (Long cb : cbs) {
|
|
+
|
|
- yellow.add(cb);
|
|
+
|
|
- }
|
|
+
|
|
}
|
|
}
|
|
else if (faceLog.getJkmStatus().equals("00"))greenNum++;
|
|
else if (faceLog.getJkmStatus().equals("00"))greenNum++;
|
|
else {
|
|
else {
|
|
@@ -272,8 +277,10 @@ public class AdminDataShowServiceImpl implements AdminDataShowService {
|
|
adminData.setNotKnowNum(notKnowNum);
|
|
adminData.setNotKnowNum(notKnowNum);
|
|
adminData.setTwExceptionNum(twExceptionNum);
|
|
adminData.setTwExceptionNum(twExceptionNum);
|
|
adminData.setTwNormal(twNormal);
|
|
adminData.setTwNormal(twNormal);
|
|
- adminData.setContactRedNum(contactRedNum+red.size());
|
|
+ adminData.setContactRedNum(contactRedNum);
|
|
- adminData.setContactYellowNum(contactYellowNum+yellow.size());
|
|
+ adminData.setContactYellowNum(contactYellowNum);
|
|
|
|
+
|
|
|
|
+
|
|
adminData.setExceptionNum(exceptionNum);
|
|
adminData.setExceptionNum(exceptionNum);
|
|
adminData.setInoculationNum(inoculationNum);
|
|
adminData.setInoculationNum(inoculationNum);
|
|
adminData.setNoInoculationNum(noInoculationNum);
|
|
adminData.setNoInoculationNum(noInoculationNum);
|
|
@@ -281,10 +288,67 @@ public class AdminDataShowServiceImpl implements AdminDataShowService {
|
|
adminData.setEffectiveTime(new Date(date.getTime() + (60 * 1000)));
|
|
adminData.setEffectiveTime(new Date(date.getTime() + (60 * 1000)));
|
|
adminData.setTime(date);
|
|
adminData.setTime(date);
|
|
adminData.setBiggerNum(biggerNum);
|
|
adminData.setBiggerNum(biggerNum);
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ * 如果红码和黄码人数不为0则需要重新统计密切接触人数
|
|
|
|
+ * */
|
|
|
|
+ if(yellowNum != 0){
|
|
|
|
+ LinkedHashSet<Long> yellowredContact = new LinkedHashSet<>();
|
|
|
|
+
|
|
|
|
+ String zero = getZero();
|
|
|
|
+ List<FaceLogVO> faceLogVOList = faceLogDao.getYellow(adminId, zero, "01");
|
|
|
|
+ for (FaceLogVO faceLogVO : faceLogVOList) {
|
|
|
|
+ Long faceTime=null;
|
|
|
|
+ try {
|
|
|
|
+ faceTime = sdf.parse(faceLogVO.getFaceTime()).getTime();
|
|
|
|
+ } catch (ParseException e) {
|
|
|
|
+ e.printStackTrace();
|
|
|
|
+ }
|
|
|
|
+ String startTime = sdf.format(new Date(faceTime - (5 * 60 * 1000)));
|
|
|
|
+ String endTime = sdf.format(new Date(faceTime + (5 * 60 * 1000)));
|
|
|
|
+ List<Long> cbs = adminDataShowDao.getCountByTimeAndSn(startTime, endTime, faceLogVO.getDeviceSn(),faceLogVO.getLogId());
|
|
|
|
+ for (Long cb : cbs) {
|
|
|
|
+ yellowredContact.add(cb);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ adminData.setContactYellowNum(yellowredContact.size());
|
|
|
|
+ }
|
|
|
|
+ if(redNum != 0){
|
|
|
|
+ LinkedHashSet<Long> redContact = new LinkedHashSet<>();
|
|
|
|
+
|
|
|
|
+ String zero = getZero();
|
|
|
|
+ List<FaceLogVO> faceLogVOList = faceLogDao.getYellow(adminId, zero, "01");
|
|
|
|
+ for (FaceLogVO faceLogVO : faceLogVOList) {
|
|
|
|
+ Long faceTime=null;
|
|
|
|
+ try {
|
|
|
|
+ faceTime = sdf.parse(faceLogVO.getFaceTime()).getTime();
|
|
|
|
+ } catch (ParseException e) {
|
|
|
|
+ e.printStackTrace();
|
|
|
|
+ }
|
|
|
|
+ String startTime = sdf.format(new Date(faceTime - (5 * 60 * 1000)));
|
|
|
|
+ String endTime = sdf.format(new Date(faceTime + (5 * 60 * 1000)));
|
|
|
|
+ List<Long> cbs = adminDataShowDao.getCountByTimeAndSn(startTime, endTime, faceLogVO.getDeviceSn(),faceLogVO.getLogId());
|
|
|
|
+ for (Long cb : cbs) {
|
|
|
|
+ redContact.add(cb);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ adminData.setContactRedNum(redContact.size());
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
|
|
redisUtil.set(RName + adminId,adminData);
|
|
redisUtil.set(RName + adminId,adminData);
|
|
return adminData;
|
|
return adminData;
|
|
}
|
|
}
|
|
|
|
+ private String getZero(){
|
|
|
|
+ SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
|
|
+ Calendar calendar = Calendar.getInstance();
|
|
|
|
+ calendar.setTime(new Date());
|
|
|
|
+ calendar.set(Calendar.HOUR_OF_DAY, 0);
|
|
|
|
+ calendar.set(Calendar.MINUTE, 0);
|
|
|
|
+ calendar.set(Calendar.SECOND, 0);
|
|
|
|
+ Date zero = calendar.getTime();
|
|
|
|
+ return sdf.format(zero);
|
|
|
|
+ }
|
|
|
|
|
|
private FaceServerLogSearch getFaceServerLogSearch() {
|
|
private FaceServerLogSearch getFaceServerLogSearch() {
|
|
FaceServerLogSearch data = new FaceServerLogSearch();
|
|
FaceServerLogSearch data = new FaceServerLogSearch();
|
|
@@ -301,19 +365,7 @@ public class AdminDataShowServiceImpl implements AdminDataShowService {
|
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
data.setStartTime(sdf.format(zero));
|
|
data.setStartTime(sdf.format(zero));
|
|
data.setEndTime(sdf.format(one));
|
|
data.setEndTime(sdf.format(one));
|
|
-
|
|
+
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
return data;
|
|
return data;
|
|
}
|
|
}
|
|
}
|
|
}
|