Authored by mali

视频优化

@@ -111,7 +111,7 @@ public class UfoLiveController { @@ -111,7 +111,7 @@ public class UfoLiveController {
111 111
112 Integer currentTime; 112 Integer currentTime;
113 try { 113 try {
114 - currentTime = ufoLiveService.queryCurrentTime(req.getOrderCode()); 114 + currentTime = ufoLiveService.queryCurrentTime(req.getOrderCode(), req.getPhoneUid());
115 } catch (PlatformException e) { 115 } catch (PlatformException e) {
116 return new ApiResponse.ApiResponseBuilder().code(e.getCode()).data("").message(e.getMessage()).build(); 116 return new ApiResponse.ApiResponseBuilder().code(e.getCode()).data("").message(e.getMessage()).build();
117 } 117 }
@@ -225,7 +225,11 @@ public class UfoLiveService { @@ -225,7 +225,11 @@ public class UfoLiveService {
225 return null == cameraCode ? req.getCameraCode() : Integer.valueOf(cameraCode); 225 return null == cameraCode ? req.getCameraCode() : Integer.valueOf(cameraCode);
226 } 226 }
227 227
228 - public Integer queryCurrentTime(Long orderCode) 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);
  231 + }
  232 +
229 Integer userId = new UserHelper().getUserId(); 233 Integer userId = new UserHelper().getUserId();
230 234
231 RedisKeyBuilder key = RedisKeyBuilder.newInstance().appendFixed(RedisKeyConstants.LIVE_USER).appendVar(userId); 235 RedisKeyBuilder key = RedisKeyBuilder.newInstance().appendFixed(RedisKeyConstants.LIVE_USER).appendVar(userId);
@@ -704,11 +704,11 @@ public class ProductServiceImpl implements IProductService, ApplicationContextAw @@ -704,11 +704,11 @@ public class ProductServiceImpl implements IProductService, ApplicationContextAw
704 } 704 }
705 int n = storagePriceMapper.cancelSaleSkup(bo.getSkup()); // SQL里面保证修改的原始状态为 可售 防止并发 705 int n = storagePriceMapper.cancelSaleSkup(bo.getSkup()); // SQL里面保证修改的原始状态为 可售 防止并发
706 if (n == 1) { 706 if (n == 1) {
707 - Storage storage = storageMapper.selectByPrimaryKey(sp.getStorageId()); 707 + /*Storage storage = storageMapper.selectByPrimaryKey(sp.getStorageId());
708 708
709 if (storageMapper.updateStorageNum(sp.getStorageId(), storage.getStorageNum() - 1, storage.getStorageNum()) != 1) { // 防止并发修改,如果失败则发送一个spring事件 709 if (storageMapper.updateStorageNum(sp.getStorageId(), storage.getStorageNum() - 1, storage.getStorageNum()) != 1) { // 防止并发修改,如果失败则发送一个spring事件
710 applicationContext.publishEvent(new StorageNumEvent(sp.getStorageId())); 710 applicationContext.publishEvent(new StorageNumEvent(sp.getStorageId()));
711 - } 711 + }*/
712 712
713 LOGGER.info("send info to seller, product_name is {}, seller_uid is {}", bo.getProductName(), sp.getSellerUid()); 713 LOGGER.info("send info to seller, product_name is {}, seller_uid is {}", bo.getProductName(), sp.getSellerUid());
714 //inboxService.addInbox(InboxBusinessTypeEnum.SALE_NOTIFIED_UNSHELF.getBusinessType(), InboxBusinessTypeEnum.SALE_NOTIFIED_UNSHELF.getType(), 714 //inboxService.addInbox(InboxBusinessTypeEnum.SALE_NOTIFIED_UNSHELF.getBusinessType(), InboxBusinessTypeEnum.SALE_NOTIFIED_UNSHELF.getType(),