Authored by caoyan

Merge branch 'test6.9.2' of http://git.yoho.cn/ufo/ufo-platform into test6.9.2

@@ -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);
@@ -729,11 +729,11 @@ public class ProductServiceImpl implements IProductService, ApplicationContextAw @@ -729,11 +729,11 @@ public class ProductServiceImpl implements IProductService, ApplicationContextAw
729 } 729 }
730 int n = storagePriceMapper.cancelSaleSkup(bo.getSkup()); // SQL里面保证修改的原始状态为 可售 防止并发 730 int n = storagePriceMapper.cancelSaleSkup(bo.getSkup()); // SQL里面保证修改的原始状态为 可售 防止并发
731 if (n == 1) { 731 if (n == 1) {
732 - Storage storage = storageMapper.selectByPrimaryKey(sp.getStorageId()); 732 + /*Storage storage = storageMapper.selectByPrimaryKey(sp.getStorageId());
733 733
734 if (storageMapper.updateStorageNum(sp.getStorageId(), storage.getStorageNum() - 1, storage.getStorageNum()) != 1) { // 防止并发修改,如果失败则发送一个spring事件 734 if (storageMapper.updateStorageNum(sp.getStorageId(), storage.getStorageNum() - 1, storage.getStorageNum()) != 1) { // 防止并发修改,如果失败则发送一个spring事件
735 applicationContext.publishEvent(new StorageNumEvent(sp.getStorageId())); 735 applicationContext.publishEvent(new StorageNumEvent(sp.getStorageId()));
736 - } 736 + }*/
737 737
738 LOGGER.info("send info to seller, product_name is {}, seller_uid is {}", bo.getProductName(), sp.getSellerUid()); 738 LOGGER.info("send info to seller, product_name is {}, seller_uid is {}", bo.getProductName(), sp.getSellerUid());
739 //inboxService.addInbox(InboxBusinessTypeEnum.SALE_NOTIFIED_UNSHELF.getBusinessType(), InboxBusinessTypeEnum.SALE_NOTIFIED_UNSHELF.getType(), 739 //inboxService.addInbox(InboxBusinessTypeEnum.SALE_NOTIFIED_UNSHELF.getBusinessType(), InboxBusinessTypeEnum.SALE_NOTIFIED_UNSHELF.getType(),