Authored by mali

视频录制的摄像头默认是录制按钮时候的选择的摄像头

... ... @@ -8,4 +8,6 @@ public interface LiveRecordTimeMapper {
int insertOrUpdate(LiveRecordTime record);
Integer selectByOrderCode(@Param("orderCode")Long orderCode);
Integer selectCameraByOrderCode(@Param("orderCode")Long orderCode);
}
\ No newline at end of file
... ...
... ... @@ -18,4 +18,8 @@
values (#{orderCode,jdbcType=BIGINT}, #{startTime,jdbcType=INTEGER}, #{cameraCode,jdbcType=INTEGER})
ON DUPLICATE KEY UPDATE start_time=#{startTime,jdbcType=INTEGER}, camera_code = #{cameraCode,jdbcType=INTEGER}
</insert>
<select id="selectCameraByOrderCode" resultType="java.lang.Integer">
select camera_code from live_record_time where order_code = #{orderCode,jdbcType=BIGINT} ORDER BY id desc limit 1
</select>
</mapper>
\ No newline at end of file
... ...
... ... @@ -210,6 +210,11 @@ public class UfoLiveService {
// 查询当前登录用户默认的摄像头设备
public Integer queryInitCameraCode(QiniuLiveRecord req) {
Integer liveCameraCode = liveRecordTimeMapper.selectCameraByOrderCode(req.getOrderCode()); // 优先取录制按钮时候保存的摄像头编号
if (null != liveCameraCode) {
return liveCameraCode;
}
// UserCameraRecord userCameraRecord = userCameraRecordMapper.selectUserCameraRecord(new UserHelper().getUserId());
Optional<Integer> phoneCamera = Optional.ofNullable(req.getPhoneUid()).map(phoneUidCameraService::selectByphoneUid).map(PhoneUidCameraBo::getCameraCode);
... ...