Commit bfc34e7f1be3e7ae5816c776f810d5a5b6c88869

Authored by liwei2917
1 parent 1ccf4c3d

更改审核流程,增加审核类型(免审、机审、人审)

src/main/java/com/cnlive/shenhe/api/VideosControllerApi.java
@@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSONObject; @@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSONObject;
5 import com.cnlive.shenhe.bean.ErrorEnum; 5 import com.cnlive.shenhe.bean.ErrorEnum;
6 import com.cnlive.shenhe.bean.ResponseBean; 6 import com.cnlive.shenhe.bean.ResponseBean;
7 import com.cnlive.shenhe.entity.ShyVideos; 7 import com.cnlive.shenhe.entity.ShyVideos;
  8 +import com.cnlive.shenhe.serviceImpl.SitesServiceImpl;
8 import com.cnlive.shenhe.serviceImpl.UsersServiceImpl; 9 import com.cnlive.shenhe.serviceImpl.UsersServiceImpl;
9 import com.cnlive.shenhe.serviceImpl.VideosServiceImpl; 10 import com.cnlive.shenhe.serviceImpl.VideosServiceImpl;
10 import com.cnlive.shenhe.utils.AuditPass; 11 import com.cnlive.shenhe.utils.AuditPass;
@@ -41,6 +42,8 @@ public class VideosControllerApi { @@ -41,6 +42,8 @@ public class VideosControllerApi {
41 VideosServiceImpl videosService; 42 VideosServiceImpl videosService;
42 @Autowired 43 @Autowired
43 UsersServiceImpl usersService; 44 UsersServiceImpl usersService;
  45 + @Autowired
  46 + SitesServiceImpl sitesService;
44 47
45 @Value("${avsmple_appKey}") 48 @Value("${avsmple_appKey}")
46 String appkey; 49 String appkey;
@@ -76,6 +79,13 @@ public class VideosControllerApi { @@ -76,6 +79,13 @@ public class VideosControllerApi {
76 if (CommonUtils.isNotNull(duration)) duration = duration / 1000; 79 if (CommonUtils.isNotNull(duration)) duration = duration / 1000;
77 //获取栏目分类 80 //获取栏目分类
78 String category=CommonUtils.isEmpty(json.getString("multiplecategory"))?"":json.getString("multiplecategory"); 81 String category=CommonUtils.isEmpty(json.getString("multiplecategory"))?"":json.getString("multiplecategory");
  82 + //获取视频上传人的id
  83 + String sid=CommonUtils.isEmpty(json.getString("videoClipsName"))?"":json.getString("videoClipsName");
  84 + sid=CommonUtils.isEmpty(sid)?"":sid.split("_")[2];
  85 + //初始化一个审核状态
  86 +// Integer shenheType=3;//审核类型,1:免审,2:机审,3:人工审
  87 +// shenheType=videosService.getShenheType(json.getInteger("spId"),category,sid);
  88 +
79 //查询一下 存在,更新 没有,插入 89 //查询一下 存在,更新 没有,插入
80 List<ShyVideos> listshyVideos = videosService.findshyVideo(shyVideos1); 90 List<ShyVideos> listshyVideos = videosService.findshyVideo(shyVideos1);
81 if (listshyVideos.size() > 0) { 91 if (listshyVideos.size() > 0) {
@@ -102,6 +112,8 @@ public class VideosControllerApi { @@ -102,6 +112,8 @@ public class VideosControllerApi {
102 shyVideos.setPlat(json.getInteger("bucketType")); 112 shyVideos.setPlat(json.getInteger("bucketType"));
103 shyVideos.setDuration(duration); 113 shyVideos.setDuration(duration);
104 shyVideos.setCategory(category);//传入栏目分类 114 shyVideos.setCategory(category);//传入栏目分类
  115 + shyVideos.setVideo_user_id(sid);//传入sid
  116 + videosService.getShenheType(shyVideos);//获取审核类型
105 boolean YorN = videosService.updateshyVideos(shyVideos); 117 boolean YorN = videosService.updateshyVideos(shyVideos);
106 if (YorN == true) { 118 if (YorN == true) {
107 return new ResponseBean(ErrorEnum.SUCCESS); 119 return new ResponseBean(ErrorEnum.SUCCESS);
@@ -134,15 +146,18 @@ public class VideosControllerApi { @@ -134,15 +146,18 @@ public class VideosControllerApi {
134 shyVideos1.setPlat(json.getInteger("bucketType")); 146 shyVideos1.setPlat(json.getInteger("bucketType"));
135 shyVideos1.setDuration(duration); 147 shyVideos1.setDuration(duration);
136 shyVideos1.setCategory(category);//传入栏目分类 148 shyVideos1.setCategory(category);//传入栏目分类
  149 + shyVideos1.setVideo_user_id(sid);//传入sid
  150 + videosService.getShenheType(shyVideos1);//获取审核类型
137 151
138 -  
139 - if(!(category).equals(CommonConst.CATEGORY_WITNESS)){//如果当前栏目分类不是“目击者”,按照原有规则 152 + if(shyVideos1.getShenhe_type()==CommonConst.AUDIT_TYPE_USER){//如果审核类型是人工审核,按照原有规则
140 if (CommonUtils.isNotNull(duration) && duration > 80) { 153 if (CommonUtils.isNotNull(duration) && duration > 80) {
141 shyVideos1 = avsample(shyVideos1);//视频至少可以抽8张,请求抽帧 154 shyVideos1 = avsample(shyVideos1);//视频至少可以抽8张,请求抽帧
142 } 155 }
143 - }else{  
144 - if (CommonUtils.isNotNull(duration) ) {//"目击者"视频,直接抽帧 156 + }else if(shyVideos1.getShenhe_type()==CommonConst.AUDIT_TYPE_MACHANE){//如果审核类型是机审
  157 + if (CommonUtils.isNotNull(duration) && duration < 60) {//"目击者"视频,小于60秒的抽帧
145 shyVideos1 = avsample(shyVideos1); 158 shyVideos1 = avsample(shyVideos1);
  159 + }else{//机审超过60秒的改为人工审核
  160 + shyVideos1.setShenhe_type(3);
146 } 161 }
147 } 162 }
148 boolean result = videosService.impotVideo(shyVideos1); 163 boolean result = videosService.impotVideo(shyVideos1);
src/main/java/com/cnlive/shenhe/entity/ShyComments.java
@@ -113,7 +113,6 @@ public class ShyComments { @@ -113,7 +113,6 @@ public class ShyComments {
113 * 领取人id 113 * 领取人id
114 */ 114 */
115 private String receive_user_id; 115 private String receive_user_id;
116 -  
117 116
118 /** 117 /**
119 * @return id 118 * @return id
@@ -530,6 +529,4 @@ public class ShyComments { @@ -530,6 +529,4 @@ public class ShyComments {
530 public void setReceive_user_id(String receive_user_id) { 529 public void setReceive_user_id(String receive_user_id) {
531 this.receive_user_id = receive_user_id; 530 this.receive_user_id = receive_user_id;
532 } 531 }
533 -  
534 -  
535 } 532 }
536 \ No newline at end of file 533 \ No newline at end of file
src/main/java/com/cnlive/shenhe/entity/ShySites.java
@@ -26,17 +26,12 @@ public class ShySites { @@ -26,17 +26,12 @@ public class ShySites {
26 26
27 private String appid; 27 private String appid;
28 28
  29 + @Transient
  30 + private String write_business_name;
29 /** 31 /**
30 * 免审业务,多种用,分割 32 * 免审业务,多种用,分割
31 */ 33 */
32 private String write_business; 34 private String write_business;
33 -  
34 - /**  
35 - * 免审业务名称  
36 - */  
37 - @Transient  
38 - private String write_business_name;  
39 -  
40 35
41 /** 36 /**
42 * @return id 37 * @return id
@@ -170,4 +165,5 @@ public class ShySites { @@ -170,4 +165,5 @@ public class ShySites {
170 this.write_business_name = write_business_name; 165 this.write_business_name = write_business_name;
171 } 166 }
172 167
  168 +
173 } 169 }
174 \ No newline at end of file 170 \ No newline at end of file
src/main/java/com/cnlive/shenhe/entity/ShyUsersfree.java 0 → 100644
  1 +package com.cnlive.shenhe.entity;
  2 +
  3 +import javax.persistence.*;
  4 +
  5 +@Table(name = "shy_usersfree")
  6 +public class ShyUsersfree {
  7 + @Id
  8 + private Integer id;
  9 +
  10 + /**
  11 + * 免审的用户id
  12 + */
  13 + private String user_id;
  14 +
  15 + /**
  16 + * spid
  17 + */
  18 + private Integer sp_id;
  19 +
  20 + /**
  21 + * 栏目分类
  22 + */
  23 + private String category;
  24 +
  25 + /**
  26 + * 是否启用,0:未启用,1:启用
  27 + */
  28 + private Integer isEnable=1;
  29 +
  30 + /**
  31 + * @return id
  32 + */
  33 + public Integer getId() {
  34 + return id;
  35 + }
  36 +
  37 + /**
  38 + * @param id
  39 + */
  40 + public void setId(Integer id) {
  41 + this.id = id;
  42 + }
  43 +
  44 + /**
  45 + * 获取免审的用户id
  46 + *
  47 + * @return user_id - 免审的用户id
  48 + */
  49 + public String getUser_id() {
  50 + return user_id;
  51 + }
  52 +
  53 + /**
  54 + * 设置免审的用户id
  55 + *
  56 + * @param user_id 免审的用户id
  57 + */
  58 + public void setUser_id(String user_id) {
  59 + this.user_id = user_id;
  60 + }
  61 +
  62 + /**
  63 + * 获取spid
  64 + *
  65 + * @return sp_id - spid
  66 + */
  67 + public Integer getSp_id() {
  68 + return sp_id;
  69 + }
  70 +
  71 + /**
  72 + * 设置spid
  73 + *
  74 + * @param sp_id spid
  75 + */
  76 + public void setSp_id(Integer sp_id) {
  77 + this.sp_id = sp_id;
  78 + }
  79 +
  80 + /**
  81 + * 获取栏目分类
  82 + *
  83 + * @return category - 栏目分类
  84 + */
  85 + public String getCategory() {
  86 + return category;
  87 + }
  88 +
  89 + /**
  90 + * 设置栏目分类
  91 + *
  92 + * @param category 栏目分类
  93 + */
  94 + public void setCategory(String category) {
  95 + this.category = category;
  96 + }
  97 +
  98 + /**
  99 + * 获取是否启用,0:未启用,1:启用
  100 + *
  101 + * @return isEnable - 是否启用,0:未启用,1:启用
  102 + */
  103 + public Integer getIsEnable() {
  104 + return isEnable;
  105 + }
  106 +
  107 + /**
  108 + * 设置是否启用,0:未启用,1:启用
  109 + *
  110 + * @param isEnable 是否启用,0:未启用,1:启用
  111 + */
  112 + public void setIsEnable(Integer isEnable) {
  113 + this.isEnable = isEnable;
  114 + }
  115 +}
0 \ No newline at end of file 116 \ No newline at end of file
src/main/java/com/cnlive/shenhe/entity/ShyVideofilter.java
1 package com.cnlive.shenhe.entity; 1 package com.cnlive.shenhe.entity;
2 2
3 import java.util.Date; 3 import java.util.Date;
4 -  
5 import javax.persistence.*; 4 import javax.persistence.*;
6 5
7 @Table(name = "shy_videofilter") 6 @Table(name = "shy_videofilter")
@@ -38,7 +37,10 @@ public class ShyVideofilter { @@ -38,7 +37,10 @@ public class ShyVideofilter {
38 * 视频时长,单位s 37 * 视频时长,单位s
39 */ 38 */
40 private Integer duration; 39 private Integer duration;
41 - 40 +
  41 + /**
  42 + * 创建时间
  43 + */
42 private Date created_at; 44 private Date created_at;
43 45
44 /** 46 /**
@@ -145,20 +147,39 @@ public class ShyVideofilter { @@ -145,20 +147,39 @@ public class ShyVideofilter {
145 this.desc_msg = desc_msg; 147 this.desc_msg = desc_msg;
146 } 148 }
147 149
148 - public Date getCreated_at() {  
149 - return created_at;  
150 - } 150 + /**
  151 + * 获取视频时长,单位s
  152 + *
  153 + * @return duration - 视频时长,单位s
  154 + */
  155 + public Integer getDuration() {
  156 + return duration;
  157 + }
151 158
152 - public void setCreated_at(Date created_at) {  
153 - this.created_at = created_at;  
154 - } 159 + /**
  160 + * 设置视频时长,单位s
  161 + *
  162 + * @param duration 视频时长,单位s
  163 + */
  164 + public void setDuration(Integer duration) {
  165 + this.duration = duration;
  166 + }
155 167
156 - public Integer getDuration() {  
157 - return duration;  
158 - } 168 + /**
  169 + * 获取创建时间
  170 + *
  171 + * @return created_at - 创建时间
  172 + */
  173 + public Date getCreated_at() {
  174 + return created_at;
  175 + }
159 176
160 - public void setDuration(Integer duration) {  
161 - this.duration = duration;  
162 - }  
163 - 177 + /**
  178 + * 设置创建时间
  179 + *
  180 + * @param created_at 创建时间
  181 + */
  182 + public void setCreated_at(Date created_at) {
  183 + this.created_at = created_at;
  184 + }
164 } 185 }
165 \ No newline at end of file 186 \ No newline at end of file
src/main/java/com/cnlive/shenhe/entity/ShyVideos.java
@@ -55,7 +55,12 @@ public class ShyVideos { @@ -55,7 +55,12 @@ public class ShyVideos {
55 private String msg; 55 private String msg;
56 56
57 /** 57 /**
58 - * 状态:0.未审核,1:已审核,2.拒绝 58 + * 审核类型,1:免审,2:机审,3:人工审
  59 + */
  60 + private Integer shenhe_type;
  61 +
  62 + /**
  63 + * 审核状态:0.未审核,1:已审核,2.拒绝
59 */ 64 */
60 private Integer state; 65 private Integer state;
61 66
@@ -94,7 +99,7 @@ public class ShyVideos { @@ -94,7 +99,7 @@ public class ShyVideos {
94 private String receive_user_id; 99 private String receive_user_id;
95 100
96 /** 101 /**
97 - * 是否抽帧 102 + * 抽帧状态:0:未抽帧;1:抽帧中;2:抽帧成功;3:抽帧失败
98 */ 103 */
99 private Integer avsample; 104 private Integer avsample;
100 105
@@ -124,6 +129,11 @@ public class ShyVideos { @@ -124,6 +129,11 @@ public class ShyVideos {
124 private String category; 129 private String category;
125 130
126 /** 131 /**
  132 + * 视频上传人的id
  133 + */
  134 + private String video_user_id;
  135 +
  136 + /**
127 * 抽帧图片地址 137 * 抽帧图片地址
128 */ 138 */
129 private String avsample_imgs; 139 private String avsample_imgs;
@@ -135,7 +145,6 @@ public class ShyVideos { @@ -135,7 +145,6 @@ public class ShyVideos {
135 145
136 @Transient 146 @Transient
137 private String spid_desc; 147 private String spid_desc;
138 -  
139 148
140 /** 149 /**
141 * @return id 150 * @return id
@@ -338,18 +347,36 @@ public class ShyVideos { @@ -338,18 +347,36 @@ public class ShyVideos {
338 } 347 }
339 348
340 /** 349 /**
341 - * 获取状态:0.未审核,1:已审核,2.拒绝 350 + * 获取审核类型,1:免审,2:机审,3:人工审
342 * 351 *
343 - * @return state - 状态:0.未审核,1:已审核,2.拒绝 352 + * @return shenhe_type - 审核类型,1:免审,2:机审,3:人工审
  353 + */
  354 + public Integer getShenhe_type() {
  355 + return shenhe_type;
  356 + }
  357 +
  358 + /**
  359 + * 设置审核类型,1:免审,2:机审,3:人工审
  360 + *
  361 + * @param shenhe_type 审核类型,1:免审,2:机审,3:人工审
  362 + */
  363 + public void setShenhe_type(Integer shenhe_type) {
  364 + this.shenhe_type = shenhe_type;
  365 + }
  366 +
  367 + /**
  368 + * 获取审核状态:0.未审核,1:已审核,2.拒绝
  369 + *
  370 + * @return state - 审核状态:0.未审核,1:已审核,2.拒绝
344 */ 371 */
345 public Integer getState() { 372 public Integer getState() {
346 return state; 373 return state;
347 } 374 }
348 375
349 /** 376 /**
350 - * 设置状态:0.未审核,1:已审核,2.拒绝 377 + * 设置审核状态:0.未审核,1:已审核,2.拒绝
351 * 378 *
352 - * @param state 状态:0.未审核,1:已审核,2.拒绝 379 + * @param state 审核状态:0.未审核,1:已审核,2.拒绝
353 */ 380 */
354 public void setState(Integer state) { 381 public void setState(Integer state) {
355 this.state = state; 382 this.state = state;
@@ -492,18 +519,18 @@ public class ShyVideos { @@ -492,18 +519,18 @@ public class ShyVideos {
492 } 519 }
493 520
494 /** 521 /**
495 - * 获取是否抽帧 522 + * 获取抽帧状态:0:未抽帧;1:抽帧中;2:抽帧成功;3:抽帧失败
496 * 523 *
497 - * @return avsample - 是否抽帧 524 + * @return avsample - 抽帧状态:0:未抽帧;1:抽帧中;2:抽帧成功;3:抽帧失败
498 */ 525 */
499 public Integer getAvsample() { 526 public Integer getAvsample() {
500 return avsample; 527 return avsample;
501 } 528 }
502 529
503 /** 530 /**
504 - * 设置是否抽帧 531 + * 设置抽帧状态:0:未抽帧;1:抽帧中;2:抽帧成功;3:抽帧失败
505 * 532 *
506 - * @param avsample 是否抽帧 533 + * @param avsample 抽帧状态:0:未抽帧;1:抽帧中;2:抽帧成功;3:抽帧失败
507 */ 534 */
508 public void setAvsample(Integer avsample) { 535 public void setAvsample(Integer avsample) {
509 this.avsample = avsample; 536 this.avsample = avsample;
@@ -600,6 +627,24 @@ public class ShyVideos { @@ -600,6 +627,24 @@ public class ShyVideos {
600 } 627 }
601 628
602 /** 629 /**
  630 + * 获取视频上传人的id
  631 + *
  632 + * @return video_user_id - 视频上传人的id
  633 + */
  634 + public String getVideo_user_id() {
  635 + return video_user_id;
  636 + }
  637 +
  638 + /**
  639 + * 设置视频上传人的id
  640 + *
  641 + * @param video_user_id 视频上传人的id
  642 + */
  643 + public void setVideo_user_id(String video_user_id) {
  644 + this.video_user_id = video_user_id;
  645 + }
  646 +
  647 + /**
603 * 获取抽帧图片地址 648 * 获取抽帧图片地址
604 * 649 *
605 * @return avsample_imgs - 抽帧图片地址 650 * @return avsample_imgs - 抽帧图片地址
src/main/java/com/cnlive/shenhe/job/VideosJob.java
@@ -33,63 +33,42 @@ public class VideosJob { @@ -33,63 +33,42 @@ public class VideosJob {
33 33
34 34
35 /** 35 /**
36 - * 白名单sp视频通过  
37 - */  
38 - @Scheduled(fixedRate = 60 * 1000)  
39 - public void updateVideos() {  
40 - //获取所有点播免审sp  
41 - List<Integer> sites = sitesService.getBusinessList();  
42 - //遍历免审的spid去更改状态值  
43 - ShyVideos shyVideos = new ShyVideos();  
44 - for (int spid : sites) {  
45 - shyVideos.setSpid(spid);  
46 - shyVideos.setState(CommonConst.AUDIT_INTT);  
47 - List<ShyVideos> shyVideosList = videosService.findshyVideo(shyVideos);  
48 - if (shyVideosList.size() > 0) {  
49 - for (ShyVideos video : shyVideosList) {  
50 - //如果网家家的栏目是“目击者”,跳过免审  
51 - if(CommonUtils.isNotEmpty(video.getCategory()) && video.getCategory().equals(CommonConst.CATEGORY_WITNESS)){  
52 - if(video.getAvsample().equals(CommonConst.AVSAMPLE_SUCCESS)){  
53 - logger.info("发送数美检测的videos_id:"+video.getId());  
54 - //数美图片过滤  
55 - videosService.videoFilter(video.getId(),CommonConst.DYNAMIC_USER);  
56 - }else{  
57 - continue;  
58 - }  
59 - }  
60 - logger.info("白名单自动通过的videos_id:"+video.getId());  
61 - video.setUpdater("白名单");  
62 - //更新点播和审核的视频状态  
63 - videosService.updateDianboAndShenhe(video,3);  
64 - }  
65 - }  
66 - } 36 + * 白名单sp视频通过
  37 + */
  38 + @Scheduled(fixedRate = 60 * 1000)
  39 + public void updateVideos() {
  40 + ShyVideos shyVideos = new ShyVideos();
  41 + shyVideos.setShenhe_type(CommonConst.AUDIT_TYPE_FREE);// 审核类型为免审
  42 + shyVideos.setState(CommonConst.AUDIT_INTT);// 审核状态为未审核
  43 + List<ShyVideos> shyVideosList = videosService.findshyVideo(shyVideos);
  44 + if (shyVideosList.size() > 0) {
  45 + for (ShyVideos video : shyVideosList) {
  46 + video.setUpdater("白名单");
  47 + // 更新点播和审核的视频状态
  48 + videosService.updateDianboAndShenhe(video, 3);
  49 + }
  50 + }
67 } 51 }
68 52
69 /** 53 /**
70 * 定时发送数美检测视频 54 * 定时发送数美检测视频
71 */ 55 */
72 - /** @Scheduled(cron="0 0/1 7-23 * * ? ")//每天7点到23点执行,每分钟一次 56 + @Scheduled(cron="0 0/1 7-23 * * ? ")//每天7点到23点执行,每分钟一次
73 public void videofilter() { 57 public void videofilter() {
74 ShyVideos shyVideos = new ShyVideos(); 58 ShyVideos shyVideos = new ShyVideos();
75 - shyVideos.setCategory(CommonConst.CATEGORY_WITNESS);//目击者 59 + shyVideos.setShenhe_type(CommonConst.AUDIT_TYPE_MACHANE);//审核类型为机审
76 shyVideos.setState(CommonConst.AUDIT_INTT);//待审核状态 60 shyVideos.setState(CommonConst.AUDIT_INTT);//待审核状态
77 shyVideos.setAvsample(CommonConst.AVSAMPLE_SUCCESS);//抽帧完成 61 shyVideos.setAvsample(CommonConst.AVSAMPLE_SUCCESS);//抽帧完成
78 List<ShyVideos> shyVideosList = videosService.findshyVideo(shyVideos); 62 List<ShyVideos> shyVideosList = videosService.findshyVideo(shyVideos);
79 - //获取所有点播免审sp  
80 -// List<Integer> sites = sitesService.getBusinessList();  
81 if (shyVideosList.size() > 0) { 63 if (shyVideosList.size() > 0) {
82 for (ShyVideos video : shyVideosList) { 64 for (ShyVideos video : shyVideosList) {
83 -// if(sites.contains(video.getSpid())){//点播免审sp里面包含视频的sp,则跳过  
84 -// continue;  
85 -// }  
86 logger.info("定时发送数美检测的videos_id:"+video.getId()); 65 logger.info("定时发送数美检测的videos_id:"+video.getId());
87 //数美图片过滤 66 //数美图片过滤
88 videosService.videoFilter(video.getId(),CommonConst.DYNAMIC_USER); 67 videosService.videoFilter(video.getId(),CommonConst.DYNAMIC_USER);
89 } 68 }
90 } 69 }
91 } 70 }
92 - */ 71 +
93 72
94 /** 73 /**
95 * 自动退领 74 * 自动退领
src/main/java/com/cnlive/shenhe/mapper/ShyUsersfreeMapper.java 0 → 100644
  1 +package com.cnlive.shenhe.mapper;
  2 +
  3 +import com.cnlive.shenhe.entity.ShyUsersfree;
  4 +import tk.mybatis.mapper.common.Mapper;
  5 +
  6 +public interface ShyUsersfreeMapper extends Mapper<ShyUsersfree> {
  7 +}
0 \ No newline at end of file 8 \ No newline at end of file
src/main/java/com/cnlive/shenhe/serviceImpl/SitesServiceImpl.java
@@ -83,14 +83,14 @@ public class SitesServiceImpl { @@ -83,14 +83,14 @@ public class SitesServiceImpl {
83 * 获取免审白名单列表(点播) 83 * 获取免审白名单列表(点播)
84 * @return 84 * @return
85 */ 85 */
86 - public List<Integer> getBusinessList() { 86 + public List<Integer> getBusinessList(Integer business_) {
87 List<ShySites> sitesList = shySitesMapper.selectAll(); 87 List<ShySites> sitesList = shySitesMapper.selectAll();
88 List<Integer> sites = new ArrayList<Integer>(); 88 List<Integer> sites = new ArrayList<Integer>();
89 for (ShySites shySites : sitesList) { 89 for (ShySites shySites : sitesList) {
90 if (CommonUtils.isNotEmpty(shySites.getWrite_business())) { 90 if (CommonUtils.isNotEmpty(shySites.getWrite_business())) {
91 String[] business = shySites.getWrite_business().split(","); 91 String[] business = shySites.getWrite_business().split(",");
92 List<String> asList = Arrays.asList(business); 92 List<String> asList = Arrays.asList(business);
93 - if (asList.contains(CommonConst.BUSINESS_VIDEO + "")) { 93 + if (asList.contains(business_ + "")) {
94 sites.add(shySites.getSpid()); 94 sites.add(shySites.getSpid());
95 } 95 }
96 } 96 }
src/main/java/com/cnlive/shenhe/serviceImpl/UsersfreeServiceImpl.java 0 → 100644
  1 +package com.cnlive.shenhe.serviceImpl;
  2 +
  3 +import com.cnlive.shenhe.entity.ShyUsersfree;
  4 +import com.cnlive.shenhe.mapper.ShyUsersfreeMapper;
  5 +
  6 +import org.springframework.beans.factory.annotation.Autowired;
  7 +import org.springframework.stereotype.Service;
  8 +
  9 +/**
  10 + * @Auther: 李伟
  11 + * @Date: 2019/05/13 14:23
  12 + * @Description:
  13 + */
  14 +@Service
  15 +public class UsersfreeServiceImpl {
  16 + @Autowired
  17 + ShyUsersfreeMapper shyUsersfreeMapper;
  18 +
  19 + public ShyUsersfree get(Integer id) {
  20 + return shyUsersfreeMapper.selectByPrimaryKey(id);
  21 + }
  22 +
  23 + public ShyUsersfree select(ShyUsersfree shyUsersfree) {
  24 + return shyUsersfreeMapper.selectOne(shyUsersfree);
  25 + }
  26 + /**
  27 + * 通过spid、栏目、用户id来查看是否是免审
  28 + * @param sp_id
  29 + * @param category
  30 + * @param user_id
  31 + * @return
  32 + */
  33 + public ShyUsersfree selectUser(Integer sp_id,String category,String user_id) {
  34 + ShyUsersfree shyUserfree=new ShyUsersfree();
  35 + shyUserfree.setSp_id(sp_id);
  36 + shyUserfree.setCategory(category);
  37 + shyUserfree.setUser_id(user_id);
  38 + return shyUsersfreeMapper.selectOne(shyUserfree);
  39 + }
  40 +}
src/main/java/com/cnlive/shenhe/serviceImpl/VideosServiceImpl.java
@@ -7,6 +7,7 @@ import com.cnlive.shenhe.bean.ErrorEnum; @@ -7,6 +7,7 @@ import com.cnlive.shenhe.bean.ErrorEnum;
7 import com.cnlive.shenhe.bean.ResponseBean; 7 import com.cnlive.shenhe.bean.ResponseBean;
8 import com.cnlive.shenhe.entity.ShySites; 8 import com.cnlive.shenhe.entity.ShySites;
9 import com.cnlive.shenhe.entity.ShyUsers; 9 import com.cnlive.shenhe.entity.ShyUsers;
  10 +import com.cnlive.shenhe.entity.ShyUsersfree;
10 import com.cnlive.shenhe.entity.ShyVideofilter; 11 import com.cnlive.shenhe.entity.ShyVideofilter;
11 import com.cnlive.shenhe.entity.ShyVideos; 12 import com.cnlive.shenhe.entity.ShyVideos;
12 import com.cnlive.shenhe.job.VideosJob; 13 import com.cnlive.shenhe.job.VideosJob;
@@ -54,6 +55,11 @@ public class VideosServiceImpl { @@ -54,6 +55,11 @@ public class VideosServiceImpl {
54 55
55 @Autowired 56 @Autowired
56 VideosServiceImpl videosService; 57 VideosServiceImpl videosService;
  58 + @Autowired
  59 + SitesServiceImpl sitesService;
  60 +
  61 + @Autowired
  62 + UsersfreeServiceImpl usersfreeServiceImpl;
57 63
58 @Autowired 64 @Autowired
59 VideofilterServiceImpl videofilterServiceImpl; 65 VideofilterServiceImpl videofilterServiceImpl;
@@ -318,13 +324,17 @@ public class VideosServiceImpl { @@ -318,13 +324,17 @@ public class VideosServiceImpl {
318 type=CommonConst.REJECT;//报错就给一个拒绝状态 324 type=CommonConst.REJECT;//报错就给一个拒绝状态
319 desc="数美审核报错了"; 325 desc="数美审核报错了";
320 } 326 }
321 -// if(type.toLowerCase().equals(CommonConst.PASS)){//数美通过  
322 -// //修改点播云视频状态  
323 -// videosService.updateDianboAndShenhe(shyVideos,3);  
324 -// }else if(type.toLowerCase().equals(CommonConst.REJECT)){//数美拒绝  
325 -// shyVideos.setMsg(desc);//拒绝原因 327 + if(type.toLowerCase().equals(CommonConst.PASS)){//数美通过
  328 + desc="数美审核通过了";
  329 + shyVideos.setMsg(desc);
  330 + //修改点播云视频状态
  331 + videosService.updateDianboAndShenhe(shyVideos,3);
  332 + }else if(type.toLowerCase().equals(CommonConst.REJECT)){//数美拒绝
  333 + shyVideos.setShenhe_type(CommonConst.AUDIT_TYPE_USER);//审核类型改为人工审核
  334 + shyVideos.setMsg(desc);//拒绝原因
  335 + videosService.updateshyVideos(shyVideos);
326 // videosService.updateDianboAndShenhe(shyVideos,4); 336 // videosService.updateDianboAndShenhe(shyVideos,4);
327 -// } 337 + }
328 ShyVideofilter videofilter=new ShyVideofilter(); 338 ShyVideofilter videofilter=new ShyVideofilter();
329 videofilter.setChannel(channel); 339 videofilter.setChannel(channel);
330 videofilter.setDesc_msg(desc); 340 videofilter.setDesc_msg(desc);
@@ -368,5 +378,40 @@ public class VideosServiceImpl { @@ -368,5 +378,40 @@ public class VideosServiceImpl {
368 return 0; 378 return 0;
369 } 379 }
370 380
  381 + /**
  382 + * 根据sp、栏目、用户id来判断审核类型
  383 + * @param spid
  384 + * @param category
  385 + * @param sid
  386 + * @return
  387 + */
  388 + public void getShenheType(ShyVideos shyVideo){
  389 +
  390 + //获取点播免审sp
  391 + List<Integer> sites = sitesService.getBusinessList(CommonConst.BUSINESS_VIDEO);
  392 + //初始化一个审核状态
  393 + Integer shenheType=3;//审核类型,1:免审,2:机审,3:人工审
  394 + //如果当前sp是免审sp
  395 + if(sites.contains(shyVideo.getSpid())){
  396 + //如果栏目是“目击者”
  397 + if(CommonUtils.isNotEmpty(shyVideo.getCategory()) && shyVideo.getCategory().equals(CommonConst.CATEGORY_WITNESS)){
  398 + //如果用户id存在
  399 + if(CommonUtils.isNotEmpty(shyVideo.getVideo_user_id())){
  400 + ShyUsersfree shyUserfree=usersfreeServiceImpl.selectUser(shyVideo.getSpid(), shyVideo.getCategory(), shyVideo.getVideo_user_id());
  401 + //如果存在免审用户
  402 + if(CommonUtils.isNotNull(shyUserfree)){
  403 + shenheType=1;//免审
  404 + }else{//用户不免审
  405 + shenheType=2;//机审
  406 + }
  407 + }else{//如果用户id不存在
  408 + shenheType=2;//机审
  409 + }
  410 + }else{//如果栏目不存在或者不是非免审栏目
  411 + shenheType=1;//免审
  412 + }
  413 + }
  414 + shyVideo.setShenhe_type(shenheType);
  415 + }
371 416
372 } 417 }
src/main/java/com/cnlive/shenhe/utils/CommonConst.java
@@ -22,6 +22,18 @@ public class CommonConst { @@ -22,6 +22,18 @@ public class CommonConst {
22 * 审核状态:审核拒绝 22 * 审核状态:审核拒绝
23 */ 23 */
24 public static Integer AUDIT_REFUSE = 2; 24 public static Integer AUDIT_REFUSE = 2;
  25 + /**
  26 + * 审核类型:免审
  27 + */
  28 + public static Integer AUDIT_TYPE_FREE = 1;
  29 + /**
  30 + * 审核类型:机审
  31 + */
  32 + public static Integer AUDIT_TYPE_MACHANE = 2;
  33 + /**
  34 + * 审核类型:人工审
  35 + */
  36 + public static Integer AUDIT_TYPE_USER = 3;
25 37
26 /** 38 /**
27 * 审核状态:白名单通过回调失败 39 * 审核状态:白名单通过回调失败
src/main/resources/mapper/ShyUsersfreeMapper.xml 0 → 100644
  1 +<?xml version="1.0" encoding="UTF-8"?>
  2 +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  3 +<mapper namespace="com.cnlive.shenhe.mapper.ShyUsersfreeMapper">
  4 + <resultMap id="BaseResultMap" type="com.cnlive.shenhe.entity.ShyUsersfree">
  5 + <!--
  6 + WARNING - @mbg.generated
  7 + -->
  8 + <id column="id" jdbcType="INTEGER" property="id" />
  9 + <result column="user_id" jdbcType="VARCHAR" property="user_id" />
  10 + <result column="sp_id" jdbcType="INTEGER" property="sp_id" />
  11 + <result column="category" jdbcType="VARCHAR" property="category" />
  12 + <result column="isEnable" jdbcType="INTEGER" property="isEnable" />
  13 + </resultMap>
  14 +</mapper>
0 \ No newline at end of file 15 \ No newline at end of file
src/main/resources/mapper/ShyVideofilterMapper.xml
@@ -11,6 +11,7 @@ @@ -11,6 +11,7 @@
11 <result column="channel" jdbcType="VARCHAR" property="channel" /> 11 <result column="channel" jdbcType="VARCHAR" property="channel" />
12 <result column="result_type" jdbcType="VARCHAR" property="result_type" /> 12 <result column="result_type" jdbcType="VARCHAR" property="result_type" />
13 <result column="desc_msg" jdbcType="VARCHAR" property="desc_msg" /> 13 <result column="desc_msg" jdbcType="VARCHAR" property="desc_msg" />
  14 + <result column="duration" jdbcType="INTEGER" property="duration" />
14 <result column="created_at" jdbcType="TIMESTAMP" property="created_at" /> 15 <result column="created_at" jdbcType="TIMESTAMP" property="created_at" />
15 </resultMap> 16 </resultMap>
16 </mapper> 17 </mapper>
17 \ No newline at end of file 18 \ No newline at end of file
src/main/resources/mapper/ShyVideosMapper.xml
@@ -17,6 +17,7 @@ @@ -17,6 +17,7 @@
17 <result column="callback" jdbcType="VARCHAR" property="callback" /> 17 <result column="callback" jdbcType="VARCHAR" property="callback" />
18 <result column="video_priority" jdbcType="VARCHAR" property="video_priority" /> 18 <result column="video_priority" jdbcType="VARCHAR" property="video_priority" />
19 <result column="msg" jdbcType="VARCHAR" property="msg" /> 19 <result column="msg" jdbcType="VARCHAR" property="msg" />
  20 + <result column="shenhe_type" jdbcType="INTEGER" property="shenhe_type" />
20 <result column="state" jdbcType="INTEGER" property="state" /> 21 <result column="state" jdbcType="INTEGER" property="state" />
21 <result column="video_upload_time" jdbcType="TIMESTAMP" property="video_upload_time" /> 22 <result column="video_upload_time" jdbcType="TIMESTAMP" property="video_upload_time" />
22 <result column="video_keyword" jdbcType="VARCHAR" property="video_keyword" /> 23 <result column="video_keyword" jdbcType="VARCHAR" property="video_keyword" />
@@ -32,6 +33,7 @@ @@ -32,6 +33,7 @@
32 <result column="plat" jdbcType="INTEGER" property="plat" /> 33 <result column="plat" jdbcType="INTEGER" property="plat" />
33 <result column="duration" jdbcType="INTEGER" property="duration" /> 34 <result column="duration" jdbcType="INTEGER" property="duration" />
34 <result column="category" jdbcType="VARCHAR" property="category" /> 35 <result column="category" jdbcType="VARCHAR" property="category" />
  36 + <result column="video_user_id" jdbcType="VARCHAR" property="video_user_id" />
35 <result column="avsample_imgs" jdbcType="LONGVARCHAR" property="avsample_imgs" /> 37 <result column="avsample_imgs" jdbcType="LONGVARCHAR" property="avsample_imgs" />
36 <result column="avsample_msg" jdbcType="LONGVARCHAR" property="avsample_msg" /> 38 <result column="avsample_msg" jdbcType="LONGVARCHAR" property="avsample_msg" />
37 </resultMap> 39 </resultMap>