Commit 8d97f4741bae809964be5603be8a847aa1e3e385
Merge branch 'dev'
Showing
1 changed file
with
18 additions
and
7 deletions
src/main/java/com/cnlive/shenhe/serviceImpl/VideosServiceImpl.java
| ... | ... | @@ -306,9 +306,19 @@ public class VideosServiceImpl { |
| 306 | 306 | list.add(map); |
| 307 | 307 | } |
| 308 | 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 | 322 | if(type.toLowerCase().equals(CommonConst.PASS)){//数美通过 |
| 313 | 323 | //修改点播云视频状态 |
| 314 | 324 | videosService.updateDianboAndShenhe(shyVideos,3); |
| ... | ... | @@ -317,7 +327,7 @@ public class VideosServiceImpl { |
| 317 | 327 | } |
| 318 | 328 | ShyVideofilter videofilter=new ShyVideofilter(); |
| 319 | 329 | videofilter.setChannel(channel); |
| 320 | - videofilter.setDesc_msg(result.getString("desc")); | |
| 330 | + videofilter.setDesc_msg(desc); | |
| 321 | 331 | videofilter.setResult_type(type); |
| 322 | 332 | videofilter.setToken_id(shyVideos.getTask_id()); |
| 323 | 333 | videofilter.setVideos_id(cid); |
| ... | ... | @@ -335,7 +345,7 @@ public class VideosServiceImpl { |
| 335 | 345 | */ |
| 336 | 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 | 349 | Integer code = result.getInteger("code"); |
| 340 | 350 | Integer shenheState=CommonConst.AUDIT_REFUSE; |
| 341 | 351 | if (0 == code) { |
| ... | ... | @@ -343,13 +353,14 @@ public class VideosServiceImpl { |
| 343 | 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 | 357 | if (i != 1) { |
| 348 | 358 | logger.error("点播视频更改失败,activity_id:{}", video.getVideo_id()); |
| 349 | 359 | } |
| 350 | 360 | return i; |
| 351 | 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 | 364 | logger.error("点播视频回调失败,activity_id:{},code:{},msg:{}", video.getVideo_id(), code, result.getString("msg")); |
| 354 | 365 | } |
| 355 | 366 | ... | ... |