Commit 3e7d72eccfcb525d8ff26e1e5e13ed160b9f1094

Authored by chenjunyu_1481036421
1 parent 9452d2b0

feat:查询视频配置去掉是否客户与客户id限制

@@ -138,8 +138,6 @@ public class TkVideoController extends BaseController { @@ -138,8 +138,6 @@ public class TkVideoController extends BaseController {
138 } 138 }
139 String url = 139 String url =
140 videoService.getCameraPreviewURL( 140 videoService.getCameraPreviewURL(
141 - getCurrentUser().isTenantAdmin(),  
142 - getCurrentUser().getCurrentUserId(),  
143 getCurrentUser().getCurrentTenantId(), 141 getCurrentUser().getCurrentTenantId(),
144 entityId, 142 entityId,
145 protocolType); 143 protocolType);
@@ -97,9 +97,9 @@ public class TkVideoServiceImpl extends AbstractBaseService<TkVideoMapper, TkVid @@ -97,9 +97,9 @@ public class TkVideoServiceImpl extends AbstractBaseService<TkVideoMapper, TkVid
97 } 97 }
98 98
99 @Override 99 @Override
100 - public String getCameraPreviewURL(boolean isTenantAdmin, String customerUserId, String tenantId, String entityId, 100 + public String getCameraPreviewURL(String tenantId, String entityId,
101 ProtocolType protocolType) throws IOException { 101 ProtocolType protocolType) throws IOException {
102 - TkVideoDTO videoDTO = getVideoInfo(isTenantAdmin,customerUserId,tenantId,entityId); 102 + TkVideoDTO videoDTO = getVideoInfo(tenantId,entityId);
103 TkVideoPlatformDTO videoPlatformDTO = videoDTO.getVideoPlatformDTO(); 103 TkVideoPlatformDTO videoPlatformDTO = videoDTO.getVideoPlatformDTO();
104 if(videoPlatformDTO.getType()==0){//如果为海康威视 104 if(videoPlatformDTO.getType()==0){//如果为海康威视
105 return HikVisionArtemis(videoDTO,protocolType); 105 return HikVisionArtemis(videoDTO,protocolType);
@@ -112,7 +112,7 @@ public class TkVideoServiceImpl extends AbstractBaseService<TkVideoMapper, TkVid @@ -112,7 +112,7 @@ public class TkVideoServiceImpl extends AbstractBaseService<TkVideoMapper, TkVid
112 112
113 @Override 113 @Override
114 public String controlli(boolean isTenantAdmin, String customerUserId, String tenantId, String entityId, int action, String command ) { 114 public String controlli(boolean isTenantAdmin, String customerUserId, String tenantId, String entityId, int action, String command ) {
115 - TkVideoDTO videoDTO = getVideoInfo(isTenantAdmin,customerUserId,tenantId,entityId); 115 + TkVideoDTO videoDTO = getVideoInfo(tenantId,entityId);
116 116
117 //组装请求参数 117 //组装请求参数
118 ObjectNode jsonBody = JacksonUtil.newObjectNode(); 118 ObjectNode jsonBody = JacksonUtil.newObjectNode();
@@ -180,13 +180,10 @@ public class TkVideoServiceImpl extends AbstractBaseService<TkVideoMapper, TkVid @@ -180,13 +180,10 @@ public class TkVideoServiceImpl extends AbstractBaseService<TkVideoMapper, TkVid
180 videoDTO.getVideoPlatformDTO().getSsl(),protocolType,body,videoDTO.getSn()); 180 videoDTO.getVideoPlatformDTO().getSsl(),protocolType,body,videoDTO.getSn());
181 } 181 }
182 182
183 - private TkVideoDTO getVideoInfo(boolean isTenantAdmin,String customerUserId, String tenantId, String entityId){  
184 - if (isTenantAdmin) {  
185 - customerUserId = null;  
186 - } 183 + private TkVideoDTO getVideoInfo(String tenantId, String entityId){
187 //通过流媒体方式获取视频流的列表 184 //通过流媒体方式获取视频流的列表
188 List<TkVideoDTO> videoDTOList = baseMapper.getVideoInfosByTenantIdOrAccessModeOrId(tenantId, entityId, 185 List<TkVideoDTO> videoDTOList = baseMapper.getVideoInfosByTenantIdOrAccessModeOrId(tenantId, entityId,
189 - FastIotConstants.MagicNumber.ONE, customerUserId); 186 + FastIotConstants.MagicNumber.ONE);
190 if (videoDTOList.size() == 0) { 187 if (videoDTOList.size() == 0) {
191 throw new TkDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); 188 throw new TkDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage());
192 } 189 }
@@ -31,9 +31,8 @@ public interface TkVideoMapper extends BaseMapper<TkVideoEntity> { @@ -31,9 +31,8 @@ public interface TkVideoMapper extends BaseMapper<TkVideoEntity> {
31 * @param tenantId 租户ID 31 * @param tenantId 租户ID
32 * @param id 视频ID 32 * @param id 视频ID
33 * @param accessMode 流获取方式 33 * @param accessMode 流获取方式
34 - * @param customerUserId 客户ID  
35 * @return 34 * @return
36 */ 35 */
37 List<TkVideoDTO> getVideoInfosByTenantIdOrAccessModeOrId(@Param("tenantId") String tenantId, @Param("id") String id, 36 List<TkVideoDTO> getVideoInfosByTenantIdOrAccessModeOrId(@Param("tenantId") String tenantId, @Param("id") String id,
38 - @Param("accessMode") Integer accessMode, @Param("customerUserId") String customerUserId); 37 + @Param("accessMode") Integer accessMode);
39 } 38 }
@@ -53,16 +53,12 @@ public interface TkVideoService extends BaseService<TkVideoEntity> { @@ -53,16 +53,12 @@ public interface TkVideoService extends BaseService<TkVideoEntity> {
53 /** 53 /**
54 * 根据租户ID、客户ID、视频ID获取视屏流播放地址 54 * 根据租户ID、客户ID、视频ID获取视屏流播放地址
55 * 55 *
56 - * @param isTenantAdmin 是否租户管理员  
57 - * @param customerUserId 客户ID  
58 * @param tenantId 租户ID 56 * @param tenantId 租户ID
59 * @param entityId 视频ID 57 * @param entityId 视频ID
60 * @param protocolType 视频协议 58 * @param protocolType 视频协议
61 * @return 视屏流播放地址 59 * @return 视屏流播放地址
62 */ 60 */
63 String getCameraPreviewURL( 61 String getCameraPreviewURL(
64 - boolean isTenantAdmin,  
65 - String customerUserId,  
66 String tenantId, 62 String tenantId,
67 String entityId, 63 String entityId,
68 ProtocolType protocolType) throws IOException; 64 ProtocolType protocolType) throws IOException;
@@ -91,9 +91,6 @@ @@ -91,9 +91,6 @@
91 <if test="accessMode !=null"> 91 <if test="accessMode !=null">
92 AND base.access_mode = #{accessMode} 92 AND base.access_mode = #{accessMode}
93 </if> 93 </if>
94 - <if test="customerUserId !=null and customerUserId !=''">  
95 - AND base.creator = #{customerUserId}  
96 - </if>  
97 </where> 94 </where>
98 </select> 95 </select>
99 </mapper> 96 </mapper>