From 31d3591b34d4f26ad2ab207ca3044048d9adb9df Mon Sep 17 00:00:00 2001 From: fuliqi <fuliqi@qq.com> Date: 星期三, 21 八月 2024 17:51:28 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/master' --- ycl-pojo/src/main/java/com/ycl/platform/domain/result/HK/SnapshotDataMonitorResult.java | 22 ycl-pojo/src/main/java/com/ycl/platform/domain/vo/WorkOrderYwConditionRecordVO.java | 3 ycl-pojo/src/main/java/com/ycl/platform/wvp/ErrorCode.java | 30 ycl-pojo/src/main/java/com/ycl/platform/wvp/MediaServer.java | 390 ++++ ycl-server/src/main/java/com/ycl/platform/mapper/ReportMapper.java | 8 ycl-server/src/main/java/com/ycl/task/PlatformTask.java | 34 ycl-server/src/main/java/com/ycl/platform/service/DeviceInfoService.java | 15 ycl-pojo/src/main/java/com/ycl/platform/domain/result/HK/FaceDeviceInspectionResult.java | 78 ycl-pojo/src/main/java/com/ycl/platform/domain/result/HK/CrossDetailResult.java | 45 ycl-pojo/src/main/java/com/ycl/platform/domain/vo/DeviceInfoVO.java | 39 ycl-pojo/src/main/java/com/ycl/platform/domain/result/HK/MonitoringDetailResult.java | 47 ycl-pojo/src/main/java/com/ycl/platform/domain/result/UY/RecordMetaDSumResult.java | 18 ycl-server/src/main/resources/application-prod.yml | 4 ycl-server/src/main/java/com/ycl/platform/mapper/DeviceInfoMapper.java | 22 ycl-pojo/src/main/java/com/ycl/platform/wvp/WVPResult.java | 75 ycl-pojo/src/main/java/com/ycl/platform/domain/result/HK/VehicleDeviceInspectionResult.java | 96 + ycl-server/src/main/java/com/ycl/task/WorkOrderImgTask.java | 48 ycl-server/src/main/resources/mapper/zgyw/ReportMapper.xml | 19 ycl-server/src/main/java/com/ycl/platform/service/impl/WorkOrderServiceImpl.java | 90 + ycl-server/src/main/java/com/ycl/platform/mapper/WorkOrderMapper.java | 7 ycl-pojo/src/main/java/com/ycl/platform/wvp/OnStreamChangedHookParam.java | 534 ++++++ ycl-pojo/src/main/java/com/ycl/platform/wvp/MediaInfo.java | 315 +++ ycl-server/src/main/java/com/ycl/platform/service/DataCenterService.java | 8 ycl-server/src/main/java/com/ycl/task/DeviceChannelTask.java | 18 ycl-pojo/src/main/java/com/ycl/platform/wvp/StreamContent.java | 442 +++++ ycl-pojo/src/main/java/com/ycl/platform/wvp/StreamInfo.java | 647 +++++++ ycl-server/src/main/resources/mapper/zgyw/WorkOrderMapper.xml | 10 ycl-pojo/src/main/java/com/ycl/platform/domain/entity/WorkOrderYwConditionRecord.java | 3 ycl-server/pom.xml | 7 ycl-server/src/main/resources/mapper/zgyw/WorkOrderYwConditionRecordMapper.xml | 2 ycl-pojo/src/main/java/com/ycl/platform/wvp/StreamURL.java | 84 + ycl-server/src/main/resources/application-dev.yml | 4 ycl-server/src/main/java/com/ycl/platform/service/impl/DataCenterServiceImpl.java | 67 ycl-pojo/src/main/java/com/ycl/platform/wvp/DownloadFileInfo.java | 41 ycl-server/src/main/java/com/ycl/platform/service/WorkOrderService.java | 26 ycl-pojo/src/main/java/com/ycl/platform/domain/form/DeviceInfoForm.java | 18 ycl-pojo/src/main/java/com/ycl/platform/domain/result/UY/OneMachineFileResult.java | 329 +++ ycl-server/src/main/java/com/ycl/platform/service/impl/DeviceInfoServiceImpl.java | 23 ycl-pojo/src/main/java/com/ycl/platform/domain/entity/WorkOrder.java | 4 ycl-pojo/src/main/java/com/ycl/platform/domain/result/UY/VideoOnlineResult.java | 39 ycl-pojo/src/main/java/com/ycl/platform/wvp/HookParam.java | 19 ycl-pojo/src/main/java/com/ycl/platform/domain/entity/DeviceInfo.java | 30 ycl-pojo/src/main/java/com/ycl/platform/wvp/ZLMServerConfig.java | 1224 ++++++++++++++ 43 files changed, 4,921 insertions(+), 63 deletions(-) diff --git a/ycl-pojo/src/main/java/com/ycl/platform/domain/entity/DeviceInfo.java b/ycl-pojo/src/main/java/com/ycl/platform/domain/entity/DeviceInfo.java new file mode 100644 index 0000000..f8a17e0 --- /dev/null +++ b/ycl-pojo/src/main/java/com/ycl/platform/domain/entity/DeviceInfo.java @@ -0,0 +1,30 @@ +package com.ycl.platform.domain.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; + +import com.ycl.platform.base.AbsEntity; +import lombok.Data; + +/** + * 鍥芥爣绾ц仈鍚屾鏁版嵁 + * + * @author xp + * @since 2024-08-21 + */ +@Data +@TableName("t_device_info") +public class DeviceInfo extends AbsEntity { + + private static final long serialVersionUID = 1L; + + @TableField("device_id") + /** 璁惧缂栧彿/鍥芥爣鐮� */ + private String deviceId; + + @TableField("channel_id") + /** 璁惧閫氶亾ID */ + private String channelId; + + +} diff --git a/ycl-pojo/src/main/java/com/ycl/platform/domain/entity/WorkOrder.java b/ycl-pojo/src/main/java/com/ycl/platform/domain/entity/WorkOrder.java index d895863..48d9220 100644 --- a/ycl-pojo/src/main/java/com/ycl/platform/domain/entity/WorkOrder.java +++ b/ycl-pojo/src/main/java/com/ycl/platform/domain/entity/WorkOrder.java @@ -66,6 +66,10 @@ @TableField("yw_condition") private String ywCondition; + @ApiModelProperty("杩愮淮妫�娴嬫儏鍐�/涓�寮犲浘") + @TableField("yw_check_condition") + private String ywCheckCondition; + @ApiModelProperty("澶勭悊鏈熼檺") @TableField("processing_period") private Integer processingPeriod; diff --git a/ycl-pojo/src/main/java/com/ycl/platform/domain/entity/WorkOrderYwConditionRecord.java b/ycl-pojo/src/main/java/com/ycl/platform/domain/entity/WorkOrderYwConditionRecord.java index 2d4f45b..71231ca 100644 --- a/ycl-pojo/src/main/java/com/ycl/platform/domain/entity/WorkOrderYwConditionRecord.java +++ b/ycl-pojo/src/main/java/com/ycl/platform/domain/entity/WorkOrderYwConditionRecord.java @@ -38,5 +38,8 @@ @TableField("yw_proofMaterials") private String ywProofMaterials; + @ApiModelProperty("鏄惁涓虹郴缁熸秷鎭�") + @TableField("sys_msg") + private Boolean sysMsg; } diff --git a/ycl-pojo/src/main/java/com/ycl/platform/domain/form/DeviceInfoForm.java b/ycl-pojo/src/main/java/com/ycl/platform/domain/form/DeviceInfoForm.java new file mode 100644 index 0000000..fc9426d --- /dev/null +++ b/ycl-pojo/src/main/java/com/ycl/platform/domain/form/DeviceInfoForm.java @@ -0,0 +1,18 @@ +package com.ycl.platform.domain.form; + +import com.ycl.platform.base.AbsForm; +import io.swagger.annotations.ApiModel; +import lombok.Data; + +/** + * 鍥芥爣绾ц仈鍚屾鏁版嵁琛ㄥ崟 + * + * @author xp + * @since 2024-08-21 + */ +@Data +@ApiModel(value = "DeviceInfo琛ㄥ崟", description = "鍥芥爣绾ц仈鍚屾鏁版嵁琛ㄥ崟") +public class DeviceInfoForm extends AbsForm { + + +} diff --git a/ycl-pojo/src/main/java/com/ycl/platform/domain/result/HK/CrossDetailResult.java b/ycl-pojo/src/main/java/com/ycl/platform/domain/result/HK/CrossDetailResult.java index af13839..7078f96 100644 --- a/ycl-pojo/src/main/java/com/ycl/platform/domain/result/HK/CrossDetailResult.java +++ b/ycl-pojo/src/main/java/com/ycl/platform/domain/result/HK/CrossDetailResult.java @@ -5,6 +5,8 @@ import org.springframework.data.mongodb.core.index.TextIndexed; import org.springframework.data.mongodb.core.mapping.Document; +import java.util.Objects; + /** * 鍗″彛灞炴�х洃娴嬬粨鏋滐細杞﹁締锛堣溅杈嗗崱鍙d俊鎭噰闆嗗噯纭巼銆侊級 * @@ -55,9 +57,52 @@ private Integer lalType; /** + * 缁忕含搴︾洃娴嬬粨鏋滐紝琛ㄧず缁忕含搴︿俊鎭殑鐩戞祴鐘舵�併�� + * 1:姝e父 2:缁忕含搴︾己澶� 3:涓嶅湪杈栧尯 4:绮惧害杩囦綆 + */ + private String lalTypeText; + + /** * 鍥芥爣缂栫爜鐩戞祴缁撴灉锛岃〃绀哄浗鏍囩紪鐮佺殑鐩戞祴鐘舵�併�� * 1:姝e父 2:缂栫爜闀垮害涓嶇瓑浜�20浣� 3:鍓�6浣嶄笉绗﹀悎鏍囧噯 4:11鑷�13浣嶄笉绗﹀悎鏍囧噯 */ private Integer gbCodeType; + /** + * 鍥芥爣缂栫爜鐩戞祴缁撴灉锛岃〃绀哄浗鏍囩紪鐮佺殑鐩戞祴鐘舵�併�� + * 1:姝e父 2:缂栫爜闀垮害涓嶇瓑浜�20浣� 3:鍓�6浣嶄笉绗﹀悎鏍囧噯 4:11鑷�13浣嶄笉绗﹀悎鏍囧噯 + */ + private String gbCodeTypeText; + + public String getLalTypeText() { + if (Objects.equals(lalType, 1)) { + lalTypeText = "姝e父"; + } + if (Objects.equals(lalType, 2)) { + lalTypeText = "缁忕含搴︾己澶�"; + } + if (Objects.equals(lalType, 3)) { + lalTypeText = "涓嶅湪杈栧尯"; + } + if (Objects.equals(lalType, 4)) { + lalTypeText = "绮惧害杩囦綆"; + } + return lalTypeText; + } + + public String getGbCodeTypeText() { + if (Objects.equals(gbCodeType, 1)) { + gbCodeTypeText = "姝e父"; + } + if (Objects.equals(gbCodeType, 2)) { + gbCodeTypeText = "缂栫爜闀垮害涓嶇瓑浜�20浣�"; + } + if (Objects.equals(gbCodeType, 3)) { + gbCodeTypeText = "鍓�6浣嶄笉绗﹀悎鏍囧噯"; + } + if (Objects.equals(gbCodeType, 4)) { + gbCodeTypeText = "11鑷�13浣嶄笉绗﹀悎鏍囧噯"; + } + return gbCodeTypeText; + } } diff --git a/ycl-pojo/src/main/java/com/ycl/platform/domain/result/HK/FaceDeviceInspectionResult.java b/ycl-pojo/src/main/java/com/ycl/platform/domain/result/HK/FaceDeviceInspectionResult.java index 309d49c..b7b4fa0 100644 --- a/ycl-pojo/src/main/java/com/ycl/platform/domain/result/HK/FaceDeviceInspectionResult.java +++ b/ycl-pojo/src/main/java/com/ycl/platform/domain/result/HK/FaceDeviceInspectionResult.java @@ -75,6 +75,11 @@ */ private Integer snapResult; + /** + * 鎶撴媿鏁版嵁閲忕洃娴嬬粨鏋滐紝1:姝e父 2:鏃犳暟鎹� 4:鏁版嵁閲忓皯 + */ + private String snapResultText; + // 浠ヤ笅涓哄祵濂楀璞$殑瀛楁 /** @@ -97,6 +102,19 @@ */ private SnapUnique snapUnique; + public String getSnapResultText() { + if (snapResult == 1) { + snapResultText = "姝e父"; + } + if (snapResult == 2) { + snapResultText = "鏃犳暟鎹�"; + } + if (snapResult == 4) { + snapResultText = "鏁版嵁閲忓皯"; + } + return snapResultText; + } + // 鍐呭祵瀵硅薄瀹氫箟 @Data @@ -117,6 +135,11 @@ private Integer todayClockResult; /** + * 褰撴棩鎺ユ敹鐨勫綋鏃ユ姄鎷嶆暟鎹椂閽熷噯纭�у垽瀹氱粨鏋滐細1鏄悎鏍硷紝0鏄笉鍚堟牸 + */ + private String todayClockResultText; + + /** * 褰撴棩鎺ユ敹鐨勫叏閮ㄦ姄鎷嶆暟鎹腑鏃堕挓鍑嗙‘鏁版嵁閲� */ private Integer allClockCount; @@ -125,6 +148,31 @@ * 褰撴棩鎺ユ敹鐨勫叏閮ㄦ姄鎷嶆暟鎹腑鏃堕挓鍑嗙‘鎬у垽瀹氱粨鏋滐細1鏄悎鏍硷紝0鏄笉鍚堟牸 */ private Integer allClockResult; + + /** + * 褰撴棩鎺ユ敹鐨勫叏閮ㄦ姄鎷嶆暟鎹腑鏃堕挓鍑嗙‘鎬у垽瀹氱粨鏋滐細1鏄悎鏍硷紝0鏄笉鍚堟牸 + */ + private String allClockResultText; + + public String getTodayClockResultText() { + if (todayClockResult == 1) { + todayClockResultText = "鍚堟牸"; + } + if (todayClockResult == 0) { + todayClockResultText = "涓嶅悎鏍�"; + } + return todayClockResultText; + } + + public String getAllClockResultText() { + if (allClockResult == 1) { + allClockResultText = "鍚堟牸"; + } + if (allClockResult == 0) { + allClockResultText = "涓嶅悎鏍�"; + } + return allClockResultText; + } } @Data @@ -160,6 +208,11 @@ private Integer todayTimelyResult; /** + * 褰撴棩鎺ユ敹鐨勫綋鏃ユ姄鎷嶆暟鎹強鏃舵�у垽瀹氱粨鏋滐細1鏄悎鏍硷紝0鏄笉鍚堟牸 + */ + private String todayTimelyResultText; + + /** * 褰撴棩鎺ユ敹鐨勫叏閮ㄦ姄鎷嶆暟鎹腑寤惰繜鏁版嵁閲� */ private Integer allDelayCount; @@ -183,6 +236,31 @@ * 褰撴棩鎺ユ敹鐨勫叏閮ㄦ姄鎷嶆暟鎹腑鍙婃椂鎬у垽瀹氱粨鏋滐細1鏄悎鏍硷紝0鏄笉鍚堟牸 */ private Integer allTimelyResult; + + /** + * 褰撴棩鎺ユ敹鐨勫叏閮ㄦ姄鎷嶆暟鎹腑鍙婃椂鎬у垽瀹氱粨鏋滐細1鏄悎鏍硷紝0鏄笉鍚堟牸 + */ + private String allTimelyResultText; + + public String getTodayTimelyResultText() { + if (todayTimelyResult == 1) { + todayTimelyResultText = "鍚堟牸"; + } + if (todayTimelyResult == 0) { + todayTimelyResultText = "涓嶅悎鏍�"; + } + return todayTimelyResultText; + } + + public String getAllTimelyResultText() { + if (allTimelyResult == 1) { + allTimelyResultText = "鍚堟牸"; + } + if (allTimelyResult == 0) { + allTimelyResultText = "涓嶅悎鏍�"; + } + return allTimelyResultText; + } } @Data diff --git a/ycl-pojo/src/main/java/com/ycl/platform/domain/result/HK/MonitoringDetailResult.java b/ycl-pojo/src/main/java/com/ycl/platform/domain/result/HK/MonitoringDetailResult.java index 14e91b0..d4105dd 100644 --- a/ycl-pojo/src/main/java/com/ycl/platform/domain/result/HK/MonitoringDetailResult.java +++ b/ycl-pojo/src/main/java/com/ycl/platform/domain/result/HK/MonitoringDetailResult.java @@ -5,6 +5,8 @@ import org.springframework.data.mongodb.core.index.TextIndexed; import org.springframework.data.mongodb.core.mapping.Document; +import java.util.Objects; + /** * 閲囬泦璁惧灞炴�х洃娴嬬粨鏋滐細浜鸿劯锛堜汉鑴稿崱鍙d俊鎭噰闆嗗噯纭巼锛� * @@ -54,9 +56,21 @@ private Integer lalType; /** + * 缁忕含搴︾洃娴嬬粨鏋滐紝琛ㄧず缁忕含搴︿俊鎭殑鐩戞祴鐘舵�併�� + * 1:姝e父 2:缁忕含搴︾己澶� 3:涓嶅湪杈栧尯 4:绮惧害杩囦綆 + */ + private String lalTypeText; + + /** * 鍥芥爣缂栫爜鐩戞祴缁撴灉: 1:姝e父 2:缂栫爜闀垮害涓嶇瓑浜�20浣� 3:鍓�6浣嶄笉绗﹀悎鏍囧噯 4:11鑷�13浣嶄笉绗﹀悎鏍囧噯 */ private Integer gbCodeType; + + /** + * 鍥芥爣缂栫爜鐩戞祴缁撴灉锛岃〃绀哄浗鏍囩紪鐮佺殑鐩戞祴鐘舵�併�� + * 1:姝e父 2:缂栫爜闀垮害涓嶇瓑浜�20浣� 3:鍓�6浣嶄笉绗﹀悎鏍囧噯 4:11鑷�13浣嶄笉绗﹀悎鏍囧噯 + */ + private String gbCodeTypeText; /** * 鏅�氳兘鍔涢泦 @@ -68,4 +82,37 @@ */ private String intelligentSet; + + public String getLalTypeText() { + if (Objects.equals(lalType, 1)) { + lalTypeText = "姝e父"; + } + if (Objects.equals(lalType, 2)) { + lalTypeText = "缁忕含搴︾己澶�"; + } + if (Objects.equals(lalType, 3)) { + lalTypeText = "涓嶅湪杈栧尯"; + } + if (Objects.equals(lalType, 4)) { + lalTypeText = "绮惧害杩囦綆"; + } + return lalTypeText; + } + + public String getGbCodeTypeText() { + if (Objects.equals(gbCodeType, 1)) { + gbCodeTypeText = "姝e父"; + } + if (Objects.equals(gbCodeType, 2)) { + gbCodeTypeText = "缂栫爜闀垮害涓嶇瓑浜�20浣�"; + } + if (Objects.equals(gbCodeType, 3)) { + gbCodeTypeText = "鍓�6浣嶄笉绗﹀悎鏍囧噯"; + } + if (Objects.equals(gbCodeType, 4)) { + gbCodeTypeText = "11鑷�13浣嶄笉绗﹀悎鏍囧噯"; + } + return gbCodeTypeText; + } + } diff --git a/ycl-pojo/src/main/java/com/ycl/platform/domain/result/HK/SnapshotDataMonitorResult.java b/ycl-pojo/src/main/java/com/ycl/platform/domain/result/HK/SnapshotDataMonitorResult.java index d343175..049c639 100644 --- a/ycl-pojo/src/main/java/com/ycl/platform/domain/result/HK/SnapshotDataMonitorResult.java +++ b/ycl-pojo/src/main/java/com/ycl/platform/domain/result/HK/SnapshotDataMonitorResult.java @@ -5,6 +5,8 @@ import org.springframework.data.mongodb.core.index.TextIndexed; import org.springframework.data.mongodb.core.mapping.Document; +import java.util.Objects; + /** * 鎶撴媿鏁版嵁閲忕洃娴嬬粨鏋滐細杞﹁締锛堣鍥惧簱瀵规帴绋冲畾鎬с�佺偣浣嶅湪绾跨巼銆侊級 * @@ -66,4 +68,24 @@ */ private int resultType; + /** + * 鎶撴媿鏁版嵁閲忕洃娴嬬粨鏋� 1:姝e父 2:鏃犳暟鎹� 3:鏁版嵁绐侀檷 4:鏁版嵁閲忓皯 + */ + private String resultTypeText; + + public String getResultTypeText() { + if (Objects.equals(resultType, 1)) { + resultTypeText = "姝e父"; + } + if (Objects.equals(resultType, 2)) { + resultTypeText = "鏃犳暟鎹�"; + } + if (Objects.equals(resultType, 3)) { + resultTypeText = "鏁版嵁绐侀檷"; + } + if (Objects.equals(resultType, 4)) { + resultTypeText = "鏁版嵁閲忓皯"; + } + return resultTypeText; + } } diff --git a/ycl-pojo/src/main/java/com/ycl/platform/domain/result/HK/VehicleDeviceInspectionResult.java b/ycl-pojo/src/main/java/com/ycl/platform/domain/result/HK/VehicleDeviceInspectionResult.java index 0a86ceb..2141d74 100644 --- a/ycl-pojo/src/main/java/com/ycl/platform/domain/result/HK/VehicleDeviceInspectionResult.java +++ b/ycl-pojo/src/main/java/com/ycl/platform/domain/result/HK/VehicleDeviceInspectionResult.java @@ -70,6 +70,11 @@ */ private Integer snapResult; + /** + * 鎶撴媿鏁版嵁閲忕洃娴嬬粨鏋滐紝1:姝e父 2:鏃犳暟鎹� 4:鏁版嵁閲忓皯 + */ + private String snapResultText; + // 浠ヤ笅涓哄祵濂楀璞$殑瀛楁 /** @@ -97,6 +102,19 @@ */ private Integrity integrity; + public String getSnapResultText() { + if (snapResult == 1) { + snapResultText = "姝e父"; + } + if (snapResult == 2) { + snapResultText = "鏃犳暟鎹�"; + } + if (snapResult == 4) { + snapResultText = "鏁版嵁閲忓皯"; + } + return snapResultText; + } + // 鍐呭祵瀵硅薄瀹氫箟 @Data @@ -117,6 +135,11 @@ private Integer todayClockResult; /** + * 褰撴棩鎺ユ敹鐨勫綋鏃ユ姄鎷嶆暟鎹椂閽熷噯纭�у垽瀹氱粨鏋滐細1鏄悎鏍硷紝0鏄笉鍚堟牸 + */ + private String todayClockResultText; + + /** * 褰撴棩鎺ユ敹鐨勫叏閮ㄦ姄鎷嶆暟鎹椂閽熷噯纭暟鎹噺 */ private Integer allClockCount; @@ -125,6 +148,31 @@ * 褰撴棩鎺ユ敹鐨勫叏閮ㄦ姄鎷嶆暟鎹椂閽熷噯纭�у垽瀹氱粨鏋滐細1鏄悎鏍硷紝0鏄笉鍚堟牸 */ private Integer allClockResult; + + /** + * 褰撴棩鎺ユ敹鐨勫叏閮ㄦ姄鎷嶆暟鎹椂閽熷噯纭�у垽瀹氱粨鏋滐細1鏄悎鏍硷紝0鏄笉鍚堟牸 + */ + private String allClockResultText; + + public String getTodayClockResultText() { + if (todayClockResult == 1) { + todayClockResultText = "鍚堟牸"; + } + if (todayClockResult == 0) { + todayClockResultText = "涓嶅悎鏍�"; + } + return todayClockResultText; + } + + public String getAllClockResultText() { + if (allClockResult == 1) { + allClockResultText = "鍚堟牸"; + } + if (allClockResult == 0) { + allClockResultText = "涓嶅悎鏍�"; + } + return allClockResultText; + } } @Data @@ -160,6 +208,11 @@ private Integer todayTimelyResult; /** + * 褰撴棩鎺ユ敹鐨勫綋鏃ユ姄鎷嶆暟鎹暟鎹強鏃舵�у垽瀹氱粨鏋滐細1鏄悎鏍硷紝0鏄笉鍚堟牸 + */ + private String todayTimelyResultText; + + /** * 褰撴棩鎺ユ敹鐨勫叏閮ㄦ暟鎹欢杩熼噺 */ private Integer allDelayCount; @@ -183,6 +236,31 @@ * 褰撴棩鎺ユ敹鐨勫叏閮ㄦ暟鎹強鏃舵�у垽瀹氱粨鏋滐細1鏄悎鏍硷紝0鏄笉鍚堟牸 */ private Integer allTimelyResult; + + /** + * 褰撴棩鎺ユ敹鐨勫叏閮ㄦ暟鎹強鏃舵�у垽瀹氱粨鏋滐細1鏄悎鏍硷紝0鏄笉鍚堟牸 + */ + private String allTimelyResultText; + + public String getTodayTimelyResultText() { + if (todayTimelyResult == 1) { + todayTimelyResultText = "鍚堟牸"; + } + if (todayTimelyResult == 0) { + todayTimelyResultText = "涓嶅悎鏍�"; + } + return todayTimelyResultText; + } + + public String getAllTimelyResultText() { + if (allTimelyResult == 1) { + allTimelyResultText = "鍚堟牸"; + } + if (allTimelyResult == 0) { + allTimelyResultText = "涓嶅悎鏍�"; + } + return allTimelyResultText; + } } @Data @@ -214,6 +292,24 @@ * 杞︾墝璇嗗埆寮傚父锛氱粨鏋滅被鍨� 1:姝e父 2:璇嗗埆鐜囦綆 3:鏄煎璇嗗埆鐜囩獊鍙� */ private Integer recgResult; + + /** + * 杞︾墝璇嗗埆寮傚父锛氱粨鏋滅被鍨� 1:姝e父 2:璇嗗埆鐜囦綆 3:鏄煎璇嗗埆鐜囩獊鍙� + */ + private String recgResultText; + + public String getRecgResultText() { + if (recgResult == 1) { + recgResultText = "姝e父"; + } + if (recgResult == 2) { + recgResultText = "璇嗗埆鐜囦綆"; + } + if (recgResult == 3) { + recgResultText = "鏄煎璇嗗埆鐜囩獊鍙�"; + } + return recgResultText; + } } @Data diff --git a/ycl-pojo/src/main/java/com/ycl/platform/domain/result/UY/OneMachineFileResult.java b/ycl-pojo/src/main/java/com/ycl/platform/domain/result/UY/OneMachineFileResult.java index 44dd4ff..7b80843 100644 --- a/ycl-pojo/src/main/java/com/ycl/platform/domain/result/UY/OneMachineFileResult.java +++ b/ycl-pojo/src/main/java/com/ycl/platform/domain/result/UY/OneMachineFileResult.java @@ -2,10 +2,12 @@ import com.ycl.platform.domain.result.BaseResult; import lombok.Data; +import org.apache.commons.lang3.ArrayUtils; import org.springframework.data.mongodb.core.index.TextIndexed; import org.springframework.data.mongodb.core.mapping.Document; +import utils.StringUtils; -import java.util.Date; +import java.util.*; /** * 涓�鏈轰竴妗� @@ -173,4 +175,329 @@ */ private String SSBMHY; + + public String getJKDWLX() { + if (Objects.equals(JKDWLX, "1")) { + this.JKDWLX = "涓�绫昏棰戠洃鎺х偣"; + } + if (Objects.equals(JKDWLX, "2")) { + this.JKDWLX = "浜岀被瑙嗛鐩戞帶鐐�"; + } + if (Objects.equals(JKDWLX, "3")) { + this.JKDWLX = "涓夌被瑙嗛鐩戞帶鐐�"; + } + if (Objects.equals(JKDWLX, "4")) { + this.JKDWLX = "鍏畨鍐呴儴瑙嗛鐩戞帶鐐�"; + } + if (Objects.equals(JKDWLX, "9")) { + this.JKDWLX = "鍏朵粬鐐逛綅"; + } + return JKDWLX; + } + + public String getSXJGNLX() { + List<String> sxjgnlx = new ArrayList<>(); + if (StringUtils.contains(SXJGNLX, "1")) { + sxjgnlx.add("瑙嗛鐩戞帶"); + } + if (StringUtils.contains(SXJGNLX, "2")) { + sxjgnlx.add("杞﹁締璇嗗埆"); + } + if (StringUtils.contains(SXJGNLX, "3")) { + sxjgnlx.add("浜哄憳璇嗗埆"); + } + if (!sxjgnlx.isEmpty()) { + this.SXJGNLX = String.join("/", sxjgnlx); + } + return SXJGNLX; + } + + public String getSBZT() { + if (Objects.equals(SBZT, "1")) { + this.SBZT = "鍦ㄧ敤"; + } + if (Objects.equals(SBZT, "2")) { + this.SBZT = "缁翠慨"; + } + if (Objects.equals(SBZT, "3")) { + this.SBZT = "鎷嗛櫎"; + } + return SBZT; + } + + public String getSBCS() { + if (Objects.equals(SBCS, "1")) { + this.SBCS = "娴峰悍濞佽"; + } + if (Objects.equals(SBCS, "2")) { + this.SBCS = "澶у崕"; + } + if (Objects.equals(SBCS, "3")) { + this.SBCS = "澶╁湴浼熶笟"; + } + if (Objects.equals(SBCS, "4")) { + this.SBCS = "绉戣揪"; + } + if (Objects.equals(SBCS, "5")) { + this.SBCS = "瀹夎澹�"; + } + if (Objects.equals(SBCS, "6")) { + this.SBCS = "鍗氫笘"; + } + if (Objects.equals(SBCS, "7")) { + this.SBCS = "浜氬畨"; + } + if (Objects.equals(SBCS, "8")) { + this.SBCS = "鑻遍鎷�"; + } + if (Objects.equals(SBCS, "9")) { + this.SBCS = "瀹囪"; + } + if (Objects.equals(SBCS, "10")) { + this.SBCS = "娴蜂俊"; + } + if (Objects.equals(SBCS, "11")) { + this.SBCS = "涓槦鐢靛瓙"; + } + if (Objects.equals(SBCS, "12")) { + this.SBCS = "鏄庢櫙"; + } + if (Objects.equals(SBCS, "13")) { + this.SBCS = "鑱旀兂"; + } + if (Objects.equals(SBCS, "14")) { + this.SBCS = "涓叴"; + } + if (Objects.equals(SBCS, "99")) { + this.SBCS = "鍏朵粬"; + } + return SBCS; + } + + public String getSXJLX() { + if (Objects.equals(SXJLX, "1")) { + this.SXJLX = "鐞冩満"; + } + if (Objects.equals(SXJLX, "2")) { + this.SXJLX = "鍗婄悆"; + } + if (Objects.equals(SXJLX, "3")) { + this.SXJLX = "鍥哄畾鏋満"; + } + if (Objects.equals(SXJLX, "4")) { + this.SXJLX = "閬ユ帶鏋満"; + } + if (Objects.equals(SXJLX, "5")) { + this.SXJLX = "鍗″彛鏋満"; + } + if (Objects.equals(SXJLX, "99")) { + this.SXJLX = "鏈煡"; + } + return SXJLX; + } + + + public String getBGSX() { + if (Objects.equals(BGSX, "1")) { + this.BGSX = "鏃犺ˉ鍏�"; + } + if (Objects.equals(BGSX, "2")) { + this.BGSX = "绾㈠琛ュ厜"; + } + if (Objects.equals(BGSX, "3")) { + this.BGSX = "鐧藉厜琛ュ厜"; + } + if (Objects.equals(BGSX, "9")) { + this.BGSX = "鍏朵粬琛ュ厜"; + } + return BGSX; + } + + public String getSXJBMGS() { + if (Objects.equals(SXJBMGS, "1")) { + this.SXJBMGS = "MPEG-4"; + } + if (Objects.equals(SXJBMGS, "2")) { + this.SXJBMGS = "H.264"; + } + if (Objects.equals(SXJBMGS, "3")) { + this.SXJBMGS = "SVAC"; + } + if (Objects.equals(SXJBMGS, "4")) { + this.SXJBMGS = "H.265"; + } + return SXJBMGS; + } + + public String getSXJWZLX() { + List<String> wzlx = new ArrayList<>(); + if (StringUtils.isBlank(SXJWZLX)) { + return SXJWZLX; + } + String[] split = SXJWZLX.split("/"); + if (ArrayUtils.contains(split, "1")) { + wzlx.add("鐪侀檯妫�鏌ョ珯"); + } + if (ArrayUtils.contains(split, "2")) { + wzlx.add("鍏氭斂鏈哄叧"); + } + if (ArrayUtils.contains(split, "3")) { + wzlx.add("杞︾珯鐮佸ご"); + } + if (ArrayUtils.contains(split, "4")) { + wzlx.add("涓績骞垮満"); + } + if (ArrayUtils.contains(split, "5")) { + wzlx.add("浣撹偛鍦洪"); + } + if (ArrayUtils.contains(split, "6")) { + wzlx.add("鍟嗕笟涓績"); + } + if (ArrayUtils.contains(split, "7")) { + wzlx.add("瀹楁暀鍦烘墍"); + } + if (ArrayUtils.contains(split, "8")) { + wzlx.add("鏍″洯鍛ㄨ竟"); + } + if (ArrayUtils.contains(split, "9")) { + wzlx.add("娌诲畨澶嶆潅鍖哄煙"); + } + if (ArrayUtils.contains(split, "10")) { + wzlx.add("浜ら�氬共绾�"); + } + if (ArrayUtils.contains(split, "11")) { + wzlx.add("鍖婚櫌鍛ㄨ竟"); + } + if (ArrayUtils.contains(split, "12")) { + wzlx.add("閲戣瀺鏈烘瀯鍛ㄨ竟"); + } + if (ArrayUtils.contains(split, "13")) { + wzlx.add("鍗遍櫓鐗╁搧鍦烘墍鍛ㄨ竟"); + } + if (ArrayUtils.contains(split, "14")) { + wzlx.add("鍗氱墿棣嗗睍瑙堥"); + } + if (ArrayUtils.contains(split, "15")) { + wzlx.add("閲嶇偣姘村煙銆佽埅閬�"); + } + if (ArrayUtils.contains(split, "96")) { + wzlx.add("甯傞檯鍏畨妫�鏌ョ珯"); + } + if (ArrayUtils.contains(split, "97")) { + wzlx.add("娑夊鍦烘墍"); + } + if (ArrayUtils.contains(split, "98")) { + wzlx.add("杈瑰娌跨嚎"); + } + if (ArrayUtils.contains(split, "99")) { + wzlx.add("鏃呮父鏅尯"); + } + this.SXJWZLX = String.join("/", wzlx); + return SXJWZLX; + } + + public String getJSFW() { + if (Objects.equals(JSFW, "1")) { + this.JSFW = "涓�"; + } + if (Objects.equals(JSFW, "2")) { + this.JSFW = "瑗�"; + } + if (Objects.equals(JSFW, "3")) { + this.JSFW = "鍗�"; + } + if (Objects.equals(JSFW, "4")) { + this.JSFW = "鍖�"; + } + if (Objects.equals(JSFW, "5")) { + this.JSFW = "涓滃崡"; + } + if (Objects.equals(JSFW, "6")) { + this.JSFW = "涓滃寳"; + } + if (Objects.equals(JSFW, "7")) { + this.JSFW = "瑗垮崡"; + } + if (Objects.equals(JSFW, "8")) { + this.JSFW = "瑗垮寳"; + } + if (Objects.equals(JSFW, "9")) { + this.JSFW = "鍏ㄥ悜"; + } + return JSFW; + } + + public String getLWSX() { + if (Objects.equals(LWSX, "0")) { + this.LWSX = "宸茶仈缃�"; + } + if (Objects.equals(LWSX, "1")) { + this.LWSX = "鏈仈缃�"; + } + return LWSX; + } + + public String getSSBMHY() { + List<String> ssbmhy = new ArrayList<>(); + if (StringUtils.isBlank(SSBMHY)) { + return SSBMHY; + } + String[] split = SSBMHY.split("/"); + if (ArrayUtils.contains(split, "1")) { + ssbmhy.add("鍏畨鏈哄叧"); + } + if (ArrayUtils.contains(split, "2")) { + ssbmhy.add("鐜繚閮ㄩ棬"); + } + if (ArrayUtils.contains(split, "3")) { + ssbmhy.add("鏂囧崥閮ㄩ棬"); + } + if (ArrayUtils.contains(split, "4")) { + ssbmhy.add("鍖荤枟閮ㄩ棬"); + } + if (ArrayUtils.contains(split, "5")) { + ssbmhy.add("鏃呮父绠$悊"); + } + if (ArrayUtils.contains(split, "6")) { + ssbmhy.add("鏂伴椈骞跨數"); + } + if (ArrayUtils.contains(split, "7")) { + ssbmhy.add("椋熷搧鍖昏嵂鐩戠潱绠$悊閮ㄩ棬"); + } + if (ArrayUtils.contains(split, "8")) { + ssbmhy.add("鏁欒偛绠$悊閮ㄩ棬"); + } + if (ArrayUtils.contains(split, "9")) { + ssbmhy.add("妫�瀵熼櫌"); + } + if (ArrayUtils.contains(split, "10")) { + ssbmhy.add("娉曢櫌"); + } + if (ArrayUtils.contains(split, "11")) { + ssbmhy.add("閲戣瀺閮ㄩ棬"); + } + if (ArrayUtils.contains(split, "12")) { + ssbmhy.add("浜ら�氶儴闂�"); + } + if (ArrayUtils.contains(split, "13")) { + ssbmhy.add("浣忔埧鍜屽煄涔″缓璁鹃儴闂�"); + } + if (ArrayUtils.contains(split, "14")) { + ssbmhy.add("姘村埄閮ㄩ棬"); + } + if (ArrayUtils.contains(split, "15")) { + ssbmhy.add("鏋椾笟閮ㄩ棬"); + } + if (ArrayUtils.contains(split, "16")) { + ssbmhy.add("瀹夊叏鐢熶骇鐩戠潱閮ㄩ棬"); + } + if (ArrayUtils.contains(split, "17")) { + ssbmhy.add("甯傛斂甯傚濮�"); + } + if (ArrayUtils.contains(split, "18")) { + ssbmhy.add("鍥藉湡灞�"); + } + this.SSBMHY = String.join("/", ssbmhy); + return SSBMHY; + } } diff --git a/ycl-pojo/src/main/java/com/ycl/platform/domain/result/UY/RecordMetaDSumResult.java b/ycl-pojo/src/main/java/com/ycl/platform/domain/result/UY/RecordMetaDSumResult.java index 9ed4af2..be732c7 100644 --- a/ycl-pojo/src/main/java/com/ycl/platform/domain/result/UY/RecordMetaDSumResult.java +++ b/ycl-pojo/src/main/java/com/ycl/platform/domain/result/UY/RecordMetaDSumResult.java @@ -7,6 +7,7 @@ import org.springframework.data.mongodb.core.mapping.Document; import java.util.Date; +import java.util.Objects; /** * 褰曞儚鍙敤鎬� @@ -72,6 +73,11 @@ private Integer recordStatus; /** + * 褰曞儚瀹屾暣鐘舵�侊紝1锛氬畬鏁达紝0锛氶棿姝囷紝-1锛氬紓甯� + */ + private String recordStatusText; + + /** * 缁熻鏃堕棿锛屾牸寮忎负鏃ユ湡瀛楃涓� */ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") @@ -82,4 +88,16 @@ */ private String tenantId; + public String getRecordStatusText() { + if (Objects.equals(recordStatus, 1)) { + recordStatusText = "瀹屾暣"; + } + if (Objects.equals(recordStatus, 0)) { + recordStatusText = "闂存瓏"; + } + if (Objects.equals(recordStatus, -1)) { + recordStatusText = "寮傚父"; + } + return recordStatusText; + } } diff --git a/ycl-pojo/src/main/java/com/ycl/platform/domain/result/UY/VideoOnlineResult.java b/ycl-pojo/src/main/java/com/ycl/platform/domain/result/UY/VideoOnlineResult.java index 7516d2f..6a7bb2f 100644 --- a/ycl-pojo/src/main/java/com/ycl/platform/domain/result/UY/VideoOnlineResult.java +++ b/ycl-pojo/src/main/java/com/ycl/platform/domain/result/UY/VideoOnlineResult.java @@ -55,6 +55,10 @@ */ private Integer icmpStatus; /** + * icmp鐘舵�� 2/1/-1/0 鍏ㄩ儴/鍦ㄧ嚎/绂荤嚎/鏈煡 + */ + private String icmpStatusText; + /** * 鏈�杩慽cmp鏃堕棿 */ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") @@ -101,6 +105,10 @@ */ private Integer status; /** + * 鍦ㄧ嚎鐘舵�� 2/1/-1/0 鍏ㄩ儴/鍦ㄧ嚎/绂荤嚎/鏈煡 + */ + private String statusText; + /** * 鐪佸巺鏍囩 */ private String tagStr; @@ -122,4 +130,35 @@ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") private Date vqdTime; + public String getIcmpStatusText() { + if (icmpStatus == 2) { + this.icmpStatusText = "鍏ㄩ儴"; + } + if (icmpStatus == 1) { + this.icmpStatusText = "鍦ㄧ嚎"; + } + if (icmpStatus == -1) { + this.icmpStatusText = "绂荤嚎"; + } + if (icmpStatus == 0) { + this.icmpStatusText = "鏈煡"; + } + return icmpStatusText; + } + + public String getStatusText() { + if (status == 2) { + this.statusText = "鍏ㄩ儴"; + } + if (status == 1) { + this.statusText = "鍦ㄧ嚎"; + } + if (status == -1) { + this.statusText = "绂荤嚎"; + } + if (status == 0) { + this.statusText = "鏈煡"; + } + return statusText; + } } diff --git a/ycl-pojo/src/main/java/com/ycl/platform/domain/vo/DeviceInfoVO.java b/ycl-pojo/src/main/java/com/ycl/platform/domain/vo/DeviceInfoVO.java new file mode 100644 index 0000000..bcb6362 --- /dev/null +++ b/ycl-pojo/src/main/java/com/ycl/platform/domain/vo/DeviceInfoVO.java @@ -0,0 +1,39 @@ +package com.ycl.platform.domain.vo; + +import com.ycl.platform.base.AbsVo; +import com.ycl.platform.domain.entity.DeviceInfo; +import org.springframework.lang.NonNull; +import org.springframework.beans.BeanUtils; +import lombok.Data; +import java.util.Date; + +/** + * 鍥芥爣绾ц仈鍚屾鏁版嵁灞曠ず + * + * @author xp + * @since 2024-08-21 + */ +@Data +public class DeviceInfoVO extends AbsVo { + + /** 宸ュ崟ID */ + private Integer workOrderId; + + /** 璁惧缂栧彿/鍥芥爣鐮� */ + private String deviceId; + + /** 璁惧閫氶亾ID */ + private String channelId; + + /** 鍒涘缓鏃堕棿 */ + private Date createTime; + + public static DeviceInfoVO getVoByEntity(@NonNull DeviceInfo entity, DeviceInfoVO vo) { + if(vo == null) { + vo = new DeviceInfoVO(); + } + BeanUtils.copyProperties(entity, vo); + return vo; + } + +} diff --git a/ycl-pojo/src/main/java/com/ycl/platform/domain/vo/WorkOrderYwConditionRecordVO.java b/ycl-pojo/src/main/java/com/ycl/platform/domain/vo/WorkOrderYwConditionRecordVO.java index 2e7abb0..9b9bdc1 100644 --- a/ycl-pojo/src/main/java/com/ycl/platform/domain/vo/WorkOrderYwConditionRecordVO.java +++ b/ycl-pojo/src/main/java/com/ycl/platform/domain/vo/WorkOrderYwConditionRecordVO.java @@ -34,6 +34,9 @@ /** 浣愯瘉鏉愭枡 */ private String ywProofMaterials; + /** 鏄惁绯荤粺娑堟伅 */ + private Boolean sysMsg; + public static WorkOrderYwConditionRecordVO getVoByEntity(@NonNull WorkOrderYwConditionRecord entity, WorkOrderYwConditionRecordVO vo) { if(vo == null) { vo = new WorkOrderYwConditionRecordVO(); diff --git a/ycl-pojo/src/main/java/com/ycl/platform/wvp/DownloadFileInfo.java b/ycl-pojo/src/main/java/com/ycl/platform/wvp/DownloadFileInfo.java new file mode 100644 index 0000000..b680852 --- /dev/null +++ b/ycl-pojo/src/main/java/com/ycl/platform/wvp/DownloadFileInfo.java @@ -0,0 +1,41 @@ +package com.ycl.platform.wvp; + +public class DownloadFileInfo { + + private String httpPath; + private String httpsPath; + private String httpDomainPath; + private String httpsDomainPath; + + public String getHttpPath() { + return httpPath; + } + + public void setHttpPath(String httpPath) { + this.httpPath = httpPath; + } + + public String getHttpsPath() { + return httpsPath; + } + + public void setHttpsPath(String httpsPath) { + this.httpsPath = httpsPath; + } + + public String getHttpDomainPath() { + return httpDomainPath; + } + + public void setHttpDomainPath(String httpDomainPath) { + this.httpDomainPath = httpDomainPath; + } + + public String getHttpsDomainPath() { + return httpsDomainPath; + } + + public void setHttpsDomainPath(String httpsDomainPath) { + this.httpsDomainPath = httpsDomainPath; + } +} diff --git a/ycl-pojo/src/main/java/com/ycl/platform/wvp/ErrorCode.java b/ycl-pojo/src/main/java/com/ycl/platform/wvp/ErrorCode.java new file mode 100644 index 0000000..1da3747 --- /dev/null +++ b/ycl-pojo/src/main/java/com/ycl/platform/wvp/ErrorCode.java @@ -0,0 +1,30 @@ +package com.ycl.platform.wvp; + +/** + * 鍏ㄥ眬閿欒鐮� + */ +public enum ErrorCode { + SUCCESS(0, "鎴愬姛"), + ERROR100(100, "澶辫触"), + ERROR400(400, "鍙傛暟鎴栨柟娉曢敊璇�"), + ERROR404(404, "璧勬簮鏈壘鍒�"), + ERROR403(403, "鏃犳潈闄愭搷浣�"), + ERROR401(401, "璇风櫥褰曞悗閲嶆柊璇锋眰"), + ERROR500(500, "绯荤粺寮傚父"); + + private final int code; + private final String msg; + + ErrorCode(int code, String msg) { + this.code = code; + this.msg = msg; + } + + public int getCode() { + return code; + } + + public String getMsg() { + return msg; + } +} diff --git a/ycl-pojo/src/main/java/com/ycl/platform/wvp/HookParam.java b/ycl-pojo/src/main/java/com/ycl/platform/wvp/HookParam.java new file mode 100644 index 0000000..45514d0 --- /dev/null +++ b/ycl-pojo/src/main/java/com/ycl/platform/wvp/HookParam.java @@ -0,0 +1,19 @@ +package com.ycl.platform.wvp; + +/** + * zlm hook浜嬩欢鐨勫弬鏁� + * @author lin + */ +public class HookParam { + private String mediaServerId; + + + + public String getMediaServerId() { + return mediaServerId; + } + + public void setMediaServerId(String mediaServerId) { + this.mediaServerId = mediaServerId; + } +} diff --git a/ycl-pojo/src/main/java/com/ycl/platform/wvp/MediaInfo.java b/ycl-pojo/src/main/java/com/ycl/platform/wvp/MediaInfo.java new file mode 100644 index 0000000..397dceb --- /dev/null +++ b/ycl-pojo/src/main/java/com/ycl/platform/wvp/MediaInfo.java @@ -0,0 +1,315 @@ +package com.ycl.platform.wvp; + +import com.alibaba.fastjson2.JSONArray; +import com.alibaba.fastjson2.JSONObject; +import io.swagger.v3.oas.annotations.media.Schema; + +import java.util.List; + +/** + * 瑙嗛淇℃伅 + */ +@Schema(description = "瑙嗛淇℃伅") +public class MediaInfo { + @Schema(description = "搴旂敤鍚�") + private String app; + @Schema(description = "娴両D") + private String stream; + @Schema(description = "娴佸獟浣撹妭鐐�") + private MediaServer mediaServer; + @Schema(description = "鍗忚") + private String schema; + + @Schema(description = "瑙傜湅浜烘暟") + private Integer readerCount; + @Schema(description = "瑙嗛缂栫爜绫诲瀷") + private String videoCodec; + @Schema(description = "瑙嗛瀹藉害") + private Integer width; + @Schema(description = "瑙嗛楂樺害") + private Integer height; + @Schema(description = "闊抽缂栫爜绫诲瀷") + private String audioCodec; + @Schema(description = "闊抽閫氶亾鏁�") + private Integer audioChannels; + @Schema(description = "闊抽閲囨牱鐜�") + private Integer audioSampleRate; + @Schema(description = "闊抽閲囨牱鐜�") + private Long duration; + @Schema(description = "鍦ㄧ嚎") + private Boolean online; + @Schema(description = "unknown = 0,rtmp_push=1,rtsp_push=2,rtp_push=3,pull=4,ffmpeg_pull=5,mp4_vod=6,device_chn=7") + private Integer originType; + @Schema(description = "瀛樻椿鏃堕棿锛屽崟浣嶇") + private Long aliveSecond; + @Schema(description = "鏁版嵁浜х敓閫熷害锛屽崟浣峛yte/s") + private Long bytesSpeed; + @Schema(description = "閴存潈鍙傛暟") + private String callId; + + public static MediaInfo getInstance(JSONObject jsonObject, MediaServer mediaServer) { + MediaInfo mediaInfo = new MediaInfo(); + mediaInfo.setMediaServer(mediaServer); + String app = jsonObject.getString("app"); + mediaInfo.setApp(app); + String stream = jsonObject.getString("stream"); + mediaInfo.setStream(stream); + String schema = jsonObject.getString("schema"); + mediaInfo.setSchema(schema); + Integer totalReaderCount = jsonObject.getInteger("totalReaderCount"); + Boolean online = jsonObject.getBoolean("online"); + Integer originType = jsonObject.getInteger("originType"); + Long aliveSecond = jsonObject.getLong("aliveSecond"); + Long bytesSpeed = jsonObject.getLong("bytesSpeed"); + if (totalReaderCount != null) { + mediaInfo.setReaderCount(totalReaderCount); + } + if (online != null) { + mediaInfo.setOnline(online); + } + if (originType != null) { + mediaInfo.setOriginType(originType); + } + if (aliveSecond != null) { + mediaInfo.setAliveSecond(aliveSecond); + } + if (bytesSpeed != null) { + mediaInfo.setBytesSpeed(bytesSpeed); + } + JSONArray jsonArray = jsonObject.getJSONArray("tracks"); + if (jsonArray.isEmpty()) { + return null; + } + for (int i = 0; i < jsonArray.size(); i++) { + JSONObject trackJson = jsonArray.getJSONObject(i); + Integer channels = trackJson.getInteger("channels"); + Integer codecId = trackJson.getInteger("codec_id"); + Integer codecType = trackJson.getInteger("codec_type"); + Integer sampleRate = trackJson.getInteger("sample_rate"); + Integer height = trackJson.getInteger("height"); + Integer width = trackJson.getInteger("height"); + Long duration = trackJson.getLongValue("duration"); + if (channels != null) { + mediaInfo.setAudioChannels(channels); + } + if (sampleRate != null) { + mediaInfo.setAudioSampleRate(sampleRate); + } + if (height != null) { + mediaInfo.setHeight(height); + } + if (width != null) { + mediaInfo.setWidth(width); + } + if (duration > 0L) { + mediaInfo.setDuration(duration); + } + if (codecId != null) { + switch (codecId) { + case 0: + mediaInfo.setVideoCodec("H264"); + break; + case 1: + mediaInfo.setVideoCodec("H265"); + break; + case 2: + mediaInfo.setAudioCodec("AAC"); + break; + case 3: + mediaInfo.setAudioCodec("G711A"); + break; + case 4: + mediaInfo.setAudioCodec("G711U"); + break; + } + } + } + return mediaInfo; + } + + public static MediaInfo getInstance(OnStreamChangedHookParam param, MediaServer mediaServer) { + + MediaInfo mediaInfo = new MediaInfo(); + mediaInfo.setApp(param.getApp()); + mediaInfo.setStream(param.getStream()); + mediaInfo.setSchema(param.getSchema()); + mediaInfo.setMediaServer(mediaServer); + mediaInfo.setReaderCount(param.getTotalReaderCount()); + mediaInfo.setOnline(param.isRegist()); + mediaInfo.setOriginType(param.getOriginType()); + mediaInfo.setAliveSecond(param.getAliveSecond()); + mediaInfo.setBytesSpeed(param.getBytesSpeed()); + List<OnStreamChangedHookParam.MediaTrack> tracks = param.getTracks(); + if (tracks == null || tracks.isEmpty()) { + return mediaInfo; + } + for (OnStreamChangedHookParam.MediaTrack mediaTrack : tracks) { + switch (mediaTrack.getCodec_id()) { + case 0: + mediaInfo.setVideoCodec("H264"); + break; + case 1: + mediaInfo.setVideoCodec("H265"); + break; + case 2: + mediaInfo.setAudioCodec("AAC"); + break; + case 3: + mediaInfo.setAudioCodec("G711A"); + break; + case 4: + mediaInfo.setAudioCodec("G711U"); + break; + } + if (mediaTrack.getSample_rate() > 0) { + mediaInfo.setAudioSampleRate(mediaTrack.getSample_rate()); + } + if (mediaTrack.getChannels() > 0) { + mediaInfo.setAudioChannels(mediaTrack.getChannels()); + } + if (mediaTrack.getHeight() > 0) { + mediaInfo.setHeight(mediaTrack.getHeight()); + } + if (mediaTrack.getWidth() > 0) { + mediaInfo.setWidth(mediaTrack.getWidth()); + } + } + return mediaInfo; + } + + public Integer getReaderCount() { + return readerCount; + } + + public void setReaderCount(Integer readerCount) { + this.readerCount = readerCount; + } + + public String getVideoCodec() { + return videoCodec; + } + + public void setVideoCodec(String videoCodec) { + this.videoCodec = videoCodec; + } + + public Integer getWidth() { + return width; + } + + public void setWidth(Integer width) { + this.width = width; + } + + public Integer getHeight() { + return height; + } + + public void setHeight(Integer height) { + this.height = height; + } + + public String getAudioCodec() { + return audioCodec; + } + + public void setAudioCodec(String audioCodec) { + this.audioCodec = audioCodec; + } + + public Integer getAudioChannels() { + return audioChannels; + } + + public void setAudioChannels(Integer audioChannels) { + this.audioChannels = audioChannels; + } + + public Integer getAudioSampleRate() { + return audioSampleRate; + } + + public void setAudioSampleRate(Integer audioSampleRate) { + this.audioSampleRate = audioSampleRate; + } + + public Long getDuration() { + return duration; + } + + public void setDuration(Long duration) { + this.duration = duration; + } + + public Boolean getOnline() { + return online; + } + + public void setOnline(Boolean online) { + this.online = online; + } + + public Integer getOriginType() { + return originType; + } + + public void setOriginType(Integer originType) { + this.originType = originType; + } + + public Long getAliveSecond() { + return aliveSecond; + } + + public void setAliveSecond(Long aliveSecond) { + this.aliveSecond = aliveSecond; + } + + public Long getBytesSpeed() { + return bytesSpeed; + } + + public void setBytesSpeed(Long bytesSpeed) { + this.bytesSpeed = bytesSpeed; + } + + public String getApp() { + return app; + } + + public void setApp(String app) { + this.app = app; + } + + public String getStream() { + return stream; + } + + public void setStream(String stream) { + this.stream = stream; + } + + public MediaServer getMediaServer() { + return mediaServer; + } + + public void setMediaServer(MediaServer mediaServer) { + this.mediaServer = mediaServer; + } + + public String getSchema() { + return schema; + } + + public void setSchema(String schema) { + this.schema = schema; + } + + public String getCallId() { + return callId; + } + + public void setCallId(String callId) { + this.callId = callId; + } +} diff --git a/ycl-pojo/src/main/java/com/ycl/platform/wvp/MediaServer.java b/ycl-pojo/src/main/java/com/ycl/platform/wvp/MediaServer.java new file mode 100644 index 0000000..153cf3a --- /dev/null +++ b/ycl-pojo/src/main/java/com/ycl/platform/wvp/MediaServer.java @@ -0,0 +1,390 @@ +package com.ycl.platform.wvp; + + +import io.swagger.v3.oas.annotations.media.Schema; +import org.springframework.util.ObjectUtils; + +@Schema(description = "娴佸獟浣撴湇鍔′俊鎭�") +public class MediaServer { + + @Schema(description = "ID") + private String id; + + @Schema(description = "IP") + private String ip; + + @Schema(description = "hook浣跨敤鐨処P锛坺lm璁块棶WVP浣跨敤鐨処P锛�") + private String hookIp = "127.0.0.1"; + + @Schema(description = "SDP IP") + private String sdpIp; + + @Schema(description = "娴両P") + private String streamIp; + + @Schema(description = "HTTP绔彛") + private int httpPort; + + @Schema(description = "HTTPS绔彛") + private int httpSSlPort; + + @Schema(description = "RTMP绔彛") + private int rtmpPort; + + @Schema(description = "flv绔彛") + private int flvPort; + + @Schema(description = "https-flv绔彛") + private int flvSSLPort; + + @Schema(description = "ws-flv绔彛") + private int wsFlvPort; + + @Schema(description = "wss-flv绔彛") + private int wsFlvSSLPort; + + @Schema(description = "RTMPS绔彛") + private int rtmpSSlPort; + + @Schema(description = "RTP鏀舵祦绔彛锛堝崟绔彛妯″紡鏈夌敤锛�") + private int rtpProxyPort; + + @Schema(description = "RTSP绔彛") + private int rtspPort; + + @Schema(description = "RTSPS绔彛") + private int rtspSSLPort; + + @Schema(description = "鏄惁寮�鍚嚜鍔ㄩ厤缃甖LM") + private boolean autoConfig; + + @Schema(description = "ZLM閴存潈鍙傛暟") + private String secret; + + @Schema(description = "keepalive hook瑙﹀彂闂撮殧,鍗曚綅绉�") + private Float hookAliveInterval; + + @Schema(description = "鏄惁浣跨敤澶氱鍙fā寮�") + private boolean rtpEnable; + + @Schema(description = "鐘舵��") + private boolean status; + + @Schema(description = "澶氱鍙TP鏀舵祦绔彛鑼冨洿") + private String rtpPortRange; + + @Schema(description = "RTP鍙戞祦绔彛鑼冨洿") + private String sendRtpPortRange; + + @Schema(description = "assist鏈嶅姟绔彛") + private int recordAssistPort; + + @Schema(description = "鍒涘缓鏃堕棿") + private String createTime; + + @Schema(description = "鏇存柊鏃堕棿") + private String updateTime; + + @Schema(description = "涓婃蹇冭烦鏃堕棿") + private String lastKeepaliveTime; + + @Schema(description = "鏄惁鏄粯璁LM") + private boolean defaultServer; + + @Schema(description = "褰曞儚瀛樺偍鏃堕暱") + private int recordDay; + + @Schema(description = "褰曞儚瀛樺偍璺緞") + private String recordPath; + @Schema(description = "绫诲瀷锛� zlm/abl") + private String type; + + @Schema(description = "杞爜鐨勫墠缂�") + private String transcodeSuffix; + + public MediaServer() { + } + + public MediaServer(ZLMServerConfig zlmServerConfig, String sipIp) { + id = zlmServerConfig.getGeneralMediaServerId(); + ip = zlmServerConfig.getIp(); + hookIp = ObjectUtils.isEmpty(zlmServerConfig.getHookIp())? sipIp: zlmServerConfig.getHookIp(); + sdpIp = ObjectUtils.isEmpty(zlmServerConfig.getSdpIp())? zlmServerConfig.getIp(): zlmServerConfig.getSdpIp(); + streamIp = ObjectUtils.isEmpty(zlmServerConfig.getStreamIp())? zlmServerConfig.getIp(): zlmServerConfig.getStreamIp(); + httpPort = zlmServerConfig.getHttpPort(); + flvPort = zlmServerConfig.getHttpPort(); + wsFlvPort = zlmServerConfig.getHttpPort(); + httpSSlPort = zlmServerConfig.getHttpSSLport(); + flvSSLPort = zlmServerConfig.getHttpSSLport(); + wsFlvSSLPort = zlmServerConfig.getHttpSSLport(); + rtmpPort = zlmServerConfig.getRtmpPort(); + rtmpSSlPort = zlmServerConfig.getRtmpSslPort(); + rtpProxyPort = zlmServerConfig.getRtpProxyPort(); + rtspPort = zlmServerConfig.getRtspPort(); + rtspSSLPort = zlmServerConfig.getRtspSSlport(); + autoConfig = true; // 榛樿鍊紅rue; + secret = zlmServerConfig.getApiSecret(); + hookAliveInterval = zlmServerConfig.getHookAliveInterval(); + rtpEnable = false; // 榛樿浣跨敤鍗曠鍙�;鐩村埌鐢ㄦ埛鑷繁璁剧疆寮�鍚绔彛 + rtpPortRange = zlmServerConfig.getPortRange().replace("_",","); // 榛樿浣跨敤30000,30500浣滀负绾ц仈鏃跺彂閫佹祦鐨勭鍙e彿 + recordAssistPort = 0; // 榛樿鍏抽棴 + transcodeSuffix = zlmServerConfig.getTranscodeSuffix(); + + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getIp() { + return ip; + } + + public void setIp(String ip) { + this.ip = ip; + } + + public String getHookIp() { + return hookIp; + } + + public void setHookIp(String hookIp) { + this.hookIp = hookIp; + } + + public String getSdpIp() { + return sdpIp; + } + + public void setSdpIp(String sdpIp) { + this.sdpIp = sdpIp; + } + + public String getStreamIp() { + return streamIp; + } + + public void setStreamIp(String streamIp) { + this.streamIp = streamIp; + } + + public int getHttpPort() { + return httpPort; + } + + public void setHttpPort(int httpPort) { + this.httpPort = httpPort; + } + + public int getHttpSSlPort() { + return httpSSlPort; + } + + public void setHttpSSlPort(int httpSSlPort) { + this.httpSSlPort = httpSSlPort; + } + + public int getRtmpPort() { + return rtmpPort; + } + + public void setRtmpPort(int rtmpPort) { + this.rtmpPort = rtmpPort; + } + + public int getRtmpSSlPort() { + return rtmpSSlPort; + } + + public void setRtmpSSlPort(int rtmpSSlPort) { + this.rtmpSSlPort = rtmpSSlPort; + } + + public int getRtpProxyPort() { + return rtpProxyPort; + } + + public void setRtpProxyPort(int rtpProxyPort) { + this.rtpProxyPort = rtpProxyPort; + } + + public int getRtspPort() { + return rtspPort; + } + + public void setRtspPort(int rtspPort) { + this.rtspPort = rtspPort; + } + + public int getRtspSSLPort() { + return rtspSSLPort; + } + + public void setRtspSSLPort(int rtspSSLPort) { + this.rtspSSLPort = rtspSSLPort; + } + + public boolean isAutoConfig() { + return autoConfig; + } + + public void setAutoConfig(boolean autoConfig) { + this.autoConfig = autoConfig; + } + + public String getSecret() { + return secret; + } + + public void setSecret(String secret) { + this.secret = secret; + } + + public boolean isRtpEnable() { + return rtpEnable; + } + + public void setRtpEnable(boolean rtpEnable) { + this.rtpEnable = rtpEnable; + } + + public String getRtpPortRange() { + return rtpPortRange; + } + + public void setRtpPortRange(String rtpPortRange) { + this.rtpPortRange = rtpPortRange; + } + + public int getRecordAssistPort() { + return recordAssistPort; + } + + public void setRecordAssistPort(int recordAssistPort) { + this.recordAssistPort = recordAssistPort; + } + + public boolean isDefaultServer() { + return defaultServer; + } + + public void setDefaultServer(boolean defaultServer) { + this.defaultServer = defaultServer; + } + + public String getCreateTime() { + return createTime; + } + + public void setCreateTime(String createTime) { + this.createTime = createTime; + } + + public String getUpdateTime() { + return updateTime; + } + + public void setUpdateTime(String updateTime) { + this.updateTime = updateTime; + } + + public boolean isStatus() { + return status; + } + + public void setStatus(boolean status) { + this.status = status; + } + + public String getLastKeepaliveTime() { + return lastKeepaliveTime; + } + + public void setLastKeepaliveTime(String lastKeepaliveTime) { + this.lastKeepaliveTime = lastKeepaliveTime; + } + + public Float getHookAliveInterval() { + return hookAliveInterval; + } + + public void setHookAliveInterval(Float hookAliveInterval) { + this.hookAliveInterval = hookAliveInterval; + } + + public String getSendRtpPortRange() { + return sendRtpPortRange; + } + + public void setSendRtpPortRange(String sendRtpPortRange) { + this.sendRtpPortRange = sendRtpPortRange; + } + + public int getRecordDay() { + return recordDay; + } + + public void setRecordDay(int recordDay) { + this.recordDay = recordDay; + } + + public String getRecordPath() { + return recordPath; + } + + public void setRecordPath(String recordPath) { + this.recordPath = recordPath; + } + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + public int getFlvPort() { + return flvPort; + } + + public void setFlvPort(int flvPort) { + this.flvPort = flvPort; + } + + public int getFlvSSLPort() { + return flvSSLPort; + } + + public void setFlvSSLPort(int flvSSLPort) { + this.flvSSLPort = flvSSLPort; + } + + public int getWsFlvPort() { + return wsFlvPort; + } + + public void setWsFlvPort(int wsFlvPort) { + this.wsFlvPort = wsFlvPort; + } + + public int getWsFlvSSLPort() { + return wsFlvSSLPort; + } + + public void setWsFlvSSLPort(int wsFlvSSLPort) { + this.wsFlvSSLPort = wsFlvSSLPort; + } + + public String getTranscodeSuffix() { + return transcodeSuffix; + } + + public void setTranscodeSuffix(String transcodeSuffix) { + this.transcodeSuffix = transcodeSuffix; + } +} diff --git a/ycl-pojo/src/main/java/com/ycl/platform/wvp/OnStreamChangedHookParam.java b/ycl-pojo/src/main/java/com/ycl/platform/wvp/OnStreamChangedHookParam.java new file mode 100644 index 0000000..77af473 --- /dev/null +++ b/ycl-pojo/src/main/java/com/ycl/platform/wvp/OnStreamChangedHookParam.java @@ -0,0 +1,534 @@ +package com.ycl.platform.wvp; + +import java.util.List; +import java.util.Map; + +/** + * @author lin + */ +public class OnStreamChangedHookParam extends HookParam { + + /** + * 娉ㄥ唽/娉ㄩ攢 + */ + private boolean regist; + + /** + * 搴旂敤鍚� + */ + private String app; + + /** + * 娴乮d + */ + private String stream; + + /** + * 鎺ㄦ祦閴存潈Id + */ + private String callId; + + /** + * 瑙傜湅鎬讳汉鏁帮紝鍖呮嫭hls/rtsp/rtmp/http-flv/ws-flv + */ + private int totalReaderCount; + + /** + * 鍗忚 鍖呮嫭hls/rtsp/rtmp/http-flv/ws-flv + */ + private String schema; + + + /** + * 浜х敓婧愮被鍨嬶紝 + * unknown = 0, + * rtmp_push=1, + * rtsp_push=2, + * rtp_push=3, + * pull=4, + * ffmpeg_pull=5, + * mp4_vod=6, + * device_chn=7 + */ + private int originType; + + /** + * 瀹㈡埛绔拰鏈嶅姟鍣ㄧ綉缁滀俊鎭紝鍙兘涓簄ull绫诲瀷 + */ + private OriginSock originSock; + + /** + * 浜х敓婧愮被鍨嬬殑瀛楃涓叉弿杩� + */ + private String originTypeStr; + + /** + * 浜х敓婧愮殑url + */ + private String originUrl; + + /** + * 鏈嶅姟鍣╥d + */ + private String severId; + + /** + * GMT unix绯荤粺鏃堕棿鎴筹紝鍗曚綅绉� + */ + private Long createStamp; + + /** + * 瀛樻椿鏃堕棿锛屽崟浣嶇 + */ + private Long aliveSecond; + + /** + * 鏁版嵁浜х敓閫熷害锛屽崟浣峛yte/s + */ + private Long bytesSpeed; + + /** + * 闊宠棰戣建閬� + */ + private List<MediaTrack> tracks; + + /** + * 闊宠棰戣建閬� + */ + private String vhost; + + /** + * 棰濆鐨勫弬鏁板瓧绗︿覆 + */ + private String params; + + /** + * 棰濆鐨勫弬鏁� + */ + private Map<String, String> paramMap; + + public boolean isRegist() { + return regist; + } + + public void setRegist(boolean regist) { + this.regist = regist; + } + + /** + * 鏄惁鏄痙ocker閮ㄧ讲锛� docker閮ㄧ讲涓嶄細鑷姩鏇存柊zlm浣跨敤鐨勭鍙o紝闇�瑕佽嚜宸辨墜鍔ㄤ慨鏀� + */ + private boolean docker; + + public static class MediaTrack { + /** + * 闊抽閫氶亾鏁� + */ + private int channels; + + /** + * H264 = 0, H265 = 1, AAC = 2, G711A = 3, G711U = 4 + */ + private int codec_id; + + /** + * 缂栫爜绫诲瀷鍚嶇О CodecAAC CodecH264 + */ + private String codec_id_name; + + /** + * Video = 0, Audio = 1 + */ + private int codec_type; + + /** + * 杞ㄩ亾鏄惁鍑嗗灏辩华 + */ + private boolean ready; + + /** + * 闊抽閲囨牱浣嶆暟 + */ + private int sample_bit; + + /** + * 闊抽閲囨牱鐜� + */ + private int sample_rate; + + /** + * 瑙嗛fps + */ + private float fps; + + /** + * 瑙嗛楂� + */ + private int height; + + /** + * 瑙嗛瀹� + */ + private int width; + + /** + * 甯ф暟 + */ + private int frames; + + /** + * 鍏抽敭甯ф暟 + */ + private int key_frames; + + /** + * GOP澶у皬 + */ + private int gop_size; + + /** + * GOP闂撮殧鏃堕暱(ms) + */ + private int gop_interval_ms; + + /** + * 涓㈠抚鐜� + */ + private float loss; + + public int getChannels() { + return channels; + } + + public void setChannels(int channels) { + this.channels = channels; + } + + public int getCodec_id() { + return codec_id; + } + + public void setCodec_id(int codec_id) { + this.codec_id = codec_id; + } + + public String getCodec_id_name() { + return codec_id_name; + } + + public void setCodec_id_name(String codec_id_name) { + this.codec_id_name = codec_id_name; + } + + public int getCodec_type() { + return codec_type; + } + + public void setCodec_type(int codec_type) { + this.codec_type = codec_type; + } + + public boolean isReady() { + return ready; + } + + public void setReady(boolean ready) { + this.ready = ready; + } + + public int getSample_bit() { + return sample_bit; + } + + public void setSample_bit(int sample_bit) { + this.sample_bit = sample_bit; + } + + public int getSample_rate() { + return sample_rate; + } + + public void setSample_rate(int sample_rate) { + this.sample_rate = sample_rate; + } + + public float getFps() { + return fps; + } + + public void setFps(float fps) { + this.fps = fps; + } + + public int getHeight() { + return height; + } + + public void setHeight(int height) { + this.height = height; + } + + public int getWidth() { + return width; + } + + public void setWidth(int width) { + this.width = width; + } + + public int getFrames() { + return frames; + } + + public void setFrames(int frames) { + this.frames = frames; + } + + public int getKey_frames() { + return key_frames; + } + + public void setKey_frames(int key_frames) { + this.key_frames = key_frames; + } + + public int getGop_size() { + return gop_size; + } + + public void setGop_size(int gop_size) { + this.gop_size = gop_size; + } + + public int getGop_interval_ms() { + return gop_interval_ms; + } + + public void setGop_interval_ms(int gop_interval_ms) { + this.gop_interval_ms = gop_interval_ms; + } + + public float getLoss() { + return loss; + } + + public void setLoss(float loss) { + this.loss = loss; + } + } + + public static class OriginSock{ + private String identifier; + private String local_ip; + private int local_port; + private String peer_ip; + private int peer_port; + + public String getIdentifier() { + return identifier; + } + + public void setIdentifier(String identifier) { + this.identifier = identifier; + } + + public String getLocal_ip() { + return local_ip; + } + + public void setLocal_ip(String local_ip) { + this.local_ip = local_ip; + } + + public int getLocal_port() { + return local_port; + } + + public void setLocal_port(int local_port) { + this.local_port = local_port; + } + + public String getPeer_ip() { + return peer_ip; + } + + public void setPeer_ip(String peer_ip) { + this.peer_ip = peer_ip; + } + + public int getPeer_port() { + return peer_port; + } + + public void setPeer_port(int peer_port) { + this.peer_port = peer_port; + } + } + + private StreamContent streamInfo; + + public String getApp() { + return app; + } + + public void setApp(String app) { + this.app = app; + } + + public String getStream() { + return stream; + } + + public void setStream(String stream) { + this.stream = stream; + } + + public int getTotalReaderCount() { + return totalReaderCount; + } + + public void setTotalReaderCount(int totalReaderCount) { + this.totalReaderCount = totalReaderCount; + } + + + public int getOriginType() { + return originType; + } + + public void setOriginType(int originType) { + this.originType = originType; + } + + + public String getOriginTypeStr() { + return originTypeStr; + } + + public void setOriginTypeStr(String originTypeStr) { + this.originTypeStr = originTypeStr; + } + + public String getOriginUrl() { + return originUrl; + } + + public void setOriginUrl(String originUrl) { + this.originUrl = originUrl; + } + + public Long getCreateStamp() { + return createStamp; + } + + public void setCreateStamp(Long createStamp) { + this.createStamp = createStamp; + } + + public Long getAliveSecond() { + return aliveSecond; + } + + public void setAliveSecond(Long aliveSecond) { + this.aliveSecond = aliveSecond; + } + + public List<MediaTrack> getTracks() { + return tracks; + } + + public void setTracks(List<MediaTrack> tracks) { + this.tracks = tracks; + } + + public String getSchema() { + return schema; + } + + public void setSchema(String schema) { + this.schema = schema; + } + + public void setOriginSock(OriginSock originSock) { + this.originSock = originSock; + } + + public Long getBytesSpeed() { + return bytesSpeed; + } + + public void setBytesSpeed(Long bytesSpeed) { + this.bytesSpeed = bytesSpeed; + } + + public String getVhost() { + return vhost; + } + + public void setVhost(String vhost) { + this.vhost = vhost; + } + + public OriginSock getOriginSock() { + return originSock; + } + + public boolean isDocker() { + return docker; + } + + public void setDocker(boolean docker) { + this.docker = docker; + } + + public StreamContent getStreamInfo() { + return streamInfo; + } + + public void setStreamInfo(StreamContent streamInfo) { + this.streamInfo = streamInfo; + } + + public String getSeverId() { + return severId; + } + + public void setSeverId(String severId) { + this.severId = severId; + } + + public String getCallId() { + return callId; + } + + public void setCallId(String callId) { + this.callId = callId; + } + + + public Map<String, String> getParamMap() { + return paramMap; + } + + public void setParamMap(Map<String, String> paramMap) { + this.paramMap = paramMap; + } + + public String getParams() { + return params; + } + + public void setParams(String params) { + this.params = params; + } + + @Override + public String toString() { + return "OnStreamChangedHookParam{" + + "regist=" + regist + + ", app='" + app + '\'' + + ", stream='" + stream + '\'' + + ", severId='" + severId + '\'' + + '}'; + } +} diff --git a/ycl-pojo/src/main/java/com/ycl/platform/wvp/StreamContent.java b/ycl-pojo/src/main/java/com/ycl/platform/wvp/StreamContent.java new file mode 100644 index 0000000..55f44e3 --- /dev/null +++ b/ycl-pojo/src/main/java/com/ycl/platform/wvp/StreamContent.java @@ -0,0 +1,442 @@ +package com.ycl.platform.wvp; + +import io.swagger.v3.oas.annotations.media.Schema; + +@Schema(description = "娴佷俊鎭�") +public class StreamContent { + + @Schema(description = "搴旂敤鍚�") + private String app; + + @Schema(description = "娴両D") + private String stream; + + @Schema(description = "IP") + private String ip; + + @Schema(description = "HTTP-FLV娴佸湴鍧�") + private String flv; + + @Schema(description = "HTTPS-FLV娴佸湴鍧�") + private String https_flv; + + @Schema(description = "Websocket-FLV娴佸湴鍧�") + private String ws_flv; + + @Schema(description = "Websockets-FLV娴佸湴鍧�") + private String wss_flv; + + @Schema(description = "HTTP-FMP4娴佸湴鍧�") + private String fmp4; + + @Schema(description = "HTTPS-FMP4娴佸湴鍧�") + private String https_fmp4; + + @Schema(description = "Websocket-FMP4娴佸湴鍧�") + private String ws_fmp4; + + @Schema(description = "Websockets-FMP4娴佸湴鍧�") + private String wss_fmp4; + + @Schema(description = "HLS娴佸湴鍧�") + private String hls; + + @Schema(description = "HTTPS-HLS娴佸湴鍧�") + private String https_hls; + + @Schema(description = "Websocket-HLS娴佸湴鍧�") + private String ws_hls; + + @Schema(description = "Websockets-HLS娴佸湴鍧�") + private String wss_hls; + + @Schema(description = "HTTP-TS娴佸湴鍧�") + private String ts; + + @Schema(description = "HTTPS-TS娴佸湴鍧�") + private String https_ts; + + @Schema(description = "Websocket-TS娴佸湴鍧�") + private String ws_ts; + + @Schema(description = "Websockets-TS娴佸湴鍧�") + private String wss_ts; + + @Schema(description = "RTMP娴佸湴鍧�") + private String rtmp; + + @Schema(description = "RTMPS娴佸湴鍧�") + private String rtmps; + + @Schema(description = "RTSP娴佸湴鍧�") + private String rtsp; + + @Schema(description = "RTSPS娴佸湴鍧�") + private String rtsps; + + @Schema(description = "RTC娴佸湴鍧�") + private String rtc; + + @Schema(description = "RTCS娴佸湴鍧�") + private String rtcs; + + @Schema(description = "娴佸獟浣揑D") + private String mediaServerId; + + @Schema(description = "娴佺紪鐮佷俊鎭�") + private MediaInfo mediaInfo; + + @Schema(description = "寮�濮嬫椂闂�") + private String startTime; + + @Schema(description = "缁撴潫鏃堕棿") + private String endTime; + + @Schema(description = "鏂囦欢涓嬭浇鍦板潃锛堝綍鍍忎笅杞戒娇鐢級") + private DownloadFileInfo downLoadFilePath; + + @Schema(description = "杞爜鍚庣殑瑙嗛娴�") + private StreamContent transcodeStream; + + private double progress; + + public StreamContent(StreamInfo streamInfo) { + if (streamInfo == null) { + return; + } + this.app = streamInfo.getApp(); + this.stream = streamInfo.getStream(); + if (streamInfo.getFlv() != null) { + this.flv = streamInfo.getFlv().getUrl(); + } + if (streamInfo.getHttps_flv() != null) { + this.https_flv = streamInfo.getHttps_flv().getUrl(); + } + if (streamInfo.getWs_flv() != null) { + this.ws_flv = streamInfo.getWs_flv().getUrl(); + } + if (streamInfo.getWss_flv() != null) { + this.wss_flv = streamInfo.getWss_flv().getUrl(); + } + if (streamInfo.getFmp4() != null) { + this.fmp4 = streamInfo.getFmp4().getUrl(); + } + if (streamInfo.getHttps_fmp4() != null) { + this.https_fmp4 = streamInfo.getHttps_fmp4().getUrl(); + } + if (streamInfo.getWs_fmp4() != null) { + this.ws_fmp4 = streamInfo.getWs_fmp4().getUrl(); + } + if (streamInfo.getWss_fmp4() != null) { + this.wss_fmp4 = streamInfo.getWss_fmp4().getUrl(); + } + if (streamInfo.getHls() != null) { + this.hls = streamInfo.getHls().getUrl(); + } + if (streamInfo.getHttps_hls() != null) { + this.https_hls = streamInfo.getHttps_hls().getUrl(); + } + if (streamInfo.getWs_hls() != null) { + this.ws_hls = streamInfo.getWs_hls().getUrl(); + } + if (streamInfo.getWss_hls() != null) { + this.wss_hls = streamInfo.getWss_hls().getUrl(); + } + if (streamInfo.getTs() != null) { + this.ts = streamInfo.getTs().getUrl(); + } + if (streamInfo.getHttps_ts() != null) { + this.https_ts = streamInfo.getHttps_ts().getUrl(); + } + if (streamInfo.getWs_ts() != null) { + this.ws_ts = streamInfo.getWs_ts().getUrl(); + } + if (streamInfo.getRtmp() != null) { + this.rtmp = streamInfo.getRtmp().getUrl(); + } + if (streamInfo.getRtmps() != null) { + this.rtmps = streamInfo.getRtmps().getUrl(); + } + if (streamInfo.getRtsp() != null) { + this.rtsp = streamInfo.getRtsp().getUrl(); + } + if (streamInfo.getRtsps() != null) { + this.rtsps = streamInfo.getRtsps().getUrl(); + } + if (streamInfo.getRtc() != null) { + this.rtc = streamInfo.getRtc().getUrl(); + } + if (streamInfo.getRtcs() != null) { + this.rtcs = streamInfo.getRtcs().getUrl(); + } + + this.mediaServerId = streamInfo.getMediaServerId(); + this.mediaInfo = streamInfo.getMediaInfo(); + this.startTime = streamInfo.getStartTime(); + this.endTime = streamInfo.getEndTime(); + this.progress = streamInfo.getProgress(); + + if (streamInfo.getDownLoadFilePath() != null) { + this.downLoadFilePath = streamInfo.getDownLoadFilePath(); + } + if (streamInfo.getTranscodeStream() != null) { + this.transcodeStream = new StreamContent(streamInfo.getTranscodeStream()); + } + } + + public StreamContent getTranscodeStream() { + return transcodeStream; + } + + public void setTranscodeStream(StreamContent transcodeStream) { + this.transcodeStream = transcodeStream; + } + + public String getApp() { + return app; + } + + public void setApp(String app) { + this.app = app; + } + + public String getStream() { + return stream; + } + + public void setStream(String stream) { + this.stream = stream; + } + + public String getIp() { + return ip; + } + + public void setIp(String ip) { + this.ip = ip; + } + + public String getFlv() { + return flv; + } + + public void setFlv(String flv) { + this.flv = flv; + } + + public String getHttps_flv() { + return https_flv; + } + + public void setHttps_flv(String https_flv) { + this.https_flv = https_flv; + } + + public String getWs_flv() { + return ws_flv; + } + + public void setWs_flv(String ws_flv) { + this.ws_flv = ws_flv; + } + + public String getWss_flv() { + return wss_flv; + } + + public void setWss_flv(String wss_flv) { + this.wss_flv = wss_flv; + } + + public String getFmp4() { + return fmp4; + } + + public void setFmp4(String fmp4) { + this.fmp4 = fmp4; + } + + public String getHttps_fmp4() { + return https_fmp4; + } + + public void setHttps_fmp4(String https_fmp4) { + this.https_fmp4 = https_fmp4; + } + + public String getWs_fmp4() { + return ws_fmp4; + } + + public void setWs_fmp4(String ws_fmp4) { + this.ws_fmp4 = ws_fmp4; + } + + public String getWss_fmp4() { + return wss_fmp4; + } + + public void setWss_fmp4(String wss_fmp4) { + this.wss_fmp4 = wss_fmp4; + } + + public String getHls() { + return hls; + } + + public void setHls(String hls) { + this.hls = hls; + } + + public String getHttps_hls() { + return https_hls; + } + + public void setHttps_hls(String https_hls) { + this.https_hls = https_hls; + } + + public String getWs_hls() { + return ws_hls; + } + + public void setWs_hls(String ws_hls) { + this.ws_hls = ws_hls; + } + + public String getWss_hls() { + return wss_hls; + } + + public void setWss_hls(String wss_hls) { + this.wss_hls = wss_hls; + } + + public String getTs() { + return ts; + } + + public void setTs(String ts) { + this.ts = ts; + } + + public String getHttps_ts() { + return https_ts; + } + + public void setHttps_ts(String https_ts) { + this.https_ts = https_ts; + } + + public String getWs_ts() { + return ws_ts; + } + + public void setWs_ts(String ws_ts) { + this.ws_ts = ws_ts; + } + + public String getWss_ts() { + return wss_ts; + } + + public void setWss_ts(String wss_ts) { + this.wss_ts = wss_ts; + } + + public String getRtmp() { + return rtmp; + } + + public void setRtmp(String rtmp) { + this.rtmp = rtmp; + } + + public String getRtmps() { + return rtmps; + } + + public void setRtmps(String rtmps) { + this.rtmps = rtmps; + } + + public String getRtsp() { + return rtsp; + } + + public void setRtsp(String rtsp) { + this.rtsp = rtsp; + } + + public String getRtsps() { + return rtsps; + } + + public void setRtsps(String rtsps) { + this.rtsps = rtsps; + } + + public String getRtc() { + return rtc; + } + + public void setRtc(String rtc) { + this.rtc = rtc; + } + + public String getRtcs() { + return rtcs; + } + + public void setRtcs(String rtcs) { + this.rtcs = rtcs; + } + + public String getMediaServerId() { + return mediaServerId; + } + + public void setMediaServerId(String mediaServerId) { + this.mediaServerId = mediaServerId; + } + + public MediaInfo getMediaInfo() { + return mediaInfo; + } + + public void setMediaInfo(MediaInfo mediaInfo) { + this.mediaInfo = mediaInfo; + } + + public String getStartTime() { + return startTime; + } + + public void setStartTime(String startTime) { + this.startTime = startTime; + } + + public String getEndTime() { + return endTime; + } + + public void setEndTime(String endTime) { + this.endTime = endTime; + } + + public double getProgress() { + return progress; + } + + public void setProgress(double progress) { + this.progress = progress; + } + + public DownloadFileInfo getDownLoadFilePath() { + return downLoadFilePath; + } + + public void setDownLoadFilePath(DownloadFileInfo downLoadFilePath) { + this.downLoadFilePath = downLoadFilePath; + } +} diff --git a/ycl-pojo/src/main/java/com/ycl/platform/wvp/StreamInfo.java b/ycl-pojo/src/main/java/com/ycl/platform/wvp/StreamInfo.java new file mode 100644 index 0000000..076f019 --- /dev/null +++ b/ycl-pojo/src/main/java/com/ycl/platform/wvp/StreamInfo.java @@ -0,0 +1,647 @@ +package com.ycl.platform.wvp; + +import io.swagger.v3.oas.annotations.media.Schema; + +import java.io.Serializable; +import java.util.Objects; + +@Schema(description = "娴佷俊鎭�") +public class StreamInfo implements Serializable, Cloneable{ + + @Schema(description = "搴旂敤鍚�") + private String app; + @Schema(description = "娴両D") + private String stream; + @Schema(description = "璁惧缂栧彿") + private String deviceID; + @Schema(description = "閫氶亾缂栧彿") + private String channelId; + + @Schema(description = "IP") + private String ip; + + @Schema(description = "HTTP-FLV娴佸湴鍧�") + private StreamURL flv; + + @Schema(description = "HTTPS-FLV娴佸湴鍧�") + private StreamURL https_flv; + @Schema(description = "Websocket-FLV娴佸湴鍧�") + private StreamURL ws_flv; + @Schema(description = "Websockets-FLV娴佸湴鍧�") + private StreamURL wss_flv; + @Schema(description = "HTTP-FMP4娴佸湴鍧�") + private StreamURL fmp4; + @Schema(description = "HTTPS-FMP4娴佸湴鍧�") + private StreamURL https_fmp4; + @Schema(description = "Websocket-FMP4娴佸湴鍧�") + private StreamURL ws_fmp4; + @Schema(description = "Websockets-FMP4娴佸湴鍧�") + private StreamURL wss_fmp4; + @Schema(description = "HLS娴佸湴鍧�") + private StreamURL hls; + @Schema(description = "HTTPS-HLS娴佸湴鍧�") + private StreamURL https_hls; + @Schema(description = "Websocket-HLS娴佸湴鍧�") + private StreamURL ws_hls; + @Schema(description = "Websockets-HLS娴佸湴鍧�") + private StreamURL wss_hls; + @Schema(description = "HTTP-TS娴佸湴鍧�") + private StreamURL ts; + @Schema(description = "HTTPS-TS娴佸湴鍧�") + private StreamURL https_ts; + @Schema(description = "Websocket-TS娴佸湴鍧�") + private StreamURL ws_ts; + @Schema(description = "Websockets-TS娴佸湴鍧�") + private StreamURL wss_ts; + @Schema(description = "RTMP娴佸湴鍧�") + private StreamURL rtmp; + @Schema(description = "RTMPS娴佸湴鍧�") + private StreamURL rtmps; + @Schema(description = "RTSP娴佸湴鍧�") + private StreamURL rtsp; + @Schema(description = "RTSPS娴佸湴鍧�") + private StreamURL rtsps; + @Schema(description = "RTC娴佸湴鍧�") + private StreamURL rtc; + + @Schema(description = "RTCS娴佸湴鍧�") + private StreamURL rtcs; + @Schema(description = "娴佸獟浣揑D") + private String mediaServerId; + @Schema(description = "娴佺紪鐮佷俊鎭�") + private MediaInfo mediaInfo; + @Schema(description = "寮�濮嬫椂闂�") + private String startTime; + @Schema(description = "缁撴潫鏃堕棿") + private String endTime; + @Schema(description = "杩涘害锛堝綍鍍忎笅杞戒娇鐢級") + private double progress; + @Schema(description = "鏂囦欢涓嬭浇鍦板潃锛堝綍鍍忎笅杞戒娇鐢級") + private DownloadFileInfo downLoadFilePath; + + @Schema(description = "鏄惁鏆傚仠锛堝綍鍍忓洖鏀句娇鐢級") + private boolean pause; + + @Schema(description = "浜х敓婧愮被鍨嬶紝鍖呮嫭 unknown = 0,rtmp_push=1,rtsp_push=2,rtp_push=3,pull=4,ffmpeg_pull=5,mp4_vod=6,device_chn=7") + private int originType; + + @Schema(description = "杞爜鍚庣殑瑙嗛娴�") + private StreamInfo transcodeStream; + + public void setFlv(StreamURL flv) { + this.flv = flv; + } + + public void setHttps_flv(StreamURL https_flv) { + this.https_flv = https_flv; + } + + public void setWs_flv(StreamURL ws_flv) { + this.ws_flv = ws_flv; + } + + public void setWss_flv(StreamURL wss_flv) { + this.wss_flv = wss_flv; + } + + public void setFmp4(StreamURL fmp4) { + this.fmp4 = fmp4; + } + + public void setHttps_fmp4(StreamURL https_fmp4) { + this.https_fmp4 = https_fmp4; + } + + public void setWs_fmp4(StreamURL ws_fmp4) { + this.ws_fmp4 = ws_fmp4; + } + + public void setWss_fmp4(StreamURL wss_fmp4) { + this.wss_fmp4 = wss_fmp4; + } + + public void setHls(StreamURL hls) { + this.hls = hls; + } + + public void setHttps_hls(StreamURL https_hls) { + this.https_hls = https_hls; + } + + public void setWs_hls(StreamURL ws_hls) { + this.ws_hls = ws_hls; + } + + public void setWss_hls(StreamURL wss_hls) { + this.wss_hls = wss_hls; + } + + public void setTs(StreamURL ts) { + this.ts = ts; + } + + public void setHttps_ts(StreamURL https_ts) { + this.https_ts = https_ts; + } + + public void setWs_ts(StreamURL ws_ts) { + this.ws_ts = ws_ts; + } + + public void setWss_ts(StreamURL wss_ts) { + this.wss_ts = wss_ts; + } + + public void setRtmp(StreamURL rtmp) { + this.rtmp = rtmp; + } + + public void setRtmps(StreamURL rtmps) { + this.rtmps = rtmps; + } + + public void setRtsp(StreamURL rtsp) { + this.rtsp = rtsp; + } + + public void setRtsps(StreamURL rtsps) { + this.rtsps = rtsps; + } + + public void setRtc(StreamURL rtc) { + this.rtc = rtc; + } + + public void setRtcs(StreamURL rtcs) { + this.rtcs = rtcs; + } + + public void setRtmp(String host, int port, int sslPort, String app, String stream, String callIdParam) { + String file = String.format("%s/%s%s", app, stream, callIdParam); + if (port > 0) { + this.rtmp = new StreamURL("rtmp", host, port, file); + } + if (sslPort > 0) { + this.rtmps = new StreamURL("rtmps", host, sslPort, file); + } + } + + public void setRtsp(String host, int port, int sslPort, String app, String stream, String callIdParam) { + String file = String.format("%s/%s%s", app, stream, callIdParam); + if (port > 0) { + this.rtsp = new StreamURL("rtsp", host, port, file); + } + if (sslPort > 0) { + this.rtsps = new StreamURL("rtsps", host, sslPort, file); + } + } + + public void setFlv(String host, int port, int sslPort, String file) { + if (port > 0) { + this.flv = new StreamURL("http", host, port, file); + } + this.ws_flv = new StreamURL("ws", host, port, file); + if (sslPort > 0) { + this.https_flv = new StreamURL("https", host, sslPort, file); + this.wss_flv = new StreamURL("wss", host, sslPort, file); + } + } + + public void setWsFlv(String host, int port, int sslPort, String file) { + if (port > 0) { + this.ws_flv = new StreamURL("ws", host, port, file); + } + if (sslPort > 0) { + this.wss_flv = new StreamURL("wss", host, sslPort, file); + } + } + + public void setFmp4(String host, int port, int sslPort, String app, String stream, String callIdParam) { + String file = String.format("%s/%s.live.mp4%s", app, stream, callIdParam); + if (port > 0) { + this.fmp4 = new StreamURL("http", host, port, file); + this.ws_fmp4 = new StreamURL("ws", host, port, file); + } + if (sslPort > 0) { + this.https_fmp4 = new StreamURL("https", host, sslPort, file); + this.wss_fmp4 = new StreamURL("wss", host, sslPort, file); + } + } + + public void setHls(String host, int port, int sslPort, String app, String stream, String callIdParam) { + String file = String.format("%s/%s/hls.m3u8%s", app, stream, callIdParam); + if (port > 0) { + this.hls = new StreamURL("http", host, port, file); + this.ws_hls = new StreamURL("ws", host, port, file); + } + if (sslPort > 0) { + this.https_hls = new StreamURL("https", host, sslPort, file); + this.wss_hls = new StreamURL("wss", host, sslPort, file); + } + } + + public void setTs(String host, int port, int sslPort, String app, String stream, String callIdParam) { + String file = String.format("%s/%s.live.ts%s", app, stream, callIdParam); + + if (port > 0) { + this.ts = new StreamURL("http", host, port, file); + this.ws_ts = new StreamURL("ws", host, port, file); + } + if (sslPort > 0) { + this.https_ts = new StreamURL("https", host, sslPort, file); + this.wss_ts = new StreamURL("wss", host, sslPort, file); + } + } + + public void setRtc(String host, int port, int sslPort, String app, String stream, String callIdParam, boolean isPlay) { + if (callIdParam != null) { + callIdParam = Objects.equals(callIdParam, "") ? callIdParam : callIdParam.replace("?", "&"); + } + String file = String.format("index/api/webrtc?app=%s&stream=%s&type=%s%s", app, stream, isPlay?"play":"push", callIdParam); + if (port > 0) { + this.rtc = new StreamURL("http", host, port, file); + } + if (sslPort > 0) { + this.rtcs = new StreamURL("https", host, sslPort, file); + } + } + + public void channgeStreamIp(String localAddr) { + if (this.flv != null) { + this.flv.setHost(localAddr); + } + if (this.ws_flv != null ){ + this.ws_flv.setHost(localAddr); + } + if (this.hls != null ) { + this.hls.setHost(localAddr); + } + if (this.ws_hls != null ) { + this.ws_hls.setHost(localAddr); + } + if (this.ts != null ) { + this.ts.setHost(localAddr); + } + if (this.ws_ts != null ) { + this.ws_ts.setHost(localAddr); + } + if (this.fmp4 != null ) { + this.fmp4.setHost(localAddr); + } + if (this.ws_fmp4 != null ) { + this.ws_fmp4.setHost(localAddr); + } + if (this.rtc != null ) { + this.rtc.setHost(localAddr); + } + if (this.https_flv != null) { + this.https_flv.setHost(localAddr); + } + if (this.wss_flv != null) { + this.wss_flv.setHost(localAddr); + } + if (this.https_hls != null) { + this.https_hls.setHost(localAddr); + } + if (this.wss_hls != null) { + this.wss_hls.setHost(localAddr); + } + if (this.wss_ts != null) { + this.wss_ts.setHost(localAddr); + } + if (this.https_fmp4 != null) { + this.https_fmp4.setHost(localAddr); + } + if (this.wss_fmp4 != null) { + this.wss_fmp4.setHost(localAddr); + } + if (this.rtcs != null) { + this.rtcs.setHost(localAddr); + } + if (this.rtsp != null) { + this.rtsp.setHost(localAddr); + } + if (this.rtsps != null) { + this.rtsps.setHost(localAddr); + } + if (this.rtmp != null) { + this.rtmp.setHost(localAddr); + } + if (this.rtmps != null) { + this.rtmps.setHost(localAddr); + } + } + + + public static class TransactionInfo{ + public String callId; + public String localTag; + public String remoteTag; + public String branch; + } + + private TransactionInfo transactionInfo; + + public String getApp() { + return app; + } + + public void setApp(String app) { + this.app = app; + } + + public String getDeviceID() { + return deviceID; + } + + public void setDeviceID(String deviceID) { + this.deviceID = deviceID; + } + + public String getChannelId() { + return channelId; + } + + public void setChannelId(String channelId) { + this.channelId = channelId; + } + + public String getStream() { + return stream; + } + + public void setStream(String stream) { + this.stream = stream; + } + + public String getIp() { + return ip; + } + + public void setIp(String ip) { + this.ip = ip; + } + + public StreamURL getFlv() { + return flv; + } + + public StreamURL getHttps_flv() { + return https_flv; + } + + public StreamURL getWs_flv() { + return ws_flv; + } + + + public StreamURL getWss_flv() { + return wss_flv; + } + + public StreamURL getFmp4() { + return fmp4; + } + + + + public StreamURL getHttps_fmp4() { + return https_fmp4; + } + + public StreamURL getWs_fmp4() { + return ws_fmp4; + } + + public StreamURL getWss_fmp4() { + return wss_fmp4; + } + + public StreamURL getHls() { + return hls; + } + + + public StreamURL getHttps_hls() { + return https_hls; + } + + public StreamURL getWs_hls() { + return ws_hls; + } + + public StreamURL getWss_hls() { + return wss_hls; + } + + public StreamURL getTs() { + return ts; + } + + + public StreamURL getHttps_ts() { + return https_ts; + } + + + public StreamURL getWs_ts() { + return ws_ts; + } + + + public StreamURL getWss_ts() { + return wss_ts; + } + + + public StreamURL getRtmp() { + return rtmp; + } + + public StreamURL getRtmps() { + return rtmps; + } + + public StreamURL getRtsp() { + return rtsp; + } + + public StreamURL getRtsps() { + return rtsps; + } + + public StreamURL getRtc() { + return rtc; + } + + public StreamURL getRtcs() { + return rtcs; + } + + public String getMediaServerId() { + return mediaServerId; + } + + public void setMediaServerId(String mediaServerId) { + this.mediaServerId = mediaServerId; + } + + public MediaInfo getMediaInfo() { + return mediaInfo; + } + + public void setMediaInfo(MediaInfo mediaInfo) { + this.mediaInfo = mediaInfo; + } + + public String getStartTime() { + return startTime; + } + + public void setStartTime(String startTime) { + this.startTime = startTime; + } + + public String getEndTime() { + return endTime; + } + + public void setEndTime(String endTime) { + this.endTime = endTime; + } + + public double getProgress() { + return progress; + } + + public void setProgress(double progress) { + this.progress = progress; + } + + public boolean isPause() { + return pause; + } + + public void setPause(boolean pause) { + this.pause = pause; + } + + public TransactionInfo getTransactionInfo() { + return transactionInfo; + } + + public void setTransactionInfo(TransactionInfo transactionInfo) { + this.transactionInfo = transactionInfo; + } + + public StreamInfo getTranscodeStream() { + return transcodeStream; + } + + public void setTranscodeStream(StreamInfo transcodeStream) { + this.transcodeStream = transcodeStream; + } + + @Override + public StreamInfo clone() { + StreamInfo instance = null; + try{ + instance = (StreamInfo)super.clone(); + if (this.flv != null) { + instance.flv=this.flv.clone(); + } + if (this.ws_flv != null ){ + instance.ws_flv= this.ws_flv.clone(); + } + if (this.hls != null ) { + instance.hls= this.hls.clone(); + } + if (this.ws_hls != null ) { + instance.ws_hls= this.ws_hls.clone(); + } + if (this.ts != null ) { + instance.ts= this.ts.clone(); + } + if (this.ws_ts != null ) { + instance.ws_ts= this.ws_ts.clone(); + } + if (this.fmp4 != null ) { + instance.fmp4= this.fmp4.clone(); + } + if (this.ws_fmp4 != null ) { + instance.ws_fmp4= this.ws_fmp4.clone(); + } + if (this.rtc != null ) { + instance.rtc= this.rtc.clone(); + } + if (this.https_flv != null) { + instance.https_flv= this.https_flv.clone(); + } + if (this.wss_flv != null) { + instance.wss_flv= this.wss_flv.clone(); + } + if (this.https_hls != null) { + instance.https_hls= this.https_hls.clone(); + } + if (this.wss_hls != null) { + instance.wss_hls= this.wss_hls.clone(); + } + if (this.wss_ts != null) { + instance.wss_ts= this.wss_ts.clone(); + } + if (this.https_fmp4 != null) { + instance.https_fmp4= this.https_fmp4.clone(); + } + if (this.wss_fmp4 != null) { + instance.wss_fmp4= this.wss_fmp4.clone(); + } + if (this.rtcs != null) { + instance.rtcs= this.rtcs.clone(); + } + if (this.rtsp != null) { + instance.rtsp= this.rtsp.clone(); + } + if (this.rtsps != null) { + instance.rtsps= this.rtsps.clone(); + } + if (this.rtmp != null) { + instance.rtmp= this.rtmp.clone(); + } + if (this.rtmps != null) { + instance.rtmps= this.rtmps.clone(); + } + }catch(CloneNotSupportedException e) { + e.printStackTrace(); + } + return instance; + } + + + /*=========================璁惧涓诲瓙鐮佹祦閫昏緫START====================*/ + @Schema(description = "鏄惁涓哄瓙鐮佹祦(true-鏄紝false-涓荤爜娴�)") + private boolean subStream; + + public boolean isSubStream() { + return subStream; + } + + public void setSubStream(boolean subStream) { + this.subStream = subStream; + } + + public DownloadFileInfo getDownLoadFilePath() { + return downLoadFilePath; + } + + public void setDownLoadFilePath(DownloadFileInfo downLoadFilePath) { + this.downLoadFilePath = downLoadFilePath; + } + + public int getOriginType() { + return originType; + } + + public void setOriginType(int originType) { + this.originType = originType; + } +} diff --git a/ycl-pojo/src/main/java/com/ycl/platform/wvp/StreamURL.java b/ycl-pojo/src/main/java/com/ycl/platform/wvp/StreamURL.java new file mode 100644 index 0000000..da31bfc --- /dev/null +++ b/ycl-pojo/src/main/java/com/ycl/platform/wvp/StreamURL.java @@ -0,0 +1,84 @@ +package com.ycl.platform.wvp; + +import io.swagger.v3.oas.annotations.media.Schema; + +import java.io.Serializable; + + +@Schema(description = "娴佸湴鍧�淇℃伅") +public class StreamURL implements Serializable,Cloneable { + + @Schema(description = "鍗忚") + private String protocol; + + @Schema(description = "涓绘満鍦板潃") + private String host; + + @Schema(description = "绔彛") + private int port = -1; + + @Schema(description = "瀹氫綅浣嶇疆") + private String file; + + @Schema(description = "鎷兼帴鍚庣殑鍦板潃") + private String url; + + public StreamURL() { + } + + public StreamURL(String protocol, String host, int port, String file) { + this.protocol = protocol; + this.host = host; + this.port = port; + this.file = file; + } + + public String getProtocol() { + return protocol; + } + + public void setProtocol(String protocol) { + this.protocol = protocol; + } + + public String getHost() { + return host; + } + + public void setHost(String host) { + this.host = host; + } + + public int getPort() { + return port; + } + + public void setPort(int port) { + this.port = port; + } + + public String getFile() { + return file; + } + + public void setFile(String file) { + this.file = file; + } + + public String getUrl() { + return this.toString(); + } + + @Override + public String toString() { + if (protocol != null && host != null && port != -1 ) { + return String.format("%s://%s:%s/%s", protocol, host, port, file); + }else { + return null; + } + } + @Override + public StreamURL clone() throws CloneNotSupportedException { + return (StreamURL) super.clone(); + } +} diff --git a/ycl-pojo/src/main/java/com/ycl/platform/wvp/WVPResult.java b/ycl-pojo/src/main/java/com/ycl/platform/wvp/WVPResult.java new file mode 100644 index 0000000..443c2eb --- /dev/null +++ b/ycl-pojo/src/main/java/com/ycl/platform/wvp/WVPResult.java @@ -0,0 +1,75 @@ +package com.ycl.platform.wvp; + + +import io.swagger.v3.oas.annotations.media.Schema; + +@Schema(description = "缁熶竴杩斿洖缁撴灉") +public class WVPResult<T> implements Cloneable{ + + public WVPResult() { + } + + public WVPResult(int code, String msg, T data) { + this.code = code; + this.msg = msg; + this.data = data; + } + + + @Schema(description = "閿欒鐮侊紝0涓烘垚鍔�") + private int code; + @Schema(description = "鎻忚堪锛岄敊璇椂鎻忚堪閿欒鍘熷洜") + private String msg; + @Schema(description = "鏁版嵁") + private T data; + + + public static <T> WVPResult<T> success(T t, String msg) { + return new WVPResult<>(ErrorCode.SUCCESS.getCode(), msg, t); + } + + public static WVPResult success() { + return new WVPResult<>(ErrorCode.SUCCESS.getCode(), ErrorCode.SUCCESS.getMsg(), null); + } + + public static <T> WVPResult<T> success(T t) { + return success(t, ErrorCode.SUCCESS.getMsg()); + } + + public static <T> WVPResult<T> fail(int code, String msg) { + return new WVPResult<>(code, msg, null); + } + + public static <T> WVPResult<T> fail(ErrorCode errorCode) { + return fail(errorCode.getCode(), errorCode.getMsg()); + } + + public int getCode() { + return code; + } + + public void setCode(int code) { + this.code = code; + } + + public String getMsg() { + return msg; + } + + public void setMsg(String msg) { + this.msg = msg; + } + + public T getData() { + return data; + } + + public void setData(T data) { + this.data = data; + } + + @Override + public Object clone() throws CloneNotSupportedException { + return super.clone(); + } +} diff --git a/ycl-pojo/src/main/java/com/ycl/platform/wvp/ZLMServerConfig.java b/ycl-pojo/src/main/java/com/ycl/platform/wvp/ZLMServerConfig.java new file mode 100644 index 0000000..161921d --- /dev/null +++ b/ycl-pojo/src/main/java/com/ycl/platform/wvp/ZLMServerConfig.java @@ -0,0 +1,1224 @@ +package com.ycl.platform.wvp; + +import com.alibaba.fastjson2.annotation.JSONField; + +public class ZLMServerConfig extends HookParam { + + @JSONField(name = "api.apiDebug") + private String apiDebug; + + @JSONField(name = "api.secret") + private String apiSecret; + + @JSONField(name = "api.snapRoot") + private String apiSnapRoot; + + @JSONField(name = "api.defaultSnap") + private String apiDefaultSnap; + + @JSONField(name = "ffmpeg.bin") + private String ffmpegBin; + + @JSONField(name = "ffmpeg.cmd") + private String ffmpegCmd; + + @JSONField(name = "ffmpeg.snap") + private String ffmpegSnap; + + @JSONField(name = "ffmpeg.log") + private String ffmpegLog; + + @JSONField(name = "ffmpeg.restart_sec") + private String ffmpegRestartSec; + + @JSONField(name = "protocol.modify_stamp") + private String protocolModifyStamp; + + @JSONField(name = "protocol.enable_audio") + private String protocolEnableAudio; + + @JSONField(name = "protocol.add_mute_audio") + private String protocolAddMuteAudio; + + @JSONField(name = "protocol.continue_push_ms") + private String protocolContinuePushMs; + + @JSONField(name = "protocol.enable_hls") + private String protocolEnableHls; + + @JSONField(name = "protocol.enable_mp4") + private String protocolEnableMp4; + + @JSONField(name = "protocol.enable_rtsp") + private String protocolEnableRtsp; + + @JSONField(name = "protocol.enable_rtmp") + private String protocolEnableRtmp; + + @JSONField(name = "protocol.enable_ts") + private String protocolEnableTs; + + @JSONField(name = "protocol.enable_fmp4") + private String protocolEnableFmp4; + + @JSONField(name = "protocol.mp4_as_player") + private String protocolMp4AsPlayer; + + @JSONField(name = "protocol.mp4_max_second") + private String protocolMp4MaxSecond; + + @JSONField(name = "protocol.mp4_save_path") + private String protocolMp4SavePath; + + @JSONField(name = "protocol.hls_save_path") + private String protocolHlsSavePath; + + @JSONField(name = "protocol.hls_demand") + private String protocolHlsDemand; + + @JSONField(name = "protocol.rtsp_demand") + private String protocolRtspDemand; + + @JSONField(name = "protocol.rtmp_demand") + private String protocolRtmpDemand; + + @JSONField(name = "protocol.ts_demand") + private String protocolTsDemand; + + @JSONField(name = "protocol.fmp4_demand") + private String protocolFmp4Demand; + + @JSONField(name = "general.enableVhost") + private String generalEnableVhost; + + @JSONField(name = "general.flowThreshold") + private String generalFlowThreshold; + + @JSONField(name = "general.maxStreamWaitMS") + private String generalMaxStreamWaitMS; + + @JSONField(name = "general.streamNoneReaderDelayMS") + private int generalStreamNoneReaderDelayMS; + + @JSONField(name = "general.resetWhenRePlay") + private String generalResetWhenRePlay; + + @JSONField(name = "general.mergeWriteMS") + private String generalMergeWriteMS; + + @JSONField(name = "general.mediaServerId") + private String generalMediaServerId; + + @JSONField(name = "general.wait_track_ready_ms") + private String generalWaitTrackReadyMs; + + @JSONField(name = "general.wait_add_track_ms") + private String generalWaitAddTrackMs; + + @JSONField(name = "general.unready_frame_cache") + private String generalUnreadyFrameCache; + + + @JSONField(name = "ip") + private String ip; + + private String sdpIp; + + private String streamIp; + + private String hookIp; + + private String updateTime; + + private String createTime; + + @JSONField(name = "hls.fileBufSize") + private String hlsFileBufSize; + + @JSONField(name = "hls.filePath") + private String hlsFilePath; + + @JSONField(name = "hls.segDur") + private String hlsSegDur; + + @JSONField(name = "hls.segNum") + private String hlsSegNum; + + @JSONField(name = "hls.segRetain") + private String hlsSegRetain; + + @JSONField(name = "hls.broadcastRecordTs") + private String hlsBroadcastRecordTs; + + @JSONField(name = "hls.deleteDelaySec") + private String hlsDeleteDelaySec; + + @JSONField(name = "hls.segKeep") + private String hlsSegKeep; + + @JSONField(name = "hook.access_file_except_hls") + private String hookAccessFileExceptHLS; + + @JSONField(name = "hook.admin_params") + private String hookAdminParams; + + @JSONField(name = "hook.alive_interval") + private Float hookAliveInterval; + + @JSONField(name = "hook.enable") + private String hookEnable; + + @JSONField(name = "hook.on_flow_report") + private String hookOnFlowReport; + + @JSONField(name = "hook.on_http_access") + private String hookOnHttpAccess; + + @JSONField(name = "hook.on_play") + private String hookOnPlay; + + @JSONField(name = "hook.on_publish") + private String hookOnPublish; + + @JSONField(name = "hook.on_record_mp4") + private String hookOnRecordMp4; + + @JSONField(name = "hook.on_rtsp_auth") + private String hookOnRtspAuth; + + @JSONField(name = "hook.on_rtsp_realm") + private String hookOnRtspRealm; + + @JSONField(name = "hook.on_shell_login") + private String hookOnShellLogin; + + @JSONField(name = "hook.on_stream_changed") + private String hookOnStreamChanged; + + @JSONField(name = "hook.on_stream_none_reader") + private String hookOnStreamNoneReader; + + @JSONField(name = "hook.on_stream_not_found") + private String hookOnStreamNotFound; + + @JSONField(name = "hook.on_server_started") + private String hookOnServerStarted; + + @JSONField(name = "hook.on_server_keepalive") + private String hookOnServerKeepalive; + + @JSONField(name = "hook.on_send_rtp_stopped") + private String hookOnSendRtpStopped; + + @JSONField(name = "hook.on_rtp_server_timeout") + private String hookOnRtpServerTimeout; + + @JSONField(name = "hook.timeoutSec") + private String hookTimeoutSec; + + @JSONField(name = "http.charSet") + private String httpCharSet; + + @JSONField(name = "http.keepAliveSecond") + private String httpKeepAliveSecond; + + @JSONField(name = "http.maxReqCount") + private String httpMaxReqCount; + + @JSONField(name = "http.maxReqSize") + private String httpMaxReqSize; + + @JSONField(name = "http.notFound") + private String httpNotFound; + + @JSONField(name = "http.port") + private int httpPort; + + @JSONField(name = "http.rootPath") + private String httpRootPath; + + @JSONField(name = "http.sendBufSize") + private String httpSendBufSize; + + @JSONField(name = "http.sslport") + private int httpSSLport; + + @JSONField(name = "multicast.addrMax") + private String multicastAddrMax; + + @JSONField(name = "multicast.addrMin") + private String multicastAddrMin; + + @JSONField(name = "multicast.udpTTL") + private String multicastUdpTTL; + + @JSONField(name = "record.appName") + private String recordAppName; + + @JSONField(name = "record.filePath") + private String recordFilePath; + + @JSONField(name = "record.fileSecond") + private String recordFileSecond; + + @JSONField(name = "record.sampleMS") + private String recordFileSampleMS; + + @JSONField(name = "rtmp.handshakeSecond") + private String rtmpHandshakeSecond; + + @JSONField(name = "rtmp.keepAliveSecond") + private String rtmpKeepAliveSecond; + + @JSONField(name = "rtmp.modifyStamp") + private String rtmpModifyStamp; + + @JSONField(name = "rtmp.port") + private int rtmpPort; + + @JSONField(name = "rtmp.sslport") + private int rtmpSslPort; + + @JSONField(name = "rtp.audioMtuSize") + private String rtpAudioMtuSize; + + @JSONField(name = "rtp.clearCount") + private String rtpClearCount; + + @JSONField(name = "rtp.cycleMS") + private String rtpCycleMS; + + @JSONField(name = "rtp.maxRtpCount") + private String rtpMaxRtpCount; + + @JSONField(name = "rtp.videoMtuSize") + private String rtpVideoMtuSize; + + @JSONField(name = "rtp_proxy.checkSource") + private String rtpProxyCheckSource; + + @JSONField(name = "rtp_proxy.dumpDir") + private String rtpProxyDumpDir; + + @JSONField(name = "rtp_proxy.port") + private int rtpProxyPort; + + @JSONField(name = "rtp_proxy.port_range") + private String portRange; + + @JSONField(name = "rtp_proxy.timeoutSec") + private String rtpProxyTimeoutSec; + + @JSONField(name = "rtsp.authBasic") + private String rtspAuthBasic; + + @JSONField(name = "rtsp.handshakeSecond") + private String rtspHandshakeSecond; + + @JSONField(name = "rtsp.keepAliveSecond") + private String rtspKeepAliveSecond; + + @JSONField(name = "rtsp.port") + private int rtspPort; + + @JSONField(name = "rtsp.sslport") + private int rtspSSlport; + + @JSONField(name = "shell.maxReqSize") + private String shellMaxReqSize; + + @JSONField(name = "shell.shell") + private String shellPhell; + + @JSONField(name = "transcode.suffix") + private String transcodeSuffix; + + + public String getHookIp() { + return hookIp; + } + + public void setHookIp(String hookIp) { + this.hookIp = hookIp; + } + + public String getApiDebug() { + return apiDebug; + } + + public void setApiDebug(String apiDebug) { + this.apiDebug = apiDebug; + } + + public String getApiSecret() { + return apiSecret; + } + + public void setApiSecret(String apiSecret) { + this.apiSecret = apiSecret; + } + + public String getFfmpegBin() { + return ffmpegBin; + } + + public void setFfmpegBin(String ffmpegBin) { + this.ffmpegBin = ffmpegBin; + } + + public String getFfmpegCmd() { + return ffmpegCmd; + } + + public void setFfmpegCmd(String ffmpegCmd) { + this.ffmpegCmd = ffmpegCmd; + } + + public String getFfmpegLog() { + return ffmpegLog; + } + + public void setFfmpegLog(String ffmpegLog) { + this.ffmpegLog = ffmpegLog; + } + + public String getGeneralEnableVhost() { + return generalEnableVhost; + } + + public void setGeneralEnableVhost(String generalEnableVhost) { + this.generalEnableVhost = generalEnableVhost; + } + + public String getGeneralMediaServerId() { + return generalMediaServerId; + } + + public void setGeneralMediaServerId(String generalMediaServerId) { + this.generalMediaServerId = generalMediaServerId; + } + + public String getGeneralFlowThreshold() { + return generalFlowThreshold; + } + + public void setGeneralFlowThreshold(String generalFlowThreshold) { + this.generalFlowThreshold = generalFlowThreshold; + } + + public String getGeneralMaxStreamWaitMS() { + return generalMaxStreamWaitMS; + } + + public void setGeneralMaxStreamWaitMS(String generalMaxStreamWaitMS) { + this.generalMaxStreamWaitMS = generalMaxStreamWaitMS; + } + + public int getGeneralStreamNoneReaderDelayMS() { + return generalStreamNoneReaderDelayMS; + } + + public void setGeneralStreamNoneReaderDelayMS(int generalStreamNoneReaderDelayMS) { + this.generalStreamNoneReaderDelayMS = generalStreamNoneReaderDelayMS; + } + + public String getIp() { + return ip; + } + + public void setIp(String ip) { + this.ip = ip; + } + + public String getSdpIp() { + return sdpIp; + } + + public void setSdpIp(String sdpIp) { + this.sdpIp = sdpIp; + } + + public String getStreamIp() { + return streamIp; + } + + public void setStreamIp(String streamIp) { + this.streamIp = streamIp; + } + + public String getUpdateTime() { + return updateTime; + } + + public void setUpdateTime(String updateTime) { + this.updateTime = updateTime; + } + + public String getCreateTime() { + return createTime; + } + + public void setCreateTime(String createTime) { + this.createTime = createTime; + } + + public String getHlsFileBufSize() { + return hlsFileBufSize; + } + + public void setHlsFileBufSize(String hlsFileBufSize) { + this.hlsFileBufSize = hlsFileBufSize; + } + + public String getHlsFilePath() { + return hlsFilePath; + } + + public void setHlsFilePath(String hlsFilePath) { + this.hlsFilePath = hlsFilePath; + } + + public String getHlsSegDur() { + return hlsSegDur; + } + + public void setHlsSegDur(String hlsSegDur) { + this.hlsSegDur = hlsSegDur; + } + + public String getHlsSegNum() { + return hlsSegNum; + } + + public void setHlsSegNum(String hlsSegNum) { + this.hlsSegNum = hlsSegNum; + } + + public String getHookAccessFileExceptHLS() { + return hookAccessFileExceptHLS; + } + + public void setHookAccessFileExceptHLS(String hookAccessFileExceptHLS) { + this.hookAccessFileExceptHLS = hookAccessFileExceptHLS; + } + + public String getHookAdminParams() { + return hookAdminParams; + } + + public void setHookAdminParams(String hookAdminParams) { + this.hookAdminParams = hookAdminParams; + } + + public String getHookEnable() { + return hookEnable; + } + + public void setHookEnable(String hookEnable) { + this.hookEnable = hookEnable; + } + + public String getHookOnFlowReport() { + return hookOnFlowReport; + } + + public void setHookOnFlowReport(String hookOnFlowReport) { + this.hookOnFlowReport = hookOnFlowReport; + } + + public String getHookOnHttpAccess() { + return hookOnHttpAccess; + } + + public void setHookOnHttpAccess(String hookOnHttpAccess) { + this.hookOnHttpAccess = hookOnHttpAccess; + } + + public String getHookOnPlay() { + return hookOnPlay; + } + + public void setHookOnPlay(String hookOnPlay) { + this.hookOnPlay = hookOnPlay; + } + + public String getHookOnPublish() { + return hookOnPublish; + } + + public void setHookOnPublish(String hookOnPublish) { + this.hookOnPublish = hookOnPublish; + } + + public String getHookOnRecordMp4() { + return hookOnRecordMp4; + } + + public void setHookOnRecordMp4(String hookOnRecordMp4) { + this.hookOnRecordMp4 = hookOnRecordMp4; + } + + public String getHookOnRtspAuth() { + return hookOnRtspAuth; + } + + public void setHookOnRtspAuth(String hookOnRtspAuth) { + this.hookOnRtspAuth = hookOnRtspAuth; + } + + public String getHookOnRtspRealm() { + return hookOnRtspRealm; + } + + public void setHookOnRtspRealm(String hookOnRtspRealm) { + this.hookOnRtspRealm = hookOnRtspRealm; + } + + public String getHookOnShellLogin() { + return hookOnShellLogin; + } + + public void setHookOnShellLogin(String hookOnShellLogin) { + this.hookOnShellLogin = hookOnShellLogin; + } + + public String getHookOnStreamChanged() { + return hookOnStreamChanged; + } + + public void setHookOnStreamChanged(String hookOnStreamChanged) { + this.hookOnStreamChanged = hookOnStreamChanged; + } + + public String getHookOnStreamNoneReader() { + return hookOnStreamNoneReader; + } + + public void setHookOnStreamNoneReader(String hookOnStreamNoneReader) { + this.hookOnStreamNoneReader = hookOnStreamNoneReader; + } + + public String getHookOnStreamNotFound() { + return hookOnStreamNotFound; + } + + public void setHookOnStreamNotFound(String hookOnStreamNotFound) { + this.hookOnStreamNotFound = hookOnStreamNotFound; + } + + public String getHookTimeoutSec() { + return hookTimeoutSec; + } + + public void setHookTimeoutSec(String hookTimeoutSec) { + this.hookTimeoutSec = hookTimeoutSec; + } + + public String getHttpCharSet() { + return httpCharSet; + } + + public void setHttpCharSet(String httpCharSet) { + this.httpCharSet = httpCharSet; + } + + public String getHttpKeepAliveSecond() { + return httpKeepAliveSecond; + } + + public void setHttpKeepAliveSecond(String httpKeepAliveSecond) { + this.httpKeepAliveSecond = httpKeepAliveSecond; + } + + public String getHttpMaxReqCount() { + return httpMaxReqCount; + } + + public void setHttpMaxReqCount(String httpMaxReqCount) { + this.httpMaxReqCount = httpMaxReqCount; + } + + public String getHttpMaxReqSize() { + return httpMaxReqSize; + } + + public void setHttpMaxReqSize(String httpMaxReqSize) { + this.httpMaxReqSize = httpMaxReqSize; + } + + public String getHttpNotFound() { + return httpNotFound; + } + + public void setHttpNotFound(String httpNotFound) { + this.httpNotFound = httpNotFound; + } + + public int getHttpPort() { + return httpPort; + } + + public void setHttpPort(int httpPort) { + this.httpPort = httpPort; + } + + public String getHttpRootPath() { + return httpRootPath; + } + + public void setHttpRootPath(String httpRootPath) { + this.httpRootPath = httpRootPath; + } + + public String getHttpSendBufSize() { + return httpSendBufSize; + } + + public void setHttpSendBufSize(String httpSendBufSize) { + this.httpSendBufSize = httpSendBufSize; + } + + public int getHttpSSLport() { + return httpSSLport; + } + + public void setHttpSSLport(int httpSSLport) { + this.httpSSLport = httpSSLport; + } + + public String getMulticastAddrMax() { + return multicastAddrMax; + } + + public void setMulticastAddrMax(String multicastAddrMax) { + this.multicastAddrMax = multicastAddrMax; + } + + public String getMulticastAddrMin() { + return multicastAddrMin; + } + + public void setMulticastAddrMin(String multicastAddrMin) { + this.multicastAddrMin = multicastAddrMin; + } + + public String getMulticastUdpTTL() { + return multicastUdpTTL; + } + + public void setMulticastUdpTTL(String multicastUdpTTL) { + this.multicastUdpTTL = multicastUdpTTL; + } + + public String getRecordAppName() { + return recordAppName; + } + + public void setRecordAppName(String recordAppName) { + this.recordAppName = recordAppName; + } + + public String getRecordFilePath() { + return recordFilePath; + } + + public void setRecordFilePath(String recordFilePath) { + this.recordFilePath = recordFilePath; + } + + public String getRecordFileSecond() { + return recordFileSecond; + } + + public void setRecordFileSecond(String recordFileSecond) { + this.recordFileSecond = recordFileSecond; + } + + public String getRecordFileSampleMS() { + return recordFileSampleMS; + } + + public void setRecordFileSampleMS(String recordFileSampleMS) { + this.recordFileSampleMS = recordFileSampleMS; + } + + public String getRtmpHandshakeSecond() { + return rtmpHandshakeSecond; + } + + public void setRtmpHandshakeSecond(String rtmpHandshakeSecond) { + this.rtmpHandshakeSecond = rtmpHandshakeSecond; + } + + public String getRtmpKeepAliveSecond() { + return rtmpKeepAliveSecond; + } + + public void setRtmpKeepAliveSecond(String rtmpKeepAliveSecond) { + this.rtmpKeepAliveSecond = rtmpKeepAliveSecond; + } + + public String getRtmpModifyStamp() { + return rtmpModifyStamp; + } + + public void setRtmpModifyStamp(String rtmpModifyStamp) { + this.rtmpModifyStamp = rtmpModifyStamp; + } + + public int getRtmpPort() { + return rtmpPort; + } + + public void setRtmpPort(int rtmpPort) { + this.rtmpPort = rtmpPort; + } + + public int getRtmpSslPort() { + return rtmpSslPort; + } + + public void setRtmpSslPort(int rtmpSslPort) { + this.rtmpSslPort = rtmpSslPort; + } + + public String getRtpAudioMtuSize() { + return rtpAudioMtuSize; + } + + public void setRtpAudioMtuSize(String rtpAudioMtuSize) { + this.rtpAudioMtuSize = rtpAudioMtuSize; + } + + public String getRtpClearCount() { + return rtpClearCount; + } + + public void setRtpClearCount(String rtpClearCount) { + this.rtpClearCount = rtpClearCount; + } + + public String getRtpCycleMS() { + return rtpCycleMS; + } + + public void setRtpCycleMS(String rtpCycleMS) { + this.rtpCycleMS = rtpCycleMS; + } + + public String getRtpMaxRtpCount() { + return rtpMaxRtpCount; + } + + public void setRtpMaxRtpCount(String rtpMaxRtpCount) { + this.rtpMaxRtpCount = rtpMaxRtpCount; + } + + public String getRtpVideoMtuSize() { + return rtpVideoMtuSize; + } + + public void setRtpVideoMtuSize(String rtpVideoMtuSize) { + this.rtpVideoMtuSize = rtpVideoMtuSize; + } + + public String getRtpProxyCheckSource() { + return rtpProxyCheckSource; + } + + public void setRtpProxyCheckSource(String rtpProxyCheckSource) { + this.rtpProxyCheckSource = rtpProxyCheckSource; + } + + public String getRtpProxyDumpDir() { + return rtpProxyDumpDir; + } + + public void setRtpProxyDumpDir(String rtpProxyDumpDir) { + this.rtpProxyDumpDir = rtpProxyDumpDir; + } + + public int getRtpProxyPort() { + return rtpProxyPort; + } + + public void setRtpProxyPort(int rtpProxyPort) { + this.rtpProxyPort = rtpProxyPort; + } + + public String getRtpProxyTimeoutSec() { + return rtpProxyTimeoutSec; + } + + public void setRtpProxyTimeoutSec(String rtpProxyTimeoutSec) { + this.rtpProxyTimeoutSec = rtpProxyTimeoutSec; + } + + public String getRtspAuthBasic() { + return rtspAuthBasic; + } + + public void setRtspAuthBasic(String rtspAuthBasic) { + this.rtspAuthBasic = rtspAuthBasic; + } + + public String getRtspHandshakeSecond() { + return rtspHandshakeSecond; + } + + public void setRtspHandshakeSecond(String rtspHandshakeSecond) { + this.rtspHandshakeSecond = rtspHandshakeSecond; + } + + public String getRtspKeepAliveSecond() { + return rtspKeepAliveSecond; + } + + public void setRtspKeepAliveSecond(String rtspKeepAliveSecond) { + this.rtspKeepAliveSecond = rtspKeepAliveSecond; + } + + public int getRtspPort() { + return rtspPort; + } + + public void setRtspPort(int rtspPort) { + this.rtspPort = rtspPort; + } + + public int getRtspSSlport() { + return rtspSSlport; + } + + public void setRtspSSlport(int rtspSSlport) { + this.rtspSSlport = rtspSSlport; + } + + public String getShellMaxReqSize() { + return shellMaxReqSize; + } + + public void setShellMaxReqSize(String shellMaxReqSize) { + this.shellMaxReqSize = shellMaxReqSize; + } + + public String getShellPhell() { + return shellPhell; + } + + public void setShellPhell(String shellPhell) { + this.shellPhell = shellPhell; + } + + public Float getHookAliveInterval() { + return hookAliveInterval; + } + + public void setHookAliveInterval(Float hookAliveInterval) { + this.hookAliveInterval = hookAliveInterval; + } + + public String getPortRange() { + return portRange; + } + + public void setPortRange(String portRange) { + this.portRange = portRange; + } + + public String getApiSnapRoot() { + return apiSnapRoot; + } + + public void setApiSnapRoot(String apiSnapRoot) { + this.apiSnapRoot = apiSnapRoot; + } + + public String getApiDefaultSnap() { + return apiDefaultSnap; + } + + public void setApiDefaultSnap(String apiDefaultSnap) { + this.apiDefaultSnap = apiDefaultSnap; + } + + public String getFfmpegSnap() { + return ffmpegSnap; + } + + public void setFfmpegSnap(String ffmpegSnap) { + this.ffmpegSnap = ffmpegSnap; + } + + public String getFfmpegRestartSec() { + return ffmpegRestartSec; + } + + public void setFfmpegRestartSec(String ffmpegRestartSec) { + this.ffmpegRestartSec = ffmpegRestartSec; + } + + public String getProtocolModifyStamp() { + return protocolModifyStamp; + } + + public void setProtocolModifyStamp(String protocolModifyStamp) { + this.protocolModifyStamp = protocolModifyStamp; + } + + public String getProtocolEnableAudio() { + return protocolEnableAudio; + } + + public void setProtocolEnableAudio(String protocolEnableAudio) { + this.protocolEnableAudio = protocolEnableAudio; + } + + public String getProtocolAddMuteAudio() { + return protocolAddMuteAudio; + } + + public void setProtocolAddMuteAudio(String protocolAddMuteAudio) { + this.protocolAddMuteAudio = protocolAddMuteAudio; + } + + public String getProtocolContinuePushMs() { + return protocolContinuePushMs; + } + + public void setProtocolContinuePushMs(String protocolContinuePushMs) { + this.protocolContinuePushMs = protocolContinuePushMs; + } + + public String getProtocolEnableHls() { + return protocolEnableHls; + } + + public void setProtocolEnableHls(String protocolEnableHls) { + this.protocolEnableHls = protocolEnableHls; + } + + public String getProtocolEnableMp4() { + return protocolEnableMp4; + } + + public void setProtocolEnableMp4(String protocolEnableMp4) { + this.protocolEnableMp4 = protocolEnableMp4; + } + + public String getProtocolEnableRtsp() { + return protocolEnableRtsp; + } + + public void setProtocolEnableRtsp(String protocolEnableRtsp) { + this.protocolEnableRtsp = protocolEnableRtsp; + } + + public String getProtocolEnableRtmp() { + return protocolEnableRtmp; + } + + public void setProtocolEnableRtmp(String protocolEnableRtmp) { + this.protocolEnableRtmp = protocolEnableRtmp; + } + + public String getProtocolEnableTs() { + return protocolEnableTs; + } + + public void setProtocolEnableTs(String protocolEnableTs) { + this.protocolEnableTs = protocolEnableTs; + } + + public String getProtocolEnableFmp4() { + return protocolEnableFmp4; + } + + public void setProtocolEnableFmp4(String protocolEnableFmp4) { + this.protocolEnableFmp4 = protocolEnableFmp4; + } + + public String getProtocolMp4AsPlayer() { + return protocolMp4AsPlayer; + } + + public void setProtocolMp4AsPlayer(String protocolMp4AsPlayer) { + this.protocolMp4AsPlayer = protocolMp4AsPlayer; + } + + public String getProtocolMp4MaxSecond() { + return protocolMp4MaxSecond; + } + + public void setProtocolMp4MaxSecond(String protocolMp4MaxSecond) { + this.protocolMp4MaxSecond = protocolMp4MaxSecond; + } + + public String getProtocolMp4SavePath() { + return protocolMp4SavePath; + } + + public void setProtocolMp4SavePath(String protocolMp4SavePath) { + this.protocolMp4SavePath = protocolMp4SavePath; + } + + public String getProtocolHlsSavePath() { + return protocolHlsSavePath; + } + + public void setProtocolHlsSavePath(String protocolHlsSavePath) { + this.protocolHlsSavePath = protocolHlsSavePath; + } + + public String getProtocolHlsDemand() { + return protocolHlsDemand; + } + + public void setProtocolHlsDemand(String protocolHlsDemand) { + this.protocolHlsDemand = protocolHlsDemand; + } + + public String getProtocolRtspDemand() { + return protocolRtspDemand; + } + + public void setProtocolRtspDemand(String protocolRtspDemand) { + this.protocolRtspDemand = protocolRtspDemand; + } + + public String getProtocolRtmpDemand() { + return protocolRtmpDemand; + } + + public void setProtocolRtmpDemand(String protocolRtmpDemand) { + this.protocolRtmpDemand = protocolRtmpDemand; + } + + public String getProtocolTsDemand() { + return protocolTsDemand; + } + + public void setProtocolTsDemand(String protocolTsDemand) { + this.protocolTsDemand = protocolTsDemand; + } + + public String getProtocolFmp4Demand() { + return protocolFmp4Demand; + } + + public void setProtocolFmp4Demand(String protocolFmp4Demand) { + this.protocolFmp4Demand = protocolFmp4Demand; + } + + public String getGeneralResetWhenRePlay() { + return generalResetWhenRePlay; + } + + public void setGeneralResetWhenRePlay(String generalResetWhenRePlay) { + this.generalResetWhenRePlay = generalResetWhenRePlay; + } + + public String getGeneralMergeWriteMS() { + return generalMergeWriteMS; + } + + public void setGeneralMergeWriteMS(String generalMergeWriteMS) { + this.generalMergeWriteMS = generalMergeWriteMS; + } + + public String getGeneralWaitTrackReadyMs() { + return generalWaitTrackReadyMs; + } + + public void setGeneralWaitTrackReadyMs(String generalWaitTrackReadyMs) { + this.generalWaitTrackReadyMs = generalWaitTrackReadyMs; + } + + public String getGeneralWaitAddTrackMs() { + return generalWaitAddTrackMs; + } + + public void setGeneralWaitAddTrackMs(String generalWaitAddTrackMs) { + this.generalWaitAddTrackMs = generalWaitAddTrackMs; + } + + public String getGeneralUnreadyFrameCache() { + return generalUnreadyFrameCache; + } + + public void setGeneralUnreadyFrameCache(String generalUnreadyFrameCache) { + this.generalUnreadyFrameCache = generalUnreadyFrameCache; + } + + public String getHlsSegRetain() { + return hlsSegRetain; + } + + public void setHlsSegRetain(String hlsSegRetain) { + this.hlsSegRetain = hlsSegRetain; + } + + public String getHlsBroadcastRecordTs() { + return hlsBroadcastRecordTs; + } + + public void setHlsBroadcastRecordTs(String hlsBroadcastRecordTs) { + this.hlsBroadcastRecordTs = hlsBroadcastRecordTs; + } + + public String getHlsDeleteDelaySec() { + return hlsDeleteDelaySec; + } + + public void setHlsDeleteDelaySec(String hlsDeleteDelaySec) { + this.hlsDeleteDelaySec = hlsDeleteDelaySec; + } + + public String getHlsSegKeep() { + return hlsSegKeep; + } + + public void setHlsSegKeep(String hlsSegKeep) { + this.hlsSegKeep = hlsSegKeep; + } + + public String getHookOnServerStarted() { + return hookOnServerStarted; + } + + public void setHookOnServerStarted(String hookOnServerStarted) { + this.hookOnServerStarted = hookOnServerStarted; + } + + public String getHookOnServerKeepalive() { + return hookOnServerKeepalive; + } + + public void setHookOnServerKeepalive(String hookOnServerKeepalive) { + this.hookOnServerKeepalive = hookOnServerKeepalive; + } + + public String getHookOnSendRtpStopped() { + return hookOnSendRtpStopped; + } + + public void setHookOnSendRtpStopped(String hookOnSendRtpStopped) { + this.hookOnSendRtpStopped = hookOnSendRtpStopped; + } + + public String getHookOnRtpServerTimeout() { + return hookOnRtpServerTimeout; + } + + public void setHookOnRtpServerTimeout(String hookOnRtpServerTimeout) { + this.hookOnRtpServerTimeout = hookOnRtpServerTimeout; + } + + public String getTranscodeSuffix() { + return transcodeSuffix; + } + + public void setTranscodeSuffix(String transcodeSuffix) { + this.transcodeSuffix = transcodeSuffix; + } +} diff --git a/ycl-server/pom.xml b/ycl-server/pom.xml index 3a4c1b9..3bcf049 100644 --- a/ycl-server/pom.xml +++ b/ycl-server/pom.xml @@ -18,6 +18,13 @@ <dependencies> + <!--瑙嗛澶勭悊--> + <dependency> + <groupId>org.bytedeco</groupId> + <artifactId>javacv-platform</artifactId> + <version>1.5.7</version> + </dependency> + <!--netty--> <dependency> <groupId>io.netty</groupId> diff --git a/ycl-server/src/main/java/com/ycl/platform/mapper/DeviceInfoMapper.java b/ycl-server/src/main/java/com/ycl/platform/mapper/DeviceInfoMapper.java new file mode 100644 index 0000000..d3ba46f --- /dev/null +++ b/ycl-server/src/main/java/com/ycl/platform/mapper/DeviceInfoMapper.java @@ -0,0 +1,22 @@ +package com.ycl.platform.mapper; + +import com.ycl.platform.domain.entity.DeviceInfo; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.ycl.platform.domain.vo.DeviceInfoVO; +import com.ycl.platform.domain.form.DeviceInfoForm; +import java.util.List; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +/** + * 鍥芥爣绾ц仈鍚屾鏁版嵁 Mapper 鎺ュ彛 + * + * @author xp + * @since 2024-08-21 + */ +@Mapper +public interface DeviceInfoMapper extends BaseMapper<DeviceInfo> { + + +} diff --git a/ycl-server/src/main/java/com/ycl/platform/mapper/ReportMapper.java b/ycl-server/src/main/java/com/ycl/platform/mapper/ReportMapper.java index 1d574d4..2569293 100644 --- a/ycl-server/src/main/java/com/ycl/platform/mapper/ReportMapper.java +++ b/ycl-server/src/main/java/com/ycl/platform/mapper/ReportMapper.java @@ -33,4 +33,12 @@ List<ReportVO> examineRecord(@Param("id") Integer id); List<String> selectNumberList(String status, String date); + + /** + * 鏌ヨ宸ュ崟鏄惁鎶ュ杩� + * + * @param serialNumber 鍥芥爣鐮� + * @return + */ + Report checkPointReported(@Param("serialNumber") String serialNumber); } diff --git a/ycl-server/src/main/java/com/ycl/platform/mapper/WorkOrderMapper.java b/ycl-server/src/main/java/com/ycl/platform/mapper/WorkOrderMapper.java index cf2f65c..fdbf66b 100644 --- a/ycl-server/src/main/java/com/ycl/platform/mapper/WorkOrderMapper.java +++ b/ycl-server/src/main/java/com/ycl/platform/mapper/WorkOrderMapper.java @@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage; import com.ycl.platform.domain.entity.WorkOrder; import com.ycl.platform.domain.query.*; +import com.ycl.platform.domain.vo.DeviceInfoVO; import com.ycl.platform.domain.vo.WorkOrderVO; import com.ycl.platform.domain.vo.YwPointJobVO; import com.ycl.platform.domain.vo.screen.ScreenWorkOrderVO; @@ -63,4 +64,10 @@ * @return 鏁版嵁 */ List<WorkOrderRegionVO> workOrderRegion(DashboardQuery dashboardQuery); + + /** + * 鏌ヨ宸ュ崟璁惧淇℃伅 + * @return + */ + List<DeviceInfoVO> hasErrorWorkOrderList(); } diff --git a/ycl-server/src/main/java/com/ycl/platform/service/DataCenterService.java b/ycl-server/src/main/java/com/ycl/platform/service/DataCenterService.java index db4bf96..d06696f 100644 --- a/ycl-server/src/main/java/com/ycl/platform/service/DataCenterService.java +++ b/ycl-server/src/main/java/com/ycl/platform/service/DataCenterService.java @@ -23,7 +23,6 @@ * @param query * @return */ - // TODO 杩斿洖鏁版嵁瀵硅薄鏇存崲 Result videoPointOnlineRate(DataCenterQuery query); /** @@ -72,7 +71,6 @@ * @param query * @return */ - // TODO 杩斿洖鏁版嵁瀵硅薄鏇存崲 Result videoLabelingAccuracy(DataCenterQuery query); /** @@ -81,7 +79,6 @@ * @param query * @return */ - // TODO 杩斿洖鏁版嵁瀵硅薄鏇存崲 Result videoImportantPointLabelingAccuracy(DataCenterQuery query); /** @@ -90,7 +87,6 @@ * @param query * @return */ - // TODO 杩斿洖鏁版嵁瀵硅薄鏇存崲 Result videoCheckTimeAccuracy(DataCenterQuery query); /** @@ -99,7 +95,6 @@ * @param query * @return */ - // TODO 杩斿洖鏁版嵁瀵硅薄鏇存崲 Result videoImportantPointCheckTimeAccuracy(DataCenterQuery query); /** @@ -108,7 +103,6 @@ * @param query * @return */ - // TODO 杩斿洖鏁版嵁瀵硅薄鏇存崲 Result videoImportantPointOnlineRate(DataCenterQuery query); /** @@ -117,7 +111,6 @@ * @param query * @return */ - // TODO 杩斿洖鏁版嵁瀵硅薄鏇存崲 Result videoImportantPointImageOnlineRate(DataCenterQuery query); @@ -226,7 +219,6 @@ * @param query * @return */ - // TODO 鏇存崲鍝嶅簲缁撴灉 Result facePointOnlineRate(DataCenterQuery query); /** diff --git a/ycl-server/src/main/java/com/ycl/platform/service/DeviceInfoService.java b/ycl-server/src/main/java/com/ycl/platform/service/DeviceInfoService.java new file mode 100644 index 0000000..bb26722 --- /dev/null +++ b/ycl-server/src/main/java/com/ycl/platform/service/DeviceInfoService.java @@ -0,0 +1,15 @@ +package com.ycl.platform.service; + +import com.ycl.platform.domain.entity.DeviceInfo; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + * 鍥芥爣绾ц仈鍚屾鏁版嵁 鏈嶅姟绫� + * + * @author xp + * @since 2024-08-21 + */ +public interface DeviceInfoService extends IService<DeviceInfo> { + + +} diff --git a/ycl-server/src/main/java/com/ycl/platform/service/WorkOrderService.java b/ycl-server/src/main/java/com/ycl/platform/service/WorkOrderService.java index 8ad3749..fcaee48 100644 --- a/ycl-server/src/main/java/com/ycl/platform/service/WorkOrderService.java +++ b/ycl-server/src/main/java/com/ycl/platform/service/WorkOrderService.java @@ -4,6 +4,7 @@ import com.ycl.platform.domain.entity.WorkOrder; import com.ycl.platform.domain.form.*; import com.ycl.platform.domain.query.*; +import com.ycl.platform.domain.vo.DeviceInfoVO; import com.ycl.platform.domain.vo.DistributeWorkOrderVO; import com.ycl.platform.domain.vo.screen.WorkOrderRegionVO; import com.ycl.platform.domain.vo.screen.WorkOrderTotalVO; @@ -175,4 +176,29 @@ */ List<WorkOrderRegionVO> workOrderRegion(DashboardQuery dashboardQuery); + + /** + * 宸ュ崟璁惧鐐规挱鑾峰彇涓�甯у浘鐗� + * + * @param deviceId 璁惧鍥芥爣鐮� + * @param channelId 璁惧閫氶亾缂栧彿 + * @return 鏁版嵁 + */ + String getFrameImgByDevice(String deviceId, String channelId); + + /** + * 鏌ヨ宸ュ崟锛氬凡涓嬪彂銆佸凡澶勭悊銆佸凡瀹屾垚鐨勫伐鍗� + * + * @return 鏁版嵁 + */ + List<DeviceInfoVO> hasErrorWorkOrderList(); + + /** + * 鏌ヨ宸ュ崟锛氬凡涓嬪彂銆佸凡澶勭悊銆佸凡瀹屾垚鐨勫伐鍗� + * + * @param workOrderId 宸ュ崟ID + * @param imgPath 鍥惧儚鍦板潃 + * @return 鏁版嵁 + */ + void updateImgById(Integer workOrderId, String imgPath); } diff --git a/ycl-server/src/main/java/com/ycl/platform/service/impl/DataCenterServiceImpl.java b/ycl-server/src/main/java/com/ycl/platform/service/impl/DataCenterServiceImpl.java index 7e35095..f779f18 100644 --- a/ycl-server/src/main/java/com/ycl/platform/service/impl/DataCenterServiceImpl.java +++ b/ycl-server/src/main/java/com/ycl/platform/service/impl/DataCenterServiceImpl.java @@ -52,9 +52,9 @@ ); } query.addCriteria(criteria); + long total = mongoTemplate.count(query, VideoOnlineResult.class); query.with(Sort.by(Sort.Order.asc(TIME_FIELD))).skip(params.getSkipNum()).limit(Math.toIntExact(params.getPageSize())); List<VideoOnlineResult> resultList = mongoTemplate.find(query, VideoOnlineResult.class); - long total = mongoTemplate.count(query, VideoOnlineResult.class); return Result.ok().data(resultList).total(total); } @@ -77,9 +77,9 @@ ); } query.addCriteria(criteria); + long total = mongoTemplate.count(query, OneMachineFileResult.class); query.with(Sort.by(Sort.Order.asc(TIME_FIELD))).skip(params.getSkipNum()).limit(Math.toIntExact(params.getPageSize())); List<OneMachineFileResult> resultList = mongoTemplate.find(query, OneMachineFileResult.class); - long total = mongoTemplate.count(query, OneMachineFileResult.class); return Result.ok().data(resultList).total(total); } @@ -102,9 +102,9 @@ ); } query.addCriteria(criteria); + long total = mongoTemplate.count(query, MonitorQualifyResult.class); query.with(Sort.by(Sort.Order.asc(TIME_FIELD))).skip(params.getSkipNum()).limit(Math.toIntExact(params.getPageSize())); List<MonitorQualifyResult> resultList = mongoTemplate.find(query, MonitorQualifyResult.class); - long total = mongoTemplate.count(query, MonitorQualifyResult.class); return Result.ok().data(resultList).total(total); } @@ -127,9 +127,9 @@ ); } query.addCriteria(criteria); + long total = mongoTemplate.count(query, OneMachineFileResult.class); query.with(Sort.by(Sort.Order.asc(TIME_FIELD))).skip(params.getSkipNum()).limit(Math.toIntExact(params.getPageSize())); List<OneMachineFileResult> resultList = mongoTemplate.find(query, OneMachineFileResult.class); - long total = mongoTemplate.count(query, OneMachineFileResult.class); return Result.ok().data(resultList).total(total); } @@ -152,9 +152,9 @@ ); } query.addCriteria(criteria); + long total = mongoTemplate.count(query, RecordMetaDSumResult.class); query.with(Sort.by(Sort.Order.asc(TIME_FIELD))).skip(params.getSkipNum()).limit(Math.toIntExact(params.getPageSize())); List<RecordMetaDSumResult> resultList = mongoTemplate.find(query, RecordMetaDSumResult.class); - long total = mongoTemplate.count(query, RecordMetaDSumResult.class); return Result.ok().data(resultList).total(total); } @@ -177,9 +177,9 @@ ); } query.addCriteria(criteria); + long total = mongoTemplate.count(query, RecordMetaDSumResult.class); query.with(Sort.by(Sort.Order.asc(TIME_FIELD))).skip(params.getSkipNum()).limit(Math.toIntExact(params.getPageSize())); List<RecordMetaDSumResult> resultList = mongoTemplate.find(query, RecordMetaDSumResult.class); - long total = mongoTemplate.count(query, RecordMetaDSumResult.class); return Result.ok().data(resultList).total(total); } @@ -189,7 +189,6 @@ * @param params * @return */ - // TODO 杩斿洖鏁版嵁瀵硅薄鏇存崲 @Override public Result videoLabelingAccuracy(DataCenterQuery params) { Query query = new Query(); @@ -203,9 +202,9 @@ ); } query.addCriteria(criteria); + long total = mongoTemplate.count(query, OneMachineFileResult.class); query.with(Sort.by(Sort.Order.asc(TIME_FIELD))).skip(params.getSkipNum()).limit(Math.toIntExact(params.getPageSize())); List<OneMachineFileResult> resultList = mongoTemplate.find(query, OneMachineFileResult.class); - long total = mongoTemplate.count(query, OneMachineFileResult.class); return Result.ok().data(resultList).total(total); } @@ -215,7 +214,6 @@ * @param params * @return */ - // TODO 杩斿洖鏁版嵁瀵硅薄鏇存崲 @Override public Result videoImportantPointLabelingAccuracy(DataCenterQuery params) { Query query = new Query(); @@ -229,9 +227,9 @@ ); } query.addCriteria(criteria); + long total = mongoTemplate.count(query, OneMachineFileResult.class); query.with(Sort.by(Sort.Order.asc(TIME_FIELD))).skip(params.getSkipNum()).limit(Math.toIntExact(params.getPageSize())); List<OneMachineFileResult> resultList = mongoTemplate.find(query, OneMachineFileResult.class); - long total = mongoTemplate.count(query, OneMachineFileResult.class); return Result.ok().data(resultList).total(total); } @@ -241,7 +239,6 @@ * @param params * @return */ - // TODO 杩斿洖鏁版嵁瀵硅薄鏇存崲 @Override public Result videoCheckTimeAccuracy(DataCenterQuery params) { Query query = new Query(); @@ -255,9 +252,9 @@ ); } query.addCriteria(criteria); + long total = mongoTemplate.count(query, OneMachineFileResult.class); query.with(Sort.by(Sort.Order.asc(TIME_FIELD))).skip(params.getSkipNum()).limit(Math.toIntExact(params.getPageSize())); List<OneMachineFileResult> resultList = mongoTemplate.find(query, OneMachineFileResult.class); - long total = mongoTemplate.count(query, OneMachineFileResult.class); return Result.ok().data(resultList).total(total); } @@ -267,7 +264,6 @@ * @param params * @return */ - // TODO 杩斿洖鏁版嵁瀵硅薄鏇存崲 @Override public Result videoImportantPointCheckTimeAccuracy(DataCenterQuery params) { Query query = new Query(); @@ -281,9 +277,9 @@ ); } query.addCriteria(criteria); + long total = mongoTemplate.count(query, OneMachineFileResult.class); query.with(Sort.by(Sort.Order.asc(TIME_FIELD))).skip(params.getSkipNum()).limit(Math.toIntExact(params.getPageSize())); List<OneMachineFileResult> resultList = mongoTemplate.find(query, OneMachineFileResult.class); - long total = mongoTemplate.count(query, OneMachineFileResult.class); return Result.ok().data(resultList).total(total); } @@ -293,7 +289,6 @@ * @param params * @return */ - // TODO 杩斿洖鏁版嵁瀵硅薄鏇存崲 @Override public Result videoImportantPointOnlineRate(DataCenterQuery params) { Query query = new Query(); @@ -307,9 +302,9 @@ ); } query.addCriteria(criteria); + long total = mongoTemplate.count(query, OneMachineFileResult.class); query.with(Sort.by(Sort.Order.asc(TIME_FIELD))).skip(params.getSkipNum()).limit(Math.toIntExact(params.getPageSize())); List<OneMachineFileResult> resultList = mongoTemplate.find(query, OneMachineFileResult.class); - long total = mongoTemplate.count(query, OneMachineFileResult.class); return Result.ok().data(resultList).total(total); } @@ -319,7 +314,6 @@ * @param params * @return */ - // TODO 杩斿洖鏁版嵁瀵硅薄鏇存崲 @Override public Result videoImportantPointImageOnlineRate(DataCenterQuery params) { Query query = new Query(); @@ -333,9 +327,9 @@ ); } query.addCriteria(criteria); + long total = mongoTemplate.count(query, OneMachineFileResult.class); query.with(Sort.by(Sort.Order.asc(TIME_FIELD))).skip(params.getSkipNum()).limit(Math.toIntExact(params.getPageSize())); List<OneMachineFileResult> resultList = mongoTemplate.find(query, OneMachineFileResult.class); - long total = mongoTemplate.count(query, OneMachineFileResult.class); return Result.ok().data(resultList).total(total); } @@ -361,9 +355,9 @@ ); } query.addCriteria(criteria); + long total = mongoTemplate.count(query, SnapshotDataMonitorResult.class); query.with(Sort.by(Sort.Order.asc(TIME_FIELD))).skip(params.getSkipNum()).limit(Math.toIntExact(params.getPageSize())); List<SnapshotDataMonitorResult> resultList = mongoTemplate.find(query, SnapshotDataMonitorResult.class); - long total = mongoTemplate.count(query, SnapshotDataMonitorResult.class); return Result.ok().data(resultList).total(total); } @@ -386,9 +380,9 @@ ); } query.addCriteria(criteria); + long total = mongoTemplate.count(query, SnapshotDataMonitorResult.class); query.with(Sort.by(Sort.Order.asc(TIME_FIELD))).skip(params.getSkipNum()).limit(Math.toIntExact(params.getPageSize())); List<SnapshotDataMonitorResult> resultList = mongoTemplate.find(query, SnapshotDataMonitorResult.class); - long total = mongoTemplate.count(query, SnapshotDataMonitorResult.class); return Result.ok().data(resultList).total(total); } @@ -411,9 +405,9 @@ ); } query.addCriteria(criteria); + long total = mongoTemplate.count(query, OneMachineFileResult.class); query.with(Sort.by(Sort.Order.asc(TIME_FIELD))).skip(params.getSkipNum()).limit(Math.toIntExact(params.getPageSize())); List<OneMachineFileResult> resultList = mongoTemplate.find(query, OneMachineFileResult.class); - long total = mongoTemplate.count(query, OneMachineFileResult.class); return Result.ok().data(resultList).total(total); } @@ -436,9 +430,9 @@ ); } query.addCriteria(criteria); + long total = mongoTemplate.count(query, CrossDetailResult.class); query.with(Sort.by(Sort.Order.asc(TIME_FIELD))).skip(params.getSkipNum()).limit(Math.toIntExact(params.getPageSize())); List<CrossDetailResult> resultList = mongoTemplate.find(query, CrossDetailResult.class); - long total = mongoTemplate.count(query, CrossDetailResult.class); return Result.ok().data(resultList).total(total); } @@ -461,9 +455,9 @@ ); } query.addCriteria(criteria); + long total = mongoTemplate.count(query, DataIntegrityMonitoringResult.class); query.with(Sort.by(Sort.Order.asc(TIME_FIELD))).skip(params.getSkipNum()).limit(Math.toIntExact(params.getPageSize())); List<DataIntegrityMonitoringResult> resultList = mongoTemplate.find(query, DataIntegrityMonitoringResult.class); - long total = mongoTemplate.count(query, DataIntegrityMonitoringResult.class); return Result.ok().data(resultList).total(total); } @@ -486,9 +480,9 @@ ); } query.addCriteria(criteria); + long total = mongoTemplate.count(query, AttrRecognitionMonitorResult.class); query.with(Sort.by(Sort.Order.asc(TIME_FIELD))).skip(params.getSkipNum()).limit(Math.toIntExact(params.getPageSize())); List<AttrRecognitionMonitorResult> resultList = mongoTemplate.find(query, AttrRecognitionMonitorResult.class); - long total = mongoTemplate.count(query, AttrRecognitionMonitorResult.class); return Result.ok().data(resultList).total(total); } @@ -511,9 +505,9 @@ ); } query.addCriteria(criteria); + long total = mongoTemplate.count(query, VehicleDeviceInspectionResult.class); query.with(Sort.by(Sort.Order.asc(TIME_FIELD))).skip(params.getSkipNum()).limit(Math.toIntExact(params.getPageSize())); List<VehicleDeviceInspectionResult> resultList = mongoTemplate.find(query, VehicleDeviceInspectionResult.class); - long total = mongoTemplate.count(query, VehicleDeviceInspectionResult.class); return Result.ok().data(resultList).total(total); } @@ -536,9 +530,9 @@ ); } query.addCriteria(criteria); + long total = mongoTemplate.count(query, SnapshotDelayMonitorResult.class); query.with(Sort.by(Sort.Order.asc(TIME_FIELD))).skip(params.getSkipNum()).limit(Math.toIntExact(params.getPageSize())); List<SnapshotDelayMonitorResult> resultList = mongoTemplate.find(query, SnapshotDelayMonitorResult.class); - long total = mongoTemplate.count(query, SnapshotDelayMonitorResult.class); return Result.ok().data(resultList).total(total); } @@ -561,9 +555,9 @@ ); } query.addCriteria(criteria); + long total = mongoTemplate.count(query, PicAccessResult.class); query.with(Sort.by(Sort.Order.asc(TIME_FIELD))).skip(params.getSkipNum()).limit(Math.toIntExact(params.getPageSize())); List<PicAccessResult> resultList = mongoTemplate.find(query, PicAccessResult.class); - long total = mongoTemplate.count(query, PicAccessResult.class); return Result.ok().data(resultList).total(total); } @@ -586,9 +580,9 @@ ); } query.addCriteria(criteria); + long total = mongoTemplate.count(query, VehicleDeviceSamplingResult.class); query.with(Sort.by(Sort.Order.asc(TIME_FIELD))).skip(params.getSkipNum()).limit(Math.toIntExact(params.getPageSize())); List<VehicleDeviceSamplingResult> resultList = mongoTemplate.find(query, VehicleDeviceSamplingResult.class); - long total = mongoTemplate.count(query, VehicleDeviceSamplingResult.class); return Result.ok().data(resultList).total(total); } @@ -611,9 +605,9 @@ ); } query.addCriteria(criteria); + long total = mongoTemplate.count(query, SnapshotDataMonitorResult.class); query.with(Sort.by(Sort.Order.asc(TIME_FIELD))).skip(params.getSkipNum()).limit(Math.toIntExact(params.getPageSize())); List<SnapshotDataMonitorResult> resultList = mongoTemplate.find(query, SnapshotDataMonitorResult.class); - long total = mongoTemplate.count(query, SnapshotDataMonitorResult.class); return Result.ok().data(resultList).total(total); } @@ -623,7 +617,6 @@ * @param params * @return */ - // TODO 鏇存崲鍝嶅簲缁撴灉 @Override public Result facePointOnlineRate(DataCenterQuery params) { Query query = new Query(); @@ -637,9 +630,9 @@ ); } query.addCriteria(criteria); + long total = mongoTemplate.count(query, SnapshotDataMonitorResult.class); query.with(Sort.by(Sort.Order.asc(TIME_FIELD))).skip(params.getSkipNum()).limit(Math.toIntExact(params.getPageSize())); List<SnapshotDataMonitorResult> resultList = mongoTemplate.find(query, SnapshotDataMonitorResult.class); - long total = mongoTemplate.count(query, SnapshotDataMonitorResult.class); return Result.ok().data(resultList).total(total); } @@ -662,9 +655,9 @@ ); } query.addCriteria(criteria); + long total = mongoTemplate.count(query, OneMachineFileResult.class); query.with(Sort.by(Sort.Order.asc(TIME_FIELD))).skip(params.getSkipNum()).limit(Math.toIntExact(params.getPageSize())); List<OneMachineFileResult> resultList = mongoTemplate.find(query, OneMachineFileResult.class); - long total = mongoTemplate.count(query, OneMachineFileResult.class); return Result.ok().data(resultList).total(total); } @@ -687,9 +680,9 @@ ); } query.addCriteria(criteria); + long total = mongoTemplate.count(query, CrossDetailResult.class); query.with(Sort.by(Sort.Order.asc(TIME_FIELD))).skip(params.getSkipNum()).limit(Math.toIntExact(params.getPageSize())); List<CrossDetailResult> resultList = mongoTemplate.find(query, CrossDetailResult.class); - long total = mongoTemplate.count(query, CrossDetailResult.class); return Result.ok().data(resultList).total(total); } @@ -712,9 +705,9 @@ ); } query.addCriteria(criteria); + long total = mongoTemplate.count(query, MonitoringDetailResult.class); query.with(Sort.by(Sort.Order.asc(TIME_FIELD))).skip(params.getSkipNum()).limit(Math.toIntExact(params.getPageSize())); List<MonitoringDetailResult> resultList = mongoTemplate.find(query, MonitoringDetailResult.class); - long total = mongoTemplate.count(query, MonitoringDetailResult.class); return Result.ok().data(resultList).total(total); } @@ -737,9 +730,9 @@ ); } query.addCriteria(criteria); + long total = mongoTemplate.count(query, FaceDeviceInspectionResult.class); query.with(Sort.by(Sort.Order.asc(TIME_FIELD))).skip(params.getSkipNum()).limit(Math.toIntExact(params.getPageSize())); List<FaceDeviceInspectionResult> resultList = mongoTemplate.find(query, FaceDeviceInspectionResult.class); - long total = mongoTemplate.count(query, FaceDeviceInspectionResult.class); return Result.ok().data(resultList).total(total); } @@ -762,9 +755,9 @@ ); } query.addCriteria(criteria); + long total = mongoTemplate.count(query, FaceDeviceInspectionResult.class); query.with(Sort.by(Sort.Order.asc(TIME_FIELD))).skip(params.getSkipNum()).limit(Math.toIntExact(params.getPageSize())); List<FaceDeviceInspectionResult> resultList = mongoTemplate.find(query, FaceDeviceInspectionResult.class); - long total = mongoTemplate.count(query, FaceDeviceInspectionResult.class); return Result.ok().data(resultList).total(total); } @@ -787,9 +780,9 @@ ); } query.addCriteria(criteria); + long total = mongoTemplate.count(query, FaceDeviceSamplingResult.class); query.with(Sort.by(Sort.Order.asc(TIME_FIELD))).skip(params.getSkipNum()).limit(Math.toIntExact(params.getPageSize())); List<FaceDeviceSamplingResult> resultList = mongoTemplate.find(query, FaceDeviceSamplingResult.class); - long total = mongoTemplate.count(query, FaceDeviceSamplingResult.class); return Result.ok().data(resultList).total(total); } } diff --git a/ycl-server/src/main/java/com/ycl/platform/service/impl/DeviceInfoServiceImpl.java b/ycl-server/src/main/java/com/ycl/platform/service/impl/DeviceInfoServiceImpl.java new file mode 100644 index 0000000..553b78d --- /dev/null +++ b/ycl-server/src/main/java/com/ycl/platform/service/impl/DeviceInfoServiceImpl.java @@ -0,0 +1,23 @@ +package com.ycl.platform.service.impl; + +import com.ycl.platform.domain.entity.DeviceInfo; +import com.ycl.platform.mapper.DeviceInfoMapper; +import com.ycl.platform.service.DeviceInfoService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; +import lombok.RequiredArgsConstructor; + +/** + * 鍥芥爣绾ц仈鍚屾鏁版嵁 鏈嶅姟瀹炵幇绫� + * + * @author xp + * @since 2024-08-21 + */ +@Service +@RequiredArgsConstructor +public class DeviceInfoServiceImpl extends ServiceImpl<DeviceInfoMapper, DeviceInfo> implements DeviceInfoService { + + private final DeviceInfoMapper deviceInfoMapper; + + +} diff --git a/ycl-server/src/main/java/com/ycl/platform/service/impl/WorkOrderServiceImpl.java b/ycl-server/src/main/java/com/ycl/platform/service/impl/WorkOrderServiceImpl.java index 66e3094..13a982c 100644 --- a/ycl-server/src/main/java/com/ycl/platform/service/impl/WorkOrderServiceImpl.java +++ b/ycl-server/src/main/java/com/ycl/platform/service/impl/WorkOrderServiceImpl.java @@ -1,14 +1,18 @@ package com.ycl.platform.service.impl; +import com.alibaba.fastjson2.JSON; import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper; import com.baomidou.mybatisplus.extension.conditions.update.LambdaUpdateChainWrapper; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.ycl.config.PlatformConfig; +import com.ycl.config.ServerConfig; import com.ycl.exception.ServiceException; import com.ycl.platform.domain.entity.*; import com.ycl.platform.domain.form.*; import com.ycl.platform.domain.query.*; +import com.ycl.platform.domain.vo.DeviceInfoVO; import com.ycl.platform.domain.vo.DistributeWorkOrderVO; import com.ycl.platform.domain.vo.WorkOrderVO; import com.ycl.platform.domain.vo.WorkOrderYwConditionRecordVO; @@ -20,6 +24,8 @@ import com.ycl.platform.service.WorkOrderAuditingRecordService; import com.ycl.platform.service.WorkOrderService; import com.ycl.platform.service.YwPointService; +import com.ycl.platform.wvp.StreamContent; +import com.ycl.platform.wvp.WVPResult; import com.ycl.system.Result; import com.ycl.system.domain.SysConfig; import com.ycl.system.mapper.SysConfigMapper; @@ -27,20 +33,29 @@ import com.ycl.system.page.PageUtil; import com.ycl.utils.DateUtils; import com.ycl.utils.SecurityUtils; +import com.ycl.utils.http.HttpUtils; import com.ycl.utils.redis.RedisCache; import com.ycl.utils.uuid.IdUtils; import enumeration.general.*; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.ObjectUtils; +import org.bytedeco.javacv.FFmpegFrameGrabber; +import org.bytedeco.javacv.Frame; +import org.bytedeco.javacv.Java2DFrameConverter; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import org.springframework.util.Assert; import org.springframework.util.CollectionUtils; import org.springframework.util.StringUtils; +import javax.imageio.ImageIO; +import java.awt.image.BufferedImage; +import java.io.File; +import java.io.IOException; import java.time.LocalDateTime; import java.time.ZoneId; import java.util.*; @@ -66,6 +81,11 @@ private final WorkOrderDistributeRecordMapper workOrderDistributeRecordMapper; private final TMonitorMapper monitorMapper; private final SysConfigMapper configMapper; + private final ServerConfig serverConfig; + private final ReportMapper reportMapper; + + @Value("${rtsp.server:http://127.0.0.1:7788}") + private String rtspServer; private final String DISTRIBUTE_LOCK_KEY = "distributeLock"; private final static String IMPORTANT = "important"; @@ -93,7 +113,7 @@ Map<String, WorkOrder> mapping = inDatabaseWorkOrderList.stream().collect((Collectors.toMap(WorkOrder::getSerialNumber, workOrder -> workOrder))); List<WorkOrder> waitAddList = new ArrayList<>(48); Integer updateNum = 0; - // TODO 鏌ヨ鏄惁鎶ュ杩囷紝鏇存柊鏁呴殰绫诲瀷 + for (WorkOrder workOrder : workOrderList) { WorkOrder databaseWorkOrder = mapping.get(workOrder.getSerialNumber()); if (Objects.nonNull(databaseWorkOrder)) { @@ -110,11 +130,22 @@ databaseWorkOrder.setUpdateTime(now); baseMapper.updateById(databaseWorkOrder); updateNum++; - // 鍚屾椂鏂板涓�涓繍缁村鐞嗕俊鎭紝琛ㄦ槑姝ゅ伐鍗曡璋冩暣 TODO + // 鍚屾椂鏂板涓�涓繍缁村鐞嗕俊鎭紝琛ㄦ槑姝ゅ伐鍗曡璋冩暣 + WorkOrderYwConditionRecord ywRecord = new WorkOrderYwConditionRecord(); + ywRecord.setWorkOrderId(databaseWorkOrder.getId()); + ywRecord.setCommitUser(1); + ywRecord.setYwCondition("鏁呴殰绫诲瀷鏇存柊锛屽伐鍗曠姸鎬佽皟鏁翠负寰呭鐞�"); + ywRecord.setCreateTime(new Date()); + workOrderYwConditionRecordMapper.insert(ywRecord); } } else { workOrder.setCreateTime(new Date()); workOrder.setUpdateTime(new Date()); + // 濡傛灉鎶ュ杩囷紝浣跨敤鏈�鏂版姤澶囩殑閿欒绫诲瀷 + Report report = reportMapper.checkPointReported(workOrder.getSerialNumber()); + if (Objects.nonNull(report)) { + workOrder.setErrorType(report.getErrorType()); + } waitAddList.add(workOrder); } } @@ -297,6 +328,7 @@ workOrderYwConditionRecord.setCommitUser(SecurityUtils.getLoginUser().getUserId().intValue()); workOrderYwConditionRecord.setYwCondition(form.getYwCondition()); workOrderYwConditionRecord.setYwProofMaterials(form.getYwProofMaterials()); + workOrderYwConditionRecord.setSysMsg(Boolean.FALSE); workOrderYwConditionRecordMapper.insert(workOrderYwConditionRecord); return Result.ok("鎿嶄綔鎴愬姛"); } @@ -304,6 +336,11 @@ @Override public Result selectYwConditionByYwId(Integer id) { List<WorkOrderYwConditionRecordVO> ywConditionList = workOrderYwConditionRecordMapper.selectYwConditionByYwId(id); + ywConditionList.stream().forEach(item -> { + if (Objects.nonNull(item.getSysMsg()) && item.getSysMsg()) { + item.setCommitUserName("绯荤粺娑堟伅"); + } + }); return Result.ok().data(ywConditionList); } @@ -557,4 +594,53 @@ public List<WorkOrderRegionVO> workOrderRegion(DashboardQuery dashboardQuery) { return baseMapper.workOrderRegion(dashboardQuery); } + + + @Override + public String getFrameImgByDevice(String deviceId, String channelId) { + String url = String.format(this.rtspServer + "/start/%s/%s", deviceId, channelId); + String result = HttpUtils.sendGet(url); + WVPResult wvpResult = JSON.parseObject(result, WVPResult.class); + if (0 == wvpResult.getCode()) { + StreamContent data = (StreamContent) wvpResult.getData(); + String rtspUrl = data.getRtsp(); + if (StringUtils.hasText(rtspUrl)) { + try { + // 鍒涘缓FFmpegFrameGrabber瀵硅薄 + FFmpegFrameGrabber grabber = new FFmpegFrameGrabber(rtspUrl); + grabber.start(); // 寮�濮嬫崟鑾� + + Frame frame; + if ((frame = grabber.grabFrame()) != null) { + // 灏嗗抚杞崲涓哄浘鐗� + Java2DFrameConverter converter = new Java2DFrameConverter(); + BufferedImage image = converter.convert(frame); + File outputfile = new File(serverConfig.getUrl() + PlatformConfig.getUploadPath() + deviceId + IdUtils.fastSimpleUUID() + ".png"); + ImageIO.write(image, "png", outputfile); + String imgPath = outputfile.getAbsolutePath(); + System.out.println("Saved " + imgPath); + return imgPath; + } + grabber.stop(); // 鍋滄鎹曡幏 + grabber.release(); // 閲婃斁璧勬簮 + } catch (IOException e) { + e.printStackTrace(); + } + } + } + return null; + } + + @Override + public List<DeviceInfoVO> hasErrorWorkOrderList() { + List<DeviceInfoVO> list = baseMapper.hasErrorWorkOrderList(); + return list; + } + + @Override + public void updateImgById(Integer workOrderId, String imgPath) { + new LambdaUpdateChainWrapper<>(baseMapper) + .eq(WorkOrder::getId, workOrderId) + .set(WorkOrder::getYwCheckCondition, imgPath); + } } diff --git a/ycl-server/src/main/java/com/ycl/task/DeviceChannelTask.java b/ycl-server/src/main/java/com/ycl/task/DeviceChannelTask.java new file mode 100644 index 0000000..ae1b355 --- /dev/null +++ b/ycl-server/src/main/java/com/ycl/task/DeviceChannelTask.java @@ -0,0 +1,18 @@ +package com.ycl.task; + +import org.springframework.stereotype.Component; + +/** + * 閫氶亾鍚屾 + * + * @author锛歺p + * @date锛�2024/8/21 15:18 + */ +@Component("deviceChannelTask") +public class DeviceChannelTask { + + public void run() { + // TODO 寰呭疄鐜� + } + +} diff --git a/ycl-server/src/main/java/com/ycl/task/PlatformTask.java b/ycl-server/src/main/java/com/ycl/task/PlatformTask.java index e0ed630..ab38afb 100644 --- a/ycl-server/src/main/java/com/ycl/task/PlatformTask.java +++ b/ycl-server/src/main/java/com/ycl/task/PlatformTask.java @@ -1,7 +1,9 @@ package com.ycl.task; import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper; +import com.ycl.platform.domain.entity.Platform; import com.ycl.platform.domain.entity.PlatformOnline; +import com.ycl.platform.mapper.PlatformMapper; import com.ycl.platform.service.PlatformOnlineService; import com.ycl.system.entity.SysDictData; import com.ycl.system.service.impl.SysDictTypeServiceImpl; @@ -32,7 +34,7 @@ public class PlatformTask { private final RedisTemplate redisTemplate; - private final SysDictTypeServiceImpl dictTypeService; + private final PlatformMapper platformMapper; private final PlatformOnlineService platformOnlineService; /** @@ -56,21 +58,23 @@ * @throws IOException */ public void ping() { - List<SysDictData> platformList = dictTypeService.selectDictDataByType(DICT_TYPE); - for (SysDictData platform : platformList) { + List<Platform> platformList = new LambdaQueryChainWrapper<>(platformMapper) + .isNotNull(Platform::getPlatformIP) + .list(); + for (Platform platform : platformList) { executorService.submit(() -> { try { Boolean reachable = Boolean.FALSE; for (int tryTimes = 1; tryTimes < 3; tryTimes++) { // 涓夌鏈猵ing閫氶噸璇曚竴娆★紝濡傛灉涓嶈鎵嶆墸鍒� - reachable = InetAddress.getByName(platform.getDictValue()).isReachable(3000); + reachable = InetAddress.getByName(platform.getPlatformIP()).isReachable(3000); if (! reachable && tryTimes == 0) { continue; } if (! reachable) { // 濡傛灉ping涓嶉�氾紝绂荤嚎鏃堕暱鍔�5绉� - redisTemplate.opsForValue().increment(REDIS_KEY_PREFIX + platform.getDictValue(), 5); - log.warn(platform.getDictLabel() + "骞冲彴鏈猵ing閫�"); + redisTemplate.opsForValue().increment(REDIS_KEY_PREFIX + platform.getPlatformIP(), 5); + log.warn(platform.getPlatformName() + "骞冲彴鏈猵ing閫�"); } } } catch (Exception e) { @@ -85,28 +89,30 @@ * */ public void synToMySQL() { - List<SysDictData> platformList = dictTypeService.selectDictDataByType(DICT_TYPE); + List<Platform> platformList = new LambdaQueryChainWrapper<>(platformMapper) + .isNotNull(Platform::getPlatformIP) + .list(); // 灏唈ava.util.Date杞崲涓簀ava.sql.Date java.sql.Date sqlDate = new java.sql.Date(new Date().getTime()); - for (SysDictData platform : platformList) { - Object outLineTime = redisTemplate.opsForValue().get(REDIS_KEY_PREFIX + platform.getDictValue()); + for (Platform platform : platformList) { + Object outLineTime = redisTemplate.opsForValue().get(REDIS_KEY_PREFIX + platform.getPlatformIP()); Integer outlineTimeSed = Objects.isNull(outLineTime) ? 0 : (Integer) outLineTime; PlatformOnline one = new LambdaQueryChainWrapper<>(platformOnlineService.getBaseMapper()) - .eq(PlatformOnline::getPlatformIp, platform.getDictValue()) + .eq(PlatformOnline::getPlatformIp, platform.getPlatformIP()) .eq(PlatformOnline::getCreateDate, sqlDate) .one(); if (Objects.isNull(one)) { one = new PlatformOnline(); - one.setPlatformIp(platform.getDictValue()); - one.setPlatformName(platform.getDictLabel()); + one.setPlatformIp(platform.getPlatformIP()); + one.setPlatformName(platform.getPlatformName()); one.setCreateDate(sqlDate); one.setTodayOutlineSed(outlineTimeSed); } else { one.setTodayOutlineSed(one.getTodayOutlineSed() + outlineTimeSed); } - one.setPlatformIp(platform.getDictValue()); - one.setPlatformName(platform.getDictLabel()); + one.setPlatformIp(platform.getPlatformIP()); + one.setPlatformName(platform.getPlatformName()); one.setCreateDate(sqlDate); platformOnlineService.saveOrUpdate(one); diff --git a/ycl-server/src/main/java/com/ycl/task/WorkOrderImgTask.java b/ycl-server/src/main/java/com/ycl/task/WorkOrderImgTask.java new file mode 100644 index 0000000..8603ba8 --- /dev/null +++ b/ycl-server/src/main/java/com/ycl/task/WorkOrderImgTask.java @@ -0,0 +1,48 @@ +package com.ycl.task; + +import com.ycl.platform.domain.vo.DeviceInfoVO; +import com.ycl.platform.service.WorkOrderService; +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Component; +import org.springframework.util.StringUtils; + +import java.util.List; +import java.util.concurrent.ArrayBlockingQueue; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.ThreadPoolExecutor; +import java.util.concurrent.TimeUnit; + +/** + * 宸ュ崟鎭㈠鍥剧墖鑾峰彇 + * + * @author锛歺p + * @date锛�2024/8/21 11:56 + */ +@RequiredArgsConstructor +@Component("workOrderImgTask") +public class WorkOrderImgTask { + + private final WorkOrderService workOrderService; + + private static final ExecutorService executorService = new ThreadPoolExecutor(8, + 24, + 5000, + TimeUnit.SECONDS, + new ArrayBlockingQueue<>(10), + new ThreadPoolExecutor.CallerRunsPolicy() + ); + + public void run() { + // 鏌ュ嚭鏁呴殰鐨勮澶� + List<DeviceInfoVO> deviceList = workOrderService.hasErrorWorkOrderList(); + for (DeviceInfoVO deviceInfo : deviceList) { + executorService.submit(() -> { + String frameImg = workOrderService.getFrameImgByDevice(deviceInfo.getDeviceId(), deviceInfo.getChannelId()); + if (StringUtils.hasText(frameImg)) { + workOrderService.updateImgById(deviceInfo.getWorkOrderId(), frameImg); + } + }); + } + } + +} diff --git a/ycl-server/src/main/resources/application-dev.yml b/ycl-server/src/main/resources/application-dev.yml index ab4cea3..a2a11c7 100644 --- a/ycl-server/src/main/resources/application-dev.yml +++ b/ycl-server/src/main/resources/application-dev.yml @@ -138,3 +138,7 @@ passwd: Yesc@123 apikey: 72fcfd6825304f7fa0453134de620f3a accesskey: fc9503a521544e76a8e69b912a2f177bc6362b19 + +# gb281瑙嗛缃戝叧鍦板潃锛岀敤浜庤幏鍙杛tsp鏍煎紡鐨勬祦鍦板潃 +rtsp: + server: http://192.168.3.88:7788 diff --git a/ycl-server/src/main/resources/application-prod.yml b/ycl-server/src/main/resources/application-prod.yml index 4b089b1..e154de5 100644 --- a/ycl-server/src/main/resources/application-prod.yml +++ b/ycl-server/src/main/resources/application-prod.yml @@ -138,3 +138,7 @@ passwd: Yesc@123 apikey: 72fcfd6825304f7fa0453134de620f3a accesskey: fc9503a521544e76a8e69b912a2f177bc6362b19 + +# gb281瑙嗛缃戝叧鍦板潃锛岀敤浜庤幏鍙杛tsp鏍煎紡鐨勬祦鍦板潃 +rtsp: + server: http://192.168.3.88:7788 diff --git a/ycl-server/src/main/resources/mapper/zgyw/ReportMapper.xml b/ycl-server/src/main/resources/mapper/zgyw/ReportMapper.xml index 52bf32f..9da4ca5 100644 --- a/ycl-server/src/main/resources/mapper/zgyw/ReportMapper.xml +++ b/ycl-server/src/main/resources/mapper/zgyw/ReportMapper.xml @@ -70,4 +70,23 @@ WHERE r.status = #{status} AND #{date} between r.begin_create_time and r.end_create_time </select> + + <select id="checkPointReported" resultType="com.ycl.platform.domain.vo.ReportVO"> + SELECT + r.id, r.errorType + FROM + t_report r + INNER JOIN t_yw_point yo ON r.point_id = yo.id AND yo.deleted = 0 + INNER JOIN t_work_order wo ON yo.serial_number = wo.serial_number AND wo.serial_number = #{serialNumber} AND wo.deleted = 0 + WHERE + r.status = 1 + ORDER BY r.auditing_time DESC + LIMIT 1 + </select> + + + + + + </mapper> diff --git a/ycl-server/src/main/resources/mapper/zgyw/WorkOrderMapper.xml b/ycl-server/src/main/resources/mapper/zgyw/WorkOrderMapper.xml index 667eded..5445a93 100644 --- a/ycl-server/src/main/resources/mapper/zgyw/WorkOrderMapper.xml +++ b/ycl-server/src/main/resources/mapper/zgyw/WorkOrderMapper.xml @@ -171,4 +171,14 @@ ORDER BY d.dept_id </select> + <select id="hasErrorWorkOrderList" resultType="com.ycl.platform.domain.vo.DeviceInfoVO"> + SELECT + wo.id as workOrderId, + di.device_id, + di.channel_id + FROM + t_work_order wo + INNER JOIN t_device_info di ON wo.serial_number = di.device_id + </select> + </mapper> diff --git a/ycl-server/src/main/resources/mapper/zgyw/WorkOrderYwConditionRecordMapper.xml b/ycl-server/src/main/resources/mapper/zgyw/WorkOrderYwConditionRecordMapper.xml index d8b6c6e..24fc1cd 100644 --- a/ycl-server/src/main/resources/mapper/zgyw/WorkOrderYwConditionRecordMapper.xml +++ b/ycl-server/src/main/resources/mapper/zgyw/WorkOrderYwConditionRecordMapper.xml @@ -13,7 +13,7 @@ </resultMap> <select id="selectYwConditionByYwId" resultMap="BaseResultMap"> - SELECT yw.id, yw.commit_user, yw.yw_condition, yw.yw_proofMaterials, yw.create_time, su.nick_name + SELECT yw.id, yw.commit_user, yw.yw_condition, yw.yw_proofMaterials, yw.create_time, yw.sys_msg, su.nick_name FROM t_work_order_yw_condition_record yw INNER JOIN sys_user su ON yw.commit_user = su.user_id AND yw.deleted = 0 AND yw.work_order_id = #{workOrderId} ORDER BY yw.create_time DESC -- Gitblit v1.8.0