Commit f72d5f7a2531ecaa153cd1275f76b09a1921e0e6
1 parent
f27a09d9
点播审核模块优化
Showing
4 changed files
with
27 additions
and
29 deletions
src/main/java/com/cnlive/shenhe/controller/ShyActivityController.java
| ... | ... | @@ -15,6 +15,7 @@ import org.springframework.ui.Model; |
| 15 | 15 | import org.springframework.web.bind.annotation.*; |
| 16 | 16 | |
| 17 | 17 | import java.util.Date; |
| 18 | +import java.util.List; | |
| 18 | 19 | |
| 19 | 20 | |
| 20 | 21 | /** |
| ... | ... | @@ -64,6 +65,10 @@ public class ShyActivityController { |
| 64 | 65 | @GetMapping("/page") |
| 65 | 66 | public String getShyActivity(@RequestParam(defaultValue = "1") Integer pageNum, @RequestParam(defaultValue = "10") Integer pageSize, Model model, String activity, String exempt_from_trial) { |
| 66 | 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 | 72 | model.addAttribute("ShyActivitylist", shyActivityPageInfo); |
| 68 | 73 | return "page/activity.html"; |
| 69 | 74 | } | ... | ... |
src/main/java/com/cnlive/shenhe/serviceImpl/ShyActivityImpl.java
| 1 | 1 | package com.cnlive.shenhe.serviceImpl; |
| 2 | 2 | |
| 3 | 3 | |
| 4 | +import com.cnlive.shenhe.dto.ShyActivityDTO; | |
| 4 | 5 | import com.cnlive.shenhe.entity.ShyActivity; |
| 5 | 6 | import com.cnlive.shenhe.mapper.ShyActivityMapper; |
| 6 | 7 | import com.cnlive.shenhe.utils.CommonUtils; |
| 8 | +import com.github.pagehelper.Page; | |
| 7 | 9 | import com.github.pagehelper.PageHelper; |
| 8 | 10 | import com.github.pagehelper.PageInfo; |
| 9 | 11 | import org.springframework.beans.factory.annotation.Autowired; |
| 10 | 12 | import org.springframework.stereotype.Service; |
| 13 | +import org.springframework.web.bind.annotation.RequestParam; | |
| 11 | 14 | import tk.mybatis.mapper.entity.Example; |
| 12 | 15 | |
| 16 | +import java.security.PublicKey; | |
| 13 | 17 | import java.util.Date; |
| 14 | 18 | import java.util.List; |
| 15 | 19 | |
| ... | ... | @@ -68,12 +72,11 @@ public class ShyActivityImpl { |
| 68 | 72 | |
| 69 | 73 | /** |
| 70 | 74 | * 查询活动 |
| 71 | - * | |
| 72 | 75 | * @param pageNum |
| 73 | 76 | * @param pageSize |
| 74 | 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 | 80 | Example example = new Example(ShyActivity.class); |
| 78 | 81 | //如果为空 按照倒序排序 分页查询所有 |
| 79 | 82 | //以创建时间为条件进行倒序 |
| ... | ... | @@ -82,8 +85,8 @@ public class ShyActivityImpl { |
| 82 | 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 | 92 | if (CommonUtils.isNotEmpty(activity)) { | ... | ... |
src/main/java/com/cnlive/shenhe/serviceImpl/VideosServiceImpl.java
| ... | ... | @@ -122,8 +122,6 @@ public class VideosServiceImpl { |
| 122 | 122 | Timestamp startdate = null; |
| 123 | 123 | Timestamp enddate = null; |
| 124 | 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 | 125 | startdate = CommonUtils.parseDate(start_date, "yyyy-MM-dd"); |
| 128 | 126 | enddate = CommonUtils.parseDate(end_date, "yyyy-MM-dd"); |
| 129 | 127 | } catch (ParseException e) { |
| ... | ... | @@ -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 | 162 | criteria.andEqualTo("source", source); |
| 164 | 163 | criteria2.andEqualTo("source", source); |
| 165 | - } else if (CommonUtils.isNotEmpty(source) && "moment".equals(source)) { | |
| 164 | + } else if (CommonUtils.isNotEmpty(source) && "22".equals(source)) { | |
| 166 | 165 | criteria.andEqualTo("category", source); |
| 167 | 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 | 174 | if (CommonUtils.isNotEmpty(video_user_id)) { |
| ... | ... | @@ -296,8 +300,6 @@ public class VideosServiceImpl { |
| 296 | 300 | Timestamp startdate = null; |
| 297 | 301 | Timestamp enddate = null; |
| 298 | 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 | 303 | startdate = CommonUtils.parseDate(start_date, "yyyy-MM-dd"); |
| 302 | 304 | enddate = CommonUtils.parseDate(end_date, "yyyy-MM-dd"); |
| 303 | 305 | } catch (ParseException e) { |
| ... | ... | @@ -470,7 +472,7 @@ public class VideosServiceImpl { |
| 470 | 472 | //审核类型,1:免审,2:机审,3:人工审 |
| 471 | 473 | Integer shenheType = 3; |
| 472 | 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 | 477 | shenheType = 1; |
| 476 | 478 | } else { | ... | ... |
src/main/resources/templates/page/activity.html
| ... | ... | @@ -116,8 +116,10 @@ |
| 116 | 116 | <label for="sp_id" class="control-label cb-toolbar" |
| 117 | 117 | style="font-size: 15px; top: 8px; font-weight: 100;">是否审核:</label> |
| 118 | 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 | 123 | <option value="0" name="未审核">未审免</option> |
| 122 | 124 | <option value="1" name="已经审核">已经审免</option> |
| 123 | 125 | </select> |
| ... | ... | @@ -193,7 +195,6 @@ |
| 193 | 195 | 14:27:17 |
| 194 | 196 | </td> |
| 195 | 197 | |
| 196 | - | |
| 197 | 198 | <td style="text-align: center; width: 10%;"> |
| 198 | 199 | <span> </span> |
| 199 | 200 | <a class="edit" |
| ... | ... | @@ -203,9 +204,9 @@ |
| 203 | 204 | <span> </span> |
| 204 | 205 | <a class="delete" th:href="'javascript:deleted('+${ShyActivity.id}+')'"> |
| 205 | 206 | <button class="btn btn-danger btn-xs">删除</button> |
| 206 | - </a><span> </span><span> </span></td> | |
| 207 | + </a><span> </span><span> </span> | |
| 208 | + </td> | |
| 207 | 209 | </tr> |
| 208 | - | |
| 209 | 210 | </tbody> |
| 210 | 211 | </table> |
| 211 | 212 | </div> |
| ... | ... | @@ -309,11 +310,6 @@ |
| 309 | 310 | <option value="0" name="未审核">未审免</option> |
| 310 | 311 | <option value="1" name="已经审核">已经审免</option> |
| 311 | 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 | 313 | </div> |
| 318 | 314 | </div> |
| 319 | 315 | |
| ... | ... | @@ -358,12 +354,6 @@ |
| 358 | 354 | <div class="form-group"> |
| 359 | 355 | <label class="control-label col-sm-3" style="font-size: 15px;">审核类型:</label> |
| 360 | 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 | 357 | <input class="form-control" style="width:40%;" type="text" value="0" |
| 368 | 358 | id="exempt_from_trial1" |
| 369 | 359 | name="exempt_from_trial"> |
| ... | ... | @@ -430,10 +420,8 @@ |
| 430 | 420 | $("#id1").val(""); |
| 431 | 421 | $("#activity1").val(""); |
| 432 | 422 | $("#activity1").removeAttr("readonly"); |
| 433 | - | |
| 434 | 423 | $("#exempt_from_trial1").val(exempt_from_trial); |
| 435 | 424 | $("#exempt_from_trial1").attr("readonly", "true"); |
| 436 | - | |
| 437 | 425 | $(".write_check input").prop("checked", false); |
| 438 | 426 | $("#redirect_url1").val(location.pathname + location.search); |
| 439 | 427 | $("#myModalLabel1").text("添加活动名称"); | ... | ... |