Commit ff1cf6e1f9b463dbe10f1417cb89726f7f290a8d

Authored by 徐近程
1 parent 53bc12bd

点播增加spid搜索

src/main/java/com/cnlive/shenhe/controller/VideosController.java
@@ -115,39 +115,39 @@ public class VideosController extends BaseController { @@ -115,39 +115,39 @@ public class VideosController extends BaseController {
115 * @return 115 * @return
116 */ 116 */
117 @GetMapping("/page") 117 @GetMapping("/page")
118 - 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, HttpSession session) { 118 + 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, HttpSession session) {
119 SessionUser sessionUser = (SessionUser) session.getAttribute(SessionUser.getSessionKey()); 119 SessionUser sessionUser = (SessionUser) session.getAttribute(SessionUser.getSessionKey());
120 - if(CommonUtils.isNull(sessionUser)){  
121 - return "redirect:/users/login"; 120 + if (CommonUtils.isNull(sessionUser)) {
  121 + return "redirect:/users/login";
122 } 122 }
123 Integer spid = sessionUser.getSpid(); 123 Integer spid = sessionUser.getSpid();
124 String userId = sessionUser.getUserId(); 124 String userId = sessionUser.getUserId();
125 if (CommonUtils.isNull(page)) page = 1; 125 if (CommonUtils.isNull(page)) page = 1;
126 if (CommonUtils.isNull(pageSize)) pageSize = 10; 126 if (CommonUtils.isNull(pageSize)) pageSize = 10;
127 if (CommonUtils.isNotEmpty(sp_desc) && spid == 0) { 127 if (CommonUtils.isNotEmpty(sp_desc) && spid == 0) {
128 - ShySites shySite=sitesService.findspidBySpdesc(sp_desc);  
129 - if(CommonUtils.isNotNull(shySite)){  
130 - spid = shySite.getSpid();  
131 - }else{  
132 - setmodel_site(model);  
133 - return "error.html";  
134 - } 128 + ShySites shySite = sitesService.findspidBySpdesc(sp_desc);
  129 + if (CommonUtils.isNotNull(shySite)) {
  130 + spid = shySite.getSpid();
  131 + } else {
  132 + setmodel_site(model);
  133 + return "error.html";
  134 + }
135 } else if (CommonUtils.isEmpty(sp_desc) && spid == 0) { 135 } else if (CommonUtils.isEmpty(sp_desc) && spid == 0) {
136 spid = null; 136 spid = null;
137 } 137 }
138 - PageInfo<ShyVideos> videoPage = videosService.getListContent(video_title, start_date, end_date, state, receive, page, pageSize, video_priority, orderByClause, spid, userId); 138 + PageInfo<ShyVideos> videoPage = videosService.getListContent(video_title, start_date, end_date, state, receive, page, pageSize, video_priority, orderByClause, spid, userId,sp_Id);
139 List<ShyVideos> list = videoPage.getList(); 139 List<ShyVideos> list = videoPage.getList();
140 if (!list.isEmpty()) { 140 if (!list.isEmpty()) {
141 for (ShyVideos videos : list) { 141 for (ShyVideos videos : list) {
142 if (videos.getState() != CommonConst.AUDIT_INTT) { 142 if (videos.getState() != CommonConst.AUDIT_INTT) {
143 - String updater =CommonUtils.isEmpty(videos.getUpdater()) || "null".equals(videos.getUpdater())? "白名单":videos.getUpdater(); 143 + String updater = CommonUtils.isEmpty(videos.getUpdater()) || "null".equals(videos.getUpdater()) ? "白名单" : videos.getUpdater();
144 String auditor_id = videos.getAuditor_id(); 144 String auditor_id = videos.getAuditor_id();
145 if (CommonUtils.isNotEmpty(auditor_id)) { 145 if (CommonUtils.isNotEmpty(auditor_id)) {
146 ShyUsers user = new ShyUsers(); 146 ShyUsers user = new ShyUsers();
147 user.setUser_id(auditor_id); 147 user.setUser_id(auditor_id);
148 user = usersService.select(user); 148 user = usersService.select(user);
149 if (CommonUtils.isNotNull(user)) { 149 if (CommonUtils.isNotNull(user)) {
150 - String email = CommonUtils.isEmpty(user.getEmail()) || "null".equals(user.getEmail()) ? "" : user.getEmail(); 150 + String email = CommonUtils.isEmpty(user.getEmail()) || "null".equals(user.getEmail()) ? "" : user.getEmail();
151 String userName = CommonUtils.isEmpty(user.getUsername()) ? email : user.getUsername(); 151 String userName = CommonUtils.isEmpty(user.getUsername()) ? email : user.getUsername();
152 updater = userName; 152 updater = userName;
153 } 153 }
@@ -157,25 +157,25 @@ public class VideosController extends BaseController { @@ -157,25 +157,25 @@ public class VideosController extends BaseController {
157 //显示spid简称 157 //显示spid简称
158 ShySites shySites = sitesService.findspidDescByspid(videos.getSpid()); 158 ShySites shySites = sitesService.findspidDescByspid(videos.getSpid());
159 if (CommonUtils.isNotNull(shySites)) { 159 if (CommonUtils.isNotNull(shySites)) {
160 - if(CommonUtils.isNotEmpty(videos.getCategory())&&videos.getCategory().equals(CommonConst.CATEGORY_WITNESS)){ 160 + if (CommonUtils.isNotEmpty(videos.getCategory()) && videos.getCategory().equals(CommonConst.CATEGORY_WITNESS)) {
161 //0-目击者 1-童声共济 2-全民健身 3-目击者政府监督 4-美食中国 5-老年大学 161 //0-目击者 1-童声共济 2-全民健身 3-目击者政府监督 4-美食中国 5-老年大学
162 String source = videos.getSource(); 162 String source = videos.getSource();
163 - if("1".equals(source)){  
164 - videos.setSpid_desc("童声共济"+"(目击者)");  
165 - } else if("2".equals(source)){  
166 - videos.setSpid_desc("全民健身"+"(目击者)");  
167 - } else if("4".equals(source)){  
168 - videos.setSpid_desc("美食中国"+"(目击者)");  
169 - } else if("5".equals(source)){  
170 - videos.setSpid_desc("老年大学"+"(目击者)"); 163 + if ("1".equals(source)) {
  164 + videos.setSpid_desc("童声共济" + "(目击者)");
  165 + } else if ("2".equals(source)) {
  166 + videos.setSpid_desc("全民健身" + "(目击者)");
  167 + } else if ("4".equals(source)) {
  168 + videos.setSpid_desc("美食中国" + "(目击者)");
  169 + } else if ("5".equals(source)) {
  170 + videos.setSpid_desc("老年大学" + "(目击者)");
171 } else { 171 } else {
172 - videos.setSpid_desc(shySites.getName()+"(目击者)"); 172 + videos.setSpid_desc(shySites.getName() + "(目击者)");
173 } 173 }
174 - }else if(CommonUtils.isNotEmpty(videos.getCategory())&&videos.getCategory().equals(CommonConst.CATEGORY_MOMENT)){  
175 - videos.setSpid_desc(shySites.getName()+"(朋友圈)");  
176 - }else{  
177 - videos.setSpid_desc(shySites.getName());  
178 - } 174 + } else if (CommonUtils.isNotEmpty(videos.getCategory()) && videos.getCategory().equals(CommonConst.CATEGORY_MOMENT)) {
  175 + videos.setSpid_desc(shySites.getName() + "(朋友圈)");
  176 + } else {
  177 + videos.setSpid_desc(shySites.getName());
  178 + }
179 } 179 }
180 } 180 }
181 } 181 }
@@ -183,7 +183,7 @@ public class VideosController extends BaseController { @@ -183,7 +183,7 @@ public class VideosController extends BaseController {
183 String state1 = state == null ? "" : state.toString(); 183 String state1 = state == null ? "" : state.toString();
184 String receive1 = ""; 184 String receive1 = "";
185 if (CommonUtils.isNotNull(receive)) { 185 if (CommonUtils.isNotNull(receive)) {
186 - receive1 = receive==CommonConst.RECEIVE_AFTER ? "true" : "false"; 186 + receive1 = receive == CommonConst.RECEIVE_AFTER ? "true" : "false";
187 } else { 187 } else {
188 receive1 = ""; 188 receive1 = "";
189 } 189 }
src/main/java/com/cnlive/shenhe/serviceImpl/VideosServiceImpl.java
@@ -118,7 +118,7 @@ public class VideosServiceImpl { @@ -118,7 +118,7 @@ public class VideosServiceImpl {
118 return shyVideosMapper.updateByPrimaryKey(shyVideos); 118 return shyVideosMapper.updateByPrimaryKey(shyVideos);
119 } 119 }
120 120
121 - 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) { 121 + 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) {
122 Example example = new Example(ShyVideos.class); 122 Example example = new Example(ShyVideos.class);
123 Example.Criteria criteria = example.createCriteria(); 123 Example.Criteria criteria = example.createCriteria();
124 Example.Criteria criteria2 = example.createCriteria(); 124 Example.Criteria criteria2 = example.createCriteria();
@@ -145,12 +145,15 @@ public class VideosServiceImpl { @@ -145,12 +145,15 @@ public class VideosServiceImpl {
145 criteria.andLike("video_title", "%" + video_title + "%"); 145 criteria.andLike("video_title", "%" + video_title + "%");
146 criteria2.andLike("video_title", "%" + video_title + "%"); 146 criteria2.andLike("video_title", "%" + video_title + "%");
147 } 147 }
148 - 148 +
149 if (CommonUtils.isNotEmpty(video_priority)) { 149 if (CommonUtils.isNotEmpty(video_priority)) {
150 criteria.andEqualTo("video_priority", video_priority); 150 criteria.andEqualTo("video_priority", video_priority);
151 criteria2.andEqualTo("video_priority", video_priority); 151 criteria2.andEqualTo("video_priority", video_priority);
152 } 152 }
153 if (CommonUtils.isNotNull(spid)) { 153 if (CommonUtils.isNotNull(spid)) {
  154 + if (CommonUtils.isNotEmpty(sp_Id)) {
  155 + spid = Integer.valueOf(sp_Id);
  156 + }
154 criteria.andEqualTo("spid", spid); 157 criteria.andEqualTo("spid", spid);
155 criteria2.andEqualTo("spid", spid); 158 criteria2.andEqualTo("spid", spid);
156 } 159 }
src/main/resources/templates/page/video.html
@@ -130,6 +130,13 @@ @@ -130,6 +130,13 @@
130 <input class="form-control" type="text" value="" id="sp_desc"> 130 <input class="form-control" type="text" value="" id="sp_desc">
131 </div> 131 </div>
132 </div> 132 </div>
  133 +
  134 + <div class="col-md-6" style="padding: 0;width: 25%;" th:if="${session.sessionUser.spid==0}">
  135 + <label for="sp_Id" class="control-label cb-toolbar">spId</label>
  136 + <div class="col-sm-9" style="padding: 0;">
  137 + <input class="form-control" type="text" value="" id="sp_Id">
  138 + </div>
  139 + </div>
133 <!-- <div class="col-md-6" style="padding: 0;width: 15%;" th:if="${session.sessionUser.spid==0}"> --> 140 <!-- <div class="col-md-6" style="padding: 0;width: 15%;" th:if="${session.sessionUser.spid==0}"> -->
134 <!-- <label for="count" class="control-label cb-toolbar">每页条数:</label> --> 141 <!-- <label for="count" class="control-label cb-toolbar">每页条数:</label> -->
135 <!-- <div class="col-sm-5" style="padding: 0;"> --> 142 <!-- <div class="col-sm-5" style="padding: 0;"> -->
@@ -401,6 +408,7 @@ @@ -401,6 +408,7 @@
401 var sp_desc =""; 408 var sp_desc ="";
402 var count = ""; 409 var count = "";
403 var state = ""; 410 var state = "";
  411 + var sp_Id = "";
404 412
405 function updateValue(){ 413 function updateValue(){
406 // video_priority = $("#video_priority").val(); 414 // video_priority = $("#video_priority").val();
@@ -408,6 +416,7 @@ @@ -408,6 +416,7 @@
408 start_date = $("#start_date").val(); 416 start_date = $("#start_date").val();
409 end_date = $("#end_date").val(); 417 end_date = $("#end_date").val();
410 state = $("#state").val(); 418 state = $("#state").val();
  419 + sp_Id = $("#sp_Id").val();
411 var spId=[[${session.sessionUser.spid}]]; 420 var spId=[[${session.sessionUser.spid}]];
412 if(spId==0){ 421 if(spId==0){
413 sp_desc = $("#sp_desc").val(); 422 sp_desc = $("#sp_desc").val();
@@ -419,7 +428,7 @@ @@ -419,7 +428,7 @@
419 //全部 428 //全部
420 function quanbu() { 429 function quanbu() {
421 updateValue(); 430 updateValue();
422 - 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; 431 + 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;
423 } 432 }
424 433
425 //全部待领 434 //全部待领
@@ -427,27 +436,27 @@ @@ -427,27 +436,27 @@
427 updateValue(); 436 updateValue();
428 if($.trim(state) == '') state=0; 437 if($.trim(state) == '') state=0;
429 var receive = 0; 438 var receive = 0;
430 - 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; 439 + 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;
431 }); 440 });
432 //我的待审核 441 //我的待审核
433 $('#Mydaishen').click(function () { 442 $('#Mydaishen').click(function () {
434 updateValue(); 443 updateValue();
435 var receive = 1; 444 var receive = 1;
436 if($.trim(state) == '') state=0; 445 if($.trim(state) == '') state=0;
437 - 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; 446 + 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;
438 }); 447 });
439 //我的已审核 448 //我的已审核
440 $('#yishen').click(function () { 449 $('#yishen').click(function () {
441 updateValue(); 450 updateValue();
442 var receive = 1; 451 var receive = 1;
443 if($.trim(state) == '') state=3;//审核状态,3代表通过和拒绝都查询 452 if($.trim(state) == '') state=3;//审核状态,3代表通过和拒绝都查询
444 - 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; 453 + 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;
445 }); 454 });
446 455
447 456
448 //查询 457 //查询
449 $('#videos_query').click(function () { 458 $('#videos_query').click(function () {
450 - 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; 459 + 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;
451 }); 460 });
452 /*全选的操作*/ 461 /*全选的操作*/
453 $('#select_all').click(function () { 462 $('#select_all').click(function () {