Commit f72d5f7a2531ecaa153cd1275f76b09a1921e0e6

Authored by 王言钊
1 parent f27a09d9

点播审核模块优化

src/main/java/com/cnlive/shenhe/controller/ShyActivityController.java
@@ -15,6 +15,7 @@ import org.springframework.ui.Model; @@ -15,6 +15,7 @@ import org.springframework.ui.Model;
15 import org.springframework.web.bind.annotation.*; 15 import org.springframework.web.bind.annotation.*;
16 16
17 import java.util.Date; 17 import java.util.Date;
  18 +import java.util.List;
18 19
19 20
20 /** 21 /**
@@ -64,6 +65,10 @@ public class ShyActivityController { @@ -64,6 +65,10 @@ public class ShyActivityController {
64 @GetMapping("/page") 65 @GetMapping("/page")
65 public String getShyActivity(@RequestParam(defaultValue = "1") Integer pageNum, @RequestParam(defaultValue = "10") Integer pageSize, Model model, String activity, String exempt_from_trial) { 66 public String getShyActivity(@RequestParam(defaultValue = "1") Integer pageNum, @RequestParam(defaultValue = "10") Integer pageSize, Model model, String activity, String exempt_from_trial) {
66 PageInfo<ShyActivity> shyActivityPageInfo = shyActivityImpl.selectByExample(pageNum, pageSize, activity, exempt_from_trial); 67 PageInfo<ShyActivity> shyActivityPageInfo = shyActivityImpl.selectByExample(pageNum, pageSize, activity, exempt_from_trial);
  68 + List<ShyActivity> list = shyActivityPageInfo.getList();
  69 + for (ShyActivity shyActivity : list) {
  70 + model.addAttribute("shyActivity",shyActivity);
  71 + }
67 model.addAttribute("ShyActivitylist", shyActivityPageInfo); 72 model.addAttribute("ShyActivitylist", shyActivityPageInfo);
68 return "page/activity.html"; 73 return "page/activity.html";
69 } 74 }
src/main/java/com/cnlive/shenhe/serviceImpl/ShyActivityImpl.java
1 package com.cnlive.shenhe.serviceImpl; 1 package com.cnlive.shenhe.serviceImpl;
2 2
3 3
  4 +import com.cnlive.shenhe.dto.ShyActivityDTO;
4 import com.cnlive.shenhe.entity.ShyActivity; 5 import com.cnlive.shenhe.entity.ShyActivity;
5 import com.cnlive.shenhe.mapper.ShyActivityMapper; 6 import com.cnlive.shenhe.mapper.ShyActivityMapper;
6 import com.cnlive.shenhe.utils.CommonUtils; 7 import com.cnlive.shenhe.utils.CommonUtils;
  8 +import com.github.pagehelper.Page;
7 import com.github.pagehelper.PageHelper; 9 import com.github.pagehelper.PageHelper;
8 import com.github.pagehelper.PageInfo; 10 import com.github.pagehelper.PageInfo;
9 import org.springframework.beans.factory.annotation.Autowired; 11 import org.springframework.beans.factory.annotation.Autowired;
10 import org.springframework.stereotype.Service; 12 import org.springframework.stereotype.Service;
  13 +import org.springframework.web.bind.annotation.RequestParam;
11 import tk.mybatis.mapper.entity.Example; 14 import tk.mybatis.mapper.entity.Example;
12 15
  16 +import java.security.PublicKey;
13 import java.util.Date; 17 import java.util.Date;
14 import java.util.List; 18 import java.util.List;
15 19
@@ -68,12 +72,11 @@ public class ShyActivityImpl { @@ -68,12 +72,11 @@ public class ShyActivityImpl {
68 72
69 /** 73 /**
70 * 查询活动 74 * 查询活动
71 - *  
72 * @param pageNum 75 * @param pageNum
73 * @param pageSize 76 * @param pageSize
74 * @return 77 * @return
75 */ 78 */
76 - public PageInfo<ShyActivity> selectByExample(Integer pageNum, Integer pageSize, String activity, String exemptFromTrial) { 79 + public PageInfo<ShyActivity> selectByExample(Integer pageNum, Integer pageSize,String activity,String exempt_from_trial) {
77 Example example = new Example(ShyActivity.class); 80 Example example = new Example(ShyActivity.class);
78 //如果为空 按照倒序排序 分页查询所有 81 //如果为空 按照倒序排序 分页查询所有
79 //以创建时间为条件进行倒序 82 //以创建时间为条件进行倒序
@@ -82,8 +85,8 @@ public class ShyActivityImpl { @@ -82,8 +85,8 @@ public class ShyActivityImpl {
82 Example.Criteria criteria = example.createCriteria(); 85 Example.Criteria criteria = example.createCriteria();
83 86
84 // 如果查询条件不为空 按照条件走模糊查询 87 // 如果查询条件不为空 按照条件走模糊查询
85 - if (CommonUtils.isNotEmpty(exemptFromTrial)) {  
86 - criteria.andLike("exemptFromTrial", "%" + exemptFromTrial + "%"); 88 + if (CommonUtils.isNotEmpty(exempt_from_trial)) {
  89 + criteria.andLike("exempt_from_trial", "%" + exempt_from_trial + "%");
87 } 90 }
88 // 如果查询条件不为空 按照条件走模糊查询 91 // 如果查询条件不为空 按照条件走模糊查询
89 if (CommonUtils.isNotEmpty(activity)) { 92 if (CommonUtils.isNotEmpty(activity)) {
src/main/java/com/cnlive/shenhe/serviceImpl/VideosServiceImpl.java
@@ -122,8 +122,6 @@ public class VideosServiceImpl { @@ -122,8 +122,6 @@ public class VideosServiceImpl {
122 Timestamp startdate = null; 122 Timestamp startdate = null;
123 Timestamp enddate = null; 123 Timestamp enddate = null;
124 try { 124 try {
125 -// startdate = CommonUtils.parseDate(start_date, "yyyy-MM-dd HH:mm:ss");  
126 -// enddate = CommonUtils.parseDate(end_date, "yyyy-MM-dd HH:mm:ss");  
127 startdate = CommonUtils.parseDate(start_date, "yyyy-MM-dd"); 125 startdate = CommonUtils.parseDate(start_date, "yyyy-MM-dd");
128 enddate = CommonUtils.parseDate(end_date, "yyyy-MM-dd"); 126 enddate = CommonUtils.parseDate(end_date, "yyyy-MM-dd");
129 } catch (ParseException e) { 127 } catch (ParseException e) {
@@ -159,12 +157,18 @@ public class VideosServiceImpl { @@ -159,12 +157,18 @@ public class VideosServiceImpl {
159 } 157 }
160 } 158 }
161 159
162 - if (CommonUtils.isNotEmpty(source) && !"moment".equals(source)) { 160 +
  161 + if (CommonUtils.isNotEmpty(source) && !"22".equals(source) && !"102".equals(source)) {
163 criteria.andEqualTo("source", source); 162 criteria.andEqualTo("source", source);
164 criteria2.andEqualTo("source", source); 163 criteria2.andEqualTo("source", source);
165 - } else if (CommonUtils.isNotEmpty(source) && "moment".equals(source)) { 164 + } else if (CommonUtils.isNotEmpty(source) && "22".equals(source)) {
166 criteria.andEqualTo("category", source); 165 criteria.andEqualTo("category", source);
167 criteria2.andEqualTo("category", source); 166 criteria2.andEqualTo("category", source);
  167 + } else if (CommonUtils.isNotEmpty(source) && "102".equals(source)) {
  168 + criteria.andEqualTo("source", "102".equals(source) ? 0 : source);
  169 + criteria2.andEqualTo("source", "102".equals(source) ? 0 : source);
  170 + boolean equals = "102".equals(source);
  171 + System.out.println(equals);
168 } 172 }
169 173
170 if (CommonUtils.isNotEmpty(video_user_id)) { 174 if (CommonUtils.isNotEmpty(video_user_id)) {
@@ -296,8 +300,6 @@ public class VideosServiceImpl { @@ -296,8 +300,6 @@ public class VideosServiceImpl {
296 Timestamp startdate = null; 300 Timestamp startdate = null;
297 Timestamp enddate = null; 301 Timestamp enddate = null;
298 try { 302 try {
299 -// startdate = CommonUtils.parseDate(start_date, "yyyy-MM-dd HH:mm:ss");  
300 -// enddate = CommonUtils.parseDate(end_date, "yyyy-MM-dd HH:mm:ss");  
301 startdate = CommonUtils.parseDate(start_date, "yyyy-MM-dd"); 303 startdate = CommonUtils.parseDate(start_date, "yyyy-MM-dd");
302 enddate = CommonUtils.parseDate(end_date, "yyyy-MM-dd"); 304 enddate = CommonUtils.parseDate(end_date, "yyyy-MM-dd");
303 } catch (ParseException e) { 305 } catch (ParseException e) {
@@ -470,7 +472,7 @@ public class VideosServiceImpl { @@ -470,7 +472,7 @@ public class VideosServiceImpl {
470 //审核类型,1:免审,2:机审,3:人工审 472 //审核类型,1:免审,2:机审,3:人工审
471 Integer shenheType = 3; 473 Integer shenheType = 3;
472 //如果当前sp是免审sp 474 //如果当前sp是免审sp
473 - if (sites.contains(shyVideo.getSpid()) || shyActivities.contains(shyVideo.getSource())){ 475 + if (sites.contains(shyVideo.getSpid()) || shyActivities.contains(shyVideo.getSource())) {
474 //免审 476 //免审
475 shenheType = 1; 477 shenheType = 1;
476 } else { 478 } else {
src/main/resources/templates/page/activity.html
@@ -116,8 +116,10 @@ @@ -116,8 +116,10 @@
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" name="exempt_from_trial">  
120 - <option value="" name="-选择审核类型-">-选择审核类型-</option> 119 +
  120 + <select class="form-control" id="exempt_from_trial_query"
  121 + name="exempt_from_trial">
  122 + <option value="" name="-全部审免类型-" th:selected="selected">-全部审核类型-</option>
121 <option value="0" name="未审核">未审免</option> 123 <option value="0" name="未审核">未审免</option>
122 <option value="1" name="已经审核">已经审免</option> 124 <option value="1" name="已经审核">已经审免</option>
123 </select> 125 </select>
@@ -193,7 +195,6 @@ @@ -193,7 +195,6 @@
193 14:27:17 195 14:27:17
194 </td> 196 </td>
195 197
196 -  
197 <td style="text-align: center; width: 10%;"> 198 <td style="text-align: center; width: 10%;">
198 <span>&nbsp;</span> 199 <span>&nbsp;</span>
199 <a class="edit" 200 <a class="edit"
@@ -203,9 +204,9 @@ @@ -203,9 +204,9 @@
203 <span>&nbsp;</span> 204 <span>&nbsp;</span>
204 <a class="delete" th:href="'javascript:deleted('+${ShyActivity.id}+')'"> 205 <a class="delete" th:href="'javascript:deleted('+${ShyActivity.id}+')'">
205 <button class="btn btn-danger btn-xs">删除</button> 206 <button class="btn btn-danger btn-xs">删除</button>
206 - </a><span> </span><span>&nbsp;</span></td> 207 + </a><span> </span><span>&nbsp;</span>
  208 + </td>
207 </tr> 209 </tr>
208 -  
209 </tbody> 210 </tbody>
210 </table> 211 </table>
211 </div> 212 </div>
@@ -309,11 +310,6 @@ @@ -309,11 +310,6 @@
309 <option value="0" name="未审核">未审免</option> 310 <option value="0" name="未审核">未审免</option>
310 <option value="1" name="已经审核">已经审免</option> 311 <option value="1" name="已经审核">已经审免</option>
311 </select> 312 </select>
312 -  
313 -  
314 - <!-- <input class="form-control" style="width:40%;" type="text" value=""-->  
315 - <!-- id="exempt_from_trial"-->  
316 - <!-- name="exempt_from_trial">-->  
317 </div> 313 </div>
318 </div> 314 </div>
319 315
@@ -358,12 +354,6 @@ @@ -358,12 +354,6 @@
358 <div class="form-group"> 354 <div class="form-group">
359 <label class="control-label col-sm-3" style="font-size: 15px;">审核类型:</label> 355 <label class="control-label col-sm-3" style="font-size: 15px;">审核类型:</label>
360 <div class="col-sm-9" style="margin-top: -5px;margin-bottom: 20px;"> 356 <div class="col-sm-9" style="margin-top: -5px;margin-bottom: 20px;">
361 - <!-- <select class="" id="exempt_from_trial1" name="exempt_from_trial">-->  
362 - <!-- <option value="" name="选择审核类型">审核类型</option>-->  
363 - <!-- <option value="0" name="未审核">未审核</option>-->  
364 - <!-- <option value="1" name="已经审核">已经审核</option>-->  
365 - <!-- </select>-->  
366 -  
367 <input class="form-control" style="width:40%;" type="text" value="0" 357 <input class="form-control" style="width:40%;" type="text" value="0"
368 id="exempt_from_trial1" 358 id="exempt_from_trial1"
369 name="exempt_from_trial"> 359 name="exempt_from_trial">
@@ -430,10 +420,8 @@ @@ -430,10 +420,8 @@
430 $("#id1").val(""); 420 $("#id1").val("");
431 $("#activity1").val(""); 421 $("#activity1").val("");
432 $("#activity1").removeAttr("readonly"); 422 $("#activity1").removeAttr("readonly");
433 -  
434 $("#exempt_from_trial1").val(exempt_from_trial); 423 $("#exempt_from_trial1").val(exempt_from_trial);
435 $("#exempt_from_trial1").attr("readonly", "true"); 424 $("#exempt_from_trial1").attr("readonly", "true");
436 -  
437 $(".write_check input").prop("checked", false); 425 $(".write_check input").prop("checked", false);
438 $("#redirect_url1").val(location.pathname + location.search); 426 $("#redirect_url1").val(location.pathname + location.search);
439 $("#myModalLabel1").text("添加活动名称"); 427 $("#myModalLabel1").text("添加活动名称");