Merge branch 'hotfix_live' into hotfix_live1
Showing
3 changed files
with
15 additions
and
4 deletions
@@ -183,7 +183,7 @@ public class UfoLiveController { | @@ -183,7 +183,7 @@ public class UfoLiveController { | ||
183 | public ApiResponse savePhoneCameraRecord(PhoneUidCameraBo phoneUidCameraBo) { | 183 | public ApiResponse savePhoneCameraRecord(PhoneUidCameraBo phoneUidCameraBo) { |
184 | LOGGER.info("savePhoneCameraRecord in. phoneUidCameraBo is {}", phoneUidCameraBo); | 184 | LOGGER.info("savePhoneCameraRecord in. phoneUidCameraBo is {}", phoneUidCameraBo); |
185 | Boolean reslut = phoneUidCameraService.insert(phoneUidCameraBo); | 185 | Boolean reslut = phoneUidCameraService.insert(phoneUidCameraBo); |
186 | - return new ApiResponse.ApiResponseBuilder().code(200).data(reslut).message("查询成功").build(); | 186 | + return new ApiResponse.ApiResponseBuilder().code(reslut ? 200 : 400).data(reslut).message("查询成功").build(); |
187 | } | 187 | } |
188 | 188 | ||
189 | 189 |
@@ -37,6 +37,10 @@ public class PhoneUidCameraService { | @@ -37,6 +37,10 @@ public class PhoneUidCameraService { | ||
37 | return false; | 37 | return false; |
38 | } | 38 | } |
39 | 39 | ||
40 | + if (null != phoneUidCameraMapper.selectByphoneUid(record.getPhoneUid())) { | ||
41 | + return false; //已存在 | ||
42 | + } | ||
43 | + | ||
40 | PhoneUidCamera phoneUidCamera = new PhoneUidCamera(); | 44 | PhoneUidCamera phoneUidCamera = new PhoneUidCamera(); |
41 | try { | 45 | try { |
42 | BeanUtils.copyProperties(phoneUidCamera, record); | 46 | BeanUtils.copyProperties(phoneUidCamera, record); |
@@ -226,12 +226,19 @@ public class UfoLiveService { | @@ -226,12 +226,19 @@ public class UfoLiveService { | ||
226 | } | 226 | } |
227 | 227 | ||
228 | public Integer queryCurrentTime(Long orderCode, String phoneUid) throws PlatformException { | 228 | public Integer queryCurrentTime(Long orderCode, String phoneUid) throws PlatformException { |
229 | - if (StringUtils.isNotEmpty(phoneUid) && null == phoneUidCameraService.selectByphoneUid(phoneUid)) { // 如果启动手机唯一标识来关联摄像头,则走此流程 | ||
230 | - throw new PlatformException("没有选择摄像头", 400); | 229 | + if (StringUtils.isNotEmpty(phoneUid)) { // 如果启动手机唯一标识来关联摄像头,则走此流程 |
230 | + if (null == phoneUidCameraService.selectByphoneUid(phoneUid)) { | ||
231 | + throw new PlatformException("没有选择摄像头", 400); | ||
232 | + } else { | ||
233 | + int currentTimeSeconds = DateUtil.getCurrentTimeSeconds(); | ||
234 | + if (!Objects.isNull(orderCode)) { | ||
235 | + liveRecordTimeMapper.insertOrUpdate(new LiveRecordTime(orderCode, currentTimeSeconds)); | ||
236 | + } | ||
237 | + return currentTimeSeconds; | ||
238 | + } | ||
231 | } | 239 | } |
232 | 240 | ||
233 | Integer userId = new UserHelper().getUserId(); | 241 | Integer userId = new UserHelper().getUserId(); |
234 | - | ||
235 | RedisKeyBuilder key = RedisKeyBuilder.newInstance().appendFixed(RedisKeyConstants.LIVE_USER).appendVar(userId); | 242 | RedisKeyBuilder key = RedisKeyBuilder.newInstance().appendFixed(RedisKeyConstants.LIVE_USER).appendVar(userId); |
236 | if (redisTemplate.hasKey(key)) { | 243 | if (redisTemplate.hasKey(key)) { |
237 | int currentTimeSeconds = DateUtil.getCurrentTimeSeconds(); | 244 | int currentTimeSeconds = DateUtil.getCurrentTimeSeconds(); |
-
Please register or login to post a comment