Commit da43c6d951ce0e05b7b19b75039df97a6cdf432a

Authored by 徐近程
1 parent 6763feec

举报投诉点播内容查询

src/main/java/com/cnlive/shenhe/controller/VideosController.java
1 package com.cnlive.shenhe.controller; 1 package com.cnlive.shenhe.controller;
2 2
  3 +import com.cnlive.shenhe.utils.*;
3 import org.apache.poi.xssf.usermodel.XSSFCell; 4 import org.apache.poi.xssf.usermodel.XSSFCell;
4 import org.apache.poi.xssf.usermodel.XSSFRow; 5 import org.apache.poi.xssf.usermodel.XSSFRow;
5 import org.apache.poi.xssf.usermodel.XSSFSheet; 6 import org.apache.poi.xssf.usermodel.XSSFSheet;
@@ -15,10 +16,6 @@ import com.cnlive.shenhe.entity.ShyVideos; @@ -15,10 +16,6 @@ import com.cnlive.shenhe.entity.ShyVideos;
15 import com.cnlive.shenhe.serviceImpl.SitesServiceImpl; 16 import com.cnlive.shenhe.serviceImpl.SitesServiceImpl;
16 import com.cnlive.shenhe.serviceImpl.UsersServiceImpl; 17 import com.cnlive.shenhe.serviceImpl.UsersServiceImpl;
17 import com.cnlive.shenhe.serviceImpl.VideosServiceImpl; 18 import com.cnlive.shenhe.serviceImpl.VideosServiceImpl;
18 -import com.cnlive.shenhe.utils.AuditPass;  
19 -import com.cnlive.shenhe.utils.CommonConst;  
20 -import com.cnlive.shenhe.utils.CommonUtils;  
21 -import com.cnlive.shenhe.utils.InfoUtil;  
22 import com.github.pagehelper.PageInfo; 19 import com.github.pagehelper.PageInfo;
23 import org.jsoup.helper.DataUtil; 20 import org.jsoup.helper.DataUtil;
24 import org.slf4j.Logger; 21 import org.slf4j.Logger;
@@ -33,11 +30,14 @@ import org.springframework.web.bind.annotation.PostMapping; @@ -33,11 +30,14 @@ import org.springframework.web.bind.annotation.PostMapping;
33 import org.springframework.web.bind.annotation.RequestMapping; 30 import org.springframework.web.bind.annotation.RequestMapping;
34 import org.springframework.web.bind.annotation.ResponseBody; 31 import org.springframework.web.bind.annotation.ResponseBody;
35 32
  33 +import javax.persistence.criteria.CriteriaBuilder;
36 import javax.servlet.ServletOutputStream; 34 import javax.servlet.ServletOutputStream;
37 import javax.servlet.http.HttpServletResponse; 35 import javax.servlet.http.HttpServletResponse;
38 import javax.servlet.http.HttpSession; 36 import javax.servlet.http.HttpSession;
39 import java.io.*; 37 import java.io.*;
  38 +import java.util.HashMap;
40 import java.util.List; 39 import java.util.List;
  40 +import java.util.Map;
41 41
42 @Controller 42 @Controller
43 @RequestMapping("/videos") 43 @RequestMapping("/videos")
@@ -60,6 +60,9 @@ public class VideosController extends BaseController { @@ -60,6 +60,9 @@ public class VideosController extends BaseController {
60 @Value("${ks_domain}") 60 @Value("${ks_domain}")
61 String ks_domain; 61 String ks_domain;
62 62
  63 + @Value("${cms_getVideoAndLiveId}")
  64 + String cms_getVideoAndLiveId;
  65 +
63 /** 66 /**
64 * 审核信息返回接口 67 * 审核信息返回接口
65 * 68 *
@@ -118,22 +121,19 @@ public class VideosController extends BaseController { @@ -118,22 +121,19 @@ public class VideosController extends BaseController {
118 * @return 121 * @return
119 */ 122 */
120 @GetMapping("/page") 123 @GetMapping("/page")
121 - public Object getListVideos(Model model, String video_title, String start_date, String end_date, Integer state, Integer receive, Integer page, Integer pageSize, String video_priority, String orderByClause, String sp_desc, String sp_Id,Integer source,String video_user_id,String shen_auditor_id, HttpSession session) { 124 + public Object getListVideos(Model model, String video_title, String start_date, String end_date, Integer state, Integer receive, Integer page, Integer pageSize, String video_priority, String orderByClause, String sp_desc, String sp_Id, Integer source, String video_user_id, String shen_auditor_id, Integer contentId, String video_id, HttpSession session) {
122 if (!StringUtils.isEmpty(shen_auditor_id)) { 125 if (!StringUtils.isEmpty(shen_auditor_id)) {
123 - if((!"自动审核".equals(shen_auditor_id))&&(!"白名单".equals(shen_auditor_id))){ 126 + if ((!"自动审核".equals(shen_auditor_id)) && (!"白名单".equals(shen_auditor_id))) {
124 shen_auditor_id = usersService.findspidByName(shen_auditor_id); 127 shen_auditor_id = usersService.findspidByName(shen_auditor_id);
125 } 128 }
126 } 129 }
127 130
128 -  
129 -  
130 -  
131 SessionUser sessionUser = (SessionUser) session.getAttribute(SessionUser.getSessionKey()); 131 SessionUser sessionUser = (SessionUser) session.getAttribute(SessionUser.getSessionKey());
132 if (CommonUtils.isNull(sessionUser)) { 132 if (CommonUtils.isNull(sessionUser)) {
133 return "redirect:/users/login"; 133 return "redirect:/users/login";
134 } 134 }
135 Integer spid = sessionUser.getSpid(); 135 Integer spid = sessionUser.getSpid();
136 - logger.info("sp_Id:{},spid:{}",sp_Id,spid); 136 + logger.info("sp_Id:{},spid:{}", sp_Id, spid);
137 String userId = sessionUser.getUserId(); 137 String userId = sessionUser.getUserId();
138 if (CommonUtils.isNull(page)) page = 1; 138 if (CommonUtils.isNull(page)) page = 1;
139 if (CommonUtils.isNull(pageSize)) pageSize = 10; 139 if (CommonUtils.isNull(pageSize)) pageSize = 10;
@@ -148,7 +148,22 @@ public class VideosController extends BaseController { @@ -148,7 +148,22 @@ public class VideosController extends BaseController {
148 } else if (CommonUtils.isEmpty(sp_desc) && spid == 0) { 148 } else if (CommonUtils.isEmpty(sp_desc) && spid == 0) {
149 spid = null; 149 spid = null;
150 } 150 }
151 - PageInfo<ShyVideos> videoPage = videosService.getListContent(video_title, start_date, end_date, state, receive, page, pageSize, video_priority, orderByClause, spid, userId,sp_Id,source,video_user_id,shen_auditor_id); 151 +
  152 + if (CommonUtils.isNotNull(contentId)) {
  153 + Map<String, String> map = new HashMap<>(1);
  154 + map.put("id", contentId.toString());
  155 + String post = HttpClientUtils.get(cms_getVideoAndLiveId, map);
  156 + JSONObject jsonObject = JSONObject.parseObject(post);
  157 + JSONObject data = jsonObject.getJSONObject("data");
  158 + if (data != null) {
  159 + String pid = data.getString("pid");
  160 + video_id = pid;
  161 + }else {
  162 + video_id=contentId.toString();
  163 + }
  164 + }
  165 +
  166 + PageInfo<ShyVideos> videoPage = videosService.getListContent(video_title, start_date, end_date, state, receive, page, pageSize, video_priority, orderByClause, spid, userId, sp_Id, source, video_user_id, shen_auditor_id, video_id);
152 List<ShyVideos> list = videoPage.getList(); 167 List<ShyVideos> list = videoPage.getList();
153 if (!list.isEmpty()) { 168 if (!list.isEmpty()) {
154 for (ShyVideos videos : list) { 169 for (ShyVideos videos : list) {
src/main/java/com/cnlive/shenhe/serviceImpl/VideosServiceImpl.java
@@ -109,7 +109,7 @@ public class VideosServiceImpl { @@ -109,7 +109,7 @@ public class VideosServiceImpl {
109 return shyVideosMapper.updateByPrimaryKey(shyVideos); 109 return shyVideosMapper.updateByPrimaryKey(shyVideos);
110 } 110 }
111 111
112 - public PageInfo<ShyVideos> getListContent(String video_title, String start_date, String end_date, Integer state, Integer receive, Integer page, Integer pageSize, String video_priority, String orderByClause, Integer spid, String userId, String sp_Id,Integer source,String video_user_id,String shen_auditor_id) { 112 + public PageInfo<ShyVideos> getListContent(String video_title, String start_date, String end_date, Integer state, Integer receive, Integer page, Integer pageSize, String video_priority, String orderByClause, Integer spid, String userId, String sp_Id,Integer source,String video_user_id,String shen_auditor_id,String video_id) {
113 Example example = new Example(ShyVideos.class); 113 Example example = new Example(ShyVideos.class);
114 Example.Criteria criteria = example.createCriteria(); 114 Example.Criteria criteria = example.createCriteria();
115 Example.Criteria criteria2 = example.createCriteria(); 115 Example.Criteria criteria2 = example.createCriteria();
@@ -142,6 +142,11 @@ public class VideosServiceImpl { @@ -142,6 +142,11 @@ public class VideosServiceImpl {
142 criteria2.andEqualTo("video_priority", video_priority); 142 criteria2.andEqualTo("video_priority", video_priority);
143 } 143 }
144 144
  145 + if (CommonUtils.isNotEmpty(video_id)) {
  146 + criteria.andEqualTo("video_id", video_id);
  147 + criteria2.andEqualTo("video_id", video_id);
  148 + }
  149 +
145 if(CommonUtils.isNotEmpty(shen_auditor_id)){ 150 if(CommonUtils.isNotEmpty(shen_auditor_id)){
146 if("白名单".equals(shen_auditor_id)||"自动审核".equals(shen_auditor_id)){ 151 if("白名单".equals(shen_auditor_id)||"自动审核".equals(shen_auditor_id)){
147 criteria.andEqualTo("updater", shen_auditor_id); 152 criteria.andEqualTo("updater", shen_auditor_id);
src/main/resources/templates/page/video.html
@@ -152,49 +152,44 @@ @@ -152,49 +152,44 @@
152 <!--<input class="form-control" name="video_priority" type="text" id="video_priority">--> 152 <!--<input class="form-control" name="video_priority" type="text" id="video_priority">-->
153 </div> 153 </div>
154 </div> 154 </div>
  155 + </div>
  156 + </div>
155 157
156 - <!--<div class="col-md-6" style="padding: 0;width: 25%;" th:if="${session.sessionUser.spid==0}">  
157 - <label for="video_user_id" class="control-label cb-toolbar">sp_Id</label>  
158 - <div class="col-sm-15" style="padding: 0;">  
159 - <input class="form-control" type="text" value="" id="video_user_id">  
160 - </div>  
161 - </div>-->  
162 - <div class="col-md-6" style="padding: 0;width: 25%;" th:if="${session.sessionUser.spid==0}">  
163 - <label for="video_user_id" class="control-label cb-toolbar">sid</label>  
164 - <div class="col-sm-9" style="padding: 0;">  
165 - <input class="form-control" type="text" value="" id="video_user_id">  
166 - </div>  
167 - </div> 158 + <div class="col-md-6" style="padding: 0;width: 18%;" th:if="${session.sessionUser.spid==0}">
  159 + <label for="video_id" class="control-label cb-toolbar">video_id</label>
  160 + <div class="col-sm-9" style="padding: 0;">
  161 + <input class="form-control" type="text" value="" id="video_id">
  162 + </div>
  163 + </div>
168 164
  165 + <div class="col-md-6" style="padding: 0;width: 18%;" th:if="${session.sessionUser.spid==0}">
  166 + <label for="video_user_id" class="control-label cb-toolbar">sid</label>
  167 + <div class="col-sm-9" style="padding: 0;">
  168 + <input class="form-control" type="text" value="" id="video_user_id">
  169 + </div>
  170 + </div>
169 171
170 - <div class="col-md-6" style="padding: 0;width: 25%;" th:if="${session.sessionUser.spid==0}">  
171 - <label for="sp_Id" class="control-label cb-toolbar">sp_Id</label>  
172 - <div class="col-sm-9" style="padding: 0;">  
173 - <input class="form-control" type="text" value="" id="sp_Id">  
174 - </div>  
175 - </div> 172 + <div class="col-md-6" style="padding: 0;width: 18%;" th:if="${session.sessionUser.spid==0}">
  173 + <label for="contentId" class="control-label cb-toolbar">内容id:</label>
  174 + <div class="col-sm-9" style="padding: 0;">
  175 + <input class="form-control" type="text" value="" id="contentId">
  176 + </div>
  177 + </div>
176 178
177 - <div class="col-md-6" style="padding: 0;width: 25%;" th:if="${session.sessionUser.spid==0}">  
178 - <label for="shen_auditor_id" class="control-label cb-toolbar">审核员</label>  
179 - <div class="col-sm-9" style="padding: 0;">  
180 - <input class="form-control" type="text" value="" id="shen_auditor_id">  
181 - </div>  
182 - </div>  
183 179
184 - <!-- <div class="col-md-6" style="padding: 0;width: 15%;" th:if="${session.sessionUser.spid==0}"> -->  
185 - <!-- <label for="count" class="control-label cb-toolbar">每页条数:</label> -->  
186 - <!-- <div class="col-sm-5" style="padding: 0;"> -->  
187 - <!-- <input class="form-control" type="text" value="" id="count"> -->  
188 - <!-- </div> -->  
189 - <!-- </div> --> 180 + <div class="col-md-6" style="padding: 0;width: 18%;" th:if="${session.sessionUser.spid==0}">
  181 + <label for="sp_Id" class="control-label cb-toolbar">sp_Id</label>
  182 + <div class="col-sm-9" style="padding: 0;">
  183 + <input class="form-control" type="text" value="" id="sp_Id">
  184 + </div>
  185 + </div>
  186 +
  187 + <div class="col-md-6" style="padding: 0;width: 18%;" th:if="${session.sessionUser.spid==0}">
  188 + <label for="shen_auditor_id" class="control-label cb-toolbar">审核员</label>
  189 + <div class="col-sm-9" style="padding: 0;">
  190 + <input class="form-control" type="text" value="" id="shen_auditor_id">
190 </div> 191 </div>
191 </div> 192 </div>
192 - <!-- <div class="btn-group margin-bottom col-md-6" style="padding: 0;width: 1%;float: left;"> -->  
193 - <!-- <div class="col-md-1 text-center" style="width: 12%;padding: 0;float: right;"> -->  
194 - <!-- <button type="button" class="btn btn-primary btn-sm" id="videos_query">查 询 -->  
195 - <!-- </button> -->  
196 - <!-- </div> -->  
197 - <!-- </div> -->  
198 </div> 193 </div>
199 194
200 <div class="fixed-table-container" style="padding-bottom: 0px;"> 195 <div class="fixed-table-container" style="padding-bottom: 0px;">
@@ -463,10 +458,11 @@ @@ -463,10 +458,11 @@
463 var source = ""; 458 var source = "";
464 var video_user_id = ""; 459 var video_user_id = "";
465 var shen_auditor_id = ""; 460 var shen_auditor_id = "";
  461 + var contentId = "";
  462 + var video_id = "";
466 463
467 464
468 function updateValue(){ 465 function updateValue(){
469 -// video_priority = $("#video_priority").val();  
470 video_title = $("#video_titleID").val(); 466 video_title = $("#video_titleID").val();
471 start_date = $("#start_date").val(); 467 start_date = $("#start_date").val();
472 end_date = $("#end_date").val(); 468 end_date = $("#end_date").val();
@@ -479,6 +475,8 @@ @@ -479,6 +475,8 @@
479 count = $("#pageSize").val(); 475 count = $("#pageSize").val();
480 video_user_id = $("#video_user_id").val(); 476 video_user_id = $("#video_user_id").val();
481 shen_auditor_id = $("#shen_auditor_id").val(); 477 shen_auditor_id = $("#shen_auditor_id").val();
  478 + contentId = $("#contentId").val();
  479 + video_id = $("#video_id").val();
482 } 480 }
483 } 481 }
484 482
@@ -486,7 +484,7 @@ @@ -486,7 +484,7 @@
486 //全部 484 //全部
487 function quanbu() { 485 function quanbu() {
488 updateValue(); 486 updateValue();
489 - window.location.href = "/videos/page?video_title=" + video_title + "&start_date=" + start_date + "&end_date=" + end_date + "&state=" + state + "&video_priority=" + video_priority + "&sp_desc=" + sp_desc+"&pageSize="+count+"&sp_Id="+sp_Id+"&source="+source+"&video_user_id="+video_user_id+"&shen_auditor_id="+shen_auditor_id; 487 + window.location.href = "/videos/page?video_title=" + video_title + "&start_date=" + start_date + "&end_date=" + end_date + "&state=" + state + "&video_priority=" + video_priority + "&sp_desc=" + sp_desc+"&pageSize="+count+"&sp_Id="+sp_Id+"&source="+source+"&video_user_id="+video_user_id+"&shen_auditor_id="+shen_auditor_id+"&contentId="+contentId+"&video_id="+video_id;
490 } 488 }
491 489
492 //全部待领 490 //全部待领
@@ -494,27 +492,27 @@ @@ -494,27 +492,27 @@
494 updateValue(); 492 updateValue();
495 if($.trim(state) == '') state=0; 493 if($.trim(state) == '') state=0;
496 var receive = 0; 494 var receive = 0;
497 - window.location.href = "page?video_title=" + video_title + "&start_date=" + start_date + "&end_date=" + end_date + "&state=" + state + "&receive=" + receive + "&video_priority=" + video_priority + "&sp_desc=" + sp_desc+"&pageSize="+count+"&sp_Id="+sp_Id+"&source="+source+"&video_user_id="+video_user_id+"&shen_auditor_id="+shen_auditor_id; 495 + window.location.href = "page?video_title=" + video_title + "&start_date=" + start_date + "&end_date=" + end_date + "&state=" + state + "&receive=" + receive + "&video_priority=" + video_priority + "&sp_desc=" + sp_desc+"&pageSize="+count+"&sp_Id="+sp_Id+"&source="+source+"&video_user_id="+video_user_id+"&shen_auditor_id="+shen_auditor_id+"&contentId="+contentId+"&video_id="+video_id;
498 }); 496 });
499 //我的待审核 497 //我的待审核
500 $('#Mydaishen').click(function () { 498 $('#Mydaishen').click(function () {
501 updateValue(); 499 updateValue();
502 var receive = 1; 500 var receive = 1;
503 if($.trim(state) == '') state=0; 501 if($.trim(state) == '') state=0;
504 - window.location.href = "page?video_title=" + video_title + "&start_date=" + start_date + "&end_date=" + end_date + "&state=" + state + "&receive=" + receive + "&video_priority=" + video_priority + "&sp_desc=" + sp_desc+"&pageSize="+count+"&sp_Id="+sp_Id+"&source="+source+"&video_user_id="+video_user_id+"&shen_auditor_id="+shen_auditor_id; 502 + window.location.href = "page?video_title=" + video_title + "&start_date=" + start_date + "&end_date=" + end_date + "&state=" + state + "&receive=" + receive + "&video_priority=" + video_priority + "&sp_desc=" + sp_desc+"&pageSize="+count+"&sp_Id="+sp_Id+"&source="+source+"&video_user_id="+video_user_id+"&shen_auditor_id="+shen_auditor_id+"&contentId="+contentId+"&video_id="+video_id;
505 }); 503 });
506 //我的已审核 504 //我的已审核
507 $('#yishen').click(function () { 505 $('#yishen').click(function () {
508 updateValue(); 506 updateValue();
509 var receive = 1; 507 var receive = 1;
510 if($.trim(state) == '') state=3;//审核状态,3代表通过和拒绝都查询 508 if($.trim(state) == '') state=3;//审核状态,3代表通过和拒绝都查询
511 - window.location.href = "page?video_title=" + video_title + "&start_date=" + start_date + "&end_date=" + end_date + "&state=" + state + "&receive=" + receive + "&video_priority=" + video_priority + "&sp_desc=" + sp_desc+"&pageSize="+count+"&sp_Id="+sp_Id+"&source="+source+"&video_user_id="+video_user_id+"&shen_auditor_id="+shen_auditor_id; 509 + window.location.href = "page?video_title=" + video_title + "&start_date=" + start_date + "&end_date=" + end_date + "&state=" + state + "&receive=" + receive + "&video_priority=" + video_priority + "&sp_desc=" + sp_desc+"&pageSize="+count+"&sp_Id="+sp_Id+"&source="+source+"&video_user_id="+video_user_id+"&shen_auditor_id="+shen_auditor_id+"&contentId="+contentId+"&video_id="+video_id;
512 }); 510 });
513 511
514 512
515 //查询 513 //查询
516 $('#videos_query').click(function () { 514 $('#videos_query').click(function () {
517 - window.location.href = "/videos/page?video_title=" + video_title + "&start_date=" + start_date + "&end_date=" + end_date + "&state=" + state + "&video_priority=" + video_priority + "&sp_desc=" + sp_desc+"&pageSize="+count+"&sp_Id="+sp_Id+"&source="+source+"&video_user_id="+video_user_id+"&shen_auditor_id="+shen_auditor_id; 515 + window.location.href = "/videos/page?video_title=" + video_title + "&start_date=" + start_date + "&end_date=" + end_date + "&state=" + state + "&video_priority=" + video_priority + "&sp_desc=" + sp_desc+"&pageSize="+count+"&sp_Id="+sp_Id+"&source="+source+"&video_user_id="+video_user_id+"&shen_auditor_id="+shen_auditor_id+"&contentId="+contentId+"&video_id="+video_id;
518 }); 516 });
519 /*全选的操作*/ 517 /*全选的操作*/
520 $('#select_all').click(function () { 518 $('#select_all').click(function () {