Commit e065ccb0273ee48f78262d8bc616dcfcffda4990

Authored by liwei2917
1 parent c83bc79f

修改时间的显示和时间的查询

src/main/java/com/cnlive/shenhe/api/CommentsControllerApi.java
@@ -56,7 +56,7 @@ public class CommentsControllerApi { @@ -56,7 +56,7 @@ public class CommentsControllerApi {
56 shyComments1.setComment_content(json.getString("commentContent")); 56 shyComments1.setComment_content(json.getString("commentContent"));
57 String commentTime = json.getString("commentTime"); 57 String commentTime = json.getString("commentTime");
58 if (CommonUtils.isNotEmpty(commentTime)) { 58 if (CommonUtils.isNotEmpty(commentTime)) {
59 - Date timestamp = CommonUtils.getTimestamp(commentTime, "yyyy-MM-dd hh:mm"); 59 + Date timestamp = CommonUtils.getTimestamp(commentTime, "yyyy-MM-dd HH:mm:ss");
60 shyComments1.setComment_time(timestamp); 60 shyComments1.setComment_time(timestamp);
61 61
62 } 62 }
@@ -85,7 +85,7 @@ public class CommentsControllerApi { @@ -85,7 +85,7 @@ public class CommentsControllerApi {
85 shyComments.setComment_content(json.getString("commentContent")); 85 shyComments.setComment_content(json.getString("commentContent"));
86 String commentTime = json.getString("commentTime"); 86 String commentTime = json.getString("commentTime");
87 if (CommonUtils.isNotEmpty(commentTime)) { 87 if (CommonUtils.isNotEmpty(commentTime)) {
88 - Date timestamp = CommonUtils.getTimestamp(commentTime, "yyyy-MM-dd hh:mm"); 88 + Date timestamp = CommonUtils.getTimestamp(commentTime, "yyyy-MM-dd HH:mm:ss");
89 shyComments.setComment_time(timestamp); 89 shyComments.setComment_time(timestamp);
90 } 90 }
91 shyComments.setSpid(json.getInteger("spId")); 91 shyComments.setSpid(json.getInteger("spId"));
src/main/java/com/cnlive/shenhe/controller/CommentsController.java
@@ -66,13 +66,13 @@ public class CommentsController { @@ -66,13 +66,13 @@ public class CommentsController {
66 66
67 if (CommonUtils.isNotEmpty(start_date)) { 67 if (CommonUtils.isNotEmpty(start_date)) {
68 try { 68 try {
69 - sDate = CommonUtils.parseDate(start_date, "yyyy-MM-dd hh:mm"); 69 + sDate = CommonUtils.parseDate(start_date, "yyyy-MM-dd");
70 } catch (Exception e) { 70 } catch (Exception e) {
71 } 71 }
72 } 72 }
73 if (CommonUtils.isNotEmpty(end_date)) { 73 if (CommonUtils.isNotEmpty(end_date)) {
74 try { 74 try {
75 - eDate = CommonUtils.parseDate(end_date, "yyyy-MM-dd hh:mm"); 75 + eDate = CommonUtils.parseDate(end_date, "yyyy-MM-dd");
76 } catch (Exception e) { 76 } catch (Exception e) {
77 } 77 }
78 } 78 }
src/main/java/com/cnlive/shenhe/controller/VideosController.java
@@ -259,7 +259,7 @@ public class VideosController { @@ -259,7 +259,7 @@ public class VideosController {
259 * @param response 259 * @param response
260 */ 260 */
261 @GetMapping("excel") 261 @GetMapping("excel")
262 - public void getExcel(String video_title, String start_date, String end_date, Integer state, Boolean receive, String video_priority, String orderByClause, HttpSession session, HttpServletResponse response) { 262 + public void getExcel(String video_title, String start_date, String end_date, Integer state, Integer receive, String video_priority, String orderByClause, HttpSession session, HttpServletResponse response) {
263 SessionUser sessionUser = (SessionUser) session.getAttribute(SessionUser.getSessionKey()); 263 SessionUser sessionUser = (SessionUser) session.getAttribute(SessionUser.getSessionKey());
264 Integer spid = sessionUser.getSpid(); 264 Integer spid = sessionUser.getSpid();
265 String userId = sessionUser.getUserId(); 265 String userId = sessionUser.getUserId();
src/main/java/com/cnlive/shenhe/serviceImpl/VideosServiceImpl.java
@@ -123,15 +123,17 @@ public class VideosServiceImpl { @@ -123,15 +123,17 @@ public class VideosServiceImpl {
123 Timestamp startdate = null; 123 Timestamp startdate = null;
124 Timestamp enddate = null; 124 Timestamp enddate = null;
125 try { 125 try {
126 - startdate = CommonUtils.parseDate(start_date, "yyyy-MM-dd HH:mm:ss");  
127 - enddate = CommonUtils.parseDate(end_date, "yyyy-MM-dd HH:mm:ss"); 126 +// startdate = CommonUtils.parseDate(start_date, "yyyy-MM-dd HH:mm:ss");
  127 +// enddate = CommonUtils.parseDate(end_date, "yyyy-MM-dd HH:mm:ss");
  128 + startdate = CommonUtils.parseDate(start_date, "yyyy-MM-dd");
  129 + enddate = CommonUtils.parseDate(end_date, "yyyy-MM-dd");
128 } catch (ParseException e) { 130 } catch (ParseException e) {
129 e.printStackTrace(); 131 e.printStackTrace();
130 } 132 }
131 - criteria.andGreaterThanOrEqualTo("video_upload_time", startdate);  
132 - criteria2.andGreaterThanOrEqualTo("video_upload_time", startdate);  
133 - criteria.andLessThanOrEqualTo("video_upload_time", enddate);  
134 - criteria2.andLessThanOrEqualTo("video_upload_time", enddate); 133 + criteria.andGreaterThanOrEqualTo("created_at", startdate);
  134 + criteria2.andGreaterThanOrEqualTo("created_at", startdate);
  135 + criteria.andLessThanOrEqualTo("created_at", enddate);
  136 + criteria2.andLessThanOrEqualTo("created_at", enddate);
135 } 137 }
136 if (CommonUtils.isNotEmpty(video_title)) { 138 if (CommonUtils.isNotEmpty(video_title)) {
137 criteria.andLike("video_title", "%" + video_title + "%"); 139 criteria.andLike("video_title", "%" + video_title + "%");
@@ -162,7 +164,7 @@ public class VideosServiceImpl { @@ -162,7 +164,7 @@ public class VideosServiceImpl {
162 example.or(criteria2); 164 example.or(criteria2);
163 } 165 }
164 //默认按上传时间倒序排序 166 //默认按上传时间倒序排序
165 - example.setOrderByClause("video_upload_time desc"); 167 + example.setOrderByClause("created_at desc");
166 PageHelper.startPage(page, pageSize, true); 168 PageHelper.startPage(page, pageSize, true);
167 List<ShyVideos> shyVideosList = shyVideosMapper.selectByExample(example); 169 List<ShyVideos> shyVideosList = shyVideosMapper.selectByExample(example);
168 PageInfo<ShyVideos> pageInfo = new PageInfo<>(shyVideosList); 170 PageInfo<ShyVideos> pageInfo = new PageInfo<>(shyVideosList);
@@ -252,7 +254,7 @@ public class VideosServiceImpl { @@ -252,7 +254,7 @@ public class VideosServiceImpl {
252 * @param userId 254 * @param userId
253 * @return 255 * @return
254 */ 256 */
255 - public List<ShyVideos> findByCondition(String video_title, String start_date, String end_date, Integer state, Boolean receive, String video_priority, String orderByClause, Integer spid, String userId) { 257 + public List<ShyVideos> findByCondition(String video_title, String start_date, String end_date, Integer state, Integer receive, String video_priority, String orderByClause, Integer spid, String userId) {
256 Example example = new Example(ShyVideos.class); 258 Example example = new Example(ShyVideos.class);
257 Example.Criteria criteria = example.createCriteria(); 259 Example.Criteria criteria = example.createCriteria();
258 Example.Criteria criteria2 = example.createCriteria(); 260 Example.Criteria criteria2 = example.createCriteria();
@@ -263,13 +265,15 @@ public class VideosServiceImpl { @@ -263,13 +265,15 @@ public class VideosServiceImpl {
263 Timestamp startdate = null; 265 Timestamp startdate = null;
264 Timestamp enddate = null; 266 Timestamp enddate = null;
265 try { 267 try {
266 - startdate = CommonUtils.parseDate(start_date, "yyyy-MM-dd HH:mm:ss");  
267 - enddate = CommonUtils.parseDate(end_date, "yyyy-MM-dd HH:mm:ss"); 268 +// startdate = CommonUtils.parseDate(start_date, "yyyy-MM-dd HH:mm:ss");
  269 +// enddate = CommonUtils.parseDate(end_date, "yyyy-MM-dd HH:mm:ss");
  270 + startdate = CommonUtils.parseDate(start_date, "yyyy-MM-dd");
  271 + enddate = CommonUtils.parseDate(end_date, "yyyy-MM-dd");
268 } catch (ParseException e) { 272 } catch (ParseException e) {
269 e.printStackTrace(); 273 e.printStackTrace();
270 } 274 }
271 - criteria.andGreaterThanOrEqualTo("video_upload_time", startdate);  
272 - criteria.andLessThanOrEqualTo("video_upload_time", enddate); 275 + criteria.andGreaterThanOrEqualTo("created_at", startdate);
  276 + criteria.andLessThanOrEqualTo("created_at", enddate);
273 } 277 }
274 if (CommonUtils.isNotEmpty(video_title)) { 278 if (CommonUtils.isNotEmpty(video_title)) {
275 criteria.andLike("video_title", "%" + video_title + "%"); 279 criteria.andLike("video_title", "%" + video_title + "%");
@@ -289,7 +293,7 @@ public class VideosServiceImpl { @@ -289,7 +293,7 @@ public class VideosServiceImpl {
289 } 293 }
290 if (CommonUtils.isNotNull(receive)) { 294 if (CommonUtils.isNotNull(receive)) {
291 criteria.andEqualTo("receive", receive); 295 criteria.andEqualTo("receive", receive);
292 - if (receive == true) { 296 + if (receive == CommonConst.RECEIVE_AFTER) {
293 criteria.andEqualTo("receive_user_id", userId); 297 criteria.andEqualTo("receive_user_id", userId);
294 } 298 }
295 } 299 }
src/main/resources/templates/page/comment.html
@@ -719,7 +719,8 @@ @@ -719,7 +719,8 @@
719 <script> 719 <script>
720 /*时间插件*/ 720 /*时间插件*/
721 $('.date').datetimepicker({ 721 $('.date').datetimepicker({
722 - format: 'YYYY-MM-DD HH:mm:ss', 722 +// format: 'YYYY-MM-DD HH:mm:ss',
  723 + format: 'YYYY-MM-DD',
723 locale: "zh-CN", 724 locale: "zh-CN",
724 toolbarPlacement: 'bottom', 725 toolbarPlacement: 'bottom',
725 showClear: true, 726 showClear: true,
src/main/resources/templates/page/video.html
@@ -75,8 +75,8 @@ @@ -75,8 +75,8 @@
75 <span id="a_up">▼</span><span id="a_down" style="display: none;">▲</span> 75 <span id="a_up">▼</span><span id="a_down" style="display: none;">▲</span>
76 </button> 76 </button>
77 </div> 77 </div>
78 - <div class="form-horizontal form-group-sm" id="forms" style="display: none;">  
79 - <div class="btn-group margin-bottom col-md-6" style="padding: 0;width: 20%;"> 78 + <div class="form-horizontal form-group-sm" id="forms" style="display: none;float: left;">
  79 + <div class="btn-group margin-bottom col-md-6" style="padding: 0;width: 15%;float: left;">
80 <div class="col-md-5" style="padding: 0;width: 100%;"> 80 <div class="col-md-5" style="padding: 0;width: 100%;">
81 <label for="video_titleID" class="control-label cb-toolbar">标题:</label> 81 <label for="video_titleID" class="control-label cb-toolbar">标题:</label>
82 <div class="col-sm-9" style="padding: 0;"> 82 <div class="col-sm-9" style="padding: 0;">
@@ -85,10 +85,10 @@ @@ -85,10 +85,10 @@
85 </div> 85 </div>
86 </div> 86 </div>
87 87
88 - <div class="btn-group margin-bottom col-md-6" style="padding: 0;width: 17%;"> 88 + <div class="btn-group margin-bottom col-md-6" style="padding: 0;width: 10%;float: left;">
89 <div class="col-md-5" style="padding: 0;width: 100%;"> 89 <div class="col-md-5" style="padding: 0;width: 100%;">
90 <label for="video_priority" class="control-label cb-toolbar">热点:</label> 90 <label for="video_priority" class="control-label cb-toolbar">热点:</label>
91 - <div class="col-sm-9" style="padding: 0;"> 91 + <div class="col-sm-8" style="padding: 0;">
92 <select class="form-control" id="video_priority" name="video_priority"> 92 <select class="form-control" id="video_priority" name="video_priority">
93 <option value="">全部</option> 93 <option value="">全部</option>
94 <option value="1">是</option> 94 <option value="1">是</option>
@@ -101,8 +101,8 @@ @@ -101,8 +101,8 @@
101 101
102 <div class="btn-group margin-bottom col-md-6 pull-right" 102 <div class="btn-group margin-bottom col-md-6 pull-right"
103 style="position: relative;width: 75%;float: left !important;"> 103 style="position: relative;width: 75%;float: left !important;">
104 - <div class="col-md-11" style="width: 100%;padding: 0;">  
105 - <div class="col-md-6" style="padding: 0;width: 25%;"> 104 + <div class="col-md-18" style="width: 100%;padding: 0;">
  105 + <div class="col-md-10" style="padding: 0;width: 25%;">
106 <label for="start_date" class="control-label cb-toolbar">时间:</label> 106 <label for="start_date" class="control-label cb-toolbar">时间:</label>
107 <div class="input-group col-md-9 date"> 107 <div class="input-group col-md-9 date">
108 <input class="form-control date" name="start_date" type="text" 108 <input class="form-control date" name="start_date" type="text"
@@ -112,7 +112,7 @@ @@ -112,7 +112,7 @@
112 </span> 112 </span>
113 </div> 113 </div>
114 </div> 114 </div>
115 - <div class="col-md-6" style="padding: 0;width: 25%;"> 115 + <div class="col-md-10" style="padding: 0;width: 25%;">
116 <label for="start_date" class="control-label cb-toolbar">至</label> 116 <label for="start_date" class="control-label cb-toolbar">至</label>
117 <div class="input-group col-md-9 date"> 117 <div class="input-group col-md-9 date">
118 <input class="form-control date" name="end_date" type="text" 118 <input class="form-control date" name="end_date" type="text"
@@ -129,20 +129,20 @@ @@ -129,20 +129,20 @@
129 <input class="form-control" type="text" value="" id="sp_desc"> 129 <input class="form-control" type="text" value="" id="sp_desc">
130 </div> 130 </div>
131 </div> 131 </div>
132 - <div class="col-md-6" style="padding: 0;width: 25%;" th:if="${session.sessionUser.spid==0}"> 132 + <div class="col-md-6" style="padding: 0;width: 15%;" th:if="${session.sessionUser.spid==0}">
133 <label for="count" class="control-label cb-toolbar">每页条数:</label> 133 <label for="count" class="control-label cb-toolbar">每页条数:</label>
134 - <div class="col-sm-9" style="padding: 0;"> 134 + <div class="col-sm-5" style="padding: 0;">
135 <input class="form-control" type="text" value="" id="count"> 135 <input class="form-control" type="text" value="" id="count">
136 </div> 136 </div>
137 </div> 137 </div>
138 </div> 138 </div>
139 </div> 139 </div>
140 - <div class="btn-group margin-bottom col-md-6" style="padding: 0;width: 1%;float: left;">  
141 - <div class="col-md-1 text-center" style="width: 12%;padding: 0;float: right;">  
142 - <button type="button" class="btn btn-primary btn-sm" id="videos_query">查 询  
143 - </button>  
144 - </div>  
145 - </div> 140 +<!-- <div class="btn-group margin-bottom col-md-6" style="padding: 0;width: 1%;float: left;"> -->
  141 +<!-- <div class="col-md-1 text-center" style="width: 12%;padding: 0;float: right;"> -->
  142 +<!-- <button type="button" class="btn btn-primary btn-sm" id="videos_query">查 询 -->
  143 +<!-- </button> -->
  144 +<!-- </div> -->
  145 +<!-- </div> -->
146 </div> 146 </div>
147 147
148 <div class="fixed-table-container" style="padding-bottom: 0px;"> 148 <div class="fixed-table-container" style="padding-bottom: 0px;">
@@ -189,6 +189,11 @@ @@ -189,6 +189,11 @@
189 <div class="th-inner ">视频上传时间</div> 189 <div class="th-inner ">视频上传时间</div>
190 <div class="fht-cell"></div> 190 <div class="fht-cell"></div>
191 </th> 191 </th>
  192 + <th style="text-align: center; width: 10%; " data-field="created_at"
  193 + tabindex="0">
  194 + <div class="th-inner ">视频送审时间</div>
  195 + <div class="fht-cell"></div>
  196 + </th>
192 <th style="text-align: center; width: 17%; " data-field="action" 197 <th style="text-align: center; width: 17%; " data-field="action"
193 tabindex="0"> 198 tabindex="0">
194 <div class="th-inner ">操作</div> 199 <div class="th-inner ">操作</div>
@@ -226,6 +231,10 @@ @@ -226,6 +231,10 @@
226 th:text="${#dates.format(video.video_upload_time, 'yyyy-MM-dd HH:mm:ss')}"> 231 th:text="${#dates.format(video.video_upload_time, 'yyyy-MM-dd HH:mm:ss')}">
227 2018-03-07 16:56:20 232 2018-03-07 16:56:20
228 </td> 233 </td>
  234 + <td style="text-align: center; width: 10%;"
  235 + th:text="${#dates.format(video.created_at, 'yyyy-MM-dd HH:mm:ss')}">
  236 + 2018-03-07 16:56:20
  237 + </td>
229 <td style="text-align: center; width: 17%;"> 238 <td style="text-align: center; width: 17%;">
230 <a class="detail" th:href="@{'/videos/details/?id='+${video.id}}"> 239 <a class="detail" th:href="@{'/videos/details/?id='+${video.id}}">
231 <!--th:if="${ (video.receive==true and session.sessionUser.userId==video.receive_user_id) or (video.state==1 or video.state==2) }"--> 240 <!--th:if="${ (video.receive==true and session.sessionUser.userId==video.receive_user_id) or (video.state==1 or video.state==2) }"-->
@@ -344,7 +353,14 @@ @@ -344,7 +353,14 @@
344 353
345 //全部 354 //全部
346 function quanbu() { 355 function quanbu() {
347 - window.location.href = "/videos/page?video_title=&start_date=&end_date=&state=&receive=&video_priority="; 356 + var video_priority = $("#video_priority").val();
  357 + var video_title = $("#video_titleID").val();
  358 + var start_date = $("#start_date").val();
  359 + var end_date = $("#end_date").val();
  360 + var sp_desc = $("#sp_desc").val();
  361 + var count = $("#count").val();
  362 +// window.location.href = "/videos/page?video_title=&start_date=&end_date=&state=&receive=&video_priority=";
  363 + window.location.href = "/videos/page?video_title=" + video_title + "&start_date=" + start_date + "&end_date=" + end_date + "&video_priority=" + video_priority + "&sp_desc=" + sp_desc+"&pageSize="+count;
348 } 364 }
349 365
350 //全部待领 366 //全部待领
@@ -561,7 +577,8 @@ @@ -561,7 +577,8 @@
561 577
562 /*时间插件*/ 578 /*时间插件*/
563 $('.date').datetimepicker({ 579 $('.date').datetimepicker({
564 - format: 'YYYY-MM-DD HH:mm:ss', 580 +// format: 'YYYY-MM-DD HH:mm:ss',
  581 + format: 'YYYY-MM-DD',
565 locale: "zh-CN", 582 locale: "zh-CN",
566 toolbarPlacement: 'bottom', 583 toolbarPlacement: 'bottom',
567 showClear: true, 584 showClear: true,