Commit cfb1f7e0aef648de1b9c6014a8e1ebb0174a68c6

Authored by 王言钊
2 parents 0ed74930 61d1ddab

Merge branch 'dev'

src/main/java/com/cnlive/shenhe/api/AvsampleCallBackControllerApi.java
@@ -70,10 +70,8 @@ public class AvsampleCallBackControllerApi { @@ -70,10 +70,8 @@ public class AvsampleCallBackControllerApi {
70 } 70 }
71 return result; 71 return result;
72 } 72 }
73 -  
74 - @GetMapping("/getGame")  
75 - public String getGame() {  
76 - return "html/game.html";  
77 - }  
78 - 73 + //@GetMapping("/getGame")
  74 + //public String getGame() {
  75 + // return "html/game.html";
  76 + //}
79 } 77 }
src/main/java/com/cnlive/shenhe/api/ContentControllerApi.java
@@ -12,9 +12,11 @@ import org.slf4j.Logger; @@ -12,9 +12,11 @@ import org.slf4j.Logger;
12 import org.slf4j.LoggerFactory; 12 import org.slf4j.LoggerFactory;
13 import org.springframework.beans.factory.annotation.Autowired; 13 import org.springframework.beans.factory.annotation.Autowired;
14 import org.springframework.stereotype.Controller; 14 import org.springframework.stereotype.Controller;
15 -import org.springframework.ui.Model;  
16 import org.springframework.util.StringUtils; 15 import org.springframework.util.StringUtils;
17 -import org.springframework.web.bind.annotation.*; 16 +import org.springframework.web.bind.annotation.PostMapping;
  17 +import org.springframework.web.bind.annotation.RequestBody;
  18 +import org.springframework.web.bind.annotation.RequestMapping;
  19 +import org.springframework.web.bind.annotation.ResponseBody;
18 20
19 import java.util.Date; 21 import java.util.Date;
20 import java.util.List; 22 import java.util.List;
@@ -268,15 +270,12 @@ public class ContentControllerApi { @@ -268,15 +270,12 @@ public class ContentControllerApi {
268 return new ResponseBean(ErrorEnum.ERROR); 270 return new ResponseBean(ErrorEnum.ERROR);
269 } 271 }
270 } 272 }
271 -  
272 - @GetMapping("/detail/{id}.html")  
273 - public Object getContentDetail(Model model, @PathVariable Integer id) {  
274 - System.out.println("数美送审页面开始进入");  
275 - ShyContent content = contentService.selectByPrimaryKey(id);  
276 - model.addAttribute("contentText", content.getContent_text());  
277 - model.addAttribute("contentTitle", content.getTitle());  
278 - return "html/contentPage.html";  
279 - }  
280 -  
281 - 273 + //@GetMapping("/detail/{id}.html")
  274 + //public Object getContentDetail(Model model, @PathVariable Integer id) {
  275 + // System.out.println("数美送审页面开始进入");
  276 + // ShyContent content = contentService.selectByPrimaryKey(id);
  277 + // model.addAttribute("contentText", content.getContent_text());
  278 + // model.addAttribute("contentTitle", content.getTitle());
  279 + // return "html/contentPage.html";
  280 + //}
282 } 281 }
src/main/java/com/cnlive/shenhe/api/LiveApplyControllerApi.java
@@ -61,9 +61,9 @@ public class LiveApplyControllerApi { @@ -61,9 +61,9 @@ public class LiveApplyControllerApi {
61 //直播主题 61 //直播主题
62 String theme = json.getString("theme"); 62 String theme = json.getString("theme");
63 //商务模式:0免费 1收费 63 //商务模式:0免费 1收费
64 - Integer businessModel = Integer.parseInt(json.getString("businessModel")); 64 + Integer businessModel = json.getInteger("businessModel");
65 //内容属性:1商业类活动 0非商业活动 65 //内容属性:1商业类活动 0非商业活动
66 - Integer contentProperty = Integer.parseInt(json.getString("contentProperty")); 66 + Integer contentProperty = json.getInteger("contentProperty");
67 //内容简述 67 //内容简述
68 String simpleContent = json.getString("simpleContent"); 68 String simpleContent = json.getString("simpleContent");
69 //直播类型 69 //直播类型
src/main/java/com/cnlive/shenhe/api/LiveControllerApi.java
1 package com.cnlive.shenhe.api; 1 package com.cnlive.shenhe.api;
2 2
3 -import com.alibaba.fastjson.JSON;  
4 import com.alibaba.fastjson.JSONObject; 3 import com.alibaba.fastjson.JSONObject;
5 import com.cnlive.shenhe.entity.ShyLive; 4 import com.cnlive.shenhe.entity.ShyLive;
6 import com.cnlive.shenhe.serviceImpl.LiveServiceImpl; 5 import com.cnlive.shenhe.serviceImpl.LiveServiceImpl;
7 import com.cnlive.shenhe.utils.CommonConst; 6 import com.cnlive.shenhe.utils.CommonConst;
8 import com.cnlive.shenhe.utils.CommonConstStates; 7 import com.cnlive.shenhe.utils.CommonConstStates;
9 import com.cnlive.shenhe.utils.CommonUtils; 8 import com.cnlive.shenhe.utils.CommonUtils;
10 -import org.apache.commons.lang3.StringUtils;  
11 import org.slf4j.Logger; 9 import org.slf4j.Logger;
12 import org.slf4j.LoggerFactory; 10 import org.slf4j.LoggerFactory;
13 import org.springframework.beans.factory.annotation.Autowired; 11 import org.springframework.beans.factory.annotation.Autowired;
14 import org.springframework.stereotype.Controller; 12 import org.springframework.stereotype.Controller;
15 -import org.springframework.web.bind.annotation.*; 13 +import org.springframework.web.bind.annotation.PostMapping;
  14 +import org.springframework.web.bind.annotation.RequestMapping;
  15 +import org.springframework.web.bind.annotation.ResponseBody;
16 16
17 import java.sql.Timestamp; 17 import java.sql.Timestamp;
18 import java.util.Date; 18 import java.util.Date;
@@ -47,7 +47,7 @@ public class LiveControllerApi { @@ -47,7 +47,7 @@ public class LiveControllerApi {
47 //直播活动名称 47 //直播活动名称
48 String activityName = json.getString("activityName"); 48 String activityName = json.getString("activityName");
49 //直播活动状态 49 //直播活动状态
50 - Integer activityStatus = Integer.parseInt(json.getString("activityStatus")); 50 + Integer activityStatus = json.getInteger("activityStatus");
51 //直播频道id 51 //直播频道id
52 String channelId = json.getString("channelId"); 52 String channelId = json.getString("channelId");
53 //直播频道id 53 //直播频道id
@@ -57,13 +57,11 @@ public class LiveControllerApi { @@ -57,13 +57,11 @@ public class LiveControllerApi {
57 //m3u8直播流 57 //m3u8直播流
58 String hlsUrl = json.getString("hlsUrl"); 58 String hlsUrl = json.getString("hlsUrl");
59 //spid 59 //spid
60 - Integer spId = Integer.parseInt(json.getString("spId")); 60 + Integer spId = json.getInteger("spId");
61 //回调地址 61 //回调地址
62 String callback = json.getString("callback"); 62 String callback = json.getString("callback");
63 -  
64 -  
65 //优先级 63 //优先级
66 - Integer isHot = Integer.parseInt(json.getString("priority")); 64 + Integer isHot = json.getInteger("priority");
67 //封面 65 //封面
68 String coverImgUrl = json.getString("coverImgUrl"); 66 String coverImgUrl = json.getString("coverImgUrl");
69 //活动描述 67 //活动描述
@@ -279,30 +277,27 @@ public class LiveControllerApi { @@ -279,30 +277,27 @@ public class LiveControllerApi {
279 } 277 }
280 return map; 278 return map;
281 } 279 }
282 -  
283 -  
284 - @RequestMapping(value = "callbackLiveResult", method = RequestMethod.POST)  
285 - @ResponseBody  
286 - public void getFilterVideoResult(@RequestBody String json) {  
287 - logger.info("数美视频过滤回调,json:{}", json);  
288 - if (StringUtils.isNotEmpty(json)) {  
289 - JSONObject jsonObj = JSON.parseObject(json);  
290 - JSONObject resultObj = jsonObj.getJSONObject("result");  
291 - Integer code = resultObj.getInteger("code");  
292 - if (code != null && code == 1100) {  
293 - String riskLevel = resultObj.getString("riskLevel");  
294 - if ("PASS".equals(riskLevel)) {  
295 -  
296 - }  
297 - if ("REJECT".equals(riskLevel)) {  
298 - JSONObject detail = resultObj.getJSONObject("detail");  
299 - logger.info("数美视频回调--REJECT,detail:{}", detail);  
300 - }  
301 - if ("REVIEW".equals(riskLevel)) {  
302 - }  
303 - } else {  
304 - }  
305 - }  
306 - }  
307 - 280 + //@RequestMapping(value = "callbackLiveResult", method = RequestMethod.POST)
  281 + //@ResponseBody
  282 + //public void getFilterVideoResult(@RequestBody String json) {
  283 + // logger.info("数美视频过滤回调,json:{}", json);
  284 + // if (StringUtils.isNotEmpty(json)) {
  285 + // JSONObject jsonObj = JSON.parseObject(json);
  286 + // JSONObject resultObj = jsonObj.getJSONObject("result");
  287 + // Integer code = resultObj.getInteger("code");
  288 + // if (code != null && code == 1100) {
  289 + // String riskLevel = resultObj.getString("riskLevel");
  290 + // if ("PASS".equals(riskLevel)) {
  291 + //
  292 + // }
  293 + // if ("REJECT".equals(riskLevel)) {
  294 + // JSONObject detail = resultObj.getJSONObject("detail");
  295 + // logger.info("数美视频回调--REJECT,detail:{}", detail);
  296 + // }
  297 + // if ("REVIEW".equals(riskLevel)) {
  298 + // }
  299 + // } else {
  300 + // }
  301 + // }
  302 + //}
308 } 303 }
src/main/java/com/cnlive/shenhe/mapper/ShyActivityMapper.java
@@ -22,4 +22,11 @@ public interface ShyActivityMapper extends Mapper<ShyActivity> { @@ -22,4 +22,11 @@ public interface ShyActivityMapper extends Mapper<ShyActivity> {
22 * @return 22 * @return
23 */ 23 */
24 ShyActivity selectById(@Param("id")Integer id); 24 ShyActivity selectById(@Param("id")Integer id);
  25 +
  26 + /**
  27 + * 根据 source 查询审核类型
  28 + * @param id
  29 + * @return
  30 + */
  31 + Integer selectBySource(@Param("id")Integer id);
25 } 32 }
26 \ No newline at end of file 33 \ No newline at end of file
src/main/java/com/cnlive/shenhe/serviceImpl/AudioServiceImpl.java
@@ -210,51 +210,38 @@ public class AudioServiceImpl { @@ -210,51 +210,38 @@ public class AudioServiceImpl {
210 public PageInfo<ShyAudio> getListContent(AudioDTO audioDTO) { 210 public PageInfo<ShyAudio> getListContent(AudioDTO audioDTO) {
211 Example example = new Example(ShyAudio.class); 211 Example example = new Example(ShyAudio.class);
212 Example.Criteria criteria = example.createCriteria(); 212 Example.Criteria criteria = example.createCriteria();
213 - Example.Criteria criteria2 = example.createCriteria();  
214 if (CommonUtils.isNotEmpty(audioDTO.getOrderByClause())) { 213 if (CommonUtils.isNotEmpty(audioDTO.getOrderByClause())) {
215 example.setOrderByClause(audioDTO.getOrderByClause()); 214 example.setOrderByClause(audioDTO.getOrderByClause());
216 } 215 }
217 if (CommonUtils.isNotEmpty(audioDTO.getStart_date()) && CommonUtils.isNotEmpty(audioDTO.getEnd_date())) { 216 if (CommonUtils.isNotEmpty(audioDTO.getStart_date()) && CommonUtils.isNotEmpty(audioDTO.getEnd_date())) {
218 criteria.andGreaterThanOrEqualTo("createTime", audioDTO.getStart_date()); 217 criteria.andGreaterThanOrEqualTo("createTime", audioDTO.getStart_date());
219 - criteria2.andGreaterThanOrEqualTo("createTime", audioDTO.getStart_date());  
220 criteria.andLessThanOrEqualTo("createTime", audioDTO.getEnd_date()); 218 criteria.andLessThanOrEqualTo("createTime", audioDTO.getEnd_date());
221 - criteria2.andLessThanOrEqualTo("createTime", audioDTO.getEnd_date());  
222 } 219 }
223 if (CommonUtils.isNotEmpty(audioDTO.getVideo_title())) { 220 if (CommonUtils.isNotEmpty(audioDTO.getVideo_title())) {
224 criteria.andLike("audioTitle", "%" + audioDTO.getVideo_title() + "%"); 221 criteria.andLike("audioTitle", "%" + audioDTO.getVideo_title() + "%");
225 - criteria2.andLike("audioTitle", "%" + audioDTO.getVideo_title() + "%");  
226 } 222 }
227 -  
228 if (CommonUtils.isNotEmpty(audioDTO.getVideo_priority())) { 223 if (CommonUtils.isNotEmpty(audioDTO.getVideo_priority())) {
229 criteria.andEqualTo("priority", audioDTO.getVideo_priority()); 224 criteria.andEqualTo("priority", audioDTO.getVideo_priority());
230 - criteria2.andEqualTo("priority", audioDTO.getVideo_priority());  
231 } 225 }
232 -  
233 if (CommonUtils.isNotNull(audioDTO.getSpid())) { 226 if (CommonUtils.isNotNull(audioDTO.getSpid())) {
234 criteria.andEqualTo("spId", audioDTO.getSpid()); 227 criteria.andEqualTo("spId", audioDTO.getSpid());
235 - criteria2.andEqualTo("spId", audioDTO.getSpid());  
236 } else if (CommonUtils.isNotEmpty(audioDTO.getSp_Id())) { 228 } else if (CommonUtils.isNotEmpty(audioDTO.getSp_Id())) {
237 criteria.andEqualTo("spId", audioDTO.getSp_Id()); 229 criteria.andEqualTo("spId", audioDTO.getSp_Id());
238 - criteria2.andEqualTo("spId", audioDTO.getSp_Id());  
239 } 230 }
240 -  
241 //领取状态 0-未领取 1-已领取 231 //领取状态 0-未领取 1-已领取
242 if (CommonUtils.isNotNull(audioDTO.getReceive())) { 232 if (CommonUtils.isNotNull(audioDTO.getReceive())) {
243 criteria.andEqualTo("receive", audioDTO.getReceive()); 233 criteria.andEqualTo("receive", audioDTO.getReceive());
244 - criteria2.andEqualTo("receive", audioDTO.getReceive());  
245 if (audioDTO.getReceive().equals(CommonConst.RECEIVE_AFTER)) { 234 if (audioDTO.getReceive().equals(CommonConst.RECEIVE_AFTER)) {
246 criteria.andEqualTo("receive_user_id", audioDTO.getUserId()); 235 criteria.andEqualTo("receive_user_id", audioDTO.getUserId());
247 - criteria2.andEqualTo("receive_user_id", audioDTO.getUserId());  
248 } 236 }
249 } 237 }
250 -  
251 - //审核状态 0-未审核 1-已审核 2-拒绝 238 + //审核状态 0-未审核 1-已审核 2-拒绝 3-我的已审
  239 + //不是 我的已审 进来的,只查一种状态
252 if (CommonUtils.isNotNull(audioDTO.getState()) && audioDTO.getState() != 3) { 240 if (CommonUtils.isNotNull(audioDTO.getState()) && audioDTO.getState() != 3) {
253 criteria.andEqualTo("state", audioDTO.getState()); 241 criteria.andEqualTo("state", audioDTO.getState());
  242 + //是 我的已审,查通过和拒绝的两种状态
254 } else if (CommonUtils.isNotNull(audioDTO.getState()) && audioDTO.getState() == 3) { 243 } else if (CommonUtils.isNotNull(audioDTO.getState()) && audioDTO.getState() == 3) {
255 - criteria.andEqualTo("state", 1);  
256 - criteria2.andEqualTo("state", 2);  
257 - example.or(criteria2); 244 + criteria.andBetween("state", CommonConst.AUDIT_SUCCESS,CommonConst.AUDIT_REFUSE);
258 } 245 }
259 246
260 //默认按上传时间倒序排序 247 //默认按上传时间倒序排序
src/main/java/com/cnlive/shenhe/serviceImpl/ChannelServiceImpl.java
@@ -99,10 +99,7 @@ public class ChannelServiceImpl { @@ -99,10 +99,7 @@ public class ChannelServiceImpl {
99 criteria.andEqualTo("shenhe_status", channelDTO.getShenhe_status()); 99 criteria.andEqualTo("shenhe_status", channelDTO.getShenhe_status());
100 //是 我的已审,查通过和拒绝的两种状态 100 //是 我的已审,查通过和拒绝的两种状态
101 } else if (CommonUtils.isNotNull(channelDTO.getShenhe_status()) && channelDTO.getShenhe_status() == 3) { 101 } else if (CommonUtils.isNotNull(channelDTO.getShenhe_status()) && channelDTO.getShenhe_status() == 3) {
102 - Example.Criteria criteria1 = example.createCriteria();  
103 - criteria1.orEqualTo("shenhe_status", CommonConst.AUDIT_SUCCESS);  
104 - criteria1.orEqualTo("shenhe_status", CommonConst.AUDIT_REFUSE);  
105 - example.and(criteria1); 102 + criteria.andBetween("shenhe_status",CommonConst.AUDIT_SUCCESS,CommonConst.AUDIT_REFUSE);
106 } 103 }
107 104
108 PageHelper.startPage(channelDTO.getPage(), channelDTO.getPageSize(), true); 105 PageHelper.startPage(channelDTO.getPage(), channelDTO.getPageSize(), true);
src/main/java/com/cnlive/shenhe/serviceImpl/CommentsServiceImpl.java
@@ -123,10 +123,7 @@ public class CommentsServiceImpl { @@ -123,10 +123,7 @@ public class CommentsServiceImpl {
123 if (CommonUtils.isNotNull(commentsDTO.getState()) && commentsDTO.getState() != 3) { 123 if (CommonUtils.isNotNull(commentsDTO.getState()) && commentsDTO.getState() != 3) {
124 criteria.andEqualTo("state", commentsDTO.getState()); 124 criteria.andEqualTo("state", commentsDTO.getState());
125 } else if (CommonUtils.isNotNull(commentsDTO.getState()) && commentsDTO.getState() == 3) { 125 } else if (CommonUtils.isNotNull(commentsDTO.getState()) && commentsDTO.getState() == 3) {
126 - Example.Criteria criteria1 = example.createCriteria();  
127 - criteria1.orEqualTo("state", CommonConst.AUDIT_SUCCESS);  
128 - criteria1.orEqualTo("state", CommonConst.AUDIT_REFUSE);  
129 - example.and(criteria1); 126 + criteria.andBetween("state",CommonConst.AUDIT_SUCCESS,CommonConst.AUDIT_REFUSE);
130 } 127 }
131 128
132 PageHelper.startPage(commentsDTO.getPage(), commentsDTO.getPageSize(), true); 129 PageHelper.startPage(commentsDTO.getPage(), commentsDTO.getPageSize(), true);
@@ -173,14 +170,12 @@ public class CommentsServiceImpl { @@ -173,14 +170,12 @@ public class CommentsServiceImpl {
173 criteria.andEqualTo("receive_user_id", commentsDTO.getUserId()); 170 criteria.andEqualTo("receive_user_id", commentsDTO.getUserId());
174 } 171 }
175 } 172 }
176 - 173 + //不是 我的已审 进来的,只查一种状态
177 if (CommonUtils.isNotNull(commentsDTO.getState()) && commentsDTO.getState() != 3) { 174 if (CommonUtils.isNotNull(commentsDTO.getState()) && commentsDTO.getState() != 3) {
178 criteria.andEqualTo("state", commentsDTO.getState()); 175 criteria.andEqualTo("state", commentsDTO.getState());
  176 + //是 我的已审,查通过和拒绝的两种状态
179 } else if (CommonUtils.isNotNull(commentsDTO.getState()) && commentsDTO.getState() == 3) { 177 } else if (CommonUtils.isNotNull(commentsDTO.getState()) && commentsDTO.getState() == 3) {
180 - Example.Criteria criteria1 = example.createCriteria();  
181 - criteria1.orEqualTo("state", CommonConst.AUDIT_SUCCESS);  
182 - criteria1.orEqualTo("state", CommonConst.AUDIT_REFUSE);  
183 - example.and(criteria1); 178 + criteria.andBetween("state",CommonConst.AUDIT_SUCCESS,CommonConst.AUDIT_REFUSE);
184 } 179 }
185 180
186 List<ShyComments> commentsList = shyCommentsMapper.selectByExample(example); 181 List<ShyComments> commentsList = shyCommentsMapper.selectByExample(example);
src/main/java/com/cnlive/shenhe/serviceImpl/ContentServiceImpl.java
@@ -65,14 +65,15 @@ public class ContentServiceImpl { @@ -65,14 +65,15 @@ public class ContentServiceImpl {
65 65
66 public List<ShyContent> findShyContentWithWebPage() { 66 public List<ShyContent> findShyContentWithWebPage() {
67 List checkParamList = new ArrayList(); 67 List checkParamList = new ArrayList();
68 - checkParamList.add("content"); 68 + //checkParamList.add("content");
69 checkParamList.add("moment"); 69 checkParamList.add("moment");
70 Example example = new Example(ShyContent.class); 70 Example example = new Example(ShyContent.class);
71 Example.Criteria criteria = example.createCriteria(); 71 Example.Criteria criteria = example.createCriteria();
72 criteria.andNotIn("content_tag", checkParamList); 72 criteria.andNotIn("content_tag", checkParamList);
73 criteria.andEqualTo("shenhe_type", CommonConst.AUDIT_TYPE_MACHANE); 73 criteria.andEqualTo("shenhe_type", CommonConst.AUDIT_TYPE_MACHANE);
74 criteria.andEqualTo("receive_status", CommonConst.RECEIVE_BEFORE); 74 criteria.andEqualTo("receive_status", CommonConst.RECEIVE_BEFORE);
75 - return shyContentMapper.selectByExampleAndRowBounds(example, new RowBounds(0, 100)); 75 + List<ShyContent> ShyContent = shyContentMapper.selectByExampleAndRowBounds(example, new RowBounds(0, 100));
  76 + return ShyContent;
76 } 77 }
77 78
78 //*************************** 79 //***************************
@@ -242,7 +243,6 @@ public class ContentServiceImpl { @@ -242,7 +243,6 @@ public class ContentServiceImpl {
242 success = false; 243 success = false;
243 return success; 244 return success;
244 } 245 }
245 -  
246 //如果当前图文是朋友圈的视频,通知点播云 246 //如果当前图文是朋友圈的视频,通知点播云
247 if (CommonUtils.isNotEmpty(content.getContent_tag()) 247 if (CommonUtils.isNotEmpty(content.getContent_tag())
248 && "moment".equals(content.getContent_tag()) 248 && "moment".equals(content.getContent_tag())
@@ -260,7 +260,6 @@ public class ContentServiceImpl { @@ -260,7 +260,6 @@ public class ContentServiceImpl {
260 } 260 }
261 } 261 }
262 } 262 }
263 -  
264 // 设置图文状态为审核后的状态 263 // 设置图文状态为审核后的状态
265 content.setContent_status(state); 264 content.setContent_status(state);
266 // 领取状态为已审核 265 // 领取状态为已审核
@@ -281,7 +280,6 @@ public class ContentServiceImpl { @@ -281,7 +280,6 @@ public class ContentServiceImpl {
281 success = false; 280 success = false;
282 } 281 }
283 } 282 }
284 -  
285 return success; 283 return success;
286 } 284 }
287 285
@@ -358,22 +356,16 @@ public class ContentServiceImpl { @@ -358,22 +356,16 @@ public class ContentServiceImpl {
358 //获取图文免审sp 356 //获取图文免审sp
359 List<Integer> sites = sitesService.getBusinessList(CommonConst.BUSINESS_CONTENT); 357 List<Integer> sites = sitesService.getBusinessList(CommonConst.BUSINESS_CONTENT);
360 //初始化一个审核状态 358 //初始化一个审核状态
361 - //审核类型,1:免审,2:机审,3:人工审 359 + //审核类型,1:免审,2:机审,3:人工审 默认人工审
362 Integer shenheType = CommonConst.AUDIT_TYPE_USER; 360 Integer shenheType = CommonConst.AUDIT_TYPE_USER;
363 //如果当前sp是免审sp 361 //如果当前sp是免审sp
364 if (sites.contains(spId)) { 362 if (sites.contains(spId)) {
365 //免审 363 //免审
366 shenheType = CommonConst.AUDIT_TYPE_FREE; 364 shenheType = CommonConst.AUDIT_TYPE_FREE;
367 } else { 365 } else {
368 - if ("content".equals(ContentTag)) {  
369 - //免审  
370 - shenheType = CommonConst.AUDIT_TYPE_FREE;  
371 - } else if (ContentTag.startsWith("cms_") || ContentTag.startsWith("edu_")) { 366 + if ("content".equals(ContentTag) || ContentTag.startsWith("cms_") || ContentTag.startsWith("edu_")) {
372 //机审 367 //机审
373 shenheType = CommonConst.AUDIT_TYPE_MACHANE; 368 shenheType = CommonConst.AUDIT_TYPE_MACHANE;
374 - } else {  
375 - //人工审  
376 - shenheType = CommonConst.AUDIT_TYPE_USER;  
377 } 369 }
378 } 370 }
379 return shenheType; 371 return shenheType;
@@ -382,6 +374,7 @@ public class ContentServiceImpl { @@ -382,6 +374,7 @@ public class ContentServiceImpl {
382 /** 374 /**
383 * 易盾网站过滤 375 * 易盾网站过滤
384 * 送审类型:1:文本 2:图片 3.网页 4:点播音频 376 * 送审类型:1:文本 2:图片 3.网页 4:点播音频
  377 + *
385 * @param shyContent 378 * @param shyContent
386 * @return 379 * @return
387 */ 380 */
@@ -391,7 +384,14 @@ public class ContentServiceImpl { @@ -391,7 +384,14 @@ public class ContentServiceImpl {
391 logger.info("审核云向易盾网站检测接口提交的url:{}", contentUrl); 384 logger.info("审核云向易盾网站检测接口提交的url:{}", contentUrl);
392 //调用易盾网站检测接口 385 //调用易盾网站检测接口
393 JSONObject jsonObject = YiDunAntiFraudUtil.submitYiDunUrl(contentUrl); 386 JSONObject jsonObject = YiDunAntiFraudUtil.submitYiDunUrl(contentUrl);
  387 +
394 if (jsonObject != null) { 388 if (jsonObject != null) {
  389 + Integer code = jsonObject.getInteger("code");
  390 + String msg = jsonObject.getString("msg");
  391 + if (code != 200) {
  392 + // |0待发布 |1已发布 |2已下线
  393 + boolean flag = callback(shyContent.getContent_id(), "易盾机审未通过:"+msg, CommonConst.AUDIT_REFUSE, shyContent.getAuditor_id(), shyContent.getUpdater());
  394 + }
395 JSONObject result = jsonObject.getJSONObject("result"); 395 JSONObject result = jsonObject.getJSONObject("result");
396 String dataId = result.getString("dataId"); 396 String dataId = result.getString("dataId");
397 String taskId = result.getString("taskId"); 397 String taskId = result.getString("taskId");
src/main/java/com/cnlive/shenhe/serviceImpl/LiveApplyServiceImpl.java
@@ -127,10 +127,12 @@ public class LiveApplyServiceImpl { @@ -127,10 +127,12 @@ public class LiveApplyServiceImpl {
127 if (CommonUtils.isNotNull(liveApplyDTO.getSpid())) { 127 if (CommonUtils.isNotNull(liveApplyDTO.getSpid())) {
128 criteria.andEqualTo("sp_id", liveApplyDTO.getSpid()); 128 criteria.andEqualTo("sp_id", liveApplyDTO.getSpid());
129 } 129 }
  130 + //不是 我的已审 进来的,只查一种状态
130 if (CommonUtils.isNotNull(liveApplyDTO.getShenhe_state()) && liveApplyDTO.getShenhe_state() != 3) { 131 if (CommonUtils.isNotNull(liveApplyDTO.getShenhe_state()) && liveApplyDTO.getShenhe_state() != 3) {
131 criteria.andEqualTo("shenhe_state", liveApplyDTO.getShenhe_state()); 132 criteria.andEqualTo("shenhe_state", liveApplyDTO.getShenhe_state());
  133 + //是 我的已审,查通过和拒绝的两种状态
132 } else if (CommonUtils.isNotNull(liveApplyDTO.getShenhe_state()) && liveApplyDTO.getShenhe_state() == 3) { 134 } else if (CommonUtils.isNotNull(liveApplyDTO.getShenhe_state()) && liveApplyDTO.getShenhe_state() == 3) {
133 - criteria.andNotEqualTo("shenhe_state", 0); 135 + criteria.andBetween("shenhe_state",CommonConst.AUDIT_SUCCESS,CommonConst.AUDIT_REFUSE);
134 } 136 }
135 if (CommonUtils.isNotNull(liveApplyDTO.getReceive())) { 137 if (CommonUtils.isNotNull(liveApplyDTO.getReceive())) {
136 criteria.andEqualTo("receive", liveApplyDTO.getReceive()); 138 criteria.andEqualTo("receive", liveApplyDTO.getReceive());
@@ -262,10 +264,12 @@ public class LiveApplyServiceImpl { @@ -262,10 +264,12 @@ public class LiveApplyServiceImpl {
262 if (CommonUtils.isNotNull(liveApplyDTO.getSpid())) { 264 if (CommonUtils.isNotNull(liveApplyDTO.getSpid())) {
263 criteria.andEqualTo("sp_id", liveApplyDTO.getSpid()); 265 criteria.andEqualTo("sp_id", liveApplyDTO.getSpid());
264 } 266 }
  267 + //不是 我的已审 进来的,只查一种状态
265 if (CommonUtils.isNotNull(liveApplyDTO.getShenhe_state()) && liveApplyDTO.getShenhe_state() != 3) { 268 if (CommonUtils.isNotNull(liveApplyDTO.getShenhe_state()) && liveApplyDTO.getShenhe_state() != 3) {
266 criteria.andEqualTo("shenhe_state", liveApplyDTO.getShenhe_state()); 269 criteria.andEqualTo("shenhe_state", liveApplyDTO.getShenhe_state());
  270 + //是 我的已审,查通过和拒绝的两种状态
267 } else if (CommonUtils.isNotNull(liveApplyDTO.getShenhe_state()) && liveApplyDTO.getShenhe_state() == 3) { 271 } else if (CommonUtils.isNotNull(liveApplyDTO.getShenhe_state()) && liveApplyDTO.getShenhe_state() == 3) {
268 - criteria.andNotEqualTo("shenhe_state", 0); 272 + criteria.andBetween("shenhe_state",CommonConst.AUDIT_SUCCESS,CommonConst.AUDIT_REFUSE);
269 } 273 }
270 if (CommonUtils.isNotNull(liveApplyDTO.getReceive())) { 274 if (CommonUtils.isNotNull(liveApplyDTO.getReceive())) {
271 criteria.andEqualTo("receive", liveApplyDTO.getReceive()); 275 criteria.andEqualTo("receive", liveApplyDTO.getReceive());
src/main/java/com/cnlive/shenhe/serviceImpl/ShyActivityImpl.java
@@ -40,7 +40,7 @@ public class ShyActivityImpl { @@ -40,7 +40,7 @@ public class ShyActivityImpl {
40 Date date = new Date(); 40 Date date = new Date();
41 shyActivity.setCreate_time(date); 41 shyActivity.setCreate_time(date);
42 shyActivity.setUpdate_time(date); 42 shyActivity.setUpdate_time(date);
43 - shyActivity.setExempt_from_trial(0); 43 + shyActivity.setExempt_from_trial(3);
44 int i = shyActivityMapper.insertSelective(shyActivity); 44 int i = shyActivityMapper.insertSelective(shyActivity);
45 return i; 45 return i;
46 } 46 }
@@ -123,12 +123,21 @@ public class ShyActivityImpl { @@ -123,12 +123,21 @@ public class ShyActivityImpl {
123 List<ShyActivity> shyActivities = shyActivityMapper.selectAll(); 123 List<ShyActivity> shyActivities = shyActivityMapper.selectAll();
124 return shyActivities; 124 return shyActivities;
125 } 125 }
  126 +
126 /** 127 /**
127 * 根据id查询单个对象 128 * 根据id查询单个对象
128 */ 129 */
129 - public ShyActivity selectById(Integer id){ 130 + public ShyActivity selectById(Integer id) {
130 ShyActivity shyActivity = shyActivityMapper.selectById(id); 131 ShyActivity shyActivity = shyActivityMapper.selectById(id);
131 return shyActivity; 132 return shyActivity;
132 } 133 }
133 134
  135 + /**
  136 + * 根据source查询审核类型
  137 + */
  138 + public Integer selectBySource(Integer id) {
  139 + Integer shtype = shyActivityMapper.selectBySource(id);
  140 + return shtype;
  141 + }
  142 +
134 } 143 }
src/main/java/com/cnlive/shenhe/serviceImpl/TopicServiceImpl.java
@@ -122,12 +122,8 @@ public class TopicServiceImpl { @@ -122,12 +122,8 @@ public class TopicServiceImpl {
122 criteria.andEqualTo("shenhe_status", topicDTO.getShenhe_status()); 122 criteria.andEqualTo("shenhe_status", topicDTO.getShenhe_status());
123 //是 我的已审,查通过和拒绝的两种状态 123 //是 我的已审,查通过和拒绝的两种状态
124 } else if (CommonUtils.isNotNull(topicDTO.getShenhe_status()) && topicDTO.getShenhe_status() == 3) { 124 } else if (CommonUtils.isNotNull(topicDTO.getShenhe_status()) && topicDTO.getShenhe_status() == 3) {
125 - Example.Criteria criteria1 = example.createCriteria();  
126 - criteria1.orEqualTo("shenhe_status", 1);  
127 - criteria1.orEqualTo("shenhe_status", 2);  
128 - example.and(criteria1); 125 + criteria.andBetween("shenhe_status",CommonConst.AUDIT_SUCCESS,CommonConst.AUDIT_REFUSE);
129 } 126 }
130 -  
131 PageHelper.startPage(topicDTO.getPage(), topicDTO.getPageSize(), true); 127 PageHelper.startPage(topicDTO.getPage(), topicDTO.getPageSize(), true);
132 List<ShyTopic> topicList = shyTopicMapper.selectByExample(example); 128 List<ShyTopic> topicList = shyTopicMapper.selectByExample(example);
133 PageInfo<ShyTopic> pageInfo = new PageInfo<>(topicList); 129 PageInfo<ShyTopic> pageInfo = new PageInfo<>(topicList);
src/main/java/com/cnlive/shenhe/serviceImpl/VideosServiceImpl.java
@@ -6,7 +6,10 @@ import com.alibaba.fastjson.JSONObject; @@ -6,7 +6,10 @@ import com.alibaba.fastjson.JSONObject;
6 import com.cnlive.shenhe.bean.ErrorEnum; 6 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.dto.VideosDTO; 8 import com.cnlive.shenhe.dto.VideosDTO;
9 -import com.cnlive.shenhe.entity.*; 9 +import com.cnlive.shenhe.entity.ShyUsers;
  10 +import com.cnlive.shenhe.entity.ShyUsersfree;
  11 +import com.cnlive.shenhe.entity.ShyVideos;
  12 +import com.cnlive.shenhe.entity.ShyYidun;
10 import com.cnlive.shenhe.mapper.ShyUsersMapper; 13 import com.cnlive.shenhe.mapper.ShyUsersMapper;
11 import com.cnlive.shenhe.mapper.ShyVideosMapper; 14 import com.cnlive.shenhe.mapper.ShyVideosMapper;
12 import com.cnlive.shenhe.utils.*; 15 import com.cnlive.shenhe.utils.*;
@@ -22,7 +25,6 @@ import org.springframework.util.StringUtils; @@ -22,7 +25,6 @@ import org.springframework.util.StringUtils;
22 import tk.mybatis.mapper.entity.Example; 25 import tk.mybatis.mapper.entity.Example;
23 26
24 import java.text.ParseException; 27 import java.text.ParseException;
25 -import java.util.Arrays;  
26 import java.util.Date; 28 import java.util.Date;
27 import java.util.List; 29 import java.util.List;
28 import java.util.UUID; 30 import java.util.UUID;
@@ -115,7 +117,6 @@ public class VideosServiceImpl { @@ -115,7 +117,6 @@ public class VideosServiceImpl {
115 logger.info("接受点播列表为,VideosDTO:{}", JSON.toJSONString(videosDTO)); 117 logger.info("接受点播列表为,VideosDTO:{}", JSON.toJSONString(videosDTO));
116 Example example = new Example(ShyVideos.class); 118 Example example = new Example(ShyVideos.class);
117 Example.Criteria criteria = example.createCriteria(); 119 Example.Criteria criteria = example.createCriteria();
118 - Example.Criteria criteria2 = example.createCriteria();  
119 if (CommonUtils.isNotEmpty(videosDTO.getOrderByClause())) { 120 if (CommonUtils.isNotEmpty(videosDTO.getOrderByClause())) {
120 example.setOrderByClause(videosDTO.getOrderByClause()); 121 example.setOrderByClause(videosDTO.getOrderByClause());
121 } 122 }
@@ -128,73 +129,58 @@ public class VideosServiceImpl { @@ -128,73 +129,58 @@ public class VideosServiceImpl {
128 e.printStackTrace(); 129 e.printStackTrace();
129 } 130 }
130 criteria.andGreaterThanOrEqualTo("created_at", videosDTO.getStart_date()); 131 criteria.andGreaterThanOrEqualTo("created_at", videosDTO.getStart_date());
131 - criteria2.andGreaterThanOrEqualTo("created_at", videosDTO.getStart_date());  
132 criteria.andLessThanOrEqualTo("created_at", videosDTO.getEnd_date()); 132 criteria.andLessThanOrEqualTo("created_at", videosDTO.getEnd_date());
133 - criteria2.andLessThanOrEqualTo("created_at", videosDTO.getEnd_date());  
134 } 133 }
135 if (CommonUtils.isNotEmpty(videosDTO.getVideo_title())) { 134 if (CommonUtils.isNotEmpty(videosDTO.getVideo_title())) {
136 criteria.andLike("video_title", "%" + videosDTO.getVideo_title() + "%"); 135 criteria.andLike("video_title", "%" + videosDTO.getVideo_title() + "%");
137 - criteria2.andLike("video_title", "%" + videosDTO.getVideo_title() + "%");  
138 } 136 }
139 137
140 if (CommonUtils.isNotEmpty(videosDTO.getVideo_priority())) { 138 if (CommonUtils.isNotEmpty(videosDTO.getVideo_priority())) {
141 criteria.andEqualTo("video_priority", videosDTO.getVideo_priority()); 139 criteria.andEqualTo("video_priority", videosDTO.getVideo_priority());
142 - criteria2.andEqualTo("video_priority", videosDTO.getVideo_priority());  
143 } 140 }
144 141
145 if (CommonUtils.isNotEmpty(videosDTO.getVideo_id())) { 142 if (CommonUtils.isNotEmpty(videosDTO.getVideo_id())) {
146 criteria.andEqualTo("video_id", videosDTO.getVideo_id()); 143 criteria.andEqualTo("video_id", videosDTO.getVideo_id());
147 - criteria2.andEqualTo("video_id", videosDTO.getVideo_id());  
148 } 144 }
149 145
150 if (CommonUtils.isNotEmpty(videosDTO.getShen_auditor_id())) { 146 if (CommonUtils.isNotEmpty(videosDTO.getShen_auditor_id())) {
151 if ("白名单".equals(videosDTO.getShen_auditor_id()) || "自动审核".equals(videosDTO.getShen_auditor_id())) { 147 if ("白名单".equals(videosDTO.getShen_auditor_id()) || "自动审核".equals(videosDTO.getShen_auditor_id())) {
152 criteria.andEqualTo("updater", videosDTO.getShen_auditor_id()); 148 criteria.andEqualTo("updater", videosDTO.getShen_auditor_id());
153 - criteria2.andEqualTo("updater", videosDTO.getShen_auditor_id());  
154 } else { 149 } else {
155 criteria.andEqualTo("auditor_id", videosDTO.getShen_auditor_id()); 150 criteria.andEqualTo("auditor_id", videosDTO.getShen_auditor_id());
156 - criteria2.andEqualTo("auditor_id", videosDTO.getShen_auditor_id());  
157 } 151 }
158 } 152 }
159 153
160 if (CommonUtils.isNotEmpty(videosDTO.getSource()) && !"22".equals(videosDTO.getSource()) && !"102".equals(videosDTO.getSource())) { 154 if (CommonUtils.isNotEmpty(videosDTO.getSource()) && !"22".equals(videosDTO.getSource()) && !"102".equals(videosDTO.getSource())) {
161 criteria.andEqualTo("source", videosDTO.getSource()); 155 criteria.andEqualTo("source", videosDTO.getSource());
162 - criteria2.andEqualTo("source", videosDTO.getSource());  
163 } else if (CommonUtils.isNotEmpty(videosDTO.getSource()) && "22".equals(videosDTO.getSource())) { 156 } else if (CommonUtils.isNotEmpty(videosDTO.getSource()) && "22".equals(videosDTO.getSource())) {
164 criteria.andEqualTo("category", "moment"); 157 criteria.andEqualTo("category", "moment");
165 - criteria2.andEqualTo("category", "moment");  
166 } else if (CommonUtils.isNotEmpty(videosDTO.getSource()) && "102".equals(videosDTO.getSource())) { 158 } else if (CommonUtils.isNotEmpty(videosDTO.getSource()) && "102".equals(videosDTO.getSource())) {
167 criteria.andEqualTo("source", "102".equals(videosDTO.getSource()) ? "0" : videosDTO.getSource()); 159 criteria.andEqualTo("source", "102".equals(videosDTO.getSource()) ? "0" : videosDTO.getSource());
168 - criteria2.andEqualTo("source", "102".equals(videosDTO.getSource()) ? "0" : videosDTO.getSource());  
169 } 160 }
170 161
171 if (CommonUtils.isNotEmpty(videosDTO.getVideo_user_id())) { 162 if (CommonUtils.isNotEmpty(videosDTO.getVideo_user_id())) {
172 criteria.andEqualTo("video_user_id", videosDTO.getVideo_user_id()); 163 criteria.andEqualTo("video_user_id", videosDTO.getVideo_user_id());
173 - criteria2.andEqualTo("video_user_id", videosDTO.getVideo_user_id());  
174 } 164 }
175 165
176 if (CommonUtils.isNotNull(videosDTO.getSpid())) { 166 if (CommonUtils.isNotNull(videosDTO.getSpid())) {
177 criteria.andEqualTo("spid", videosDTO.getSpid()); 167 criteria.andEqualTo("spid", videosDTO.getSpid());
178 - criteria2.andEqualTo("spid", videosDTO.getSpid());  
179 } else if (CommonUtils.isNotEmpty(videosDTO.getSp_Id())) { 168 } else if (CommonUtils.isNotEmpty(videosDTO.getSp_Id())) {
180 criteria.andEqualTo("spid", videosDTO.getSp_Id()); 169 criteria.andEqualTo("spid", videosDTO.getSp_Id());
181 - criteria2.andEqualTo("spid", videosDTO.getSp_Id());  
182 } 170 }
183 171
184 if (CommonUtils.isNotNull(videosDTO.getReceive())) { 172 if (CommonUtils.isNotNull(videosDTO.getReceive())) {
185 criteria.andEqualTo("receive", videosDTO.getReceive()); 173 criteria.andEqualTo("receive", videosDTO.getReceive());
186 - criteria2.andEqualTo("receive", videosDTO.getReceive());  
187 if (videosDTO.getReceive().equals(CommonConst.RECEIVE_AFTER)) { 174 if (videosDTO.getReceive().equals(CommonConst.RECEIVE_AFTER)) {
188 criteria.andEqualTo("receive_user_id", videosDTO.getUserId()); 175 criteria.andEqualTo("receive_user_id", videosDTO.getUserId());
189 - criteria2.andEqualTo("receive_user_id", videosDTO.getUserId());  
190 } 176 }
191 } 177 }
  178 + //不是 我的已审 进来的,只查一种状态
192 if (CommonUtils.isNotNull(videosDTO.getState()) && videosDTO.getState() != 3) { 179 if (CommonUtils.isNotNull(videosDTO.getState()) && videosDTO.getState() != 3) {
193 criteria.andEqualTo("state", videosDTO.getState()); 180 criteria.andEqualTo("state", videosDTO.getState());
  181 + //是 我的已审,查通过和拒绝的两种状态
194 } else if (CommonUtils.isNotNull(videosDTO.getState()) && videosDTO.getState() == 3) { 182 } else if (CommonUtils.isNotNull(videosDTO.getState()) && videosDTO.getState() == 3) {
195 - criteria.andEqualTo("state", 1);  
196 - criteria2.andEqualTo("state", 2);  
197 - example.or(criteria2); 183 + criteria.andBetween("state", CommonConst.AUDIT_SUCCESS, CommonConst.AUDIT_REFUSE);
198 } 184 }
199 //默认按上传时间倒序排序 185 //默认按上传时间倒序排序
200 example.setOrderByClause("created_at desc"); 186 example.setOrderByClause("created_at desc");
@@ -288,7 +274,6 @@ public class VideosServiceImpl { @@ -288,7 +274,6 @@ public class VideosServiceImpl {
288 example.setOrderByClause(videosDTO.getOrderByClause()); 274 example.setOrderByClause(videosDTO.getOrderByClause());
289 } 275 }
290 if (CommonUtils.isNotEmpty(videosDTO.getStart_date()) && CommonUtils.isNotEmpty(videosDTO.getEnd_date())) { 276 if (CommonUtils.isNotEmpty(videosDTO.getStart_date()) && CommonUtils.isNotEmpty(videosDTO.getEnd_date())) {
291 -  
292 try { 277 try {
293 videosDTO.setStart_date(String.valueOf(CommonUtils.parseDate(videosDTO.getStart_date(), "yyyy-MM-dd"))); 278 videosDTO.setStart_date(String.valueOf(CommonUtils.parseDate(videosDTO.getStart_date(), "yyyy-MM-dd")));
294 videosDTO.setEnd_date(String.valueOf(CommonUtils.parseDate(videosDTO.getEnd_date(), "yyyy-MM-dd"))); 279 videosDTO.setEnd_date(String.valueOf(CommonUtils.parseDate(videosDTO.getEnd_date(), "yyyy-MM-dd")));
@@ -457,53 +442,45 @@ public class VideosServiceImpl { @@ -457,53 +442,45 @@ public class VideosServiceImpl {
457 public void getShenheType(ShyVideos shyVideo) { 442 public void getShenheType(ShyVideos shyVideo) {
458 //获取点播免审sp 443 //获取点播免审sp
459 List<Integer> sites = sitesService.getBusinessList(CommonConst.BUSINESS_VIDEO); 444 List<Integer> sites = sitesService.getBusinessList(CommonConst.BUSINESS_VIDEO);
460 - List<Integer> shyActivities = shyActivityImpl.selectByExample(CommonConst.AUDIT_TYPE_FREE);  
461 - logger.info("免审渠道列表:{}====sites:{}", JSON.toJSONString(shyActivities), sites.toString()); 445 + // List<Integer> shyActivities = shyActivityImpl.selectByExample(CommonConst.AUDIT_TYPE_FREE);
  446 + logger.info("====sites:{}", sites.toString());
462 String source = shyVideo.getSource(); 447 String source = shyVideo.getSource();
  448 + // 根据source 查询审核类型 source有传空的时候 默认给0
  449 + Integer shType = shyActivityImpl.selectBySource(StringUtils.isEmpty(source) ? 0 : Integer.valueOf(source));
  450 + logger.info("审核类型为:{}", shType);
  451 + ShyUsersfree shyUserfree = null;
  452 + //如果用户id存在
  453 + if (CommonUtils.isNotEmpty(shyVideo.getVideo_user_id())) {
  454 + shyUserfree = usersfreeServiceImpl.selectUser(shyVideo.getSpid(), shyVideo.getCategory(), shyVideo.getVideo_user_id());
  455 + }
463 //初始化一个审核状态 456 //初始化一个审核状态
464 //审核类型,1:免审,2:机审,3:人工审 457 //审核类型,1:免审,2:机审,3:人工审
465 Integer shenheType = CommonConst.AUDIT_TYPE_USER; 458 Integer shenheType = CommonConst.AUDIT_TYPE_USER;
466 - //如果当前sp是免审sp source有传空的时候 默认给0  
467 - if (sites.contains(shyVideo.getSpid()) || shyActivities.contains(StringUtils.isEmpty(source) ? "0" : Integer.valueOf(source))) { 459 + //如果当前sp是免审sp //如果审核类型为免审 //如果存在免审用户
  460 + if (sites.contains(shyVideo.getSpid()) || (CommonUtils.isNotNull(shType) && CommonConst.AUDIT_TYPE_FREE.equals(shType)) || CommonUtils.isNotNull(shyUserfree)) {
468 logger.info("进入已经免审渠道:{}", source); 461 logger.info("进入已经免审渠道:{}", source);
469 //免审 462 //免审
470 shenheType = CommonConst.AUDIT_TYPE_FREE; 463 shenheType = CommonConst.AUDIT_TYPE_FREE;
471 - } else if ("10000".equals(source)) {  
472 - //机审  
473 - shenheType = CommonConst.AUDIT_TYPE_MACHANE;  
474 } else { 464 } else {
475 //如果栏目是“目击者” 465 //如果栏目是“目击者”
476 if (CommonUtils.isNotEmpty(shyVideo.getCategory()) && shyVideo.getCategory().equals(CommonConst.CATEGORY_WITNESS)) { 466 if (CommonUtils.isNotEmpty(shyVideo.getCategory()) && shyVideo.getCategory().equals(CommonConst.CATEGORY_WITNESS)) {
477 - //如果用户id存在  
478 - if (CommonUtils.isNotEmpty(shyVideo.getVideo_user_id())) {  
479 - ShyUsersfree shyUserfree = usersfreeServiceImpl.selectUser(shyVideo.getSpid(), shyVideo.getCategory(), shyVideo.getVideo_user_id());  
480 - //如果存在免审用户  
481 - if (CommonUtils.isNotNull(shyUserfree)) {  
482 - //免审  
483 - shenheType = CommonConst.AUDIT_TYPE_FREE;  
484 - } else {  
485 - //用户不免审  
486 - //机审  
487 - shenheType = CommonConst.AUDIT_TYPE_MACHANE;  
488 - }  
489 - } else {  
490 - //如果用户id不存在  
491 - //机审  
492 - shenheType = CommonConst.AUDIT_TYPE_MACHANE;  
493 - }  
494 - if (manualReview(shyVideo)) {  
495 - //给审核变量 赋值人工审核 467 + // 机审
  468 + shenheType = CommonConst.AUDIT_TYPE_MACHANE;
  469 + // 如果是人工审
  470 + if (CommonConst.AUDIT_TYPE_USER.equals(shType)) {
496 shenheType = CommonConst.AUDIT_TYPE_USER; 471 shenheType = CommonConst.AUDIT_TYPE_USER;
497 } 472 }
498 - }  
499 - //如果栏目是朋友圈  
500 - if (CommonUtils.isNotEmpty(shyVideo.getCategory()) && shyVideo.getCategory().equals(CommonConst.CATEGORY_MOMENT)) {  
501 - //免审 473 + // 如果栏目是朋友圈
  474 + } else if (CommonUtils.isNotEmpty(shyVideo.getCategory()) && shyVideo.getCategory().equals(CommonConst.CATEGORY_MOMENT)) {
  475 + // 免审
502 shenheType = CommonConst.AUDIT_TYPE_FREE; 476 shenheType = CommonConst.AUDIT_TYPE_FREE;
  477 + } else {
  478 + if (shType != null) {
  479 + // 机审或者是人工审
  480 + shenheType = shType;
  481 + }
503 } 482 }
504 } 483 }
505 -  
506 -  
507 logger.info("id : {} 审核类型: {}", shyVideo.getVideo_id(), shenheType); 484 logger.info("id : {} 审核类型: {}", shyVideo.getVideo_id(), shenheType);
508 shyVideo.setShenhe_type(shenheType); 485 shyVideo.setShenhe_type(shenheType);
509 } 486 }
@@ -514,15 +491,15 @@ public class VideosServiceImpl { @@ -514,15 +491,15 @@ public class VideosServiceImpl {
514 * @param shyVideo 491 * @param shyVideo
515 * @return 492 * @return
516 */ 493 */
517 - public boolean manualReview(ShyVideos shyVideo) {  
518 - String[] list = {"41", "42", "43", "44", "45", "46", "47","515","516","517","518"};  
519 - List<String> asList = Arrays.asList(list);  
520 - if (asList.contains(shyVideo.getSource())) {  
521 - //人工审 返回true  
522 - return true;  
523 - }  
524 - return false;  
525 - } 494 + //public boolean manualReview(ShyVideos shyVideo) {
  495 + // String[] list = {"41", "42", "43", "44", "45", "46", "47","515","516","517","518"};
  496 + // List<String> asList = Arrays.asList(list);
  497 + // if (asList.contains(shyVideo.getSource())) {
  498 + // //人工审 返回true
  499 + // return true;
  500 + // }
  501 + // return false;
  502 + //}
526 503
527 /** 504 /**
528 * 人工审核拒绝方法 505 * 人工审核拒绝方法
src/main/resources/mapper/ShyActivityMapper.xml
1 <?xml version="1.0" encoding="UTF-8"?> 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"> 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.ShyActivityMapper"> 3 <mapper namespace="com.cnlive.shenhe.mapper.ShyActivityMapper">
4 - <resultMap id="BaseResultMap" type="com.cnlive.shenhe.entity.ShyActivity">  
5 - <!--  
6 - WARNING - @mbg.generated  
7 - -->  
8 - <id column="id" jdbcType="INTEGER" property="id" />  
9 - <result column="activity" jdbcType="VARCHAR" property="activity" />  
10 - <result column="create_time" jdbcType="TIMESTAMP" property="create_time" />  
11 - <result column="update_time" jdbcType="TIMESTAMP" property="update_time" />  
12 - <result column="exempt_from_trial" jdbcType="INTEGER" property="exempt_from_trial" />  
13 - </resultMap>  
14 - <select id="selectAllByExempt_from_trial" resultType="java.lang.Integer">  
15 - select id from shy_activity where exempt_from_trial=${exempt_from_trial};  
16 - </select> 4 + <resultMap id="BaseResultMap" type="com.cnlive.shenhe.entity.ShyActivity">
  5 + <!--
  6 + WARNING - @mbg.generated
  7 + -->
  8 + <id column="id" jdbcType="INTEGER" property="id"/>
  9 + <result column="activity" jdbcType="VARCHAR" property="activity"/>
  10 + <result column="create_time" jdbcType="TIMESTAMP" property="create_time"/>
  11 + <result column="update_time" jdbcType="TIMESTAMP" property="update_time"/>
  12 + <result column="exempt_from_trial" jdbcType="INTEGER" property="exempt_from_trial"/>
  13 + </resultMap>
  14 + <select id="selectAllByExempt_from_trial" resultType="java.lang.Integer">
  15 + select id from shy_activity where exempt_from_trial=${exempt_from_trial};
  16 + </select>
17 <select id="selectById" resultType="com.cnlive.shenhe.entity.ShyActivity"> 17 <select id="selectById" resultType="com.cnlive.shenhe.entity.ShyActivity">
18 - select * from shy_activity where id=${id} 18 + select * from shy_activity where id=${id}
  19 + </select>
  20 + <select id="selectBySource" resultType="java.lang.Integer">
  21 + select exempt_from_trial from shy_activity where id=${id};
19 </select> 22 </select>
20 23
21 24
src/main/resources/templates/page/activity.html
@@ -114,13 +114,17 @@ @@ -114,13 +114,17 @@
114 </div> 114 </div>
115 <div class="col-md-5 pull-right" style="padding: 0; width: 15%;"> 115 <div class="col-md-5 pull-right" style="padding: 0; width: 15%;">
116 <label for="sp_id" class="control-label cb-toolbar" 116 <label for="sp_id" class="control-label cb-toolbar"
117 - style="font-size: 15px; top: 8px; font-weight: 100;">是否审核:</label> 117 + style="font-size: 15px; top: 8px; font-weight: 100;">审核类型:</label>
118 <div class="col-sm-7" style="padding: 0;"> 118 <div class="col-sm-7" style="padding: 0;">
119 <select class="form-control" id="exempt_from_trial_query" 119 <select class="form-control" id="exempt_from_trial_query"
120 name="exempt_from_trial"> 120 name="exempt_from_trial">
121 - <option value="">--全部免审类型--</option>  
122 - <option value="0" name="非免审" th:selected="${exempt_from_trial ==0}" >非免审</option>  
123 - <option value="1" name="免审" th:selected="${exempt_from_trial ==1}" >免审</option> 121 + <option value="">--审核类型--</option>
  122 + <option value="1" name="免审" th:selected="${exempt_from_trial ==1}">免审
  123 + </option>
  124 + <option value="2" name="机审" th:selected="${exempt_from_trial ==2}">机审
  125 + </option>
  126 + <option value="3" name="人工审" th:selected="${exempt_from_trial ==3}">人工审
  127 + </option>
124 </select> 128 </select>
125 </div> 129 </div>
126 </div> 130 </div>
@@ -188,10 +192,10 @@ @@ -188,10 +192,10 @@
188 14:27:17 192 14:27:17
189 </td> 193 </td>
190 194
191 - <td style="text-align: center; width: 12%;"  
192 - th:text="${ShyActivity.exempt_from_trial} == 1 ? 免审 : 非免审">  
193 - 2016-08-03  
194 - 14:27:17 195 + <td style="text-align: center; width: 12%;">
  196 + <span th:if="${ShyActivity.exempt_from_trial==1}">免审</span>
  197 + <span th:if="${ShyActivity.exempt_from_trial==2}">机审</span>
  198 + <span th:if="${ShyActivity.exempt_from_trial==3}">人工审</span>
195 </td> 199 </td>
196 200
197 <td style="text-align: center; width: 10%;"> 201 <td style="text-align: center; width: 10%;">
@@ -219,8 +223,7 @@ @@ -219,8 +223,7 @@
219 <option value="10" th:selected="${ShyActivitylist.pageSize==10}">10</option> 223 <option value="10" th:selected="${ShyActivitylist.pageSize==10}">10</option>
220 <option value="20" th:selected="${ShyActivitylist.pageSize==20}">20</option> 224 <option value="20" th:selected="${ShyActivitylist.pageSize==20}">20</option>
221 <option value="50" th:selected="${ShyActivitylist.pageSize==50}">50</option> 225 <option value="50" th:selected="${ShyActivitylist.pageSize==50}">50</option>
222 - <option value="100" th:selected="${ShyActivitylist.pageSize==100}">100  
223 - </option> 226 + <option value="100" th:selected="${ShyActivitylist.pageSize==100}">100</option>
224 </select> <span class="pagination-info">条记录</span> 227 </select> <span class="pagination-info">条记录</span>
225 </div> 228 </div>
226 <div class="pull-right pagination"> 229 <div class="pull-right pagination">
@@ -306,8 +309,9 @@ @@ -306,8 +309,9 @@
306 309
307 <select class="" id="exempt_from_trial" name="exempt_from_trial"> 310 <select class="" id="exempt_from_trial" name="exempt_from_trial">
308 <option value="" name="-选择审核类型-">-选择审核类型-</option> 311 <option value="" name="-选择审核类型-">-选择审核类型-</option>
309 - <option value="0" name="非免审">非免审</option>  
310 - <option value="1" name="免审">免审</option> 312 + <option value="1" name="非免审">免审</option>
  313 + <option value="2" name="免审">机审</option>
  314 + <option value="3" name="免审">人工审</option>
311 </select> 315 </select>
312 </div> 316 </div>
313 </div> 317 </div>
@@ -396,7 +400,7 @@ @@ -396,7 +400,7 @@
396 400
397 //打开编辑窗口 401 //打开编辑窗口
398 function edit(Id, activity, exempt_from_trial) { 402 function edit(Id, activity, exempt_from_trial) {
399 - $("#myModalLabel").text("编辑活动名称是否免审"); 403 + $("#myModalLabel").text("编辑活动审核类型");
400 $("#id").val(Id); 404 $("#id").val(Id);
401 $("#activity").val(activity); 405 $("#activity").val(activity);
402 $("#activity").attr("readonly", "true"); 406 $("#activity").attr("readonly", "true");