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 56 shyComments1.setComment_content(json.getString("commentContent"));
57 57 String commentTime = json.getString("commentTime");
58 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 60 shyComments1.setComment_time(timestamp);
61 61  
62 62 }
... ... @@ -85,7 +85,7 @@ public class CommentsControllerApi {
85 85 shyComments.setComment_content(json.getString("commentContent"));
86 86 String commentTime = json.getString("commentTime");
87 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 89 shyComments.setComment_time(timestamp);
90 90 }
91 91 shyComments.setSpid(json.getInteger("spId"));
... ...
src/main/java/com/cnlive/shenhe/controller/CommentsController.java
... ... @@ -66,13 +66,13 @@ public class CommentsController {
66 66  
67 67 if (CommonUtils.isNotEmpty(start_date)) {
68 68 try {
69   - sDate = CommonUtils.parseDate(start_date, "yyyy-MM-dd hh:mm");
  69 + sDate = CommonUtils.parseDate(start_date, "yyyy-MM-dd");
70 70 } catch (Exception e) {
71 71 }
72 72 }
73 73 if (CommonUtils.isNotEmpty(end_date)) {
74 74 try {
75   - eDate = CommonUtils.parseDate(end_date, "yyyy-MM-dd hh:mm");
  75 + eDate = CommonUtils.parseDate(end_date, "yyyy-MM-dd");
76 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 259 * @param response
260 260 */
261 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 263 SessionUser sessionUser = (SessionUser) session.getAttribute(SessionUser.getSessionKey());
264 264 Integer spid = sessionUser.getSpid();
265 265 String userId = sessionUser.getUserId();
... ...
src/main/java/com/cnlive/shenhe/serviceImpl/VideosServiceImpl.java
... ... @@ -123,15 +123,17 @@ public class VideosServiceImpl {
123 123 Timestamp startdate = null;
124 124 Timestamp enddate = null;
125 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 130 } catch (ParseException e) {
129 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 138 if (CommonUtils.isNotEmpty(video_title)) {
137 139 criteria.andLike("video_title", "%" + video_title + "%");
... ... @@ -162,7 +164,7 @@ public class VideosServiceImpl {
162 164 example.or(criteria2);
163 165 }
164 166 //默认按上传时间倒序排序
165   - example.setOrderByClause("video_upload_time desc");
  167 + example.setOrderByClause("created_at desc");
166 168 PageHelper.startPage(page, pageSize, true);
167 169 List<ShyVideos> shyVideosList = shyVideosMapper.selectByExample(example);
168 170 PageInfo<ShyVideos> pageInfo = new PageInfo<>(shyVideosList);
... ... @@ -252,7 +254,7 @@ public class VideosServiceImpl {
252 254 * @param userId
253 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 258 Example example = new Example(ShyVideos.class);
257 259 Example.Criteria criteria = example.createCriteria();
258 260 Example.Criteria criteria2 = example.createCriteria();
... ... @@ -263,13 +265,15 @@ public class VideosServiceImpl {
263 265 Timestamp startdate = null;
264 266 Timestamp enddate = null;
265 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 272 } catch (ParseException e) {
269 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 278 if (CommonUtils.isNotEmpty(video_title)) {
275 279 criteria.andLike("video_title", "%" + video_title + "%");
... ... @@ -289,7 +293,7 @@ public class VideosServiceImpl {
289 293 }
290 294 if (CommonUtils.isNotNull(receive)) {
291 295 criteria.andEqualTo("receive", receive);
292   - if (receive == true) {
  296 + if (receive == CommonConst.RECEIVE_AFTER) {
293 297 criteria.andEqualTo("receive_user_id", userId);
294 298 }
295 299 }
... ...
src/main/resources/templates/page/comment.html
... ... @@ -719,7 +719,8 @@
719 719 <script>
720 720 /*时间插件*/
721 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 724 locale: "zh-CN",
724 725 toolbarPlacement: 'bottom',
725 726 showClear: true,
... ...
src/main/resources/templates/page/video.html
... ... @@ -75,8 +75,8 @@
75 75 <span id="a_up">▼</span><span id="a_down" style="display: none;">▲</span>
76 76 </button>
77 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 80 <div class="col-md-5" style="padding: 0;width: 100%;">
81 81 <label for="video_titleID" class="control-label cb-toolbar">标题:</label>
82 82 <div class="col-sm-9" style="padding: 0;">
... ... @@ -85,10 +85,10 @@
85 85 </div>
86 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 89 <div class="col-md-5" style="padding: 0;width: 100%;">
90 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 92 <select class="form-control" id="video_priority" name="video_priority">
93 93 <option value="">全部</option>
94 94 <option value="1">是</option>
... ... @@ -101,8 +101,8 @@
101 101  
102 102 <div class="btn-group margin-bottom col-md-6 pull-right"
103 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 106 <label for="start_date" class="control-label cb-toolbar">时间:</label>
107 107 <div class="input-group col-md-9 date">
108 108 <input class="form-control date" name="start_date" type="text"
... ... @@ -112,7 +112,7 @@
112 112 </span>
113 113 </div>
114 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 116 <label for="start_date" class="control-label cb-toolbar">至</label>
117 117 <div class="input-group col-md-9 date">
118 118 <input class="form-control date" name="end_date" type="text"
... ... @@ -129,20 +129,20 @@
129 129 <input class="form-control" type="text" value="" id="sp_desc">
130 130 </div>
131 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 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 135 <input class="form-control" type="text" value="" id="count">
136 136 </div>
137 137 </div>
138 138 </div>
139 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 146 </div>
147 147  
148 148 <div class="fixed-table-container" style="padding-bottom: 0px;">
... ... @@ -189,6 +189,11 @@
189 189 <div class="th-inner ">视频上传时间</div>
190 190 <div class="fht-cell"></div>
191 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 197 <th style="text-align: center; width: 17%; " data-field="action"
193 198 tabindex="0">
194 199 <div class="th-inner ">操作</div>
... ... @@ -226,6 +231,10 @@
226 231 th:text="${#dates.format(video.video_upload_time, 'yyyy-MM-dd HH:mm:ss')}">
227 232 2018-03-07 16:56:20
228 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 238 <td style="text-align: center; width: 17%;">
230 239 <a class="detail" th:href="@{'/videos/details/?id='+${video.id}}">
231 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 353  
345 354 //全部
346 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 577  
562 578 /*时间插件*/
563 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 582 locale: "zh-CN",
566 583 toolbarPlacement: 'bottom',
567 584 showClear: true,
... ...