Commit c534a8a40ba6f0cab577283533974b271f71f1b7

Authored by 王言钊
1 parent d0893e50

添加人工审核拒绝或者通过的记录功能

src/main/java/com/cnlive/shenhe/controller/VideosController.java
... ... @@ -6,14 +6,8 @@ import com.cnlive.shenhe.bean.ErrorEnum;
6 6 import com.cnlive.shenhe.bean.ResponseBean;
7 7 import com.cnlive.shenhe.bean.SessionUser;
8 8 import com.cnlive.shenhe.dto.VideosDTO;
9   -import com.cnlive.shenhe.entity.ShyActivity;
10   -import com.cnlive.shenhe.entity.ShySites;
11   -import com.cnlive.shenhe.entity.ShyUsers;
12   -import com.cnlive.shenhe.entity.ShyVideos;
13   -import com.cnlive.shenhe.serviceImpl.ShyActivityImpl;
14   -import com.cnlive.shenhe.serviceImpl.SitesServiceImpl;
15   -import com.cnlive.shenhe.serviceImpl.UsersServiceImpl;
16   -import com.cnlive.shenhe.serviceImpl.VideosServiceImpl;
  9 +import com.cnlive.shenhe.entity.*;
  10 +import com.cnlive.shenhe.serviceImpl.*;
17 11 import com.cnlive.shenhe.utils.AuditPass;
18 12 import com.cnlive.shenhe.utils.CommonConst;
19 13 import com.cnlive.shenhe.utils.CommonUtils;
... ... @@ -23,6 +17,7 @@ import org.apache.poi.xssf.usermodel.XSSFCell;
23 17 import org.apache.poi.xssf.usermodel.XSSFRow;
24 18 import org.apache.poi.xssf.usermodel.XSSFSheet;
25 19 import org.apache.poi.xssf.usermodel.XSSFWorkbook;
  20 +import org.jasig.cas.client.authentication.AttributePrincipal;
26 21 import org.slf4j.Logger;
27 22 import org.slf4j.LoggerFactory;
28 23 import org.springframework.beans.factory.annotation.Autowired;
... ... @@ -36,9 +31,11 @@ import org.springframework.web.bind.annotation.RequestMapping;
36 31 import org.springframework.web.bind.annotation.ResponseBody;
37 32  
38 33 import javax.servlet.ServletOutputStream;
  34 +import javax.servlet.http.HttpServletRequest;
39 35 import javax.servlet.http.HttpServletResponse;
40 36 import javax.servlet.http.HttpSession;
41 37 import java.io.*;
  38 +import java.util.Date;
42 39 import java.util.HashMap;
43 40 import java.util.List;
44 41 import java.util.Map;
... ... @@ -48,24 +45,27 @@ import java.util.Map;
48 45 public class VideosController extends BaseController {
49 46 private static Logger logger = LoggerFactory.getLogger(VideosController.class);
50 47 @Autowired
51   - AuditPass pass;
  48 + private AuditPass pass;
52 49 @Autowired
53   - VideosServiceImpl videosService;
  50 + private VideosServiceImpl videosService;
54 51 @Autowired
55   - UsersServiceImpl usersService;
  52 + private UsersServiceImpl usersService;
56 53 @Autowired
57   - SitesServiceImpl sitesService;
  54 + private SitesServiceImpl sitesService;
58 55 @Autowired
59   - ShyActivityImpl shyActivityImpl;
  56 + private ShyActivityImpl shyActivityImpl;
  57 + @Autowired
  58 + private ShyLogServiceImpl shyLogService;
60 59  
61 60 @Value("${qn_domain}")
62   - String qn_domain;
  61 + private String qn_domain;
63 62  
64 63 @Value("${ks_domain}")
65   - String ks_domain;
  64 + private String ks_domain;
66 65  
67 66 @Value("${cms_getVideoAndLiveId}")
68   - String cms_getVideoAndLiveId;
  67 + private String cms_getVideoAndLiveId;
  68 +
69 69  
70 70 /**
71 71 * 审核信息返回接口
... ... @@ -78,13 +78,28 @@ public class VideosController extends BaseController {
78 78 */
79 79 @PostMapping("/shenheVideo")
80 80 @ResponseBody
81   - public ResponseBean shenheInfo(Integer id, String activity_id, Integer state, String attr_tags, String msg, String callback, HttpSession session) {
  81 + public ResponseBean shenheInfo(Integer id, String activity_id, Integer state, String attr_tags, String msg, String callback, String video_title,
  82 + HttpSession session, HttpServletRequest request) {
82 83 logger.info("id:{},activity_id:{},state:{},attr_tags:{},msg:{},callback:{}", id, activity_id, state, attr_tags, msg, callback);
  84 + AttributePrincipal principal = (AttributePrincipal) request.getUserPrincipal();
  85 + String user_id = principal.getName();
83 86 SessionUser sessionUser = (SessionUser) session.getAttribute(SessionUser.getSessionKey());
84 87 String userId = sessionUser.getUserId();
  88 + String userName = sessionUser.getUserName();
  89 + ShyVideos shyVideos = videosService.selectByPrimaryKey(id);
85 90 JSONObject result;
86 91 try {
87 92 result = pass.auditPass(activity_id, state, attr_tags, msg, callback);
  93 +
  94 + ShyLog shyLog = new ShyLog();
  95 + shyLog.setVideoId(activity_id);
  96 + shyLog.setVideoName(shyVideos.getVideo_title());
  97 + shyLog.setOperator(userName + "(" + user_id + ")");
  98 + shyLog.setOperationTime(new Date());
  99 + shyLog.setOperationType("人工审核");
  100 + shyLog.setRemark(msg);
  101 + shyLogService.addShyLog(shyLog);
  102 +
88 103 } catch (Exception e) {
89 104 e.printStackTrace();
90 105 logger.error("视频审核失败", e);
... ...
src/main/java/com/cnlive/shenhe/serviceImpl/VideosServiceImpl.java
... ... @@ -6,10 +6,7 @@ import com.alibaba.fastjson.JSONObject;
6 6 import com.cnlive.shenhe.bean.ErrorEnum;
7 7 import com.cnlive.shenhe.bean.ResponseBean;
8 8 import com.cnlive.shenhe.dto.VideosDTO;
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;
  9 +import com.cnlive.shenhe.entity.*;
13 10 import com.cnlive.shenhe.mapper.ShyUsersMapper;
14 11 import com.cnlive.shenhe.mapper.ShyVideosMapper;
15 12 import com.cnlive.shenhe.utils.*;
... ... @@ -40,31 +37,34 @@ public class VideosServiceImpl {
40 37  
41 38 private static Logger logger = LoggerFactory.getLogger(VideofilterServiceImpl.class);
42 39 @Autowired
43   - ShyVideosMapper shyVideosMapper;
  40 + private ShyVideosMapper shyVideosMapper;
44 41 @Autowired
45   - ShyUsersMapper shyUsersMapper;
  42 + private ShyUsersMapper shyUsersMapper;
46 43  
47 44 @Autowired
48   - VideosServiceImpl videosService;
  45 + private VideosServiceImpl videosService;
49 46 @Autowired
50   - SitesServiceImpl sitesService;
  47 + private SitesServiceImpl sitesService;
51 48  
52 49 @Autowired
53   - UsersfreeServiceImpl usersfreeServiceImpl;
  50 + private UsersfreeServiceImpl usersfreeServiceImpl;
54 51  
55 52 @Autowired
56   - YiDunServiceImpl yiDunServiceImpl;
  53 + private YiDunServiceImpl yiDunServiceImpl;
57 54 @Autowired
58   - ShyActivityImpl shyActivityImpl;
  55 + private ShyActivityImpl shyActivityImpl;
59 56  
60 57 @Value("${qn_domain}")
61   - String qn_domain;
  58 + private String qn_domain;
62 59  
63 60 @Value("${ks_domain}")
64   - String ks_domain;
  61 + private String ks_domain;
65 62  
66 63 @Autowired
67   - AuditPass pass;
  64 + private AuditPass pass;
  65 +
  66 + @Autowired
  67 + private ShyLogServiceImpl shyLogService;
68 68  
69 69 public boolean impotVideo(ShyVideos shyVideos) {
70 70 int result = shyVideosMapper.insertSelective(shyVideos);
... ... @@ -333,6 +333,7 @@ public class VideosServiceImpl {
333 333 /**
334 334 * 易盾视频(图片)过滤
335 335 * type:1:文本 2:图片 3.网页 4:点播音频
  336 + *
336 337 * @param cid 审核云中视频的id
337 338 * @return
338 339 */
... ... @@ -523,6 +524,15 @@ public class VideosServiceImpl {
523 524 return false;
524 525 }
525 526  
  527 + /**
  528 + * 人工审核拒绝方法
  529 + *
  530 + * @param shyVideoId
  531 + * @param msg
  532 + * @param userId
  533 + * @param
  534 + * @return
  535 + */
526 536 public String repulse(String shyVideoId, String msg, String userId) {
527 537 String showMsg = "";
528 538 ShyVideos shyVideos = videosService.selectByPrimaryKey(Integer.parseInt(shyVideoId));
... ...