Commit ff1cf6e1f9b463dbe10f1417cb89726f7f290a8d
1 parent
53bc12bd
点播增加spid搜索
Showing
3 changed files
with
48 additions
and
36 deletions
src/main/java/com/cnlive/shenhe/controller/VideosController.java
| ... | ... | @@ -115,39 +115,39 @@ public class VideosController extends BaseController { |
| 115 | 115 | * @return |
| 116 | 116 | */ |
| 117 | 117 | @GetMapping("/page") |
| 118 | - public Object getListVideos(Model model, String video_title, String start_date, String end_date, Integer state, Integer receive, Integer page, Integer pageSize, String video_priority, String orderByClause, String sp_desc, HttpSession session) { | |
| 118 | + public Object getListVideos(Model model, String video_title, String start_date, String end_date, Integer state, Integer receive, Integer page, Integer pageSize, String video_priority, String orderByClause, String sp_desc, String sp_Id, HttpSession session) { | |
| 119 | 119 | SessionUser sessionUser = (SessionUser) session.getAttribute(SessionUser.getSessionKey()); |
| 120 | - if(CommonUtils.isNull(sessionUser)){ | |
| 121 | - return "redirect:/users/login"; | |
| 120 | + if (CommonUtils.isNull(sessionUser)) { | |
| 121 | + return "redirect:/users/login"; | |
| 122 | 122 | } |
| 123 | 123 | Integer spid = sessionUser.getSpid(); |
| 124 | 124 | String userId = sessionUser.getUserId(); |
| 125 | 125 | if (CommonUtils.isNull(page)) page = 1; |
| 126 | 126 | if (CommonUtils.isNull(pageSize)) pageSize = 10; |
| 127 | 127 | if (CommonUtils.isNotEmpty(sp_desc) && spid == 0) { |
| 128 | - ShySites shySite=sitesService.findspidBySpdesc(sp_desc); | |
| 129 | - if(CommonUtils.isNotNull(shySite)){ | |
| 130 | - spid = shySite.getSpid(); | |
| 131 | - }else{ | |
| 132 | - setmodel_site(model); | |
| 133 | - return "error.html"; | |
| 134 | - } | |
| 128 | + ShySites shySite = sitesService.findspidBySpdesc(sp_desc); | |
| 129 | + if (CommonUtils.isNotNull(shySite)) { | |
| 130 | + spid = shySite.getSpid(); | |
| 131 | + } else { | |
| 132 | + setmodel_site(model); | |
| 133 | + return "error.html"; | |
| 134 | + } | |
| 135 | 135 | } else if (CommonUtils.isEmpty(sp_desc) && spid == 0) { |
| 136 | 136 | spid = null; |
| 137 | 137 | } |
| 138 | - PageInfo<ShyVideos> videoPage = videosService.getListContent(video_title, start_date, end_date, state, receive, page, pageSize, video_priority, orderByClause, spid, userId); | |
| 138 | + PageInfo<ShyVideos> videoPage = videosService.getListContent(video_title, start_date, end_date, state, receive, page, pageSize, video_priority, orderByClause, spid, userId,sp_Id); | |
| 139 | 139 | List<ShyVideos> list = videoPage.getList(); |
| 140 | 140 | if (!list.isEmpty()) { |
| 141 | 141 | for (ShyVideos videos : list) { |
| 142 | 142 | if (videos.getState() != CommonConst.AUDIT_INTT) { |
| 143 | - String updater =CommonUtils.isEmpty(videos.getUpdater()) || "null".equals(videos.getUpdater())? "白名单":videos.getUpdater(); | |
| 143 | + String updater = CommonUtils.isEmpty(videos.getUpdater()) || "null".equals(videos.getUpdater()) ? "白名单" : videos.getUpdater(); | |
| 144 | 144 | String auditor_id = videos.getAuditor_id(); |
| 145 | 145 | if (CommonUtils.isNotEmpty(auditor_id)) { |
| 146 | 146 | ShyUsers user = new ShyUsers(); |
| 147 | 147 | user.setUser_id(auditor_id); |
| 148 | 148 | user = usersService.select(user); |
| 149 | 149 | if (CommonUtils.isNotNull(user)) { |
| 150 | - String email = CommonUtils.isEmpty(user.getEmail()) || "null".equals(user.getEmail()) ? "" : user.getEmail(); | |
| 150 | + String email = CommonUtils.isEmpty(user.getEmail()) || "null".equals(user.getEmail()) ? "" : user.getEmail(); | |
| 151 | 151 | String userName = CommonUtils.isEmpty(user.getUsername()) ? email : user.getUsername(); |
| 152 | 152 | updater = userName; |
| 153 | 153 | } |
| ... | ... | @@ -157,25 +157,25 @@ public class VideosController extends BaseController { |
| 157 | 157 | //显示spid简称 |
| 158 | 158 | ShySites shySites = sitesService.findspidDescByspid(videos.getSpid()); |
| 159 | 159 | if (CommonUtils.isNotNull(shySites)) { |
| 160 | - if(CommonUtils.isNotEmpty(videos.getCategory())&&videos.getCategory().equals(CommonConst.CATEGORY_WITNESS)){ | |
| 160 | + if (CommonUtils.isNotEmpty(videos.getCategory()) && videos.getCategory().equals(CommonConst.CATEGORY_WITNESS)) { | |
| 161 | 161 | //0-目击者 1-童声共济 2-全民健身 3-目击者政府监督 4-美食中国 5-老年大学 |
| 162 | 162 | String source = videos.getSource(); |
| 163 | - if("1".equals(source)){ | |
| 164 | - videos.setSpid_desc("童声共济"+"(目击者)"); | |
| 165 | - } else if("2".equals(source)){ | |
| 166 | - videos.setSpid_desc("全民健身"+"(目击者)"); | |
| 167 | - } else if("4".equals(source)){ | |
| 168 | - videos.setSpid_desc("美食中国"+"(目击者)"); | |
| 169 | - } else if("5".equals(source)){ | |
| 170 | - videos.setSpid_desc("老年大学"+"(目击者)"); | |
| 163 | + if ("1".equals(source)) { | |
| 164 | + videos.setSpid_desc("童声共济" + "(目击者)"); | |
| 165 | + } else if ("2".equals(source)) { | |
| 166 | + videos.setSpid_desc("全民健身" + "(目击者)"); | |
| 167 | + } else if ("4".equals(source)) { | |
| 168 | + videos.setSpid_desc("美食中国" + "(目击者)"); | |
| 169 | + } else if ("5".equals(source)) { | |
| 170 | + videos.setSpid_desc("老年大学" + "(目击者)"); | |
| 171 | 171 | } else { |
| 172 | - videos.setSpid_desc(shySites.getName()+"(目击者)"); | |
| 172 | + videos.setSpid_desc(shySites.getName() + "(目击者)"); | |
| 173 | 173 | } |
| 174 | - }else if(CommonUtils.isNotEmpty(videos.getCategory())&&videos.getCategory().equals(CommonConst.CATEGORY_MOMENT)){ | |
| 175 | - videos.setSpid_desc(shySites.getName()+"(朋友圈)"); | |
| 176 | - }else{ | |
| 177 | - videos.setSpid_desc(shySites.getName()); | |
| 178 | - } | |
| 174 | + } else if (CommonUtils.isNotEmpty(videos.getCategory()) && videos.getCategory().equals(CommonConst.CATEGORY_MOMENT)) { | |
| 175 | + videos.setSpid_desc(shySites.getName() + "(朋友圈)"); | |
| 176 | + } else { | |
| 177 | + videos.setSpid_desc(shySites.getName()); | |
| 178 | + } | |
| 179 | 179 | } |
| 180 | 180 | } |
| 181 | 181 | } |
| ... | ... | @@ -183,7 +183,7 @@ public class VideosController extends BaseController { |
| 183 | 183 | String state1 = state == null ? "" : state.toString(); |
| 184 | 184 | String receive1 = ""; |
| 185 | 185 | if (CommonUtils.isNotNull(receive)) { |
| 186 | - receive1 = receive==CommonConst.RECEIVE_AFTER ? "true" : "false"; | |
| 186 | + receive1 = receive == CommonConst.RECEIVE_AFTER ? "true" : "false"; | |
| 187 | 187 | } else { |
| 188 | 188 | receive1 = ""; |
| 189 | 189 | } | ... | ... |
src/main/java/com/cnlive/shenhe/serviceImpl/VideosServiceImpl.java
| ... | ... | @@ -118,7 +118,7 @@ public class VideosServiceImpl { |
| 118 | 118 | return shyVideosMapper.updateByPrimaryKey(shyVideos); |
| 119 | 119 | } |
| 120 | 120 | |
| 121 | - public PageInfo<ShyVideos> getListContent(String video_title, String start_date, String end_date, Integer state, Integer receive, Integer page, Integer pageSize, String video_priority, String orderByClause, Integer spid, String userId) { | |
| 121 | + public PageInfo<ShyVideos> getListContent(String video_title, String start_date, String end_date, Integer state, Integer receive, Integer page, Integer pageSize, String video_priority, String orderByClause, Integer spid, String userId, String sp_Id) { | |
| 122 | 122 | Example example = new Example(ShyVideos.class); |
| 123 | 123 | Example.Criteria criteria = example.createCriteria(); |
| 124 | 124 | Example.Criteria criteria2 = example.createCriteria(); |
| ... | ... | @@ -145,12 +145,15 @@ public class VideosServiceImpl { |
| 145 | 145 | criteria.andLike("video_title", "%" + video_title + "%"); |
| 146 | 146 | criteria2.andLike("video_title", "%" + video_title + "%"); |
| 147 | 147 | } |
| 148 | - | |
| 148 | + | |
| 149 | 149 | if (CommonUtils.isNotEmpty(video_priority)) { |
| 150 | 150 | criteria.andEqualTo("video_priority", video_priority); |
| 151 | 151 | criteria2.andEqualTo("video_priority", video_priority); |
| 152 | 152 | } |
| 153 | 153 | if (CommonUtils.isNotNull(spid)) { |
| 154 | + if (CommonUtils.isNotEmpty(sp_Id)) { | |
| 155 | + spid = Integer.valueOf(sp_Id); | |
| 156 | + } | |
| 154 | 157 | criteria.andEqualTo("spid", spid); |
| 155 | 158 | criteria2.andEqualTo("spid", spid); |
| 156 | 159 | } | ... | ... |
src/main/resources/templates/page/video.html
| ... | ... | @@ -130,6 +130,13 @@ |
| 130 | 130 | <input class="form-control" type="text" value="" id="sp_desc"> |
| 131 | 131 | </div> |
| 132 | 132 | </div> |
| 133 | + | |
| 134 | + <div class="col-md-6" style="padding: 0;width: 25%;" th:if="${session.sessionUser.spid==0}"> | |
| 135 | + <label for="sp_Id" class="control-label cb-toolbar">spId</label> | |
| 136 | + <div class="col-sm-9" style="padding: 0;"> | |
| 137 | + <input class="form-control" type="text" value="" id="sp_Id"> | |
| 138 | + </div> | |
| 139 | + </div> | |
| 133 | 140 | <!-- <div class="col-md-6" style="padding: 0;width: 15%;" th:if="${session.sessionUser.spid==0}"> --> |
| 134 | 141 | <!-- <label for="count" class="control-label cb-toolbar">每页条数:</label> --> |
| 135 | 142 | <!-- <div class="col-sm-5" style="padding: 0;"> --> |
| ... | ... | @@ -401,6 +408,7 @@ |
| 401 | 408 | var sp_desc =""; |
| 402 | 409 | var count = ""; |
| 403 | 410 | var state = ""; |
| 411 | + var sp_Id = ""; | |
| 404 | 412 | |
| 405 | 413 | function updateValue(){ |
| 406 | 414 | // video_priority = $("#video_priority").val(); |
| ... | ... | @@ -408,6 +416,7 @@ |
| 408 | 416 | start_date = $("#start_date").val(); |
| 409 | 417 | end_date = $("#end_date").val(); |
| 410 | 418 | state = $("#state").val(); |
| 419 | + sp_Id = $("#sp_Id").val(); | |
| 411 | 420 | var spId=[[${session.sessionUser.spid}]]; |
| 412 | 421 | if(spId==0){ |
| 413 | 422 | sp_desc = $("#sp_desc").val(); |
| ... | ... | @@ -419,7 +428,7 @@ |
| 419 | 428 | //全部 |
| 420 | 429 | function quanbu() { |
| 421 | 430 | updateValue(); |
| 422 | - window.location.href = "/videos/page?video_title=" + video_title + "&start_date=" + start_date + "&end_date=" + end_date + "&state=" + state + "&video_priority=" + video_priority + "&sp_desc=" + sp_desc+"&pageSize="+count; | |
| 431 | + window.location.href = "/videos/page?video_title=" + video_title + "&start_date=" + start_date + "&end_date=" + end_date + "&state=" + state + "&video_priority=" + video_priority + "&sp_desc=" + sp_desc+"&pageSize="+count+"&sp_Id="+sp_Id; | |
| 423 | 432 | } |
| 424 | 433 | |
| 425 | 434 | //全部待领 |
| ... | ... | @@ -427,27 +436,27 @@ |
| 427 | 436 | updateValue(); |
| 428 | 437 | if($.trim(state) == '') state=0; |
| 429 | 438 | var receive = 0; |
| 430 | - window.location.href = "page?video_title=" + video_title + "&start_date=" + start_date + "&end_date=" + end_date + "&state=" + state + "&receive=" + receive + "&video_priority=" + video_priority + "&sp_desc=" + sp_desc+"&pageSize="+count; | |
| 439 | + window.location.href = "page?video_title=" + video_title + "&start_date=" + start_date + "&end_date=" + end_date + "&state=" + state + "&receive=" + receive + "&video_priority=" + video_priority + "&sp_desc=" + sp_desc+"&pageSize="+count+"&sp_Id="+sp_Id; | |
| 431 | 440 | }); |
| 432 | 441 | //我的待审核 |
| 433 | 442 | $('#Mydaishen').click(function () { |
| 434 | 443 | updateValue(); |
| 435 | 444 | var receive = 1; |
| 436 | 445 | if($.trim(state) == '') state=0; |
| 437 | - window.location.href = "page?video_title=" + video_title + "&start_date=" + start_date + "&end_date=" + end_date + "&state=" + state + "&receive=" + receive + "&video_priority=" + video_priority + "&sp_desc=" + sp_desc+"&pageSize="+count; | |
| 446 | + window.location.href = "page?video_title=" + video_title + "&start_date=" + start_date + "&end_date=" + end_date + "&state=" + state + "&receive=" + receive + "&video_priority=" + video_priority + "&sp_desc=" + sp_desc+"&pageSize="+count+"&sp_Id="+sp_Id; | |
| 438 | 447 | }); |
| 439 | 448 | //我的已审核 |
| 440 | 449 | $('#yishen').click(function () { |
| 441 | 450 | updateValue(); |
| 442 | 451 | var receive = 1; |
| 443 | 452 | if($.trim(state) == '') state=3;//审核状态,3代表通过和拒绝都查询 |
| 444 | - window.location.href = "page?video_title=" + video_title + "&start_date=" + start_date + "&end_date=" + end_date + "&state=" + state + "&receive=" + receive + "&video_priority=" + video_priority + "&sp_desc=" + sp_desc+"&pageSize="+count; | |
| 453 | + window.location.href = "page?video_title=" + video_title + "&start_date=" + start_date + "&end_date=" + end_date + "&state=" + state + "&receive=" + receive + "&video_priority=" + video_priority + "&sp_desc=" + sp_desc+"&pageSize="+count+"&sp_Id="+sp_Id; | |
| 445 | 454 | }); |
| 446 | 455 | |
| 447 | 456 | |
| 448 | 457 | //查询 |
| 449 | 458 | $('#videos_query').click(function () { |
| 450 | - window.location.href = "/videos/page?video_title=" + video_title + "&start_date=" + start_date + "&end_date=" + end_date + "&state=" + state + "&video_priority=" + video_priority + "&sp_desc=" + sp_desc+"&pageSize="+count; | |
| 459 | + window.location.href = "/videos/page?video_title=" + video_title + "&start_date=" + start_date + "&end_date=" + end_date + "&state=" + state + "&video_priority=" + video_priority + "&sp_desc=" + sp_desc+"&pageSize="+count+"&sp_Id="+sp_Id; | |
| 451 | 460 | }); |
| 452 | 461 | /*全选的操作*/ |
| 453 | 462 | $('#select_all').click(function () { | ... | ... |