Commit 4f40ad9a7f410e076044640f3c167762d2a9ef65

Authored by 徐近程
2 parents 9a62402f 44ef5dd8

Merge branch 'dev'

src/main/java/com/cnlive/shenhe/api/VideosControllerApi.java
@@ -75,6 +75,8 @@ public class VideosControllerApi { @@ -75,6 +75,8 @@ public class VideosControllerApi {
75 //g得到视频id去查询是否已有 75 //g得到视频id去查询是否已有
76 String videoId = json.getString("videoId"); 76 String videoId = json.getString("videoId");
77 shyVideos1.setVideo_id(videoId); 77 shyVideos1.setVideo_id(videoId);
  78 + //目击者类型 0-目击者 1-童声共济 2-全民健身 3-目击者政府监督
  79 + String source = json.getString("source");
78 Integer duration = json.getInteger("duration"); 80 Integer duration = json.getInteger("duration");
79 if (CommonUtils.isNotNull(duration)) duration = duration / 1000; 81 if (CommonUtils.isNotNull(duration)) duration = duration / 1000;
80 //获取栏目分类 82 //获取栏目分类
@@ -94,6 +96,7 @@ public class VideosControllerApi { @@ -94,6 +96,7 @@ public class VideosControllerApi {
94 ShyVideos shyVideos = listshyVideos.get(0); 96 ShyVideos shyVideos = listshyVideos.get(0);
95 //封装数据入库 97 //封装数据入库
96 shyVideos.setVideo_id(videoId); 98 shyVideos.setVideo_id(videoId);
  99 + shyVideos.setSource(source);
97 shyVideos.setVideo_title(json.getString("videoTitle")); 100 shyVideos.setVideo_title(json.getString("videoTitle"));
98 shyVideos.setVideo_url(json.getString("videoUrl")); 101 shyVideos.setVideo_url(json.getString("videoUrl"));
99 String videoCoverUrl = json.getString("videoCoverUrl"); 102 String videoCoverUrl = json.getString("videoCoverUrl");
@@ -127,6 +130,7 @@ public class VideosControllerApi { @@ -127,6 +130,7 @@ public class VideosControllerApi {
127 } 130 }
128 } 131 }
129 //查了,没有,直接插入数据库 132 //查了,没有,直接插入数据库
  133 + shyVideos1.setSource(source);
130 shyVideos1.setVideo_title(json.getString("videoTitle")); 134 shyVideos1.setVideo_title(json.getString("videoTitle"));
131 shyVideos1.setVideo_url(json.getString("videoUrl")); 135 shyVideos1.setVideo_url(json.getString("videoUrl"));
132 String videoCoverUrl = json.getString("videoCoverUrl"); 136 String videoCoverUrl = json.getString("videoCoverUrl");
src/main/java/com/cnlive/shenhe/entity/ShyVideos.java
@@ -139,6 +139,11 @@ public class ShyVideos { @@ -139,6 +139,11 @@ public class ShyVideos {
139 private String video_user_id; 139 private String video_user_id;
140 140
141 /** 141 /**
  142 + * 0-目击者 1-童声共济 2-全民健身 3-目击者政府监督
  143 + */
  144 + private String source;
  145 +
  146 + /**
142 * 抽帧图片地址 147 * 抽帧图片地址
143 */ 148 */
144 private String avsample_imgs; 149 private String avsample_imgs;
@@ -667,6 +672,24 @@ public class ShyVideos { @@ -667,6 +672,24 @@ public class ShyVideos {
667 } 672 }
668 673
669 /** 674 /**
  675 + * 获取0-目击者 1-童声共济 2-全民健身 3-目击者政府监督
  676 + *
  677 + * @return source - 0-目击者 1-童声共济 2-全民健身 3-目击者政府监督
  678 + */
  679 + public String getSource() {
  680 + return source;
  681 + }
  682 +
  683 + /**
  684 + * 设置0-目击者 1-童声共济 2-全民健身 3-目击者政府监督
  685 + *
  686 + * @param source 0-目击者 1-童声共济 2-全民健身 3-目击者政府监督
  687 + */
  688 + public void setSource(String source) {
  689 + this.source = source;
  690 + }
  691 +
  692 + /**
670 * 获取抽帧图片地址 693 * 获取抽帧图片地址
671 * 694 *
672 * @return avsample_imgs - 抽帧图片地址 695 * @return avsample_imgs - 抽帧图片地址
src/main/java/com/cnlive/shenhe/serviceImpl/VideosServiceImpl.java
@@ -400,45 +400,52 @@ public class VideosServiceImpl { @@ -400,45 +400,52 @@ public class VideosServiceImpl {
400 return 0; 400 return 0;
401 } 401 }
402 402
403 - /**  
404 - * 根据sp、栏目、用户id来判断审核类型  
405 - * @param spid  
406 - * @param category  
407 - * @param sid  
408 - * @return  
409 - */  
410 - public void getShenheType(ShyVideos shyVideo){  
411 -  
412 - //获取点播免审sp 403 +
  404 + /**
  405 + * 根据sp、栏目、用户id来判断审核类型
  406 + *
  407 + * @param shyVideo
  408 + */
  409 + public void getShenheType(ShyVideos shyVideo) {
  410 + //获取点播免审sp
413 List<Integer> sites = sitesService.getBusinessList(CommonConst.BUSINESS_VIDEO); 411 List<Integer> sites = sitesService.getBusinessList(CommonConst.BUSINESS_VIDEO);
414 - logger.info("sites"+sites.toString()); 412 + logger.info("sites" + sites.toString());
415 //初始化一个审核状态 413 //初始化一个审核状态
416 - Integer shenheType=3;//审核类型,1:免审,2:机审,3:人工审 414 + //审核类型,1:免审,2:机审,3:人工审
  415 + Integer shenheType = 3;
417 //如果当前sp是免审sp 416 //如果当前sp是免审sp
418 - if(sites.contains(shyVideo.getSpid())){  
419 - shenheType=1;//免审  
420 - }  
421 -// //如果栏目是“目击者”  
422 -// if(CommonUtils.isNotEmpty(shyVideo.getCategory()) && shyVideo.getCategory().equals(CommonConst.CATEGORY_WITNESS)){  
423 -// //如果用户id存在  
424 -// if(CommonUtils.isNotEmpty(shyVideo.getVideo_user_id())){  
425 -// ShyUsersfree shyUserfree=usersfreeServiceImpl.selectUser(shyVideo.getSpid(), shyVideo.getCategory(), shyVideo.getVideo_user_id());  
426 -// //如果存在免审用户  
427 -// if(CommonUtils.isNotNull(shyUserfree)){  
428 -// shenheType=1;//免审  
429 -// }else{//用户不免审  
430 -// shenheType=2;//机审  
431 -// }  
432 -// }else{//如果用户id不存在  
433 -// shenheType=2;//机审  
434 -// }  
435 -// }  
436 - //如果栏目是朋友圈  
437 - if(CommonUtils.isNotEmpty(shyVideo.getCategory()) && shyVideo.getCategory().equals(CommonConst.CATEGORY_MOMENT)){  
438 - shenheType=1;//免审 417 + if (sites.contains(shyVideo.getSpid()) || "1".equals(shyVideo.getSource())) {
  418 + //免审
  419 + shenheType = 1;
  420 + } else {
  421 + //如果栏目是“目击者”
  422 + if (CommonUtils.isNotEmpty(shyVideo.getCategory()) && shyVideo.getCategory().equals(CommonConst.CATEGORY_WITNESS)) {
  423 + //如果用户id存在
  424 + if (CommonUtils.isNotEmpty(shyVideo.getVideo_user_id())) {
  425 + ShyUsersfree shyUserfree = usersfreeServiceImpl.selectUser(shyVideo.getSpid(), shyVideo.getCategory(), shyVideo.getVideo_user_id());
  426 + //如果存在免审用户
  427 + if (CommonUtils.isNotNull(shyUserfree)) {
  428 + //免审
  429 + shenheType = 1;
  430 + } else {
  431 + //用户不免审
  432 + //机审
  433 + shenheType = 2;
  434 + }
  435 + } else {
  436 + //如果用户id不存在
  437 + //机审
  438 + shenheType = 2;
  439 + }
  440 + }
  441 + //如果栏目是朋友圈
  442 + if (CommonUtils.isNotEmpty(shyVideo.getCategory()) && shyVideo.getCategory().equals(CommonConst.CATEGORY_MOMENT)) {
  443 + //免审
  444 + shenheType = 1;
  445 + }
439 } 446 }
440 shyVideo.setShenhe_type(shenheType); 447 shyVideo.setShenhe_type(shenheType);
441 - } 448 + }
442 449
443 450
444 public String repulse(String shyVideoId,String msg,String userId){ 451 public String repulse(String shyVideoId,String msg,String userId){
src/main/resources/mapper/ShyVideosMapper.xml
@@ -35,6 +35,7 @@ @@ -35,6 +35,7 @@
35 <result column="duration" jdbcType="INTEGER" property="duration" /> 35 <result column="duration" jdbcType="INTEGER" property="duration" />
36 <result column="category" jdbcType="VARCHAR" property="category" /> 36 <result column="category" jdbcType="VARCHAR" property="category" />
37 <result column="video_user_id" jdbcType="VARCHAR" property="video_user_id" /> 37 <result column="video_user_id" jdbcType="VARCHAR" property="video_user_id" />
  38 + <result column="source" jdbcType="VARCHAR" property="source" />
38 <result column="avsample_imgs" jdbcType="LONGVARCHAR" property="avsample_imgs" /> 39 <result column="avsample_imgs" jdbcType="LONGVARCHAR" property="avsample_imgs" />
39 <result column="avsample_msg" jdbcType="LONGVARCHAR" property="avsample_msg" /> 40 <result column="avsample_msg" jdbcType="LONGVARCHAR" property="avsample_msg" />
40 </resultMap> 41 </resultMap>