">
562
|
if("旷工".equals(dailyAttendance.get("goToWorkStatus"))){
|
|
563
|
//不动
|
|
564
|
}else if("倒休".equals(dailyAttendance.get("goToWorkStatus"))||"事假".equals(dailyAttendance.get("goToWorkStatus"))||"年假".equals(dailyAttendance.get("goToWorkStatus"))||"放假".equals(dailyAttendance.get("goToWorkStatus"))||"病假".equals(dailyAttendance.get("goToWorkStatus"))){
|
|
565
|
//将下午外勤移除
|
|
566
|
Iterator<Object> iterator = attendanceStatusList.iterator();
|
|
567
|
while (iterator.hasNext()){
|
|
568
|
String next =(String) iterator.next();
|
|
569
|
if("下午外勤".equals(next)){
|
|
570
|
iterator.remove();
|
|
571
|
}
|
|
572
|
}
|
|
573
|
}else{
|
|
574
|
//将attendanceStatusArray[1]移除
|
|
575
|
attendanceStatusArray[1]=null;
|
|
576
|
}
|
|
577
|
}
|
459
|
578
|
attendanceStatusList.add(attendanceStatusArray[0]);
|
460
|
579
|
attendanceStatusList.add(attendanceStatusArray[1]);
|
461
|
580
|
}
|
462
|
|
// dailyAttendance.put("descr",attendanceStatusList);
|
|
581
|
}
|
|
582
|
//遍历集合,将为null的值去掉
|
|
583
|
Iterator<Object> iterator = attendanceStatusList.iterator();
|
|
584
|
while (iterator.hasNext()){
|
|
585
|
String next =(String) iterator.next();
|
|
586
|
if(null==next){
|
|
587
|
iterator.remove();
|
|
588
|
}
|
463
|
589
|
}
|
464
|
590
|
dailyAttendance.put("descr",attendanceStatusList);
|
465
|
591
|
|
466
|
592
|
|
467
|
|
/* String[] attendanceStatusArray = new String[2];
|
468
|
|
|
469
|
|
if("正常".equals(dailyAttendance.get("goToWorkStatus"))&&"正常".equals(dailyAttendance.get("goOffWorkStatus"))){
|
470
|
|
//上下班都正常
|
471
|
|
dailyAttendance.put("isAbnormal",false);
|
472
|
|
attendanceStatusArray[0]="正常";
|
473
|
|
dailyAttendance.put("descr",attendanceStatusArray);
|
474
|
|
}else if(!"正常".equals(dailyAttendance.get("goToWorkStatus"))&&!"正常".equals(dailyAttendance.get("goOffWorkStatus"))){
|
475
|
|
attendanceStatusArray[0]= (String) dailyAttendance.get("goToWorkStatus");
|
476
|
|
attendanceStatusArray[1]= (String) dailyAttendance.get("goOffWorkStatus");
|
477
|
|
//上下班都不正常
|
478
|
|
if("迟到".equals(dailyAttendance.get("goToWorkStatus"))){
|
479
|
|
attendanceStatusArray[0]="迟到"+dailyAttendance.get("goToWorkTime") +"分";
|
480
|
|
}
|
481
|
|
if("早退".equals(dailyAttendance.get("goOffWorkStatus"))){
|
482
|
|
attendanceStatusArray[1]="早退"+dailyAttendance.get("goOffWorkTime") +"分";
|
483
|
|
}
|
484
|
|
if("旷工".equals(dailyAttendance.get("goToWorkStatus"))){
|
485
|
|
//attendanceStatusArray[1]=null;
|
486
|
|
attendanceStatusArray[1]="旷工"+dailyAttendance.get("goOffWorkTime") +"天";
|
487
|
|
attendanceStatusArray[0]="旷工"+dailyAttendance.get("goToWorkTime") +"天";
|
488
|
|
}
|
489
|
|
if("倒休".equals(dailyAttendance.get("goToWorkStatus"))||"事假".equals(dailyAttendance.get("goToWorkStatus"))||"年假".equals(dailyAttendance.get("goToWorkStatus"))||"放假".equals(dailyAttendance.get("goToWorkStatus"))||"病假".equals(dailyAttendance.get("goToWorkStatus"))){
|
490
|
|
//attendanceStatusArray[1]=null;
|
491
|
|
attendanceStatusArray[1]=(String) dailyAttendance.get("goOffWorkStatus");
|
492
|
|
attendanceStatusArray[0]=(String) dailyAttendance.get("goToWorkStatus");
|
493
|
|
}
|
494
|
|
|
495
|
|
dailyAttendance.put("descr",attendanceStatusArray);
|
496
|
|
}else{
|
497
|
|
//上下班一个正常一个不正常
|
498
|
|
if("正常".equals(dailyAttendance.get("goToWorkStatus"))){
|
499
|
|
attendanceStatusArray[0]= (String) dailyAttendance.get("goOffWorkStatus");
|
500
|
|
}else{
|
501
|
|
attendanceStatusArray[0]= (String) dailyAttendance.get("goToWorkStatus");
|
502
|
|
}
|
503
|
|
dailyAttendance.put("descr",attendanceStatusArray);
|
504
|
|
}*/
|
505
|
593
|
});
|
506
|
594
|
} catch (ParseException e) {
|
507
|
595
|
e.printStackTrace();
|
508
|
596
|
}
|
509
|
|
/* List<Map<String, Object>> dataList = attendanceReport.getData().getData();
|
510
|
|
dataList.forEach((data)->{
|
511
|
|
String[] attendanceStatus = (String[]) data.get("attendanceStatus");
|
512
|
|
if(null!=attendanceStatus&&attendanceStatus.length>0){
|
513
|
|
String[] attendanceStatusArray = new String[1];
|
514
|
|
if(null==attendanceStatus[1]){
|
515
|
|
attendanceStatusArray[0]=attendanceStatus[0];
|
516
|
|
data.put("attendanceStatus",attendanceStatusArray);
|
517
|
|
}
|
518
|
|
}
|
519
|
|
});*/
|
520
|
597
|
return attendanceReport;
|
521
|
598
|
}
|
522
|
599
|
}
|
|
@ -1,11 +1,17 @@
|
1
|
1
|
package com.ai.bss.security.protection.service.impl;
|
2
|
2
|
|
|
3
|
import java.io.ByteArrayInputStream;
|
|
4
|
import java.io.InputStream;
|
3
|
5
|
import java.util.ArrayList;
|
4
|
6
|
import java.util.Date;
|
5
|
7
|
import java.util.HashMap;
|
6
|
8
|
import java.util.List;
|
7
|
9
|
import java.util.Map;
|
8
|
10
|
|
|
11
|
import cn.hutool.core.lang.UUID;
|
|
12
|
import com.ai.bss.components.minio.service.MinioService;
|
|
13
|
import com.ai.bss.security.protection.model.SecurityProtectionMinioConfig;
|
|
14
|
import com.ai.bss.security.protection.service.interfaces.UploadFileService;
|
9
|
15
|
import org.apache.commons.lang.StringUtils;
|
10
|
16
|
import org.springframework.beans.factory.annotation.Autowired;
|
11
|
17
|
import org.springframework.stereotype.Service;
|
|
@ -25,11 +31,20 @@ import com.ai.bss.work.safety.service.api.MonitorSceneQuery;
|
25
|
31
|
@Service
|
26
|
32
|
public class MonitorVideoLogManageServiceImpl implements MonitorVideoLogManageService {
|
27
|
33
|
|
|
34
|
public String SPLIT_CHAR = "_";
|
28
|
35
|
@Autowired
|
29
|
36
|
private MonitorSceneQuery monitorSceneQuery;
|
30
|
37
|
|
31
|
38
|
@Autowired
|
32
|
39
|
private MonitorSceneCommand monitorSceneCommand;
|
|
40
|
@Autowired
|
|
41
|
private MinioService minioService;
|
|
42
|
@Autowired
|
|
43
|
private UploadFileService uploadFileService;
|
|
44
|
|
|
45
|
|
|
46
|
@Autowired
|
|
47
|
private SecurityProtectionMinioConfig minioConfig;
|
33
|
48
|
|
34
|
49
|
@Override
|
35
|
50
|
public CommonResponse<List<EbcMonitorVideoLog>> queryMonitorVideoLogByTime(MonitorVideoLog monitorVideoLogCondition)
|
|
@ -50,6 +65,46 @@ public class MonitorVideoLogManageServiceImpl implements MonitorVideoLogManageSe
|
50
|
65
|
return CommonResponse.ok(list);
|
51
|
66
|
}
|
52
|
67
|
|
|
68
|
|
|
69
|
|
|
70
|
@Override
|
|
71
|
public CommonResponse<String> queryMonitorVideoLogByTimeForM3u8(MonitorVideoLog monitorVideoLogCondition) throws Exception {
|
|
72
|
CommonRequest<MonitorVideoLog> request = new CommonRequest<MonitorVideoLog>(monitorVideoLogCondition);
|
|
73
|
CommonResponse<List<MonitorVideoLog>> response = monitorSceneQuery.queryMonitorVideoLogByTime(request);
|
|
74
|
|
|
75
|
List<EbcMonitorVideoLog> list = new ArrayList<EbcMonitorVideoLog>();
|
|
76
|
if (response == null || CollectionUtils.isEmpty(response.getData())) {
|
|
77
|
return CommonResponse.ok(null);
|
|
78
|
}
|
|
79
|
|
|
80
|
|
|
81
|
StringBuffer m3u8Str = new StringBuffer();
|
|
82
|
m3u8Str.append("#EXTM3U").append("\n");
|
|
83
|
m3u8Str.append("#EXT-X-VERSION:3").append("\n");
|
|
84
|
m3u8Str.append("#EXT-X-TARGETDURATION:65").append("\n");
|
|
85
|
m3u8Str.append("#EXT-X-MEDIA-SEQUENCE:0").append("\n");
|
|
86
|
String bucketName = minioConfig.getBucketM3U8();//"m3u8-index";
|
|
87
|
String fileType = ".m3u8";
|
|
88
|
String m3u8FileName = bucketName + SPLIT_CHAR + UUID.fastUUID().toString().replace("-", "") + fileType;
|
|
89
|
|
|
90
|
String videoUrl = "";
|
|
91
|
for (MonitorVideoLog monitorVideoLog : response.getData()) {
|
|
92
|
EbcMonitorVideoLog ebcMonitorVideoLog = getEbcMonitorVideoLog(monitorVideoLog);
|
|
93
|
list.add(ebcMonitorVideoLog);
|
|
94
|
videoUrl = uploadFileService.getFileUrl(monitorVideoLog.getVideoUrl());// minioService.getObjectUrl(videoFileIdArr[0],ebcMonitorVideoLog.getVideoFileUrl());
|
|
95
|
|
|
96
|
m3u8Str.append("#EXTINF:65,").append("\n");
|
|
97
|
m3u8Str.append(videoUrl).append("\n");
|
|
98
|
}
|
|
99
|
m3u8Str.append("#EXT-X-ENDLIST").append("\n");
|
|
100
|
InputStream is = new ByteArrayInputStream(m3u8Str.toString().getBytes());
|
|
101
|
minioService.putObject(bucketName,m3u8FileName,is,fileType);
|
|
102
|
|
|
103
|
String m3u8IndexFileUrl = uploadFileService.getFileUrl(m3u8FileName);
|
|
104
|
|
|
105
|
return CommonResponse.ok(m3u8IndexFileUrl);
|
|
106
|
}
|
|
107
|
|
53
|
108
|
@Override
|
54
|
109
|
public CommonResponse<EbcMonitorVideoLog> queryMonitorVideoLogById(Long monitorVideoLogId) throws Exception {
|
55
|
110
|
CommonRequest<Long> request = new CommonRequest<Long>(monitorVideoLogId);
|
|
@ -7,6 +7,7 @@ import java.util.HashMap;
|
7
|
7
|
import java.util.List;
|
8
|
8
|
import java.util.Map;
|
9
|
9
|
|
|
10
|
import com.ai.abc.exception.BaseException;
|
10
|
11
|
import com.ai.bss.components.common.util.JsonUtils;
|
11
|
12
|
import com.ai.bss.user.dto.UserDto;
|
12
|
13
|
import com.ai.bss.work.attendance.dto.LeaveApprovalDto;
|
|
@ -266,7 +267,13 @@ public class WorkOrderManagementServiceImpl implements WorkOrderManagementServic
|
266
|
267
|
userDto.setId(employId);
|
267
|
268
|
CommonRequest<UserDto> request = CommonRequest.<UserDto>builder().data(userDto).pageNumber(1).pageSize(1).build();
|
268
|
269
|
CommonResponse<PageBean<UserDto>> result = userDtoQuery.queryWorkEmployee(request);
|
269
|
|
String employOrgId = result.getData().getData().get(0).getOrgId();
|
|
270
|
String employOrgId = "";
|
|
271
|
try {
|
|
272
|
employOrgId = result.getData().getData().get(0).getOrgId();
|
|
273
|
}catch (Exception e){
|
|
274
|
log.error("员工不存在");
|
|
275
|
new BaseException("员工不存在");
|
|
276
|
}
|
270
|
277
|
log.info("输出参数:{}",JSON.toJSONString(result , SerializerFeature.PrettyFormat));
|
271
|
278
|
|
272
|
279
|
|
|
@ -22,6 +22,9 @@ public interface MonitorVideoLogManageService {
|
22
|
22
|
CommonResponse<List<EbcMonitorVideoLog>> queryMonitorVideoLogByTime(MonitorVideoLog monitorVideoLogCondition)
|
23
|
23
|
throws Exception;
|
24
|
24
|
|
|
25
|
|
|
26
|
CommonResponse<String> queryMonitorVideoLogByTimeForM3u8(MonitorVideoLog monitorVideoLogCondition) throws Exception;
|
|
27
|
|
25
|
28
|
/**
|
26
|
29
|
* 根据视频日志ID查询监控视频日志
|
27
|
30
|
* @param monitorVideoLogId
|
|
@ -540,7 +540,7 @@ public class DateUtil {
|
540
|
540
|
/**
|
541
|
541
|
* 取得date中的纯日期部分
|
542
|
542
|
*
|
543
|
|
* @param date需要变动的日期
|
|
543
|
* @param date
|
544
|
544
|
* @return 变动后的日期
|
545
|
545
|
*/
|
546
|
546
|
public static Date getDateWithoutTime(Date date) {
|
|
@ -652,4 +652,14 @@ public class DateUtil {
|
652
|
652
|
return Integer.parseInt(lastDay);
|
653
|
653
|
}
|
654
|
654
|
|
|
655
|
|
|
656
|
public static String getDateTimeString(Date date){
|
|
657
|
if (date == null){
|
|
658
|
return null;
|
|
659
|
}
|
|
660
|
SimpleDateFormat simpleDateFormat = new SimpleDateFormat( NORM_DATETIME_PATTERN);
|
|
661
|
String dateString = simpleDateFormat.format(date);
|
|
662
|
return dateString;
|
|
663
|
}
|
|
664
|
|
655
|
665
|
}
|
|
@ -65,6 +65,8 @@ spminio.bucketToolImage=tool-image
|
65
|
65
|
spminio.bucketAiVideo=ai-video
|
66
|
66
|
# \u76d1\u63a7\u89c6\u9891\u622a\u56fe
|
67
|
67
|
spminio.bucketAiImage=ai-image
|
|
68
|
# \u76d1\u63a7\u89c6\u9891\u622a\u56fe
|
|
69
|
spminio.bucketM3U8=m3u8-index
|
68
|
70
|
|
69
|
71
|
|
70
|
72
|
# CACHE
|