Commit ee28418e908aa7cfddddef4d0ea07a984b2131f2

Authored by 徐近程
1 parent e9e3cd16

update

src/main/java/com/cnlive/shenhe/serviceImpl/VideosServiceImpl.java
... ... @@ -420,22 +420,40 @@ public class VideosServiceImpl {
420 420 Integer code = result.getInteger("code");
421 421 String errorCode = result.getString("errorCode");
422 422 Integer shenheState = CommonConst.AUDIT_REFUSE;
423   - if (0 == code || "0".equals(errorCode)) {
424   - if (dianboState == 3) {
425   - shenheState = CommonConst.AUDIT_SUCCESS;
426   - }
427   - //修改审核云的视频状态
428   - int i = videosService.updateVideo(video.getId(), null, video.getUpdater(), "", shenheState, video.getMsg());
429   - if (i != 1) {
430   - logger.error("点播视频更改失败,activity_id:{}", video.getVideo_id());
  423 + String callback = video.getCallback();
  424 + if (callback.contains("bc.cnlive.com")) {
  425 + if ("0".equals(errorCode)) {
  426 + if (dianboState == 3) {
  427 + shenheState = CommonConst.AUDIT_SUCCESS;
  428 + }
  429 + //修改审核云的视频状态
  430 + int i = videosService.updateVideo(video.getId(), null, video.getUpdater(), "", shenheState, video.getMsg());
  431 + if (i != 1) {
  432 + logger.error("点播视频更改失败,activity_id:{}", video.getVideo_id());
  433 + }
  434 + return i;
  435 + } else {
  436 + video.setMsg("点播视频回调失败," + video.getMsg());
  437 + videosService.updateVideo(video.getId(), null, video.getUpdater(), "", CommonConst.AUDIT_CALLBACK_FAIL, video.getMsg());
  438 + logger.error("点播视频回调失败,activity_id:{},code:{},msg:{}", video.getVideo_id(), code, result.getString("msg"));
431 439 }
432   - return i;
433 440 } else {
434   - video.setMsg("点播视频回调失败," + video.getMsg());
435   - videosService.updateVideo(video.getId(), null, video.getUpdater(), "", CommonConst.AUDIT_CALLBACK_FAIL, video.getMsg());
436   - logger.error("点播视频回调失败,activity_id:{},code:{},msg:{}", video.getVideo_id(), code, result.getString("msg"));
  441 + if (0 == code) {
  442 + if (dianboState == 3) {
  443 + shenheState = CommonConst.AUDIT_SUCCESS;
  444 + }
  445 + //修改审核云的视频状态
  446 + int i = videosService.updateVideo(video.getId(), null, video.getUpdater(), "", shenheState, video.getMsg());
  447 + if (i != 1) {
  448 + logger.error("点播视频更改失败,activity_id:{}", video.getVideo_id());
  449 + }
  450 + return i;
  451 + } else {
  452 + video.setMsg("点播视频回调失败," + video.getMsg());
  453 + videosService.updateVideo(video.getId(), null, video.getUpdater(), "", CommonConst.AUDIT_CALLBACK_FAIL, video.getMsg());
  454 + logger.error("点播视频回调失败,activity_id:{},code:{},msg:{}", video.getVideo_id(), code, result.getString("msg"));
  455 + }
437 456 }
438   -
439 457 return 0;
440 458 }
441 459  
... ...