Commit 8d97f4741bae809964be5603be8a847aa1e3e385

Authored by liwei2917
2 parents 33f8a64a d19f2736

Merge branch 'dev'

src/main/java/com/cnlive/shenhe/serviceImpl/VideosServiceImpl.java
@@ -306,9 +306,19 @@ public class VideosServiceImpl { @@ -306,9 +306,19 @@ public class VideosServiceImpl {
306 list.add(map); 306 list.add(map);
307 } 307 }
308 String jsonList = JSONArray.toJSONString(list); 308 String jsonList = JSONArray.toJSONString(list);
309 - //调用数美接口  
310 - JSONObject result = AntiFraudUtil.filterImg(shyVideos.getTask_id(),jsonList,CommonConst.DYNAMIC_USER);  
311 - String type=result.getString("type"); 309 + JSONObject result = null;//数美返回结果
  310 + String type="";//数美返回结果的类型
  311 + String desc="";//数美失败结果的详情
  312 + try{
  313 + //调用数美接口
  314 + result = AntiFraudUtil.filterImg(shyVideos.getTask_id(),jsonList,CommonConst.DYNAMIC_USER);
  315 + type=result.getString("type");
  316 + desc=result.getString("desc");//数美失败结果的详情
  317 + }catch(Exception e){
  318 + type=CommonConst.REJECT;//报错就给一个拒绝状态
  319 + desc="数美审核报错了";
  320 + shyVideos.setMsg(desc);
  321 + }
312 if(type.toLowerCase().equals(CommonConst.PASS)){//数美通过 322 if(type.toLowerCase().equals(CommonConst.PASS)){//数美通过
313 //修改点播云视频状态 323 //修改点播云视频状态
314 videosService.updateDianboAndShenhe(shyVideos,3); 324 videosService.updateDianboAndShenhe(shyVideos,3);
@@ -317,7 +327,7 @@ public class VideosServiceImpl { @@ -317,7 +327,7 @@ public class VideosServiceImpl {
317 } 327 }
318 ShyVideofilter videofilter=new ShyVideofilter(); 328 ShyVideofilter videofilter=new ShyVideofilter();
319 videofilter.setChannel(channel); 329 videofilter.setChannel(channel);
320 - videofilter.setDesc_msg(result.getString("desc")); 330 + videofilter.setDesc_msg(desc);
321 videofilter.setResult_type(type); 331 videofilter.setResult_type(type);
322 videofilter.setToken_id(shyVideos.getTask_id()); 332 videofilter.setToken_id(shyVideos.getTask_id());
323 videofilter.setVideos_id(cid); 333 videofilter.setVideos_id(cid);
@@ -335,7 +345,7 @@ public class VideosServiceImpl { @@ -335,7 +345,7 @@ public class VideosServiceImpl {
335 */ 345 */
336 public int updateDianboAndShenhe(ShyVideos video,int dianboState) { 346 public int updateDianboAndShenhe(ShyVideos video,int dianboState) {
337 //修改点播云的视频状态 347 //修改点播云的视频状态
338 - JSONObject result = Pass.auditPass(video.getVideo_id(), dianboState, "", "", video.getCallback()); 348 + JSONObject result = Pass.auditPass(video.getVideo_id(), dianboState, video.getMsg(), video.getMsg(), video.getCallback());
339 Integer code = result.getInteger("code"); 349 Integer code = result.getInteger("code");
340 Integer shenheState=CommonConst.AUDIT_REFUSE; 350 Integer shenheState=CommonConst.AUDIT_REFUSE;
341 if (0 == code) { 351 if (0 == code) {
@@ -343,13 +353,14 @@ public class VideosServiceImpl { @@ -343,13 +353,14 @@ public class VideosServiceImpl {
343 shenheState=CommonConst.AUDIT_SUCCESS; 353 shenheState=CommonConst.AUDIT_SUCCESS;
344 } 354 }
345 //修改审核云的视频状态 355 //修改审核云的视频状态
346 - int i = videosService.updateVideo(video.getId(), null,video.getUpdater(), shenheState, result.getString("msg")); 356 + int i = videosService.updateVideo(video.getId(), null,video.getUpdater(), shenheState, video.getMsg());
347 if (i != 1) { 357 if (i != 1) {
348 logger.error("点播视频更改失败,activity_id:{}", video.getVideo_id()); 358 logger.error("点播视频更改失败,activity_id:{}", video.getVideo_id());
349 } 359 }
350 return i; 360 return i;
351 } else { 361 } else {
352 - videosService.updateVideo(video.getId(), null,video.getUpdater(), CommonConst.AUDIT_CALLBACK_FAIL, result.getString("msg")); 362 + video.setMsg("点播视频回调失败,"+video.getMsg());
  363 + videosService.updateVideo(video.getId(), null,video.getUpdater(), CommonConst.AUDIT_CALLBACK_FAIL, video.getMsg());
353 logger.error("点播视频回调失败,activity_id:{},code:{},msg:{}", video.getVideo_id(), code, result.getString("msg")); 364 logger.error("点播视频回调失败,activity_id:{},code:{},msg:{}", video.getVideo_id(), code, result.getString("msg"));
354 } 365 }
355 366