Commit f6990ba5d676856db85106d1748d8338793157fc

Authored by 陈浩
1 parent 8206b6e5

点播审核添加认领和退领功能

src/main/java/com/cnlive/shenhe/controller/UsersController.java
@@ -53,7 +53,7 @@ public class UsersController { @@ -53,7 +53,7 @@ public class UsersController {
53 sessionUser.setLogo(user.getUser_logo()); 53 sessionUser.setLogo(user.getUser_logo());
54 sessionUser.setMaster(user.getMaster()); 54 sessionUser.setMaster(user.getMaster());
55 request.getSession().setAttribute(SessionUser.SESSION_KEY, sessionUser); 55 request.getSession().setAttribute(SessionUser.SESSION_KEY, sessionUser);
56 - return "redirect:http://test.shen.cnlive.com/videos/page?state=0"; 56 + return "redirect:http://test.shen.cnlive.com/videos/page?state=0&receive=true";
57 } 57 }
58 } 58 }
59 return "page/error.html"; 59 return "page/error.html";
src/main/java/com/cnlive/shenhe/controller/VideosController.java
@@ -7,7 +7,6 @@ import com.cnlive.shenhe.bean.ResponseBean; @@ -7,7 +7,6 @@ import com.cnlive.shenhe.bean.ResponseBean;
7 import com.cnlive.shenhe.bean.SessionUser; 7 import com.cnlive.shenhe.bean.SessionUser;
8 import com.cnlive.shenhe.entity.ShyUsers; 8 import com.cnlive.shenhe.entity.ShyUsers;
9 import com.cnlive.shenhe.entity.ShyVideos; 9 import com.cnlive.shenhe.entity.ShyVideos;
10 -import com.cnlive.shenhe.serviceImpl.CommentsServiceImpl;  
11 import com.cnlive.shenhe.serviceImpl.UsersServiceImpl; 10 import com.cnlive.shenhe.serviceImpl.UsersServiceImpl;
12 import com.cnlive.shenhe.serviceImpl.VideosServiceImpl; 11 import com.cnlive.shenhe.serviceImpl.VideosServiceImpl;
13 import com.cnlive.shenhe.utils.AuditPass; 12 import com.cnlive.shenhe.utils.AuditPass;
@@ -54,10 +53,10 @@ public class VideosController { @@ -54,10 +53,10 @@ public class VideosController {
54 SessionUser sessionUser = (SessionUser) session.getAttribute(SessionUser.getSessionKey()); 53 SessionUser sessionUser = (SessionUser) session.getAttribute(SessionUser.getSessionKey());
55 String userId = sessionUser.getUserId(); 54 String userId = sessionUser.getUserId();
56 ShyVideos shyVideos = videosService.selectByPrimaryKey(id); 55 ShyVideos shyVideos = videosService.selectByPrimaryKey(id);
57 - /*if (!shyVideos.getReceive() || CommonUtils.isEmpty(shyVideos.getReceive_user_id()) || !userId.equals(shyVideos.getReceive_user_id())) { 56 + if (!shyVideos.getReceive() || CommonUtils.isEmpty(shyVideos.getReceive_user_id()) || !userId.equals(shyVideos.getReceive_user_id())) {
58 logger.error("领取逻辑不符,不能审核,Video_id:{}", shyVideos.getVideo_id()); 57 logger.error("领取逻辑不符,不能审核,Video_id:{}", shyVideos.getVideo_id());
59 return new ResponseBean(ErrorEnum.ERROR); 58 return new ResponseBean(ErrorEnum.ERROR);
60 - }*/ 59 + }
61 JSONObject result = null; 60 JSONObject result = null;
62 try { 61 try {
63 result = Pass.auditPass(activity_id, state, attr_tags, msg, callback); 62 result = Pass.auditPass(activity_id, state, attr_tags, msg, callback);
@@ -188,13 +187,14 @@ public class VideosController { @@ -188,13 +187,14 @@ public class VideosController {
188 public ResponseBean retReceive(String ids, HttpSession session) { 187 public ResponseBean retReceive(String ids, HttpSession session) {
189 SessionUser sessionUser = (SessionUser) session.getAttribute(SessionUser.getSessionKey()); 188 SessionUser sessionUser = (SessionUser) session.getAttribute(SessionUser.getSessionKey());
190 String userId = sessionUser.getUserId(); 189 String userId = sessionUser.getUserId();
191 - boolean n = videosService.retReceive(ids, userId);  
192 - if (n) {  
193 - return new ResponseBean(ErrorEnum.SUCCESS);  
194 - } else {  
195 - return new ResponseBean(ErrorEnum.ERROR); 190 + //在退领操作前先判断是否包含已退领或者已经审核的数据,有则退回检查并重新退领
  191 + String[] cids = ids.split(",");
  192 + for (String cid : cids) {
  193 + ShyVideos shyVideos = videosService.selectByPrimaryKey(Integer.parseInt(cid));
  194 + if (shyVideos.getState() != CommonConst.AUDIT_INTT || !shyVideos.getReceive() || !shyVideos.getReceive_user_id().equals(userId)) {
  195 + return new ResponseBean(ErrorEnum.ERROR.getErrorCode(), "退领失败,您选中的内容包含已退领的或已经审核的");
  196 + }
196 } 197 }
  198 + return videosService.retReceive(ids, userId);
197 } 199 }
198 -  
199 -  
200 } 200 }
src/main/java/com/cnlive/shenhe/serviceImpl/VideosServiceImpl.java
1 package com.cnlive.shenhe.serviceImpl; 1 package com.cnlive.shenhe.serviceImpl;
2 2
  3 +import com.cnlive.shenhe.bean.ErrorEnum;
  4 +import com.cnlive.shenhe.bean.ResponseBean;
3 import com.cnlive.shenhe.entity.ShySites; 5 import com.cnlive.shenhe.entity.ShySites;
4 import com.cnlive.shenhe.entity.ShyUsers; 6 import com.cnlive.shenhe.entity.ShyUsers;
5 import com.cnlive.shenhe.entity.ShyVideos; 7 import com.cnlive.shenhe.entity.ShyVideos;
@@ -166,23 +168,23 @@ public class VideosServiceImpl { @@ -166,23 +168,23 @@ public class VideosServiceImpl {
166 return n; 168 return n;
167 } 169 }
168 170
169 - public boolean retReceive(String ids, String userId) { 171 + public ResponseBean retReceive(String ids, String userId) {
170 boolean result = true; 172 boolean result = true;
171 String[] cids = ids.split(","); 173 String[] cids = ids.split(",");
172 for (String cid : cids) { 174 for (String cid : cids) {
173 ShyVideos shyVideos = shyVideosMapper.selectByPrimaryKey(Integer.parseInt(cid)); 175 ShyVideos shyVideos = shyVideosMapper.selectByPrimaryKey(Integer.parseInt(cid));
174 - if (shyVideos.getState() == CommonConst.AUDIT_INTT && shyVideos.getReceive() && shyVideos.getReceive_user_id() == userId) { 176 + if (shyVideos.getState() == CommonConst.AUDIT_INTT && shyVideos.getReceive() && shyVideos.getReceive_user_id().equals(userId) ) {
175 shyVideos.setReceive(CommonConst.RECEIVE_BEFORE); 177 shyVideos.setReceive(CommonConst.RECEIVE_BEFORE);
176 shyVideos.setReceive_user_id(null); 178 shyVideos.setReceive_user_id(null);
177 int i = shyVideosMapper.updateByPrimaryKeySelective(shyVideos); 179 int i = shyVideosMapper.updateByPrimaryKeySelective(shyVideos);
178 if (i != 1) { 180 if (i != 1) {
179 - return false; 181 + return new ResponseBean(ErrorEnum.ERROR.getErrorCode(),"退领失败,请重试");
180 } 182 }
181 } else { 183 } else {
182 - return false; 184 + return new ResponseBean(ErrorEnum.ERROR.getErrorCode(),"退领失败,您选中的内容包含已退领的或已经审核的");
183 } 185 }
184 } 186 }
185 - return result; 187 + return new ResponseBean(ErrorEnum.SUCCESS.getErrorCode(),"已退领");
186 } 188 }
187 189
188 190
src/main/resources/templates/page/video.html
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <html lang="zh" xmlns:th="http://www.thymeleaf.org"> 2 <html lang="zh" xmlns:th="http://www.thymeleaf.org">
3 3
4 -<head th:replace="../templates/common/head::head" > 4 +<head th:replace="../templates/common/head::head">
5 </head> 5 </head>
6 6
7 <body class="skin-blue sidebar-mini"> 7 <body class="skin-blue sidebar-mini">
8 8
9 <div class="wrapper"> 9 <div class="wrapper">
10 - <div th:replace="../templates/common/frame::frame" ></div> 10 + <div th:replace="../templates/common/frame::frame"></div>
11 <div class="content-wrapper" style="min-height: 788px;"> 11 <div class="content-wrapper" style="min-height: 788px;">
12 <section class="content-header"> 12 <section class="content-header">
13 <h1> 13 <h1>
@@ -23,16 +23,47 @@ @@ -23,16 +23,47 @@
23 <div class="col-md-12"> 23 <div class="col-md-12">
24 <div class="box box-info"> 24 <div class="box box-info">
25 <div class="box-body"> 25 <div class="box-body">
  26 +
  27 + <div class="btn-group margin-bottom pull-left">
  28 + <input type="hidden" name="state" id="state" value=""/>
  29 + <div class="btn-group margin-bottom" id="hide_select_area_2" style=>
  30 + <button type="button" class="btn btn-success btn-sm margin-r-5 action claim"
  31 + value="2" data="claim" id="claim" data-toggle="modal"
  32 + data-target="#modal" onclick="receive(0);">认领
  33 + </button>
  34 + <button type="button" class="btn btn-success btn-sm margin-r-5 action claim"
  35 + value="2" data="claim100" id="claim100" data-toggle="modal"
  36 + data-target="#modal" onclick="receive(100);">认领100条
  37 + </button>
  38 + <button type="button" class="btn btn-success btn-sm margin-r-5 action claim"
  39 + value="2" data="claim1000" id="claim1000" data-toggle="modal"
  40 + data-target="#modal" onclick="receive(1000);">认领1000条
  41 + </button>
  42 + <button type="button" class="btn btn-warning btn-sm margin-r-5 action claim"
  43 + value="2" data="claim1000" id="claim1000" data-toggle="modal"
  44 + data-target="#modal" onclick="retReceive();">退领
  45 + </button>
  46 + </div>
  47 + </div>
  48 +
  49 +
26 <div class="btn-group margin-bottom pull-right"> 50 <div class="btn-group margin-bottom pull-right">
27 - <button type="button" class="btn btn-sm margin-r-5 filter " th:onclick="'javascript:quanbu()'" value=""> 51 + <button type="button" class="btn btn-sm margin-r-5 filter "
  52 + th:onclick="'javascript:quanbu()'" value="">
28 全部 53 全部
29 </button> 54 </button>
30 </button> 55 </button>
31 - <button type="button" class="btn btn-sm margin-r-5 filter " id="daishen" onclick="javascript:daishen()" value="0">待审 56 + <button type="button" class="btn btn-sm margin-r-5 filter " id="daishen"
  57 + th:onclick="'javascript:daishen()'" value="0">全部待领
  58 + </button>
  59 + <button type="button" class="btn btn-sm margin-r-5 filter " id="Mydaishen"
  60 + th:onclick="'javascript:Mydaishen()'" value="0">我的待审
32 </button> 61 </button>
33 - <button type="button" class="btn btn-sm margin-r-5 filter " id="yishen" th:onclick="'javascript:yishen()'" value="1">已审 62 + <button type="button" class="btn btn-sm margin-r-5 filter " id="yishen"
  63 + th:onclick="'javascript:yishen()'" value="1">我的已审
34 </button> 64 </button>
35 - <button type="button" class="btn btn-primary btn-sm margin-r-5" id="query" onclick="openOrClose(&#39;forms&#39;)">查询 65 + <button type="button" class="btn btn-primary btn-sm margin-r-5" id="query"
  66 + onclick="openOrClose(&#39;forms&#39;)">查询
36 <span id="a_up">▼</span><span id="a_down" style="display: none;">▲</span> 67 <span id="a_up">▼</span><span id="a_down" style="display: none;">▲</span>
37 </button> 68 </button>
38 </div> 69 </div>
@@ -41,7 +72,7 @@ @@ -41,7 +72,7 @@
41 <div class="col-md-5" style="padding: 0;width: 100%;"> 72 <div class="col-md-5" style="padding: 0;width: 100%;">
42 <label for="video_title" class="control-label cb-toolbar">标题:</label> 73 <label for="video_title" class="control-label cb-toolbar">标题:</label>
43 <div class="col-sm-9" style="padding: 0;"> 74 <div class="col-sm-9" style="padding: 0;">
44 - <input class="form-control" type="text" value="" id="video_titleID"> 75 + <input class="form-control" type="text" value="" id="video_titleID">
45 </div> 76 </div>
46 </div> 77 </div>
47 </div> 78 </div>
@@ -49,22 +80,24 @@ @@ -49,22 +80,24 @@
49 <div class="col-md-5" style="padding: 0;width: 100%;"> 80 <div class="col-md-5" style="padding: 0;width: 100%;">
50 <label for="video_title" class="control-label cb-toolbar">热点:</label> 81 <label for="video_title" class="control-label cb-toolbar">热点:</label>
51 <div class="col-sm-9" style="padding: 0;"> 82 <div class="col-sm-9" style="padding: 0;">
52 - <select class="form-control" id="video_priority" name="video_priority" >  
53 - <option value ="">全部</option>  
54 - <option value ="1">是</option>  
55 - <option value ="0">否</option> 83 + <select class="form-control" id="video_priority" name="video_priority">
  84 + <option value="">全部</option>
  85 + <option value="1">是</option>
  86 + <option value="0">否</option>
56 </select> 87 </select>
57 <!--<input class="form-control" name="video_priority" type="text" id="video_priority">--> 88 <!--<input class="form-control" name="video_priority" type="text" id="video_priority">-->
58 </div> 89 </div>
59 </div> 90 </div>
60 </div> 91 </div>
61 92
62 - <div class="btn-group margin-bottom col-md-6 pull-right" style="position: relative;left: -51%;"> 93 + <div class="btn-group margin-bottom col-md-6 pull-right"
  94 + style="position: relative;left: -51%;">
63 <div class="col-md-11" style="width: 84%;padding: 0;"> 95 <div class="col-md-11" style="width: 84%;padding: 0;">
64 <div class="col-md-6" style="padding: 0"> 96 <div class="col-md-6" style="padding: 0">
65 <label for="start_date" class="control-label cb-toolbar">时间:</label> 97 <label for="start_date" class="control-label cb-toolbar">时间:</label>
66 <div class="input-group col-md-9 date"> 98 <div class="input-group col-md-9 date">
67 - <input class="form-control date" name="start_date" type="text" id="start_date"> 99 + <input class="form-control date" name="start_date" type="text"
  100 + id="start_date">
68 <span class="input-group-addon"> 101 <span class="input-group-addon">
69 <span class="glyphicon glyphicon-calendar"></span> 102 <span class="glyphicon glyphicon-calendar"></span>
70 </span> 103 </span>
@@ -73,7 +106,8 @@ @@ -73,7 +106,8 @@
73 <div class="col-md-6" style="padding: 0"> 106 <div class="col-md-6" style="padding: 0">
74 <label for="start_date" class="control-label cb-toolbar">至</label> 107 <label for="start_date" class="control-label cb-toolbar">至</label>
75 <div class="input-group col-md-9 date"> 108 <div class="input-group col-md-9 date">
76 - <input class="form-control date" name="end_date" type="text" id="end_date"> 109 + <input class="form-control date" name="end_date" type="text"
  110 + id="end_date">
77 <span class="input-group-addon"> 111 <span class="input-group-addon">
78 <span class="glyphicon glyphicon-calendar"></span> 112 <span class="glyphicon glyphicon-calendar"></span>
79 </span> 113 </span>
@@ -83,81 +117,154 @@ @@ -83,81 +117,154 @@
83 </div> 117 </div>
84 <div class="btn-group margin-bottom col-md-6" style="padding: 0;"> 118 <div class="btn-group margin-bottom col-md-6" style="padding: 0;">
85 <div class="col-md-1 text-center" style="width: 12%;padding: 0;float: right;"> 119 <div class="col-md-1 text-center" style="width: 12%;padding: 0;float: right;">
86 - <button type="button" class="btn btn-primary btn-sm" id="videos_query">查 询</button> 120 + <button type="button" class="btn btn-primary btn-sm" id="videos_query">查 询
  121 + </button>
87 </div> 122 </div>
88 </div> 123 </div>
89 </div> 124 </div>
90 125
91 - <div class="fixed-table-container" style="padding-bottom: 0px;">  
92 - <div class="fixed-table-body">  
93 - <table id="table" data-toggle="table" class="table table-hover table-striped">  
94 - <thead>  
95 - <tr>  
96 - <!--<th class="bs-checkbox " style="text-align: center; width: 5%; " data-field="state" tabindex="0">-->  
97 - <!--<div class="th-inner "><input name="btSelectAll" type="checkbox"></div>-->  
98 - <!--<div class="fht-cell"></div>-->  
99 - <!--</th>-->  
100 - <th style="text-align: center; width: 6%; " data-field="sp_id_brief" tabindex="0"><div class="th-inner ">spid</div><div class="fht-cell"></div></th>  
101 - <th style="text-align: center; width: 20%; " data-field="video_title" tabindex="0"><div class="th-inner ">标题</div><div class="fht-cell"></div></th>  
102 - <!--<th style="text-align: center; width: 10%; " data-field="video_cover_img" tabindex="0"><div class="th-inner ">点播封面图</div><div class="fht-cell"></div></th>-->  
103 - <th style="text-align: center; width: 6%; " data-field="auditor" tabindex="0"><div class="th-inner ">审核员</div><div class="fht-cell"></div></th>  
104 - <th style="text-align: center; width: 3%; " data-field="is_hot_name" tabindex="0"><div class="th-inner ">热点</div><div class="fht-cell"></div></th>  
105 - <th style="text-align: center; width: 3%; " data-field="state_name" tabindex="0"><div class="th-inner ">审核状态</div><div class="fht-cell"></div></th>  
106 - <th style="text-align: center; width: 10%; " data-field="upload_time" tabindex="0"><div class="th-inner ">视频上传时间</div><div class="fht-cell"></div></th>  
107 - <th style="text-align: center; width: 17%; " data-field="action" tabindex="0"><div class="th-inner ">操作</div><div class="fht-cell"></div></th>  
108 - </tr>  
109 - </thead>  
110 - <tbody>  
111 - <tr data-index="0" th:each="video : ${videoPage.list}">  
112 - <!--<td class="bs-checkbox "><input data-index="0" name="btSelectItem" type="checkbox"></td>-->  
113 - <td style="text-align: center; width: 6%;" th:text="${video.spid}"></td>  
114 - <td style="text-align: center; width: 20%;" th:text="${video.video_title}">邓建国正面PK冯小刚 </td>  
115 - <!--<td style="text-align: center; width: 10%;">-->  
116 - <!--<div width="160px" height="90px"><img th:src="@{${video.video_poster}}" width="160px" alt="封面图"></div>-->  
117 - <!--</td>-->  
118 - <td style="text-align: center; width: 6%;" th:text="${video.auditor}">审核员</td>  
119 - <td style="text-align: center; width: 3%;" th:text="${video.video_priority=='1'?'是':'否'}">是</td>  
120 - <td style="text-align: center; width: 3%;">  
121 - <span class="btn btn-sm btn-warning" th:if="${video.state==0}">待审</span>  
122 - <span class="btn btn-sm btn-success" th:if="${video.state==1}">通过</span>  
123 - <span class="btn btn-sm btn-danger" th:if="${video.state==2}">拒绝</span>  
124 - </td>  
125 - <td style="text-align: center; width: 10%;" th:text="${#dates.format(video.video_upload_time, 'yyyy-MM-dd HH:mm:ss')}">2018-03-07 16:56:20</td>  
126 - <td style="text-align: center; width: 17%;">  
127 - <a class="detail" th:href="@{'/videos/details/?id='+${video.id}}">  
128 - <button class="btn btn-default btn-sm" >查看</button>  
129 - </a>  
130 - </td>  
131 - </tr>  
132 - </tbody>  
133 - </table>  
134 - </div> 126 + <div class="fixed-table-container" style="padding-bottom: 0px;">
  127 + <div class="fixed-table-body">
  128 + <table id="table" data-toggle="table" class="table table-hover table-striped">
  129 + <thead>
  130 + <tr>
  131 + <th class="bs-checkbox " style="width: 5%; " data-field="state"
  132 + tabindex="0">
  133 + <div class="th-inner "><input name="btSelectAll" type="checkbox"
  134 + id="select_all">
  135 + </div>
  136 + <div class="fht-cell"></div>
  137 + </th>
  138 + <th style="text-align: center; width: 6%; " data-field="sp_id_brief"
  139 + tabindex="0">
  140 + <div class="th-inner ">spid</div>
  141 + <div class="fht-cell"></div>
  142 + </th>
  143 + <th style="text-align: center; width: 20%; " data-field="video_title"
  144 + tabindex="0">
  145 + <div class="th-inner ">标题</div>
  146 + <div class="fht-cell"></div>
  147 + </th>
  148 + <!--<th style="text-align: center; width: 10%; " data-field="video_cover_img" tabindex="0"><div class="th-inner ">点播封面图</div><div class="fht-cell"></div></th>-->
  149 + <th style="text-align: center; width: 6%; " data-field="auditor"
  150 + tabindex="0">
  151 + <div class="th-inner ">审核员</div>
  152 + <div class="fht-cell"></div>
  153 + </th>
  154 + <th style="text-align: center; width: 3%; " data-field="is_hot_name"
  155 + tabindex="0">
  156 + <div class="th-inner ">热点</div>
  157 + <div class="fht-cell"></div>
  158 + </th>
  159 + <th style="text-align: center; width: 3%; " data-field="state_name"
  160 + tabindex="0">
  161 + <div class="th-inner ">审核状态</div>
  162 + <div class="fht-cell"></div>
  163 + </th>
  164 + <th style="text-align: center; width: 10%; " data-field="upload_time"
  165 + tabindex="0">
  166 + <div class="th-inner ">视频上传时间</div>
  167 + <div class="fht-cell"></div>
  168 + </th>
  169 + <th style="text-align: center; width: 17%; " data-field="action"
  170 + tabindex="0">
  171 + <div class="th-inner ">操作</div>
  172 + <div class="fht-cell"></div>
  173 + </th>
  174 + </tr>
  175 + </thead>
  176 + <tbody>
  177 + <tr data-index="0" th:each="video : ${videoPage.list}">
  178 + <td class="bs-checkbox "><input data-index="0" name="btSelectItem"
  179 + type="checkbox" th:value="${video.id}"></td>
  180 + <td style="text-align: center; width: 6%;" th:text="${video.spid}"></td>
  181 + <td style="text-align: center; width: 20%;" th:text="${video.video_title}">
  182 + 邓建国正面PK冯小刚
  183 + </td>
  184 + <!--<td style="text-align: center; width: 10%;">-->
  185 + <!--<div width="160px" height="90px"><img th:src="@{${video.video_poster}}" width="160px" alt="封面图"></div>-->
  186 + <!--</td>-->
  187 + <td style="text-align: center; width: 6%;" th:text="${video.auditor}">审核员
  188 + </td>
  189 + <td style="text-align: center; width: 3%;"
  190 + th:text="${video.video_priority=='1'?'是':'否'}">是
  191 + </td>
  192 + <td style="text-align: center; width: 3%;">
  193 + <span class="btn btn-sm btn-warning" th:if="${video.state==0}">待审</span>
  194 + <span class="btn btn-sm btn-success" th:if="${video.state==1}">通过</span>
  195 + <span class="btn btn-sm btn-danger" th:if="${video.state==2}">拒绝</span>
  196 + </td>
  197 + <td style="text-align: center; width: 10%;"
  198 + th:text="${#dates.format(video.video_upload_time, 'yyyy-MM-dd HH:mm:ss')}">
  199 + 2018-03-07 16:56:20
  200 + </td>
  201 + <td style="text-align: center; width: 17%;">
  202 + <a class="detail" th:href="@{'/videos/details/?id='+${video.id}}"
  203 + th:if="${ (video.receive==true and session.sessionUser.userId==video.receive_user_id) or (video.state==1 or video.state==2) }">
  204 + <button class="btn btn-default btn-sm">查看</button>
  205 + </a>
  206 + <span th:if="${video.state==0 and !video.receive}"> &nbsp;</span>
  207 + <a th:href="@{'javascript:applyReceive('+${video.id}+')'}"
  208 + th:if="${video.state==0 and !video.receive}">
  209 + <button class="btn btn-primary btn-sm">认领</button>
  210 + </a>
  211 + <span th:if="${video.state==0 and video.receive and session.sessionUser.userId==video.receive_user_id}"> &nbsp;</span>
  212 + <a th:href="@{'javascript:applyRetReceive('+${video.id}+')'}"
  213 + th:if="${video.state==0 and video.receive and session.sessionUser.userId==video.receive_user_id}">
  214 + <button class="btn btn-warning btn-sm">退领</button>
  215 + </a>
  216 + </td>
  217 + </tr>
  218 + </tbody>
  219 + </table>
  220 + </div>
135 221
136 222
137 - <!--分页处理-->  
138 - <div class="fixed-table-pagination" style="display: block;">  
139 - <div class="pull-left pagination-detail"><span class="pagination-info" th:text="'共 '+${videoPage.total}+' 条记录'">共 0 条记录</span></div>  
140 - <div class="pull-right pagination">  
141 - <ul class="pagination" th:if="${videoPage.pages>1}">  
142 - <li class="page-pre"><a th:href="@{'/videos/page'}">‹‹</a></li>  
143 - <li class="page-pre" th:if="${!videoPage.isFirstPage}"><a th:onclick="'javascript:fanye(\''+${videoPage.pageNum-1}+'\');'">‹</a></li> 223 + <!--分页处理-->
  224 + <div class="fixed-table-pagination" style="display: block;">
  225 + <div class="pull-left pagination-detail"><span class="pagination-info"
  226 + th:text="'共 '+${videoPage.total}+' 条记录'">共 0 条记录</span>
  227 + </div>
  228 + <div class="pull-right pagination">
  229 + <ul class="pagination" th:if="${videoPage.pages>1}">
  230 + <li class="page-pre"><a th:href="@{'/videos/page'}">‹‹</a></li>
  231 + <li class="page-pre" th:if="${!videoPage.isFirstPage}"><a
  232 + th:onclick="'javascript:fanye(\''+${videoPage.pageNum-1}+'\');'">‹</a>
  233 + </li>
144 234
145 - <li class="page-number" th:if="${videoPage.pageNum-3>=1}"><a th:onclick="'javascript:fanye(\''+${videoPage.pageNum-3}+'\');'" th:text="${videoPage.pageNum-3}">2</a></li>  
146 - <li class="page-number" th:if="${videoPage.pageNum-2>=1}"><a th:onclick="'javascript:fanye(\''+${videoPage.pageNum-2}+'\');'" th:text="${videoPage.pageNum-2}">2</a></li>  
147 - <li class="page-number" th:if="${videoPage.pageNum-1>=1}"><a th:onclick="'javascript:fanye(\''+${videoPage.pageNum-1}+'\');'" th:text="${videoPage.pageNum-1}">2</a></li>  
148 - <li class="page-number active"><a href="javaScript:void(0);" th:text="${videoPage.pageNum}">2</a></li>  
149 - <li class="page-number" th:if="${videoPage.pageNum+1<=videoPage.pages}"><a th:onclick="'javascript:fanye(\''+${videoPage.pageNum+1}+'\');'" th:text="${videoPage.pageNum+1}">2</a></li>  
150 - <li class="page-number" th:if="${videoPage.pageNum+2<=videoPage.pages}"><a th:onclick="'javascript:fanye(\''+${videoPage.pageNum+2}+'\');'" th:text="${videoPage.pageNum+2}">2</a></li>  
151 - <li class="page-number" th:if="${videoPage.pageNum+3<=videoPage.pages}"><a th:onclick="'javascript:fanye(\''+${videoPage.pageNum+3}+'\');'" th:text="${videoPage.pageNum+3}">2</a></li> 235 + <li class="page-number" th:if="${videoPage.pageNum-3>=1}"><a
  236 + th:onclick="'javascript:fanye(\''+${videoPage.pageNum-3}+'\');'"
  237 + th:text="${videoPage.pageNum-3}">2</a></li>
  238 + <li class="page-number" th:if="${videoPage.pageNum-2>=1}"><a
  239 + th:onclick="'javascript:fanye(\''+${videoPage.pageNum-2}+'\');'"
  240 + th:text="${videoPage.pageNum-2}">2</a></li>
  241 + <li class="page-number" th:if="${videoPage.pageNum-1>=1}"><a
  242 + th:onclick="'javascript:fanye(\''+${videoPage.pageNum-1}+'\');'"
  243 + th:text="${videoPage.pageNum-1}">2</a></li>
  244 + <li class="page-number active"><a href="javaScript:void(0);"
  245 + th:text="${videoPage.pageNum}">2</a></li>
  246 + <li class="page-number" th:if="${videoPage.pageNum+1<=videoPage.pages}"><a
  247 + th:onclick="'javascript:fanye(\''+${videoPage.pageNum+1}+'\');'"
  248 + th:text="${videoPage.pageNum+1}">2</a></li>
  249 + <li class="page-number" th:if="${videoPage.pageNum+2<=videoPage.pages}"><a
  250 + th:onclick="'javascript:fanye(\''+${videoPage.pageNum+2}+'\');'"
  251 + th:text="${videoPage.pageNum+2}">2</a></li>
  252 + <li class="page-number" th:if="${videoPage.pageNum+3<=videoPage.pages}"><a
  253 + th:onclick="'javascript:fanye(\''+${videoPage.pageNum+3}+'\');'"
  254 + th:text="${videoPage.pageNum+3}">2</a></li>
152 255
153 - <li class="page-next" th:if="${!videoPage.isLastPage}"><a th:onclick="'javascript:fanye(\''+${videoPage.pageNum+1}+'\');'">›</a></li>  
154 - <li class="page-next"><a th:onclick="'javascript:fanye(\''+${videoPage.pages}+'\');'">››</a></li>  
155 - </ul> 256 + <li class="page-next" th:if="${!videoPage.isLastPage}"><a
  257 + th:onclick="'javascript:fanye(\''+${videoPage.pageNum+1}+'\');'">›</a>
  258 + </li>
  259 + <li class="page-next"><a
  260 + th:onclick="'javascript:fanye(\''+${videoPage.pages}+'\');'">››</a>
  261 + </li>
  262 + </ul>
  263 + </div>
  264 + </div>
156 </div> 265 </div>
157 </div> 266 </div>
158 </div> 267 </div>
159 - </div>  
160 - </div>  
161 </div> 268 </div>
162 </div> 269 </div>
163 </section> 270 </section>
@@ -166,51 +273,156 @@ @@ -166,51 +273,156 @@
166 //翻页函数 273 //翻页函数
167 function fanye(page) { 274 function fanye(page) {
168 var param = location.search; 275 var param = location.search;
169 - if (param.indexOf("page=")!= -1) {  
170 - if(page < 10){  
171 - param = param.substring(1,param.length-7);  
172 - }else if (page < 100){  
173 - param = param.substring(1,param.length-8);  
174 - }else if (page < 1000){  
175 - param = param.substring(1,param.length-9);  
176 - }else if (page < 10000) {  
177 - param = param.substring(1,param.length-10); 276 + if (param.indexOf("page=") != -1) {
  277 + if (page < 10) {
  278 + param = param.substring(1, param.length - 7);
  279 + } else if (page < 100) {
  280 + param = param.substring(1, param.length - 8);
  281 + } else if (page < 1000) {
  282 + param = param.substring(1, param.length - 9);
  283 + } else if (page < 10000) {
  284 + param = param.substring(1, param.length - 10);
178 } 285 }
179 - window.location.href = "/videos/page?"+param+"&page="+page;  
180 - }else {  
181 - param = param.substring(1,param.length);  
182 - window.location.href = "/videos/page?"+param+"&page="+page; 286 + window.location.href = "/videos/page?" + param + "&page=" + page;
  287 + } else {
  288 + param = param.substring(1, param.length);
  289 + window.location.href = "/videos/page?" + param + "&page=" + page;
183 } 290 }
184 } 291 }
185 - //待审核 292 +
  293 + //全部
  294 + function quanbu() {
  295 + window.location.href = "page";
  296 + }
  297 +
  298 + //全部待审核/我的待审核
186 $('#daishen').click(function () { 299 $('#daishen').click(function () {
187 var state = 0; 300 var state = 0;
  301 + var receive = false;
188 var video_priority = $("#video_priority").val(); 302 var video_priority = $("#video_priority").val();
189 var video_title = $("#video_titleID").val(); 303 var video_title = $("#video_titleID").val();
190 var start_date = $("#start_date").val(); 304 var start_date = $("#start_date").val();
191 var end_date = $("#end_date").val(); 305 var end_date = $("#end_date").val();
192 - window.location.href = "page?video_title="+video_title+"&start_date="+start_date+"&end_date="+end_date+"&state="+state+"&video_priority="+video_priority; 306 + window.location.href = "page?video_title=" + video_title + "&start_date=" + start_date + "&end_date=" + end_date + "&state=" + state + "&receive=" + receive + "&video_priority=" + video_priority;
193 }); 307 });
194 - //已审核 308 + //我的待审核
  309 + $('#Mydaishen').click(function () {
  310 + var state = 0;
  311 + var receive = true;
  312 + var video_priority = $("#video_priority").val();
  313 + var video_title = $("#video_titleID").val();
  314 + var start_date = $("#start_date").val();
  315 + var end_date = $("#end_date").val();
  316 + window.location.href = "page?video_title=" + video_title + "&start_date=" + start_date + "&end_date=" + end_date + "&state=" + state + "&receive=" + receive + "&video_priority=" + video_priority;
  317 + });
  318 + //我的已审核
195 $('#yishen').click(function () { 319 $('#yishen').click(function () {
196 var state = 1; 320 var state = 1;
197 var video_priority = $("#video_priority").val(); 321 var video_priority = $("#video_priority").val();
198 var video_title = $("#video_titleID").val(); 322 var video_title = $("#video_titleID").val();
199 var start_date = $("#start_date").val(); 323 var start_date = $("#start_date").val();
200 var end_date = $("#end_date").val(); 324 var end_date = $("#end_date").val();
201 - window.location.href = "page?video_title="+video_title+"&start_date="+start_date+"&end_date="+end_date+"&state="+state+"&video_priority="+video_priority; 325 + window.location.href = "page?video_title=" + video_title + "&start_date=" + start_date + "&end_date=" + end_date + "&state=" + state + "&video_priority=" + video_priority;
202 }); 326 });
203 - function quanbu() {  
204 - window.location.href = "page";  
205 - } 327 +
  328 +
206 //查询 329 //查询
207 $('#videos_query').click(function () { 330 $('#videos_query').click(function () {
208 var video_priority = $("#video_priority").val(); 331 var video_priority = $("#video_priority").val();
209 var video_title = $("#video_titleID").val(); 332 var video_title = $("#video_titleID").val();
210 var start_date = $("#start_date").val(); 333 var start_date = $("#start_date").val();
211 var end_date = $("#end_date").val(); 334 var end_date = $("#end_date").val();
212 - window.location.href = "/videos/page?video_title="+video_title+"&start_date="+start_date+"&end_date="+end_date+"&state=&video_priority="+video_priority; 335 + window.location.href = "/videos/page?video_title=" + video_title + "&start_date=" + start_date + "&end_date=" + end_date + "&state=&video_priority=" + video_priority;
213 }); 336 });
  337 + /*全选的操作*/
  338 + $('#select_all').click(function () {
  339 + if ($("[name=btSelectItem]:checkbox:not(:checked)").length > 0) {
  340 + $("#select_all").prop('checked', true);
  341 + $("[name=btSelectItem]:checkbox").each(function () {
  342 + $(this).prop('checked', true);
  343 + });
  344 + } else {
  345 + $("#select_all").prop('checked', false);
  346 + $("[name=btSelectItem]:checkbox").each(function () {
  347 + $(this).prop('checked', false);
  348 + });
  349 + }
  350 + });
  351 +
  352 + /**
  353 + * 认领
  354 + */
  355 + function receive(n) {
  356 + if (n > 0) {
  357 + applyReceiveNum(n);
  358 + } else {
  359 + var rows = $("[name=btSelectItem]:checkbox:checked");
  360 + if (rows.length > 0) {
  361 + var ids = "";
  362 + rows.each(function (i, e) {
  363 + ids = ids + "," + e.value;
  364 + })
  365 + ids = ids.substring(1);
  366 + applyReceive(ids);
  367 + } else {
  368 + alert("请选择要认领的内容!");
  369 + }
  370 + }
  371 + }
  372 +
  373 + //认领选中请求
  374 + function applyReceive(ids) {
  375 + $.post("/videos/receive?ids=" + ids, function (data) {
  376 + if (data.errorCode == 0) {
  377 + alert(data.errorMessage);
  378 + location.href = location.href;
  379 + } else {
  380 + alert(data.errorMessage);
  381 + }
  382 + })
  383 + }
  384 +
  385 + //认领多条请求
  386 + function applyReceiveNum(num) {
  387 + $.post("/videos/receive?num=" + num, function (data) {
  388 + if (data.errorCode == 0) {
  389 + alert(data.errorMessage);
  390 + location.href = location.href;
  391 + } else {
  392 + alert(data.errorMessage);
  393 + }
  394 + })
  395 + }
  396 +
  397 + //退领选中内容
  398 + function retReceive() {
  399 + var rows = $("[name=btSelectItem]:checkbox:checked");
  400 + if (rows.length > 0) {
  401 + var r = confirm("您确定退领选中的" + rows.length + "条评论吗?");
  402 + if (r == true) {
  403 + var ids = "";
  404 + rows.each(function (i, e) {
  405 + ids = ids + "," + e.value;
  406 + })
  407 + ids = ids.substring(1);
  408 + applyRetReceive(ids);
  409 + }
  410 + } else {
  411 + alert("没有选中的数据!");
  412 + }
  413 + }
  414 +
  415 + //退领
  416 + function applyRetReceive(ids) {
  417 + $.post("/videos/retReceive?ids=" + ids, function (data) {
  418 + if (data.errorCode == 0) {
  419 + alert(data.errorMessage);
  420 + location.href = location.href;
  421 + } else {
  422 + alert(data.errorMessage);
  423 + }
  424 + })
  425 + }
214 </script> 426 </script>
215 <!--保留之前的样式代码--> 427 <!--保留之前的样式代码-->
216 <script> 428 <script>
@@ -242,6 +454,7 @@ @@ -242,6 +454,7 @@
242 $('#state').val(object['state']); 454 $('#state').val(object['state']);
243 }); 455 });
244 $('#a_down').hide(); 456 $('#a_down').hide();
  457 +
245 /*查询样式*/ 458 /*查询样式*/
246 function openOrClose(id_name_str) { 459 function openOrClose(id_name_str) {
247 var id_name = '#' + id_name_str; 460 var id_name = '#' + id_name_str;