Commit cce9aac5b052c7a00929536ef5df82fee81b32cc
1 parent
101d9ed7
优化了项目中所有Controller+Service接口,将零散的参数数据封装成DTO对象
Showing
38 changed files
with
1092 additions
and
974 deletions
src/main/java/com/cnlive/shenhe/controller/AudioController.java
| ... | ... | @@ -69,45 +69,33 @@ public class AudioController extends BaseController { |
| 69 | 69 | * 音频数据分页获取 |
| 70 | 70 | * |
| 71 | 71 | * @param model |
| 72 | - * @param video_title | |
| 73 | - * @param start_date | |
| 74 | - * @param end_date | |
| 75 | - * @param state | |
| 76 | - * @param receive | |
| 77 | - * @param page | |
| 78 | - * @param pageSize | |
| 79 | - * @param video_priority | |
| 80 | - * @param orderByClause | |
| 81 | - * @param sp_desc | |
| 82 | - * @param sp_Id | |
| 72 | + * @param audioDTO | |
| 83 | 73 | * @param session |
| 84 | 74 | * @return |
| 85 | 75 | */ |
| 86 | 76 | @GetMapping("/page") |
| 87 | 77 | public Object getListVideos(Model model, AudioDTO audioDTO, HttpSession session) { |
| 88 | - //, 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 | |
| 89 | 78 | SessionUser sessionUser = (SessionUser) session.getAttribute(SessionUser.getSessionKey()); |
| 90 | 79 | if (CommonUtils.isNull(sessionUser)) { |
| 91 | 80 | return "redirect:/users/login"; |
| 92 | 81 | } |
| 93 | 82 | Integer spid = sessionUser.getSpid(); |
| 83 | + audioDTO.setSpid(spid); | |
| 94 | 84 | logger.info("sp_Id:{},spid:{}", audioDTO.getSp_Id(), spid); |
| 95 | 85 | String userId = sessionUser.getUserId(); |
| 96 | - //if (CommonUtils.isNull(audioDTO.getPage())) {page = 1;} | |
| 97 | - //if (CommonUtils.isNull(audioDTO.getPageSize())) {pageSize = 10;} | |
| 86 | + audioDTO.setUserId(userId); | |
| 98 | 87 | if (CommonUtils.isNotEmpty(audioDTO.getSp_desc()) && spid == 0) { |
| 99 | 88 | ShySites shySite = sitesService.findspidBySpdesc(audioDTO.getSp_desc()); |
| 100 | 89 | if (CommonUtils.isNotNull(shySite)) { |
| 101 | - spid = shySite.getSpid(); | |
| 90 | + audioDTO.setSpid(shySite.getSpid()); | |
| 102 | 91 | } else { |
| 103 | 92 | setmodelSite(model); |
| 104 | 93 | return "error.html"; |
| 105 | 94 | } |
| 106 | 95 | } else if (CommonUtils.isEmpty(audioDTO.getSp_desc()) && spid == 0) { |
| 107 | - spid = null; | |
| 96 | + audioDTO.setSpid(null); | |
| 108 | 97 | } |
| 109 | - //video_title, start_date, end_date, state, receive, page, pageSize, video_priority, orderByClause, spid, userId, sp_Id | |
| 110 | - PageInfo<ShyAudio> audioPage = audioService.getListContent(audioDTO.getVideo_title(), audioDTO.getStart_date(), audioDTO.getEnd_date(), audioDTO.getState(), audioDTO.getReceive(), audioDTO.getPage(), audioDTO.getPageSize(), audioDTO.getVideo_priority(), audioDTO.getOrderByClause(), spid, userId, audioDTO.getSp_Id()); | |
| 98 | + PageInfo<ShyAudio> audioPage = audioService.getListContent(audioDTO); | |
| 111 | 99 | if (audioPage != null && audioPage.getSize() > 0) { |
| 112 | 100 | List<ShyAudio> list = audioPage.getList(); |
| 113 | 101 | if (list != null && list.size() > 0) { |
| ... | ... | @@ -142,7 +130,7 @@ public class AudioController extends BaseController { |
| 142 | 130 | String state1 = audioDTO.getState() == null ? "" : audioDTO.getState().toString(); |
| 143 | 131 | String receive1 = ""; |
| 144 | 132 | if (CommonUtils.isNotNull(audioDTO.getReceive())) { |
| 145 | - receive1 = audioDTO.getReceive() == CommonConst.RECEIVE_AFTER ? "true" : "false"; | |
| 133 | + receive1 = audioDTO.getReceive().equals(CommonConst.RECEIVE_AFTER) ? "true" : "false"; | |
| 146 | 134 | } else { |
| 147 | 135 | receive1 = ""; |
| 148 | 136 | } |
| ... | ... | @@ -174,7 +162,7 @@ public class AudioController extends BaseController { |
| 174 | 162 | for (String cid : cids) { |
| 175 | 163 | ShyAudio shyAudio = audioService.selectByPrimaryKey(Integer.parseInt(cid)); |
| 176 | 164 | if (CommonUtils.isNotNull(shyAudio)) { |
| 177 | - if (shyAudio.getState() != CommonConst.AUDIT_INTT || shyAudio.getReceive() == CommonConst.RECEIVE_AFTER) { | |
| 165 | + if (!shyAudio.getState().equals(CommonConst.AUDIT_INTT) || shyAudio.getReceive().equals(CommonConst.RECEIVE_AFTER)) { | |
| 178 | 166 | return new ResponseBean(ErrorEnum.ERROR.getErrorCode(), "您领取的内容中有已被领取或者已经被审核,请检查并重试"); |
| 179 | 167 | } |
| 180 | 168 | } else { |
| ... | ... | @@ -204,7 +192,7 @@ public class AudioController extends BaseController { |
| 204 | 192 | String[] cids = ids.split(","); |
| 205 | 193 | for (String cid : cids) { |
| 206 | 194 | ShyAudio shyAudio = audioService.selectByPrimaryKey(Integer.parseInt(cid)); |
| 207 | - if (shyAudio.getState() != CommonConst.AUDIT_INTT || shyAudio.getReceive() == CommonConst.RECEIVE_BEFORE || !shyAudio.getReceive_user_id().equals(userId)) { | |
| 195 | + if (!shyAudio.getState() .equals( CommonConst.AUDIT_INTT )|| shyAudio.getReceive() .equals(CommonConst.RECEIVE_BEFORE) || !shyAudio.getReceive_user_id().equals(userId)) { | |
| 208 | 196 | return new ResponseBean(ErrorEnum.ERROR.getErrorCode(), "退领失败,您选中的内容包含已退领的或已经审核的"); |
| 209 | 197 | } |
| 210 | 198 | } |
| ... | ... | @@ -252,9 +240,9 @@ public class AudioController extends BaseController { |
| 252 | 240 | |
| 253 | 241 | String yuming = ""; |
| 254 | 242 | Integer plat = shyAudio.getBucketType(); |
| 255 | - if (plat == CommonConst.QINIU_PLAT) { | |
| 243 | + if (plat .equals( CommonConst.QINIU_PLAT)) { | |
| 256 | 244 | yuming = qn_domain + "/"; |
| 257 | - } else if (plat == CommonConst.KS_PLAT) { | |
| 245 | + } else if (plat .equals( CommonConst.KS_PLAT)) { | |
| 258 | 246 | yuming = ks_domain + "/"; |
| 259 | 247 | } |
| 260 | 248 | shyAudio.setAttr_tags(CommonUtils.isEmpty(shyAudio.getAttr_tags()) ? "" : shyAudio.getAttr_tags()); |
| ... | ... | @@ -267,25 +255,21 @@ public class AudioController extends BaseController { |
| 267 | 255 | /** |
| 268 | 256 | * 根据条件导出excel |
| 269 | 257 | * |
| 270 | - * @param video_title | |
| 271 | - * @param start_date | |
| 272 | - * @param end_date | |
| 273 | - * @param state | |
| 274 | - * @param receive | |
| 275 | - * @param video_priority | |
| 276 | - * @param orderByClause | |
| 258 | + * @param audioDTO | |
| 277 | 259 | * @param session |
| 278 | 260 | * @param response |
| 279 | 261 | */ |
| 280 | 262 | @GetMapping("excel") |
| 281 | 263 | public void getExcel(AudioDTO audioDTO, HttpSession session, HttpServletResponse response) { |
| 282 | - //String video_title, String start_date, String end_date, Integer state, Integer receive, String video_priority, String orderByClause | |
| 283 | 264 | SessionUser sessionUser = (SessionUser) session.getAttribute(SessionUser.getSessionKey()); |
| 284 | 265 | Integer spid = sessionUser.getSpid(); |
| 285 | 266 | String userId = sessionUser.getUserId(); |
| 286 | - if (spid == 0) spid = null; | |
| 287 | - List<ShyAudio> shyAudioList = audioService.findByCondition(audioDTO.getVideo_title(),audioDTO.getStart_date(),audioDTO.getEnd_date(),audioDTO.getState(),audioDTO.getReceive(),audioDTO.getVideo_priority(),audioDTO.getOrderByClause(), spid, userId); | |
| 288 | - //video_title, start_date, end_date, state, receive, video_priority, orderByClause | |
| 267 | + audioDTO.setSpid(spid); | |
| 268 | + audioDTO.setUserId(userId); | |
| 269 | + if (spid == 0) { | |
| 270 | + audioDTO.setSpid(null); | |
| 271 | + } | |
| 272 | + List<ShyAudio> shyAudioList = audioService.findByCondition(audioDTO); | |
| 289 | 273 | String fileName = "音频数据"; |
| 290 | 274 | String updater = "";//审核员名字 |
| 291 | 275 | String state1 = "";//审核状态 1已审核 2审核拒绝 0未审核 |
| ... | ... | @@ -345,7 +329,7 @@ public class AudioController extends BaseController { |
| 345 | 329 | cell.setCellValue(shyAudioList.get(i).getAudioTag()); |
| 346 | 330 | cell = row.createCell(5);//列 |
| 347 | 331 | //审核员需要做处理 |
| 348 | - if (shyAudioList.get(i).getState() != CommonConst.AUDIT_INTT) { | |
| 332 | + if (!shyAudioList.get(i).getState().equals(CommonConst.AUDIT_INTT)) { | |
| 349 | 333 | updater = CommonUtils.isEmpty(shyAudioList.get(i).getUploader()) || "null".equals(shyAudioList.get(i).getUploader()) ? "白名单" : shyAudioList.get(i).getUploader(); |
| 350 | 334 | String auditor_id = shyAudioList.get(i).getAuditor_id(); |
| 351 | 335 | if (CommonUtils.isNotEmpty(auditor_id)) { |
| ... | ... | @@ -412,19 +396,23 @@ public class AudioController extends BaseController { |
| 412 | 396 | } catch (final Exception e) { |
| 413 | 397 | e.printStackTrace(); |
| 414 | 398 | try { |
| 415 | - if (bis != null) | |
| 399 | + if (bis != null) { | |
| 416 | 400 | bis.close(); |
| 417 | - if (bos != null) | |
| 401 | + } | |
| 402 | + if (bos != null) { | |
| 418 | 403 | bos.close(); |
| 404 | + } | |
| 419 | 405 | } catch (Exception e1) { |
| 420 | 406 | e1.printStackTrace(); |
| 421 | 407 | } |
| 422 | 408 | } finally { |
| 423 | 409 | try { |
| 424 | - if (bis != null) | |
| 410 | + if (bis != null) { | |
| 425 | 411 | bis.close(); |
| 426 | - if (bos != null) | |
| 412 | + } | |
| 413 | + if (bos != null) { | |
| 427 | 414 | bos.close(); |
| 415 | + } | |
| 428 | 416 | } catch (Exception e2) { |
| 429 | 417 | e2.printStackTrace(); |
| 430 | 418 | } | ... | ... |
src/main/java/com/cnlive/shenhe/controller/ChannelController.java
| ... | ... | @@ -51,55 +51,45 @@ public class ChannelController extends BaseController { |
| 51 | 51 | * 评论列表页 |
| 52 | 52 | * |
| 53 | 53 | * @param model |
| 54 | - * @param start_date | |
| 55 | - * @param end_date | |
| 56 | - * @param sp_desc | |
| 57 | - * @param page | |
| 58 | - * @param pageSize | |
| 59 | - * @param orderByClause | |
| 54 | + * @param channelDTO | |
| 60 | 55 | * @param session |
| 61 | 56 | * @return |
| 62 | 57 | */ |
| 63 | 58 | @GetMapping("/page") |
| 64 | 59 | public String getPage(Model model, ChannelDTO channelDTO, HttpSession session) { |
| 65 | - //String channel_id, String channel_name, Integer receive, | |
| 66 | - // String start_date, String end_date, Integer shenhe_status, String sp_desc, | |
| 67 | - // Integer page, Integer pageSize, String orderByClause, | |
| 68 | 60 | SessionUser sessionUser = (SessionUser) session.getAttribute(SessionUser.getSessionKey()); |
| 69 | 61 | if (CommonUtils.isNull(sessionUser)) { |
| 70 | 62 | return "redirect:/users/login"; |
| 71 | 63 | } |
| 72 | 64 | Integer spid = sessionUser.getSpid(); |
| 65 | + channelDTO.setSpid(spid); | |
| 73 | 66 | String userId = sessionUser.getUserId(); |
| 74 | - //if (CommonUtils.isNull(page)) page = 1; | |
| 75 | - //if (CommonUtils.isNull(pageSize)) pageSize = 10; | |
| 67 | + channelDTO.setUserId(userId); | |
| 76 | 68 | if (CommonUtils.isNotEmpty(channelDTO.getSp_desc()) && spid == 0) { |
| 77 | 69 | ShySites shySite = sitesService.findspidBySpdesc(channelDTO.getSp_desc()); |
| 78 | 70 | if (CommonUtils.isNotNull(shySite)) { |
| 79 | - spid = shySite.getSpid(); | |
| 71 | + channelDTO.setSpid(shySite.getSpid()); | |
| 80 | 72 | } else { |
| 81 | 73 | setmodelSite(model); |
| 82 | 74 | return "error.html"; |
| 83 | 75 | } |
| 84 | 76 | } else if (CommonUtils.isEmpty(channelDTO.getSp_desc()) && spid == 0) { |
| 85 | - spid = null; | |
| 77 | + channelDTO.setSpid(null); | |
| 86 | 78 | } |
| 87 | - Date sDate = null; | |
| 88 | - Date eDate = null; | |
| 89 | 79 | |
| 90 | - if (CommonUtils.isNotEmpty(channelDTO.getStart_date())) { | |
| 80 | + if (CommonUtils.isNotEmpty(channelDTO.getsDate())) { | |
| 91 | 81 | try { |
| 92 | - sDate = CommonUtils.parseDate(channelDTO.getStart_date(), "yyyy-MM-dd"); | |
| 82 | + channelDTO.setsDate(String.valueOf(CommonUtils.parseDate(channelDTO.getsDate(), "yyyy-MM-dd"))); | |
| 93 | 83 | } catch (Exception e) { |
| 94 | 84 | } |
| 95 | 85 | } |
| 96 | - if (CommonUtils.isNotEmpty(channelDTO.getEnd_date())) { | |
| 86 | + if (CommonUtils.isNotEmpty(channelDTO.geteDate())) { | |
| 97 | 87 | try { |
| 98 | - eDate = CommonUtils.parseDate(channelDTO.getEnd_date(), "yyyy-MM-dd"); | |
| 88 | + channelDTO.seteDate(String.valueOf(CommonUtils.parseDate(channelDTO.geteDate(), "yyyy-MM-dd"))); | |
| 99 | 89 | } catch (Exception e) { |
| 100 | 90 | } |
| 101 | 91 | } |
| 102 | - PageInfo<ShyChannel> channelPage = channelService.getPage(channelDTO.getChannel_id(), channelDTO.getChannel_name(), channelDTO.getReceive(), sDate, eDate, channelDTO.getShenhe_status(), null, channelDTO.getPage(), channelDTO.getPageSize(), channelDTO.getOrderByClause(), spid, userId); | |
| 92 | + PageInfo<ShyChannel> channelPage = channelService.getPage(channelDTO); | |
| 103 | 93 | List<ShyChannel> list = channelPage.getList(); |
| 104 | 94 | if (!list.isEmpty()) { |
| 105 | 95 | for (ShyChannel channel : list) { | ... | ... |
src/main/java/com/cnlive/shenhe/controller/CommentsController.java
| ... | ... | @@ -9,7 +9,6 @@ import com.cnlive.shenhe.entity.ShyComments; |
| 9 | 9 | import com.cnlive.shenhe.entity.ShyContent; |
| 10 | 10 | import com.cnlive.shenhe.entity.ShySites; |
| 11 | 11 | import com.cnlive.shenhe.entity.ShyUsers; |
| 12 | -import com.cnlive.shenhe.entity.ShyVideos; | |
| 13 | 12 | import com.cnlive.shenhe.serviceImpl.CommentsServiceImpl; |
| 14 | 13 | import com.cnlive.shenhe.serviceImpl.ContentServiceImpl; |
| 15 | 14 | import com.cnlive.shenhe.serviceImpl.SitesServiceImpl; |
| ... | ... | @@ -65,52 +64,41 @@ public class CommentsController extends BaseController { |
| 65 | 64 | /** |
| 66 | 65 | * 评论列表页 |
| 67 | 66 | * |
| 68 | - * @param activity_id | |
| 69 | - * @param content | |
| 70 | - * @param is_hot | |
| 71 | - * @param start_date | |
| 72 | - * @param end_date | |
| 73 | - * @param state | |
| 74 | - * @param page | |
| 75 | - * @param pageSize | |
| 76 | - * @param orderByClause | |
| 67 | + * @param commentsDTO | |
| 77 | 68 | * @return |
| 78 | 69 | */ |
| 79 | 70 | @GetMapping("/page") |
| 80 | 71 | public String getPage(Model model, CommentsDTO commentsDTO, HttpSession session) { |
| 81 | - //String activity_id, String content, Integer is_hot, | |
| 82 | - // String start_date, String end_date, Integer state, Integer receive, | |
| 83 | - // Integer page, Integer pageSize, String orderByClause, Integer type, Integer comment_user_id | |
| 72 | + | |
| 84 | 73 | SessionUser sessionUser = (SessionUser) session.getAttribute(SessionUser.getSessionKey()); |
| 85 | 74 | if (CommonUtils.isNull(sessionUser)) { |
| 86 | 75 | return "redirect:/users/login"; |
| 87 | 76 | } |
| 88 | 77 | Integer spid = sessionUser.getSpid(); |
| 78 | + commentsDTO.setSpid(spid); | |
| 89 | 79 | String userId = sessionUser.getUserId(); |
| 90 | - if (spid == 0) spid = null; | |
| 91 | - //if (CommonUtils.isNull(page)) page = 1; | |
| 92 | - //if (CommonUtils.isNull(pageSize)) pageSize = 10; | |
| 93 | - Date sDate = null; | |
| 94 | - Date eDate = null; | |
| 80 | + commentsDTO.setUserId(userId); | |
| 81 | + if (spid == 0) { | |
| 82 | + commentsDTO.setSpid(null); | |
| 83 | + } | |
| 95 | 84 | |
| 96 | - if (CommonUtils.isNotEmpty(commentsDTO.getStart_date())) { | |
| 85 | + if (CommonUtils.isNotEmpty(commentsDTO.getsDate())) { | |
| 97 | 86 | try { |
| 98 | - sDate = CommonUtils.parseDate(commentsDTO.getStart_date(), "yyyy-MM-dd"); | |
| 87 | + commentsDTO.setsDate(String.valueOf(CommonUtils.parseDate(commentsDTO.getsDate(), "yyyy-MM-dd"))); | |
| 99 | 88 | } catch (Exception e) { |
| 100 | 89 | } |
| 101 | 90 | } |
| 102 | - if (CommonUtils.isNotEmpty(commentsDTO.getEnd_date())) { | |
| 91 | + if (CommonUtils.isNotEmpty(commentsDTO.geteDate())) { | |
| 103 | 92 | try { |
| 104 | - eDate = CommonUtils.parseDate(commentsDTO.getEnd_date(), "yyyy-MM-dd"); | |
| 93 | + commentsDTO.seteDate(String.valueOf(CommonUtils.parseDate(commentsDTO.geteDate(), "yyyy-MM-dd"))); | |
| 105 | 94 | } catch (Exception e) { |
| 106 | 95 | } |
| 107 | 96 | } |
| 108 | - PageInfo<ShyComments> commentPage = commentsService.getPage(commentsDTO.getActivity_id(), commentsDTO.getContent(), commentsDTO.getIs_hot(), sDate, eDate, commentsDTO.getState(), commentsDTO.getReceive(), null, commentsDTO.getPage(), commentsDTO.getPageSize(), commentsDTO.getOrderByClause(), spid, userId, commentsDTO.getType(), commentsDTO.getComment_user_id()); | |
| 109 | - //activity_id, content, is_hot, sDate, eDate, state, receive, null, page, pageSize, orderByClause, spid, userId, type, comment_user_id | |
| 97 | + PageInfo<ShyComments> commentPage = commentsService.getPage(commentsDTO); | |
| 110 | 98 | List<ShyComments> list = commentPage.getList(); |
| 111 | 99 | if (!list.isEmpty()) { |
| 112 | 100 | for (ShyComments comment : list) { |
| 113 | - if (comment.getState() != CommonConst.AUDIT_INTT) { | |
| 101 | + if (!comment.getState().equals(CommonConst.AUDIT_INTT)) { | |
| 114 | 102 | String updater = CommonUtils.isEmpty(comment.getUpdater()) || "null".equals(comment.getUpdater()) ? "白名单" : comment.getUpdater(); |
| 115 | 103 | String auditor_id = comment.getAuditor_id(); |
| 116 | 104 | if (CommonUtils.isNotEmpty(auditor_id)) { |
| ... | ... | @@ -313,33 +301,28 @@ public class CommentsController extends BaseController { |
| 313 | 301 | */ |
| 314 | 302 | @GetMapping("excel") |
| 315 | 303 | public void getExcel(CommentsDTO commentsDTO, HttpSession session, HttpServletResponse response) { |
| 316 | - | |
| 317 | - //String activity_id, String content, Integer is_hot, | |
| 318 | - // String start_date, String end_date, Integer state, Integer receive, Integer type, | |
| 319 | - // Integer page, Integer pageSize, String orderByClause, | |
| 320 | 304 | SessionUser sessionUser = (SessionUser) session.getAttribute(SessionUser.getSessionKey()); |
| 321 | 305 | Integer spid = sessionUser.getSpid(); |
| 306 | + commentsDTO.setSpid(spid); | |
| 322 | 307 | String userId = sessionUser.getUserId(); |
| 323 | - if (spid == 0) spid = null; | |
| 324 | - //if (CommonUtils.isNull(page)) page = 1; | |
| 325 | - //if (CommonUtils.isNull(pageSize)) pageSize = 10; | |
| 326 | - Date sDate = null; | |
| 327 | - Date eDate = null; | |
| 308 | + commentsDTO.setUserId(userId); | |
| 309 | + if (spid == 0) { | |
| 310 | + commentsDTO.setSpid(null); | |
| 311 | + } | |
| 328 | 312 | |
| 329 | - if (CommonUtils.isNotEmpty(commentsDTO.getStart_date())) { | |
| 313 | + if (CommonUtils.isNotEmpty(commentsDTO.getsDate())) { | |
| 330 | 314 | try { |
| 331 | - sDate = CommonUtils.parseDate(commentsDTO.getStart_date(), "yyyy-MM-dd"); | |
| 315 | + commentsDTO.setsDate(String.valueOf(CommonUtils.parseDate(commentsDTO.getsDate(), "yyyy-MM-dd"))); | |
| 332 | 316 | } catch (Exception e) { |
| 333 | 317 | } |
| 334 | 318 | } |
| 335 | - if (CommonUtils.isNotEmpty(commentsDTO.getEnd_date())) { | |
| 319 | + if (CommonUtils.isNotEmpty(commentsDTO.geteDate())) { | |
| 336 | 320 | try { |
| 337 | - eDate = CommonUtils.parseDate(commentsDTO.getEnd_date(), "yyyy-MM-dd"); | |
| 321 | + commentsDTO.seteDate(String.valueOf(CommonUtils.parseDate(commentsDTO.geteDate(), "yyyy-MM-dd"))); | |
| 338 | 322 | } catch (Exception e) { |
| 339 | 323 | } |
| 340 | 324 | } |
| 341 | - PageInfo<ShyComments> commentPage = commentsService.getPageExcel(commentsDTO.getActivity_id(), commentsDTO.getContent(), commentsDTO.getIs_hot(), sDate, eDate, commentsDTO.getState(), commentsDTO.getReceive(), null, commentsDTO.getPage(), commentsDTO.getPageSize(), commentsDTO.getOrderByClause(), spid, userId, commentsDTO.getType()); | |
| 342 | - //activity_id, content, is_hot, sDate, eDate, state, receive, null, page, pageSize, orderByClause, spid, userId, type | |
| 325 | + PageInfo<ShyComments> commentPage = commentsService.getPageExcel(commentsDTO); | |
| 343 | 326 | List<ShyComments> list = commentPage.getList(); |
| 344 | 327 | String fileName = "评论数据"; |
| 345 | 328 | |
| ... | ... | @@ -437,7 +420,7 @@ public class CommentsController extends BaseController { |
| 437 | 420 | |
| 438 | 421 | /* 审核员需要做处理*/ |
| 439 | 422 | String updater = "";//审核员名字 |
| 440 | - if (list.get(i).getState() != CommonConst.AUDIT_INTT) { | |
| 423 | + if (!list.get(i).getState().equals(CommonConst.AUDIT_INTT)) { | |
| 441 | 424 | updater = CommonUtils.isEmpty(list.get(i).getUpdater()) || "null".equals(list.get(i).getUpdater()) ? "自动通过" : list.get(i).getUpdater(); |
| 442 | 425 | String auditor_id = list.get(i).getAuditor_id(); |
| 443 | 426 | if (CommonUtils.isNotEmpty(auditor_id)) { |
| ... | ... | @@ -475,19 +458,23 @@ public class CommentsController extends BaseController { |
| 475 | 458 | } catch (final Exception e) { |
| 476 | 459 | e.printStackTrace(); |
| 477 | 460 | try { |
| 478 | - if (bis != null) | |
| 461 | + if (bis != null) { | |
| 479 | 462 | bis.close(); |
| 480 | - if (bos != null) | |
| 463 | + } | |
| 464 | + if (bos != null) { | |
| 481 | 465 | bos.close(); |
| 466 | + } | |
| 482 | 467 | } catch (Exception e1) { |
| 483 | 468 | e1.printStackTrace(); |
| 484 | 469 | } |
| 485 | 470 | } finally { |
| 486 | 471 | try { |
| 487 | - if (bis != null) | |
| 472 | + if (bis != null) { | |
| 488 | 473 | bis.close(); |
| 489 | - if (bos != null) | |
| 474 | + } | |
| 475 | + if (bos != null) { | |
| 490 | 476 | bos.close(); |
| 477 | + } | |
| 491 | 478 | } catch (Exception e2) { |
| 492 | 479 | e2.printStackTrace(); |
| 493 | 480 | } | ... | ... |
src/main/java/com/cnlive/shenhe/controller/ContentController.java
| ... | ... | @@ -46,66 +46,49 @@ public class ContentController extends BaseController { |
| 46 | 46 | * 图文列表 |
| 47 | 47 | * |
| 48 | 48 | * @param model |
| 49 | - * @param title | |
| 50 | - * @param contentId | |
| 51 | - * @param content_tag | |
| 52 | - * @param start_date | |
| 53 | - * @param end_date | |
| 54 | - * @param receive_status | |
| 55 | - * @param sp_desc | |
| 56 | - * @param source | |
| 57 | - * @param author | |
| 58 | - * @param page | |
| 59 | - * @param pageSize | |
| 60 | - * @param orderByClause | |
| 49 | + * @param contentDTO | |
| 61 | 50 | * @param session |
| 62 | 51 | * @return |
| 63 | 52 | */ |
| 64 | 53 | @GetMapping("/page") |
| 65 | - public String getPage(Model model, ContentDTO contentDTO , HttpSession session) { | |
| 66 | - //String title, String contentId, String content_tag, | |
| 67 | - // String start_date, String end_date, Integer receive_status, String sp_desc, String source, String author, | |
| 68 | - // Integer page, Integer pageSize, String orderByClause | |
| 54 | + public String getPage(Model model, ContentDTO contentDTO, HttpSession session) { | |
| 69 | 55 | SessionUser sessionUser = (SessionUser) session.getAttribute(SessionUser.getSessionKey()); |
| 70 | 56 | if (CommonUtils.isNull(sessionUser)) { |
| 71 | 57 | return "redirect:/users/login"; |
| 72 | 58 | } |
| 73 | 59 | Integer spid = sessionUser.getSpid(); |
| 60 | + contentDTO.setSpid(spid); | |
| 74 | 61 | String userId = sessionUser.getUserId(); |
| 75 | - //if (CommonUtils.isNull(page)) page = 1; | |
| 76 | - //if (CommonUtils.isNull(pageSize)) pageSize = 10; | |
| 77 | - if (CommonUtils.isNotEmpty(contentDTO.getSp_desc()) && spid == 0) { | |
| 62 | + contentDTO.setUserId(userId); | |
| 63 | + if (CommonUtils.isNotEmpty(contentDTO.getSp_desc()) && contentDTO.getSpid() == 0) { | |
| 78 | 64 | ShySites shySite = sitesService.findspidBySpdesc(contentDTO.getSp_desc()); |
| 79 | 65 | if (CommonUtils.isNotNull(shySite)) { |
| 80 | - spid = shySite.getSpid(); | |
| 66 | + contentDTO.setSpid(shySite.getSpid()); | |
| 81 | 67 | } else { |
| 82 | 68 | setmodelSite(model); |
| 83 | 69 | return "error.html"; |
| 84 | 70 | } |
| 85 | - } else if (CommonUtils.isEmpty(contentDTO.getSp_desc()) && spid == 0) { | |
| 86 | - spid = null; | |
| 71 | + } else if (CommonUtils.isEmpty(contentDTO.getSp_desc()) && contentDTO.getSpid() == 0) { | |
| 72 | + contentDTO.setSpid(null); | |
| 87 | 73 | } |
| 88 | - Date sDate = null; | |
| 89 | - Date eDate = null; | |
| 90 | 74 | |
| 91 | - if (CommonUtils.isNotEmpty(contentDTO.getStart_date())) { | |
| 75 | + if (CommonUtils.isNotEmpty(String.valueOf(contentDTO.getsDate()))) { | |
| 92 | 76 | try { |
| 93 | - sDate = CommonUtils.parseDate(contentDTO.getStart_date(), "yyyy-MM-dd"); | |
| 77 | + contentDTO.setsDate(String.valueOf(CommonUtils.parseDate(String.valueOf(contentDTO.getsDate()), "yyyy-MM-dd"))); | |
| 94 | 78 | } catch (Exception e) { |
| 95 | 79 | } |
| 96 | 80 | } |
| 97 | - if (CommonUtils.isNotEmpty(contentDTO.getEnd_date())) { | |
| 81 | + if (CommonUtils.isNotEmpty(contentDTO.geteDate())) { | |
| 98 | 82 | try { |
| 99 | - eDate = CommonUtils.parseDate(contentDTO.getEnd_date(), "yyyy-MM-dd"); | |
| 83 | + contentDTO.seteDate(String.valueOf(CommonUtils.parseDate(contentDTO.geteDate(), "yyyy-MM-dd"))); | |
| 100 | 84 | } catch (Exception e) { |
| 101 | 85 | } |
| 102 | 86 | } |
| 103 | - PageInfo<ShyContent> contentPage = contentService.getPage(contentDTO.getTitle(), contentDTO.getSource(), contentDTO.getAuthor(), contentDTO.getContent_tag(), contentDTO.getContentId(), sDate, eDate, contentDTO.getReceive_status(), null, contentDTO.getPage(), contentDTO.getPageSize(), contentDTO.getOrderByClause(), spid, userId); | |
| 104 | - //title, source, author, content_tag, contentId, sDate, eDate, receive_status, null, page, pageSize, orderByClause, spid, userId | |
| 87 | + PageInfo<ShyContent> contentPage = contentService.getPage(contentDTO); | |
| 105 | 88 | List<ShyContent> list = contentPage.getList(); |
| 106 | 89 | if (!list.isEmpty()) { |
| 107 | 90 | for (ShyContent content : list) { |
| 108 | - if (content.getReceive_status() == CommonConst.RECEIVE_AUDIT) { | |
| 91 | + if (content.getReceive_status().equals(CommonConst.RECEIVE_AUDIT)) { | |
| 109 | 92 | String auditor_id = content.getAuditor_id(); |
| 110 | 93 | String updater = CommonUtils.isEmpty(content.getUpdater()) || "null".equals(content.getUpdater()) ? "白名单" : content.getUpdater(); |
| 111 | 94 | updater = sitesService.getUpdater(updater, auditor_id); |
| ... | ... | @@ -232,37 +215,33 @@ public class ContentController extends BaseController { |
| 232 | 215 | */ |
| 233 | 216 | @GetMapping("excel") |
| 234 | 217 | public void getExcel(ContentDTO contentDTO, HttpSession session, HttpServletResponse response) { |
| 235 | - //String title, String contentId, String content_tag, | |
| 236 | - // String start_date, String end_date, Integer receive_status, String sp_desc, | |
| 237 | - // Integer page, Integer pageSize, String orderByClause | |
| 238 | 218 | SessionUser sessionUser = (SessionUser) session.getAttribute(SessionUser.getSessionKey()); |
| 239 | 219 | Integer spid = sessionUser.getSpid(); |
| 240 | - if (CommonUtils.isNotEmpty(contentDTO.getSp_desc()) && spid == 0) { | |
| 220 | + contentDTO.setSpid(spid); | |
| 221 | + String userId = sessionUser.getUserId(); | |
| 222 | + contentDTO.setUserId(userId); | |
| 223 | + if (CommonUtils.isNotEmpty(contentDTO.getSp_desc()) && contentDTO.getSpid() == 0) { | |
| 241 | 224 | ShySites shySite = sitesService.findspidBySpdesc(contentDTO.getSp_desc()); |
| 242 | 225 | if (CommonUtils.isNotNull(shySite)) { |
| 243 | - spid = shySite.getSpid(); | |
| 226 | + contentDTO.setSpid(shySite.getSpid()); | |
| 244 | 227 | } |
| 245 | - } else if (CommonUtils.isEmpty(contentDTO.getSp_desc()) && spid == 0) { | |
| 246 | - spid = null; | |
| 228 | + } else if (CommonUtils.isEmpty(contentDTO.getSp_desc()) && contentDTO.getSpid() == 0) { | |
| 229 | + contentDTO.setSpid(null); | |
| 247 | 230 | } |
| 248 | - Date sDate = null; | |
| 249 | - Date eDate = null; | |
| 250 | 231 | |
| 251 | - if (CommonUtils.isNotEmpty(contentDTO.getStart_date())) { | |
| 232 | + if (CommonUtils.isNotEmpty(contentDTO.getsDate())) { | |
| 252 | 233 | try { |
| 253 | - sDate = CommonUtils.parseDate(contentDTO.getStart_date(), "yyyy-MM-dd"); | |
| 234 | + contentDTO.setsDate(String.valueOf((CommonUtils.parseDate(contentDTO.getsDate(), "yyyy-MM-dd")))); | |
| 254 | 235 | } catch (Exception e) { |
| 255 | 236 | } |
| 256 | 237 | } |
| 257 | - if (CommonUtils.isNotEmpty(contentDTO.getEnd_date())) { | |
| 238 | + if (CommonUtils.isNotEmpty(contentDTO.geteDate())) { | |
| 258 | 239 | try { |
| 259 | - eDate = CommonUtils.parseDate(contentDTO.getEnd_date(), "yyyy-MM-dd"); | |
| 240 | + contentDTO.seteDate(String.valueOf(CommonUtils.parseDate(contentDTO.geteDate(), "yyyy-MM-dd"))); | |
| 260 | 241 | } catch (Exception e) { |
| 261 | 242 | } |
| 262 | 243 | } |
| 263 | - List<ShyContent> contentList = contentService.findByCondition(contentDTO.getTitle(), contentDTO.getContent_tag(), contentDTO.getContentId(), sDate, eDate, contentDTO.getReceive_status(), contentDTO.getPage(), contentDTO.getPageSize(), contentDTO.getOrderByClause(), spid); | |
| 264 | - //title, content_tag, contentId, sDate, eDate, receive_status, page, pageSize, orderByClause, spid | |
| 265 | - | |
| 244 | + List<ShyContent> contentList = contentService.findByCondition(contentDTO); | |
| 266 | 245 | String fileName = "图文数据"; |
| 267 | 246 | |
| 268 | 247 | XSSFWorkbook wb = new XSSFWorkbook(); |
| ... | ... | @@ -322,7 +301,7 @@ public class ContentController extends BaseController { |
| 322 | 301 | } |
| 323 | 302 | cell = row.createCell(4);//列 |
| 324 | 303 | cell.setCellValue(contentTag); |
| 325 | - | |
| 304 | + | |
| 326 | 305 | /*状态需要处理成用户可读*/ |
| 327 | 306 | String shenheType = "";//审核类型,1:免审,2:机审,3:人工审 |
| 328 | 307 | if (contentList.get(i).getShenhe_type() == 1) { |
| ... | ... | @@ -334,7 +313,7 @@ public class ContentController extends BaseController { |
| 334 | 313 | } |
| 335 | 314 | cell = row.createCell(5);//列 |
| 336 | 315 | cell.setCellValue(shenheType); |
| 337 | - | |
| 316 | + | |
| 338 | 317 | /*状态需要处理成用户可读*/ |
| 339 | 318 | String contentStatus = "";//内容状态:0:待发布,1:已发布,2:已下线,3:已删除 |
| 340 | 319 | if (contentList.get(i).getContent_status() == 0) { |
| ... | ... | @@ -353,7 +332,7 @@ public class ContentController extends BaseController { |
| 353 | 332 | cell.setCellValue(contentList.get(i).getContent_time() == null ? "" : CommonUtils.formatDate(contentList.get(i).getContent_time(), "yyyy-MM-dd HH:mm:ss")); |
| 354 | 333 | cell = row.createCell(8);//列 |
| 355 | 334 | cell.setCellValue(contentList.get(i).getCreate_date() == null ? "" : CommonUtils.formatDate(contentList.get(i).getCreate_date(), "yyyy-MM-dd HH:mm:ss")); |
| 356 | - | |
| 335 | + | |
| 357 | 336 | /*状态需要处理成用户可读*/ |
| 358 | 337 | String receiveStatus = "";//领取状态。0:未领取;1:已领取,2:已审核 |
| 359 | 338 | if (contentList.get(i).getReceive_status() == 1) { |
| ... | ... | @@ -366,10 +345,10 @@ public class ContentController extends BaseController { |
| 366 | 345 | |
| 367 | 346 | cell = row.createCell(9);//列 |
| 368 | 347 | cell.setCellValue(receiveStatus); |
| 369 | - | |
| 348 | + | |
| 370 | 349 | /* 审核员需要做处理*/ |
| 371 | 350 | String updater = "";//审核员名字 |
| 372 | - if (contentList.get(i).getReceive_status() != CommonConst.RECEIVE_BEFORE) { | |
| 351 | + if (!contentList.get(i).getReceive_status().equals(CommonConst.RECEIVE_BEFORE)) { | |
| 373 | 352 | updater = CommonUtils.isEmpty(contentList.get(i).getUpdater()) || "null".equals(contentList.get(i).getUpdater()) ? "自动通过" : contentList.get(i).getUpdater(); |
| 374 | 353 | String auditor_id = contentList.get(i).getAuditor_id(); |
| 375 | 354 | if (CommonUtils.isNotEmpty(auditor_id)) { |
| ... | ... | @@ -414,19 +393,23 @@ public class ContentController extends BaseController { |
| 414 | 393 | } catch (final Exception e) { |
| 415 | 394 | e.printStackTrace(); |
| 416 | 395 | try { |
| 417 | - if (bis != null) | |
| 396 | + if (bis != null) { | |
| 418 | 397 | bis.close(); |
| 419 | - if (bos != null) | |
| 398 | + } | |
| 399 | + if (bos != null) { | |
| 420 | 400 | bos.close(); |
| 401 | + } | |
| 421 | 402 | } catch (Exception e1) { |
| 422 | 403 | e1.printStackTrace(); |
| 423 | 404 | } |
| 424 | 405 | } finally { |
| 425 | 406 | try { |
| 426 | - if (bis != null) | |
| 407 | + if (bis != null) { | |
| 427 | 408 | bis.close(); |
| 428 | - if (bos != null) | |
| 409 | + } | |
| 410 | + if (bos != null) { | |
| 429 | 411 | bos.close(); |
| 412 | + } | |
| 430 | 413 | } catch (Exception e2) { |
| 431 | 414 | e2.printStackTrace(); |
| 432 | 415 | } | ... | ... |
src/main/java/com/cnlive/shenhe/controller/EmailController.java
| ... | ... | @@ -46,16 +46,11 @@ public class EmailController extends BaseController { |
| 46 | 46 | |
| 47 | 47 | @GetMapping(value = "/page") |
| 48 | 48 | public String page(Model model, EmailDTO emailDTO, HttpSession session) { |
| 49 | - //Integer page, Integer pageSize, String orderByClause, | |
| 50 | - // String remark,String email | |
| 51 | 49 | SessionUser sessionUser = (SessionUser) session.getAttribute(SessionUser.getSessionKey()); |
| 52 | 50 | if(CommonUtils.isNull(sessionUser)){ |
| 53 | 51 | return "redirect:/users/login"; |
| 54 | 52 | } |
| 55 | - //if (CommonUtils.isNull(page)) page = 1; | |
| 56 | - //if (CommonUtils.isNull(pageSize)) pageSize = 10; | |
| 57 | - PageInfo<ShyEmail> emailPage = emailServiceImpl.getPage(emailDTO.getPage(), emailDTO.getPageSize(), emailDTO.getOrderByClause(), emailDTO.getRemark(),emailDTO.getEmail()); | |
| 58 | - //page, pageSize, orderByClause, remark,email | |
| 53 | + PageInfo<ShyEmail> emailPage = emailServiceImpl.getPage(emailDTO); | |
| 59 | 54 | List<ShyEmail> list = emailPage.getList(); |
| 60 | 55 | JSONObject email_message = CommonConst.EMAIL_MESSAGE; |
| 61 | 56 | if (!list.isEmpty()) { | ... | ... |
src/main/java/com/cnlive/shenhe/controller/LiveApplyController.java
| ... | ... | @@ -66,9 +66,9 @@ public class LiveApplyController extends BaseController { |
| 66 | 66 | /** |
| 67 | 67 | * 直播申请审核信息回调接口 |
| 68 | 68 | * |
| 69 | - * @param activity_id 视频id | |
| 69 | + * @param ids 视频id | |
| 70 | 70 | * @param state 状态码 |
| 71 | - * @param attr_tags 标签 | |
| 71 | + * @param | |
| 72 | 72 | * @param msg 备注信息 |
| 73 | 73 | * @return |
| 74 | 74 | */ |
| ... | ... | @@ -117,48 +117,36 @@ public class LiveApplyController extends BaseController { |
| 117 | 117 | /** |
| 118 | 118 | * 内容分页列表接口 |
| 119 | 119 | * |
| 120 | - * @param video_title | |
| 121 | - * @param start_date | |
| 122 | - * @param end_date | |
| 123 | - * @param state | |
| 124 | - * @param page | |
| 125 | - * @param pageSize | |
| 126 | - * @param orderByClause | |
| 120 | + * @param liveApplyDTO | |
| 127 | 121 | * @return |
| 128 | 122 | */ |
| 129 | 123 | @GetMapping("/page") |
| 130 | 124 | public Object getListLiveApply(Model model, LiveApplyDTO liveApplyDTO, HttpSession session) { |
| 131 | - //String start_date,String end_date, | |
| 132 | - // String theme, String business_model, Integer page,Integer pageSize, | |
| 133 | - // Integer shenhe_state,Integer receive, String sp_desc,String orderByClause | |
| 134 | 125 | System.out.println("进入直播申请内容页"); |
| 135 | 126 | SessionUser sessionUser = (SessionUser) session.getAttribute(SessionUser.getSessionKey()); |
| 136 | 127 | if(CommonUtils.isNull(sessionUser)){ |
| 137 | 128 | return "redirect:/users/login"; |
| 138 | 129 | } |
| 139 | 130 | Integer spid = sessionUser.getSpid(); |
| 131 | + liveApplyDTO.setSpid(spid); | |
| 140 | 132 | String userId = sessionUser.getUserId(); |
| 141 | - //if (CommonUtils.isNull(page)) page = 1; | |
| 142 | - //if (CommonUtils.isNull(pageSize)) pageSize = 10; | |
| 133 | + liveApplyDTO.setUserId(userId); | |
| 143 | 134 | if (CommonUtils.isNotEmpty(liveApplyDTO.getSp_desc()) && spid == 0) { |
| 144 | 135 | ShySites shySite=sitesService.findspidBySpdesc(liveApplyDTO.getSp_desc()); |
| 145 | 136 | if(CommonUtils.isNotNull(shySite)){ |
| 146 | - spid = shySite.getSpid(); | |
| 137 | + liveApplyDTO.setSpid(shySite.getSpid()); | |
| 147 | 138 | }else{ |
| 148 | 139 | setmodelSite(model); |
| 149 | 140 | return "error.html"; |
| 150 | 141 | } |
| 151 | 142 | } else if (CommonUtils.isEmpty(liveApplyDTO.getSp_desc()) && spid == 0) { |
| 152 | - spid = null; | |
| 143 | + liveApplyDTO.setSpid(null); | |
| 153 | 144 | } |
| 154 | - PageInfo<ShyLiveapply> liveApplyPage = liveApplyServiceImpl.getListLiveApply(liveApplyDTO.getTheme(), liveApplyDTO.getStart_date(),liveApplyDTO.getEnd_date(), | |
| 155 | - liveApplyDTO.getBusiness_model(), liveApplyDTO.getPage(), liveApplyDTO.getPageSize(), liveApplyDTO.getShenhe_state(),liveApplyDTO.getReceive(), liveApplyDTO.getOrderByClause(), spid, userId); | |
| 156 | - //theme, start_date,end_date, | |
| 157 | - // business_model, page, pageSize, shenhe_state,receive, orderByClause, spid, userId | |
| 145 | + PageInfo<ShyLiveapply> liveApplyPage = liveApplyServiceImpl.getListLiveApply(liveApplyDTO); | |
| 158 | 146 | List<ShyLiveapply> list = liveApplyPage.getList(); |
| 159 | 147 | if (!list.isEmpty()) { |
| 160 | 148 | for (ShyLiveapply liveApply : list) { |
| 161 | - if (liveApply.getShenhe_state() != CommonConst.AUDIT_INTT) { | |
| 149 | + if (!liveApply.getShenhe_state().equals(CommonConst.AUDIT_INTT)) { | |
| 162 | 150 | String updater =CommonUtils.isEmpty(liveApply.getUpdater()) || "null".equals(liveApply.getUpdater())? "白名单":liveApply.getUpdater(); |
| 163 | 151 | String auditor_id = liveApply.getAuditor(); |
| 164 | 152 | if (CommonUtils.isNotEmpty(auditor_id)) { |
| ... | ... | @@ -226,7 +214,7 @@ public class LiveApplyController extends BaseController { |
| 226 | 214 | for (String cid : cids) { |
| 227 | 215 | ShyLiveapply shyLiveapply = liveApplyServiceImpl.selectByPrimaryKey(Integer.parseInt(cid)); |
| 228 | 216 | if (CommonUtils.isNotNull(shyLiveapply)) { |
| 229 | - if (shyLiveapply.getShenhe_state() != CommonConst.RECEIVE_BEFORE ) { | |
| 217 | + if (!shyLiveapply.getShenhe_state().equals(CommonConst.RECEIVE_BEFORE)) { | |
| 230 | 218 | return new ResponseBean(ErrorEnum.ERROR.getErrorCode(), "您领取的内容中有已被领取或者已经被审核,请检查并重试"); |
| 231 | 219 | } |
| 232 | 220 | } else { |
| ... | ... | @@ -317,25 +305,21 @@ public class LiveApplyController extends BaseController { |
| 317 | 305 | */ |
| 318 | 306 | @GetMapping("excel") |
| 319 | 307 | public void getExcel(LiveApplyDTO liveApplyDTO, HttpSession session,HttpServletResponse response) { |
| 320 | - //String start_date,String end_date, | |
| 321 | - // String theme, Integer business_model, Integer page,Integer pageSize, | |
| 322 | - // Integer shenhe_state,Integer receive, String sp_desc,String orderByClause | |
| 323 | 308 | SessionUser sessionUser = (SessionUser) session.getAttribute(SessionUser.getSessionKey()); |
| 324 | 309 | Integer spid = sessionUser.getSpid(); |
| 310 | + liveApplyDTO.setSpid(spid); | |
| 325 | 311 | String userId = sessionUser.getUserId(); |
| 312 | + liveApplyDTO.setUserId(userId); | |
| 326 | 313 | if (CommonUtils.isNotEmpty(liveApplyDTO.getSp_desc()) && spid == 0) { |
| 327 | 314 | ShySites shySite=sitesService.findspidBySpdesc(liveApplyDTO.getSp_desc()); |
| 328 | 315 | if(CommonUtils.isNotNull(shySite)){ |
| 329 | - spid = shySite.getSpid(); | |
| 316 | + liveApplyDTO.setSpid(shySite.getSpid()); | |
| 330 | 317 | } |
| 331 | 318 | }else if (CommonUtils.isEmpty(liveApplyDTO.getSp_desc()) && spid == 0) { |
| 332 | - spid = null; | |
| 319 | + liveApplyDTO.setSpid(null); | |
| 333 | 320 | } |
| 334 | - List<ShyLiveapply> liveApplyList = liveApplyServiceImpl.findByCondition(liveApplyDTO.getTheme(), liveApplyDTO.getStart_date(),liveApplyDTO.getEnd_date(), | |
| 335 | - liveApplyDTO.getBusiness_model(), liveApplyDTO.getPage(), liveApplyDTO.getPageSize(), liveApplyDTO.getShenhe_state(),liveApplyDTO.getReceive(), liveApplyDTO.getOrderByClause(), spid, userId); | |
| 336 | - //theme, start_date,end_date, | |
| 337 | - // business_model, page, pageSize, shenhe_state,receive, orderByClause, | |
| 338 | - | |
| 321 | + List<ShyLiveapply> liveApplyList = liveApplyServiceImpl.findByCondition(liveApplyDTO); | |
| 322 | + | |
| 339 | 323 | String fileName = "直播申请数据"; |
| 340 | 324 | |
| 341 | 325 | XSSFWorkbook wb = new XSSFWorkbook(); |
| ... | ... | @@ -429,19 +413,23 @@ public class LiveApplyController extends BaseController { |
| 429 | 413 | } catch (final Exception e) { |
| 430 | 414 | e.printStackTrace(); |
| 431 | 415 | try { |
| 432 | - if (bis != null) | |
| 416 | + if (bis != null) { | |
| 433 | 417 | bis.close(); |
| 434 | - if (bos != null) | |
| 418 | + } | |
| 419 | + if (bos != null) { | |
| 435 | 420 | bos.close(); |
| 421 | + } | |
| 436 | 422 | } catch (Exception e1) { |
| 437 | 423 | e1.printStackTrace(); |
| 438 | 424 | } |
| 439 | 425 | } finally { |
| 440 | 426 | try { |
| 441 | - if (bis != null) | |
| 427 | + if (bis != null) { | |
| 442 | 428 | bis.close(); |
| 443 | - if (bos != null) | |
| 429 | + } | |
| 430 | + if (bos != null) { | |
| 444 | 431 | bos.close(); |
| 432 | + } | |
| 445 | 433 | } catch (Exception e2) { |
| 446 | 434 | e2.printStackTrace(); |
| 447 | 435 | } | ... | ... |
src/main/java/com/cnlive/shenhe/controller/LiveController.java
| ... | ... | @@ -112,43 +112,28 @@ public class LiveController extends BaseController { |
| 112 | 112 | * 内容分页列表接口 |
| 113 | 113 | * |
| 114 | 114 | * @param model |
| 115 | - * @param activity_id | |
| 116 | - * @param start_date | |
| 117 | - * @param end_date | |
| 118 | - * @param activity_name | |
| 119 | - * @param activity_status | |
| 120 | - * @param page | |
| 121 | - * @param pageSize | |
| 122 | - * @param shenhe_state | |
| 123 | - * @param sp_desc | |
| 124 | - * @param contentId | |
| 115 | + * @param liveDTO | |
| 125 | 116 | * @param session |
| 126 | 117 | * @return |
| 127 | 118 | */ |
| 128 | 119 | @GetMapping("/page") |
| 129 | 120 | public Object getListVideos(Model model, LiveDTO liveDTO, HttpSession session) { |
| 130 | - //String activity_id, String start_date, String end_date, | |
| 131 | - // String activity_name, Integer activity_status, Integer page, Integer pageSize, | |
| 132 | - // Integer shenhe_state, String sp_desc, Integer contentId | |
| 133 | 121 | System.out.println("进入直播内容页"); |
| 134 | 122 | SessionUser sessionUser = (SessionUser) session.getAttribute(SessionUser.getSessionKey()); |
| 135 | -// if(CommonUtils.isNull(sessionUser)){ | |
| 136 | -// return "redirect:/users/login"; | |
| 137 | -// } | |
| 138 | 123 | Integer spid = sessionUser.getSpid(); |
| 139 | 124 | String userId = sessionUser.getUserId(); |
| 140 | - //if (CommonUtils.isNull(page)) page = 1; | |
| 141 | - //if (CommonUtils.isNull(pageSize)) pageSize = 20; | |
| 125 | + liveDTO.setSpid(spid); | |
| 126 | + liveDTO.setUserId(userId); | |
| 142 | 127 | if (CommonUtils.isNotEmpty(liveDTO.getSp_desc()) && spid == 0) { |
| 143 | 128 | ShySites shySite = sitesService.findspidBySpdesc(liveDTO.getSp_desc()); |
| 144 | 129 | if (CommonUtils.isNotNull(shySite)) { |
| 145 | - spid = shySite.getSpid(); | |
| 130 | + liveDTO.setSpid(shySite.getSpid()); | |
| 146 | 131 | } else { |
| 147 | 132 | setmodelSite(model); |
| 148 | 133 | return "error.html"; |
| 149 | 134 | } |
| 150 | 135 | } else if (CommonUtils.isEmpty(liveDTO.getSp_desc()) && spid == 0) { |
| 151 | - spid = null; | |
| 136 | + liveDTO.setSpid(null); | |
| 152 | 137 | } |
| 153 | 138 | String orderByClause = ""; |
| 154 | 139 | //审核状态:全部待领 |
| ... | ... | @@ -179,8 +164,7 @@ public class LiveController extends BaseController { |
| 179 | 164 | } |
| 180 | 165 | } |
| 181 | 166 | |
| 182 | - PageInfo<ShyLive> livePage = liveService.getListContent(liveDTO.getActivity_name(), liveDTO.getStart_date(), liveDTO.getEnd_date(), | |
| 183 | - liveDTO.getActivity_id(), liveDTO.getActivity_status(), liveDTO.getPage(), liveDTO.getPageSize(), liveDTO.getShenhe_state(), orderByClause, spid, userId); | |
| 167 | + PageInfo<ShyLive> livePage = liveService.getListContent(liveDTO); | |
| 184 | 168 | List<ShyLive> list = livePage.getList(); |
| 185 | 169 | if (!list.isEmpty()) { |
| 186 | 170 | for (ShyLive live : list) { |
| ... | ... | @@ -376,22 +360,21 @@ public class LiveController extends BaseController { |
| 376 | 360 | */ |
| 377 | 361 | @GetMapping("excel") |
| 378 | 362 | public void getExcel(LiveDTO liveDTO, HttpSession session,HttpServletResponse response) { |
| 379 | - //String activity_id,String start_date,String end_date, | |
| 380 | - // String activity_name, Integer activity_status, Integer page,Integer pageSize, | |
| 381 | - // Integer shenhe_state, String orderByClause, String sp_desc | |
| 363 | + | |
| 382 | 364 | SessionUser sessionUser = (SessionUser) session.getAttribute(SessionUser.getSessionKey()); |
| 383 | 365 | Integer spid = sessionUser.getSpid(); |
| 384 | 366 | String userId = sessionUser.getUserId(); |
| 367 | + liveDTO.setSpid(spid); | |
| 368 | + liveDTO.setUserId(userId); | |
| 385 | 369 | if (CommonUtils.isNotEmpty(liveDTO.getSp_desc()) && spid == 0) { |
| 386 | 370 | ShySites shySite=sitesService.findspidBySpdesc(liveDTO.getSp_desc()); |
| 387 | 371 | if(CommonUtils.isNotNull(shySite)){ |
| 388 | - spid = shySite.getSpid(); | |
| 372 | + liveDTO.setSpid(shySite.getSpid()); | |
| 389 | 373 | } |
| 390 | 374 | }else if (CommonUtils.isEmpty(liveDTO.getSp_desc()) && spid == 0) { |
| 391 | - spid = null; | |
| 375 | + liveDTO.setSpid(null); | |
| 392 | 376 | } |
| 393 | - List<ShyLive> liveList = liveService.findByCondition(liveDTO.getActivity_name(), liveDTO.getStart_date(),liveDTO.getEnd_date(), | |
| 394 | - liveDTO.getActivity_id(), liveDTO.getActivity_status(), liveDTO.getPage(), liveDTO.getPageSize(), liveDTO.getShenhe_state(), liveDTO.getOrderByClause(), spid,userId); | |
| 377 | + List<ShyLive> liveList = liveService.findByCondition(liveDTO); | |
| 395 | 378 | |
| 396 | 379 | String fileName = "直播数据"; |
| 397 | 380 | |
| ... | ... | @@ -526,19 +509,23 @@ public class LiveController extends BaseController { |
| 526 | 509 | } catch (final Exception e) { |
| 527 | 510 | e.printStackTrace(); |
| 528 | 511 | try { |
| 529 | - if (bis != null) | |
| 512 | + if (bis != null) { | |
| 530 | 513 | bis.close(); |
| 531 | - if (bos != null) | |
| 514 | + } | |
| 515 | + if (bos != null) { | |
| 532 | 516 | bos.close(); |
| 517 | + } | |
| 533 | 518 | } catch (Exception e1) { |
| 534 | 519 | e1.printStackTrace(); |
| 535 | 520 | } |
| 536 | 521 | } finally { |
| 537 | 522 | try { |
| 538 | - if (bis != null) | |
| 523 | + if (bis != null) { | |
| 539 | 524 | bis.close(); |
| 540 | - if (bos != null) | |
| 525 | + } | |
| 526 | + if (bos != null) { | |
| 541 | 527 | bos.close(); |
| 528 | + } | |
| 542 | 529 | } catch (Exception e2) { |
| 543 | 530 | e2.printStackTrace(); |
| 544 | 531 | } | ... | ... |
src/main/java/com/cnlive/shenhe/controller/NotSpeakController.java
| ... | ... | @@ -55,30 +55,19 @@ public class NotSpeakController extends BaseController { |
| 55 | 55 | /** |
| 56 | 56 | * 禁言列表页 |
| 57 | 57 | * |
| 58 | - * @param activity_id | |
| 59 | - * @param content | |
| 60 | - * @param is_hot | |
| 61 | - * @param start_date | |
| 62 | - * @param end_date | |
| 63 | - * @param state | |
| 64 | - * @param page | |
| 65 | - * @param pageSize | |
| 66 | - * @param orderByClause | |
| 58 | + * @param notSpeakDTO | |
| 67 | 59 | * @return |
| 68 | 60 | */ |
| 69 | 61 | @GetMapping("/page") |
| 70 | 62 | public String getPage(Model model, NotSpeakDTO notSpeakDTO, HttpSession session) { |
| 71 | - //String user_name, Integer user_id,Integer state, | |
| 72 | - // Integer page, Integer pageSize, String orderByClause | |
| 73 | 63 | SessionUser sessionUser = (SessionUser) session.getAttribute(SessionUser.getSessionKey()); |
| 74 | 64 | if(CommonUtils.isNull(sessionUser)){ |
| 75 | 65 | return "redirect:/users/login"; |
| 76 | 66 | } |
| 77 | 67 | String userId = sessionUser.getUserId(); |
| 78 | - //if (CommonUtils.isNull(page)) page = 1; | |
| 79 | - //if (CommonUtils.isNull(pageSize)) pageSize = 10; | |
| 80 | - PageInfo<ShyNotspeak> shyNotspeakPage = notSpeakService.getPage(notSpeakDTO.getUser_name(),notSpeakDTO.getUser_id(), notSpeakDTO.getState(), notSpeakDTO.getPage(), notSpeakDTO.getPageSize(), notSpeakDTO.getOrderByClause()); | |
| 81 | - //user_name,user_id, state, page, pageSize, orderByClause | |
| 68 | + notSpeakDTO.setUserId(userId); | |
| 69 | + PageInfo<ShyNotspeak> shyNotspeakPage = notSpeakService.getPage(notSpeakDTO); | |
| 70 | + | |
| 82 | 71 | List<ShyNotspeak> list = shyNotspeakPage.getList(); |
| 83 | 72 | if (!list.isEmpty()) { |
| 84 | 73 | for (ShyNotspeak notspeak : list) { |
| ... | ... | @@ -115,7 +104,7 @@ public class NotSpeakController extends BaseController { |
| 115 | 104 | /** |
| 116 | 105 | * 禁言(通过评论进入) |
| 117 | 106 | * @param commentId |
| 118 | - * @param type | |
| 107 | + * @param | |
| 119 | 108 | * @param time |
| 120 | 109 | * @param session |
| 121 | 110 | * @return |
| ... | ... | @@ -131,8 +120,8 @@ public class NotSpeakController extends BaseController { |
| 131 | 120 | /** |
| 132 | 121 | * 查询禁言状态(通过评论进入) |
| 133 | 122 | * @param commentId |
| 134 | - * @param type | |
| 135 | - * @param time | |
| 123 | + * @param | |
| 124 | + * @param | |
| 136 | 125 | * @param session |
| 137 | 126 | * @return |
| 138 | 127 | */ | ... | ... |
src/main/java/com/cnlive/shenhe/controller/ShyActivityController.java
| ... | ... | @@ -6,15 +6,11 @@ import com.cnlive.shenhe.bean.ResponseBean; |
| 6 | 6 | import com.cnlive.shenhe.dto.ShyActivityDTO; |
| 7 | 7 | import com.cnlive.shenhe.entity.ShyActivity; |
| 8 | 8 | import com.cnlive.shenhe.serviceImpl.ShyActivityImpl; |
| 9 | -import com.cnlive.shenhe.utils.CommonConst; | |
| 10 | -import com.cnlive.shenhe.utils.CommonUtils; | |
| 11 | 9 | import com.github.pagehelper.PageInfo; |
| 12 | 10 | import org.springframework.beans.factory.annotation.Autowired; |
| 13 | 11 | import org.springframework.stereotype.Controller; |
| 14 | 12 | import org.springframework.ui.Model; |
| 15 | 13 | import org.springframework.web.bind.annotation.*; |
| 16 | - | |
| 17 | -import java.util.Date; | |
| 18 | 14 | import java.util.List; |
| 19 | 15 | |
| 20 | 16 | |
| ... | ... | @@ -64,7 +60,6 @@ public class ShyActivityController extends BaseController { |
| 64 | 60 | |
| 65 | 61 | @GetMapping("/page") |
| 66 | 62 | public String getShyActivity(ShyActivityDTO shyActivityDTO, Model model) { |
| 67 | - //@RequestParam(defaultValue = "1") Integer pageNum, @RequestParam(defaultValue = "10") Integer pageSize, String activity, Integer exempt_from_trial | |
| 68 | 63 | PageInfo<ShyActivity> shyActivityPageInfo = shyActivityImpl.selectByExample(shyActivityDTO); |
| 69 | 64 | List<ShyActivity> list = shyActivityPageInfo.getList(); |
| 70 | 65 | model.addAttribute("exempt_from_trial",shyActivityDTO.getExempt_from_trial()); | ... | ... |
src/main/java/com/cnlive/shenhe/controller/SitesController.java
| ... | ... | @@ -37,28 +37,27 @@ public class SitesController extends BaseController { |
| 37 | 37 | /** |
| 38 | 38 | * 站点白名单分页列表 |
| 39 | 39 | * |
| 40 | - * @param page | |
| 41 | - * @param pageSize | |
| 42 | - * @param orderByClause | |
| 43 | - * @param keyword | |
| 40 | + * @param sitesDTO | |
| 44 | 41 | * @return |
| 45 | 42 | */ |
| 46 | 43 | @GetMapping(value = "/page") |
| 47 | 44 | public String page(Model model, SitesDTO sitesDTO, HttpSession session) { |
| 48 | - //Integer page, Integer pageSize, String orderByClause, String keyword | |
| 45 | + | |
| 49 | 46 | SessionUser sessionUser = (SessionUser) session.getAttribute(SessionUser.getSessionKey()); |
| 50 | 47 | if(CommonUtils.isNull(sessionUser)){ |
| 51 | 48 | return "redirect:/users/login"; |
| 52 | 49 | } |
| 53 | 50 | Integer spid = sessionUser.getSpid(); |
| 51 | + sitesDTO.setSpId(spid); | |
| 54 | 52 | if (!sessionUser.isMaster() && spid != 0) { |
| 55 | 53 | setmodelSite(model); |
| 56 | 54 | return "error.html"; |
| 57 | 55 | } |
| 58 | - if (spid == 0) spid = null; | |
| 59 | - //if (CommonUtils.isNull(page)) page = 1; | |
| 60 | - //if (CommonUtils.isNull(pageSize)) pageSize = 10; | |
| 61 | - PageInfo<ShySites> sitePage = sitesService.getPage(sitesDTO.getPage(), sitesDTO.getPageSize(), sitesDTO.getOrderByClause(), sitesDTO.getKeyword(), spid); | |
| 56 | + if (spid == 0) { | |
| 57 | + sitesDTO.setSpId(null); | |
| 58 | + } | |
| 59 | + | |
| 60 | + PageInfo<ShySites> sitePage = sitesService.getPage(sitesDTO); | |
| 62 | 61 | List<ShySites> list = sitePage.getList(); |
| 63 | 62 | JSONObject business = CommonConst.BUSINESS; |
| 64 | 63 | if (!list.isEmpty()) { | ... | ... |
src/main/java/com/cnlive/shenhe/controller/TopicController.java
| ... | ... | @@ -53,61 +53,50 @@ public class TopicController extends BaseController { |
| 53 | 53 | * 图文列表 |
| 54 | 54 | * |
| 55 | 55 | * @param model |
| 56 | - * @param title | |
| 57 | - * @param start_date | |
| 58 | - * @param end_date | |
| 59 | - * @param receive_status | |
| 60 | - * @param sp_desc | |
| 61 | - * @param page | |
| 62 | - * @param pageSize | |
| 63 | - * @param orderByClause | |
| 56 | + * @param topicDTO | |
| 64 | 57 | * @param session |
| 65 | 58 | * @return |
| 66 | 59 | */ |
| 67 | 60 | @GetMapping("/page") |
| 68 | 61 | public String getPage(Model model, TopicDTO topicDTO, HttpSession session) { |
| 69 | - //String topic_name,String topic_id, String topic_tag, | |
| 70 | - // String start_date, String end_date, Integer shenhe_status, String sp_desc, | |
| 71 | - // Integer page, Integer pageSize,Integer receive, String orderByClause | |
| 62 | + | |
| 72 | 63 | SessionUser sessionUser = (SessionUser) session.getAttribute(SessionUser.getSessionKey()); |
| 73 | 64 | if(CommonUtils.isNull(sessionUser)){ |
| 74 | 65 | return "redirect:/users/login"; |
| 75 | 66 | } |
| 76 | 67 | Integer spid = sessionUser.getSpid(); |
| 77 | 68 | String userId = sessionUser.getUserId(); |
| 78 | - //if (CommonUtils.isNull(page)) page = 1; | |
| 79 | - //if (CommonUtils.isNull(pageSize)) pageSize = 10; | |
| 69 | + topicDTO.setSpid(spid); | |
| 70 | + topicDTO.setUserId(userId); | |
| 80 | 71 | if (CommonUtils.isNotEmpty(topicDTO.getSp_desc()) && spid == 0) { |
| 81 | 72 | ShySites shySite=sitesService.findspidBySpdesc(topicDTO.getSp_desc()); |
| 82 | 73 | if(CommonUtils.isNotNull(shySite)){ |
| 83 | - spid = shySite.getSpid(); | |
| 74 | + topicDTO.setSpid(shySite.getSpid()); | |
| 84 | 75 | }else{ |
| 85 | 76 | setmodelSite(model); |
| 86 | 77 | return "error.html"; |
| 87 | 78 | } |
| 88 | 79 | } else if (CommonUtils.isEmpty(topicDTO.getSp_desc()) && spid == 0) { |
| 89 | - spid = null; | |
| 80 | + topicDTO.setSpid(null); | |
| 90 | 81 | } |
| 91 | - Date sDate = null; | |
| 92 | - Date eDate = null; | |
| 93 | 82 | |
| 94 | - if (CommonUtils.isNotEmpty(topicDTO.getStart_date())) { | |
| 83 | + if (CommonUtils.isNotEmpty(topicDTO.getsDate())) { | |
| 95 | 84 | try { |
| 96 | - sDate = CommonUtils.parseDate(topicDTO.getStart_date(), "yyyy-MM-dd"); | |
| 85 | + topicDTO.setsDate(String.valueOf(CommonUtils.parseDate(topicDTO.getsDate(), "yyyy-MM-dd"))); | |
| 97 | 86 | } catch (Exception e) { |
| 98 | 87 | } |
| 99 | 88 | } |
| 100 | - if (CommonUtils.isNotEmpty(topicDTO.getEnd_date())) { | |
| 89 | + if (CommonUtils.isNotEmpty(topicDTO.geteDate())) { | |
| 101 | 90 | try { |
| 102 | - eDate = CommonUtils.parseDate(topicDTO.getEnd_date(), "yyyy-MM-dd"); | |
| 91 | + topicDTO.seteDate(String.valueOf(CommonUtils.parseDate(topicDTO.geteDate(), "yyyy-MM-dd"))); | |
| 103 | 92 | } catch (Exception e) { |
| 104 | 93 | } |
| 105 | 94 | } |
| 106 | - PageInfo<ShyTopic> topicPage = topicService.getPage( topicDTO.getTopic_name(),topicDTO.getTopic_tag(),topicDTO.getTopic_id(), sDate, eDate, topicDTO.getShenhe_status(), null, topicDTO.getPage(), topicDTO.getPageSize(), topicDTO.getOrderByClause(), spid, userId,topicDTO.getReceive()); | |
| 95 | + PageInfo<ShyTopic> topicPage = topicService.getPage(topicDTO); | |
| 107 | 96 | List<ShyTopic> list = topicPage.getList(); |
| 108 | 97 | if (!list.isEmpty()) { |
| 109 | 98 | for (ShyTopic topic : list) { |
| 110 | - if (topic.getShenhe_status() != CommonConst.AUDIT_INTT) { | |
| 99 | + if (!topic.getShenhe_status().equals(CommonConst.AUDIT_INTT)) { | |
| 111 | 100 | String auditor_id = topic.getAuditor_id(); |
| 112 | 101 | String updater = CommonUtils.isEmpty(topic.getUpdater()) || "null".equals(topic.getUpdater())? "白名单":topic.getUpdater(); |
| 113 | 102 | updater =sitesService.getUpdater(updater,auditor_id); | ... | ... |
src/main/java/com/cnlive/shenhe/controller/UsersController.java
| ... | ... | @@ -84,17 +84,17 @@ public class UsersController extends BaseController { |
| 84 | 84 | @GetMapping(value = "/page") |
| 85 | 85 | public String page(Model model, UsersDTO usersDTO, HttpSession session) { |
| 86 | 86 | |
| 87 | - //Integer page, Integer pageSize, String orderByClause, | |
| 88 | - // String username, String mobile, Integer sp_id, String company_brief | |
| 89 | 87 | SessionUser sessionUser = (SessionUser) session.getAttribute(SessionUser.getSessionKey()); |
| 90 | 88 | if(CommonUtils.isNull(sessionUser)){ |
| 91 | 89 | return "redirect:/users/login"; |
| 92 | 90 | } |
| 93 | 91 | Integer spid = sessionUser.getSpid(); |
| 94 | - if (spid == 0) spid = null; | |
| 95 | - //if (CommonUtils.isNull(page)) page = 1; | |
| 96 | - //if (CommonUtils.isNull(pageSize)) pageSize = 10; | |
| 97 | - PageInfo<ShyUsers> usersPage = usersService.getPage(usersDTO.getPage(), usersDTO.getPageSize(), usersDTO.getOrderByClause(), usersDTO.getUsername(),usersDTO.getMobile(),usersDTO.getSp_id(),usersDTO.getCompany_brief()); | |
| 92 | + usersDTO.setSp_id(spid); | |
| 93 | + if (spid == 0) { | |
| 94 | + usersDTO.setSp_id(null); | |
| 95 | + } | |
| 96 | + | |
| 97 | + PageInfo<ShyUsers> usersPage = usersService.getPage(usersDTO); | |
| 98 | 98 | List<ShyUsers> list = usersPage.getList(); |
| 99 | 99 | JSONObject notice = CommonConst.NOTICE; |
| 100 | 100 | if (!list.isEmpty()) { |
| ... | ... | @@ -114,7 +114,7 @@ public class UsersController extends BaseController { |
| 114 | 114 | |
| 115 | 115 | /** |
| 116 | 116 | * 获取通知是否显示 |
| 117 | - * @param showType | |
| 117 | + * @param | |
| 118 | 118 | * @param session |
| 119 | 119 | * @return |
| 120 | 120 | */ | ... | ... |
src/main/java/com/cnlive/shenhe/controller/UsersFreeController.java
| ... | ... | @@ -41,8 +41,6 @@ public class UsersFreeController extends BaseController { |
| 41 | 41 | |
| 42 | 42 | @GetMapping(value = "/page") |
| 43 | 43 | public String wangjiajiaPage(Model model, UsersFreeDTO usersFreeDTO, HttpSession session) { |
| 44 | - //Integer page, Integer pageSize, String orderByClause, | |
| 45 | - // String userId, String mobile | |
| 46 | 44 | SessionUser sessionUser = (SessionUser) session.getAttribute(SessionUser.getSessionKey()); |
| 47 | 45 | if(CommonUtils.isNull(sessionUser)){ |
| 48 | 46 | return "redirect:/users/login"; |
| ... | ... | @@ -51,10 +49,10 @@ public class UsersFreeController extends BaseController { |
| 51 | 49 | if (!sessionUser.isMaster() && spid != 0) { |
| 52 | 50 | return "page/error.html"; |
| 53 | 51 | } |
| 54 | - if (spid == 0) spid = null; | |
| 55 | - //if (CommonUtils.isNull(page)) page = 1; | |
| 56 | - //if (CommonUtils.isNull(pageSize)) pageSize = 10; | |
| 57 | - PageInfo<ShyUsersfree> usersPage = usersfreeService.getpage(usersFreeDTO.getPage(), usersFreeDTO.getPageSize(), usersFreeDTO.getOrderByClause(), usersFreeDTO.getUserId(),usersFreeDTO.getMobile()); | |
| 52 | + if (spid == 0) { | |
| 53 | + spid = null; | |
| 54 | + } | |
| 55 | + PageInfo<ShyUsersfree> usersPage = usersfreeService.getpage(usersFreeDTO); | |
| 58 | 56 | List<ShyUsersfree> list = usersPage.getList(); |
| 59 | 57 | JSONObject category = CommonConst.CATEGORY; |
| 60 | 58 | if (!list.isEmpty()) { | ... | ... |
src/main/java/com/cnlive/shenhe/controller/VideosController.java
| ... | ... | @@ -115,47 +115,36 @@ public class VideosController extends BaseController { |
| 115 | 115 | /** |
| 116 | 116 | * 内容分页列表接口 |
| 117 | 117 | * |
| 118 | - * @param video_title | |
| 119 | - * @param start_date | |
| 120 | - * @param end_date | |
| 121 | - * @param state | |
| 122 | - * @param page | |
| 123 | - * @param pageSize | |
| 124 | - * @param orderByClause | |
| 118 | + * @param videosDTO | |
| 125 | 119 | * @return |
| 126 | 120 | */ |
| 127 | 121 | @GetMapping("/page") |
| 128 | 122 | public Object getListVideos(Model model, VideosDTO videosDTO, HttpSession session) { |
| 129 | - //String video_title, String start_date, String end_date, Integer state, Integer receive, Integer page, Integer pageSize, | |
| 130 | - // String video_priority, String orderByClause, String sp_desc, String sp_Id, String source, String video_user_id, | |
| 131 | - // String shen_auditor_id, Integer contentId, String video_id | |
| 132 | 123 | if (!StringUtils.isEmpty(videosDTO.getShen_auditor_id())) { |
| 133 | 124 | if ((!"自动审核".equals(videosDTO.getShen_auditor_id())) && (!"白名单".equals(videosDTO.getShen_auditor_id()))) { |
| 134 | 125 | videosDTO.setShen_auditor_id(usersService.findspidByName(videosDTO.getShen_auditor_id())); |
| 135 | 126 | |
| 136 | 127 | } |
| 137 | 128 | } |
| 138 | - | |
| 139 | 129 | SessionUser sessionUser = (SessionUser) session.getAttribute(SessionUser.getSessionKey()); |
| 140 | 130 | if (CommonUtils.isNull(sessionUser)) { |
| 141 | 131 | return "redirect:/users/login"; |
| 142 | 132 | } |
| 143 | - | |
| 144 | - Integer sessionUserSpid = sessionUser.getSpid(); | |
| 145 | - logger.info("sp_Id:{},sessionUserSpid:{}", videosDTO.getSp_Id(), sessionUserSpid); | |
| 133 | + Integer spid = sessionUser.getSpid(); | |
| 134 | + videosDTO.setSpid(spid); | |
| 135 | + logger.info("sp_Id:{},spid:{}", videosDTO.getSp_Id(), videosDTO.getSpid()); | |
| 146 | 136 | String userId = sessionUser.getUserId(); |
| 147 | - //if (CommonUtils.isNull(page)) page = 1; | |
| 148 | - //if (CommonUtils.isNull(pageSize)) pageSize = 10; | |
| 149 | - if (CommonUtils.isNotEmpty(videosDTO.getSp_desc()) && sessionUserSpid == 0) { | |
| 137 | + videosDTO.setUserId(userId); | |
| 138 | + if (CommonUtils.isNotEmpty(videosDTO.getSp_desc()) && videosDTO.getSpid() == 0) { | |
| 150 | 139 | ShySites shySite = sitesService.findspidBySpdesc(videosDTO.getSp_desc()); |
| 151 | 140 | if (CommonUtils.isNotNull(shySite)) { |
| 152 | - sessionUserSpid = shySite.getSpid(); | |
| 141 | + videosDTO.setSpid(shySite.getSpid()); | |
| 153 | 142 | } else { |
| 154 | 143 | setmodelSite(model); |
| 155 | 144 | return "error.html"; |
| 156 | 145 | } |
| 157 | - } else if (CommonUtils.isEmpty(videosDTO.getSp_desc()) && sessionUserSpid == 0) { | |
| 158 | - sessionUserSpid = null; | |
| 146 | + } else if (CommonUtils.isEmpty(videosDTO.getSp_desc()) && videosDTO.getSpid() == 0) { | |
| 147 | + videosDTO.setSpid(null); | |
| 159 | 148 | } |
| 160 | 149 | |
| 161 | 150 | if (CommonUtils.isNotNull(videosDTO.getContentId())) { |
| ... | ... | @@ -167,15 +156,12 @@ public class VideosController extends BaseController { |
| 167 | 156 | if (data != null) { |
| 168 | 157 | String pid = data.getString("pid"); |
| 169 | 158 | videosDTO.setVideo_id(pid); |
| 170 | - //video_id = pid; | |
| 171 | 159 | } else { |
| 172 | 160 | videosDTO.setVideo_id(String.valueOf(videosDTO.getContentId())); |
| 173 | - //video_id = contentId.toString(); | |
| 174 | 161 | } |
| 175 | 162 | } |
| 176 | 163 | |
| 177 | - PageInfo<ShyVideos> videoPage = videosService.getListContent(videosDTO.getVideo_title(), videosDTO.getStart_date(), videosDTO.getEnd_date(), videosDTO.getState(), videosDTO.getReceive(), videosDTO.getPage(), | |
| 178 | - videosDTO.getPageSize(), videosDTO.getVideo_priority(), videosDTO.getOrderByClause(), sessionUserSpid, userId, videosDTO.getSp_Id(), videosDTO.getSource(), videosDTO.getVideo_user_id(), videosDTO.getShen_auditor_id(), videosDTO.getVideo_id()); | |
| 164 | + PageInfo<ShyVideos> videoPage = videosService.getListContent(videosDTO); | |
| 179 | 165 | //查询查询条件 |
| 180 | 166 | List<ShyActivity> activityList = shyActivityImpl.selectAll(); |
| 181 | 167 | List<ShyVideos> list = videoPage.getList(); |
| ... | ... | @@ -339,37 +325,31 @@ public class VideosController extends BaseController { |
| 339 | 325 | /** |
| 340 | 326 | * 根据条件导出excel |
| 341 | 327 | * |
| 342 | - * @param video_title | |
| 343 | - * @param start_date | |
| 344 | - * @param end_date | |
| 345 | - * @param state | |
| 346 | - * @param receive | |
| 347 | - * @param video_priority | |
| 348 | - * @param orderByClause | |
| 328 | + * @param videosDTO | |
| 349 | 329 | * @param session |
| 350 | 330 | * @param response |
| 351 | 331 | */ |
| 352 | 332 | @GetMapping("excel") |
| 353 | 333 | public void getExcel(VideosDTO videosDTO, HttpSession session, HttpServletResponse response) { |
| 354 | 334 | |
| 355 | - //String video_title, String start_date, String end_date, Integer state, Integer | |
| 356 | - //receive, String video_priority, Integer source, String video_user_id, String orderByClause, Integer | |
| 357 | - //sp_Id, String sp_desc, | |
| 358 | 335 | if (CommonUtils.isNotEmpty(videosDTO.getSp_desc())) { |
| 359 | 336 | ShySites shySite = sitesService.findspidBySpdesc(videosDTO.getSp_desc()); |
| 360 | 337 | if (CommonUtils.isNotNull(shySite)) { |
| 361 | 338 | videosDTO.setSp_Id(String.valueOf(shySite.getSpid())); |
| 362 | - //sp_Id = shySite.getSpid(); | |
| 363 | 339 | } |
| 364 | 340 | } |
| 365 | 341 | SessionUser sessionUser = (SessionUser) session.getAttribute(SessionUser.getSessionKey()); |
| 366 | 342 | Integer spid = sessionUser.getSpid(); |
| 367 | 343 | String userId = sessionUser.getUserId(); |
| 368 | - if (spid == 0) spid = null; | |
| 344 | + videosDTO.setSpid(spid); | |
| 345 | + videosDTO.setUserId(userId); | |
| 346 | + if (spid == 0) { | |
| 347 | + videosDTO.setSpid(null); | |
| 348 | + } | |
| 369 | 349 | if (videosDTO.getSp_Id() != null) { |
| 370 | - spid = Integer.valueOf(videosDTO.getSp_Id()); | |
| 350 | + videosDTO.setSpid(Integer.valueOf(videosDTO.getSp_Id())); | |
| 371 | 351 | } |
| 372 | - List<ShyVideos> shyVideosList = videosService.findByCondition(videosDTO.getVideo_title(), videosDTO.getStart_date(), videosDTO.getEnd_date(), videosDTO.getState(), videosDTO.getReceive(), videosDTO.getVideo_priority(), videosDTO.getOrderByClause(), spid, userId, videosDTO.getSource(), videosDTO.getVideo_user_id()); | |
| 352 | + List<ShyVideos> shyVideosList = videosService.findByCondition(videosDTO); | |
| 373 | 353 | String fileName = "点播数据"; |
| 374 | 354 | String updater = "";//审核员名字 |
| 375 | 355 | String state1 = "";//审核状态 1已审核 2审核拒绝 0未审核 |
| ... | ... | @@ -504,19 +484,23 @@ public class VideosController extends BaseController { |
| 504 | 484 | } catch (final Exception e) { |
| 505 | 485 | e.printStackTrace(); |
| 506 | 486 | try { |
| 507 | - if (bis != null) | |
| 487 | + if (bis != null) { | |
| 508 | 488 | bis.close(); |
| 509 | - if (bos != null) | |
| 489 | + } | |
| 490 | + if (bos != null) { | |
| 510 | 491 | bos.close(); |
| 492 | + } | |
| 511 | 493 | } catch (Exception e1) { |
| 512 | 494 | e1.printStackTrace(); |
| 513 | 495 | } |
| 514 | 496 | } finally { |
| 515 | 497 | try { |
| 516 | - if (bis != null) | |
| 498 | + if (bis != null) { | |
| 517 | 499 | bis.close(); |
| 518 | - if (bos != null) | |
| 500 | + } | |
| 501 | + if (bos != null) { | |
| 519 | 502 | bos.close(); |
| 503 | + } | |
| 520 | 504 | } catch (Exception e2) { |
| 521 | 505 | e2.printStackTrace(); |
| 522 | 506 | } | ... | ... |
src/main/java/com/cnlive/shenhe/dto/AudioDTO.java
| ... | ... | @@ -10,8 +10,8 @@ import java.io.Serializable; |
| 10 | 10 | public class AudioDTO implements Serializable { |
| 11 | 11 | |
| 12 | 12 | private String video_title; |
| 13 | - private String start_date; | |
| 14 | - private String end_date; | |
| 13 | + private String sDate ; | |
| 14 | + private String eDate ; | |
| 15 | 15 | private Integer state; |
| 16 | 16 | private Integer receive; |
| 17 | 17 | private Integer page = 1; |
| ... | ... | @@ -20,24 +20,16 @@ public class AudioDTO implements Serializable { |
| 20 | 20 | private String orderByClause; |
| 21 | 21 | private String sp_desc; |
| 22 | 22 | private String sp_Id; |
| 23 | + private Integer spid; | |
| 24 | + private String userId; | |
| 23 | 25 | |
| 24 | 26 | public AudioDTO() { |
| 25 | 27 | } |
| 26 | 28 | |
| 27 | - public AudioDTO(String video_title, String start_date, String end_date, Integer state, Integer receive, String video_priority, String orderByClause) { | |
| 29 | + public AudioDTO(String video_title, String sDate, String eDate, Integer state, Integer receive, Integer page, Integer pageSize, String video_priority, String orderByClause, String sp_desc, String sp_Id, Integer spid, String userId) { | |
| 28 | 30 | this.video_title = video_title; |
| 29 | - this.start_date = start_date; | |
| 30 | - this.end_date = end_date; | |
| 31 | - this.state = state; | |
| 32 | - this.receive = receive; | |
| 33 | - this.video_priority = video_priority; | |
| 34 | - this.orderByClause = orderByClause; | |
| 35 | - } | |
| 36 | - | |
| 37 | - public AudioDTO(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) { | |
| 38 | - this.video_title = video_title; | |
| 39 | - this.start_date = start_date; | |
| 40 | - this.end_date = end_date; | |
| 31 | + this.sDate = sDate; | |
| 32 | + this.eDate = eDate; | |
| 41 | 33 | this.state = state; |
| 42 | 34 | this.receive = receive; |
| 43 | 35 | this.page = page; |
| ... | ... | @@ -46,9 +38,10 @@ public class AudioDTO implements Serializable { |
| 46 | 38 | this.orderByClause = orderByClause; |
| 47 | 39 | this.sp_desc = sp_desc; |
| 48 | 40 | this.sp_Id = sp_Id; |
| 41 | + this.spid = spid; | |
| 42 | + this.userId = userId; | |
| 49 | 43 | } |
| 50 | 44 | |
| 51 | - | |
| 52 | 45 | public String getVideo_title() { |
| 53 | 46 | return video_title; |
| 54 | 47 | } |
| ... | ... | @@ -57,20 +50,20 @@ public class AudioDTO implements Serializable { |
| 57 | 50 | this.video_title = video_title; |
| 58 | 51 | } |
| 59 | 52 | |
| 60 | - public String getStart_date() { | |
| 61 | - return start_date; | |
| 53 | + public String getsDate() { | |
| 54 | + return sDate; | |
| 62 | 55 | } |
| 63 | 56 | |
| 64 | - public void setStart_date(String start_date) { | |
| 65 | - this.start_date = start_date; | |
| 57 | + public void setsDate(String sDate) { | |
| 58 | + this.sDate = sDate; | |
| 66 | 59 | } |
| 67 | 60 | |
| 68 | - public String getEnd_date() { | |
| 69 | - return end_date; | |
| 61 | + public String geteDate() { | |
| 62 | + return eDate; | |
| 70 | 63 | } |
| 71 | 64 | |
| 72 | - public void setEnd_date(String end_date) { | |
| 73 | - this.end_date = end_date; | |
| 65 | + public void seteDate(String eDate) { | |
| 66 | + this.eDate = eDate; | |
| 74 | 67 | } |
| 75 | 68 | |
| 76 | 69 | public Integer getState() { |
| ... | ... | @@ -136,6 +129,22 @@ public class AudioDTO implements Serializable { |
| 136 | 129 | public void setSp_Id(String sp_Id) { |
| 137 | 130 | this.sp_Id = sp_Id; |
| 138 | 131 | } |
| 132 | + | |
| 133 | + public Integer getSpid() { | |
| 134 | + return spid; | |
| 135 | + } | |
| 136 | + | |
| 137 | + public void setSpid(Integer spid) { | |
| 138 | + this.spid = spid; | |
| 139 | + } | |
| 140 | + | |
| 141 | + public String getUserId() { | |
| 142 | + return userId; | |
| 143 | + } | |
| 144 | + | |
| 145 | + public void setUserId(String userId) { | |
| 146 | + this.userId = userId; | |
| 147 | + } | |
| 139 | 148 | } |
| 140 | 149 | |
| 141 | 150 | ... | ... |
src/main/java/com/cnlive/shenhe/dto/ChannelDTO.java
| 1 | 1 | package com.cnlive.shenhe.dto; |
| 2 | 2 | |
| 3 | 3 | import java.io.Serializable; |
| 4 | +import java.util.Date; | |
| 4 | 5 | |
| 5 | 6 | /** |
| 6 | 7 | * @author Administrator |
| ... | ... | @@ -12,28 +13,34 @@ public class ChannelDTO implements Serializable { |
| 12 | 13 | private String channel_id; |
| 13 | 14 | private String channel_name; |
| 14 | 15 | private Integer receive; |
| 15 | - private String start_date; | |
| 16 | - private String end_date; | |
| 17 | 16 | private Integer shenhe_status; |
| 18 | 17 | private String sp_desc; |
| 19 | 18 | private Integer page = 1; |
| 20 | 19 | private Integer pageSize = 10; |
| 21 | 20 | private String orderByClause; |
| 21 | + private Integer spid; | |
| 22 | + private String userId; | |
| 23 | + private String updater; | |
| 24 | + private String sDate ; | |
| 25 | + private String eDate ; | |
| 22 | 26 | |
| 23 | 27 | public ChannelDTO() { |
| 24 | 28 | } |
| 25 | 29 | |
| 26 | - public ChannelDTO(String channel_id, String channel_name, Integer receive, String start_date, String end_date, Integer shenhe_status, String sp_desc, Integer page, Integer pageSize, String orderByClause) { | |
| 30 | + public ChannelDTO(String channel_id, String channel_name, Integer receive, Integer shenhe_status, String sp_desc, Integer page, Integer pageSize, String orderByClause, Integer spid, String userId, String updater, String sDate, String eDate) { | |
| 27 | 31 | this.channel_id = channel_id; |
| 28 | 32 | this.channel_name = channel_name; |
| 29 | 33 | this.receive = receive; |
| 30 | - this.start_date = start_date; | |
| 31 | - this.end_date = end_date; | |
| 32 | 34 | this.shenhe_status = shenhe_status; |
| 33 | 35 | this.sp_desc = sp_desc; |
| 34 | 36 | this.page = page; |
| 35 | 37 | this.pageSize = pageSize; |
| 36 | 38 | this.orderByClause = orderByClause; |
| 39 | + this.spid = spid; | |
| 40 | + this.userId = userId; | |
| 41 | + this.updater = updater; | |
| 42 | + this.sDate = sDate; | |
| 43 | + this.eDate = eDate; | |
| 37 | 44 | } |
| 38 | 45 | |
| 39 | 46 | public String getChannel_id() { |
| ... | ... | @@ -60,22 +67,6 @@ public class ChannelDTO implements Serializable { |
| 60 | 67 | this.receive = receive; |
| 61 | 68 | } |
| 62 | 69 | |
| 63 | - public String getStart_date() { | |
| 64 | - return start_date; | |
| 65 | - } | |
| 66 | - | |
| 67 | - public void setStart_date(String start_date) { | |
| 68 | - this.start_date = start_date; | |
| 69 | - } | |
| 70 | - | |
| 71 | - public String getEnd_date() { | |
| 72 | - return end_date; | |
| 73 | - } | |
| 74 | - | |
| 75 | - public void setEnd_date(String end_date) { | |
| 76 | - this.end_date = end_date; | |
| 77 | - } | |
| 78 | - | |
| 79 | 70 | public Integer getShenhe_status() { |
| 80 | 71 | return shenhe_status; |
| 81 | 72 | } |
| ... | ... | @@ -115,4 +106,44 @@ public class ChannelDTO implements Serializable { |
| 115 | 106 | public void setOrderByClause(String orderByClause) { |
| 116 | 107 | this.orderByClause = orderByClause; |
| 117 | 108 | } |
| 109 | + | |
| 110 | + public Integer getSpid() { | |
| 111 | + return spid; | |
| 112 | + } | |
| 113 | + | |
| 114 | + public void setSpid(Integer spid) { | |
| 115 | + this.spid = spid; | |
| 116 | + } | |
| 117 | + | |
| 118 | + public String getUserId() { | |
| 119 | + return userId; | |
| 120 | + } | |
| 121 | + | |
| 122 | + public void setUserId(String userId) { | |
| 123 | + this.userId = userId; | |
| 124 | + } | |
| 125 | + | |
| 126 | + public String getsDate() { | |
| 127 | + return sDate; | |
| 128 | + } | |
| 129 | + | |
| 130 | + public void setsDate(String sDate) { | |
| 131 | + this.sDate = sDate; | |
| 132 | + } | |
| 133 | + | |
| 134 | + public String geteDate() { | |
| 135 | + return eDate; | |
| 136 | + } | |
| 137 | + | |
| 138 | + public void seteDate(String eDate) { | |
| 139 | + this.eDate = eDate; | |
| 140 | + } | |
| 141 | + | |
| 142 | + public String getUpdater() { | |
| 143 | + return updater; | |
| 144 | + } | |
| 145 | + | |
| 146 | + public void setUpdater(String updater) { | |
| 147 | + this.updater = updater; | |
| 148 | + } | |
| 118 | 149 | } | ... | ... |
src/main/java/com/cnlive/shenhe/dto/CommentsDTO.java
| ... | ... | @@ -12,8 +12,6 @@ public class CommentsDTO implements Serializable { |
| 12 | 12 | private String activity_id; |
| 13 | 13 | private String content; |
| 14 | 14 | private Integer is_hot; |
| 15 | - private String start_date; | |
| 16 | - private String end_date; | |
| 17 | 15 | private Integer state; |
| 18 | 16 | private Integer receive; |
| 19 | 17 | private Integer page = 1; |
| ... | ... | @@ -21,16 +19,19 @@ public class CommentsDTO implements Serializable { |
| 21 | 19 | private String orderByClause; |
| 22 | 20 | private Integer type; |
| 23 | 21 | private Integer comment_user_id; |
| 22 | + private String sDate ; | |
| 23 | + private String eDate ; | |
| 24 | + private Integer spid; | |
| 25 | + private String userId; | |
| 26 | + private String updater; | |
| 24 | 27 | |
| 25 | 28 | public CommentsDTO() { |
| 26 | 29 | } |
| 27 | 30 | |
| 28 | - public CommentsDTO(String activity_id, String content, Integer is_hot, String start_date, String end_date, Integer state, Integer receive, Integer page, Integer pageSize, String orderByClause, Integer type, Integer comment_user_id) { | |
| 31 | + public CommentsDTO(String activity_id, String content, Integer is_hot, Integer state, Integer receive, Integer page, Integer pageSize, String orderByClause, Integer type, Integer comment_user_id, String sDate, String eDate, Integer spid, String userId, String updater) { | |
| 29 | 32 | this.activity_id = activity_id; |
| 30 | 33 | this.content = content; |
| 31 | 34 | this.is_hot = is_hot; |
| 32 | - this.start_date = start_date; | |
| 33 | - this.end_date = end_date; | |
| 34 | 35 | this.state = state; |
| 35 | 36 | this.receive = receive; |
| 36 | 37 | this.page = page; |
| ... | ... | @@ -38,6 +39,11 @@ public class CommentsDTO implements Serializable { |
| 38 | 39 | this.orderByClause = orderByClause; |
| 39 | 40 | this.type = type; |
| 40 | 41 | this.comment_user_id = comment_user_id; |
| 42 | + this.sDate = sDate; | |
| 43 | + this.eDate = eDate; | |
| 44 | + this.spid = spid; | |
| 45 | + this.userId = userId; | |
| 46 | + this.updater = updater; | |
| 41 | 47 | } |
| 42 | 48 | |
| 43 | 49 | public String getActivity_id() { |
| ... | ... | @@ -64,22 +70,6 @@ public class CommentsDTO implements Serializable { |
| 64 | 70 | this.is_hot = is_hot; |
| 65 | 71 | } |
| 66 | 72 | |
| 67 | - public String getStart_date() { | |
| 68 | - return start_date; | |
| 69 | - } | |
| 70 | - | |
| 71 | - public void setStart_date(String start_date) { | |
| 72 | - this.start_date = start_date; | |
| 73 | - } | |
| 74 | - | |
| 75 | - public String getEnd_date() { | |
| 76 | - return end_date; | |
| 77 | - } | |
| 78 | - | |
| 79 | - public void setEnd_date(String end_date) { | |
| 80 | - this.end_date = end_date; | |
| 81 | - } | |
| 82 | - | |
| 83 | 73 | public Integer getState() { |
| 84 | 74 | return state; |
| 85 | 75 | } |
| ... | ... | @@ -135,4 +125,44 @@ public class CommentsDTO implements Serializable { |
| 135 | 125 | public void setComment_user_id(Integer comment_user_id) { |
| 136 | 126 | this.comment_user_id = comment_user_id; |
| 137 | 127 | } |
| 128 | + | |
| 129 | + public String getsDate() { | |
| 130 | + return sDate; | |
| 131 | + } | |
| 132 | + | |
| 133 | + public void setsDate(String sDate) { | |
| 134 | + this.sDate = sDate; | |
| 135 | + } | |
| 136 | + | |
| 137 | + public String geteDate() { | |
| 138 | + return eDate; | |
| 139 | + } | |
| 140 | + | |
| 141 | + public void seteDate(String eDate) { | |
| 142 | + this.eDate = eDate; | |
| 143 | + } | |
| 144 | + | |
| 145 | + public Integer getSpid() { | |
| 146 | + return spid; | |
| 147 | + } | |
| 148 | + | |
| 149 | + public void setSpid(Integer spid) { | |
| 150 | + this.spid = spid; | |
| 151 | + } | |
| 152 | + | |
| 153 | + public String getUserId() { | |
| 154 | + return userId; | |
| 155 | + } | |
| 156 | + | |
| 157 | + public void setUserId(String userId) { | |
| 158 | + this.userId = userId; | |
| 159 | + } | |
| 160 | + | |
| 161 | + public String getUpdater() { | |
| 162 | + return updater; | |
| 163 | + } | |
| 164 | + | |
| 165 | + public void setUpdater(String updater) { | |
| 166 | + this.updater = updater; | |
| 167 | + } | |
| 138 | 168 | } | ... | ... |
src/main/java/com/cnlive/shenhe/dto/ContentDTO.java
| 1 | 1 | package com.cnlive.shenhe.dto; |
| 2 | 2 | |
| 3 | 3 | import java.io.Serializable; |
| 4 | +import java.util.Date; | |
| 4 | 5 | |
| 5 | 6 | /** |
| 6 | 7 | * @author Administrator |
| ... | ... | @@ -12,8 +13,6 @@ public class ContentDTO implements Serializable { |
| 12 | 13 | private String title; |
| 13 | 14 | private String contentId; |
| 14 | 15 | private String content_tag; |
| 15 | - private String start_date; | |
| 16 | - private String end_date; | |
| 17 | 16 | private Integer receive_status; |
| 18 | 17 | private String sp_desc; |
| 19 | 18 | private String source; |
| ... | ... | @@ -21,25 +20,15 @@ public class ContentDTO implements Serializable { |
| 21 | 20 | private Integer page = 1; |
| 22 | 21 | private Integer pageSize = 10; |
| 23 | 22 | private String orderByClause; |
| 23 | + private String sDate; | |
| 24 | + private String eDate; | |
| 25 | + private Integer spid; | |
| 26 | + private String userId; | |
| 27 | + private String updater; | |
| 24 | 28 | |
| 25 | 29 | public ContentDTO() { |
| 26 | 30 | } |
| 27 | 31 | |
| 28 | - public ContentDTO(String title, String contentId, String content_tag, String start_date, String end_date, Integer receive_status, String sp_desc, String source, String author, Integer page, Integer pageSize, String orderByClause) { | |
| 29 | - this.title = title; | |
| 30 | - this.contentId = contentId; | |
| 31 | - this.content_tag = content_tag; | |
| 32 | - this.start_date = start_date; | |
| 33 | - this.end_date = end_date; | |
| 34 | - this.receive_status = receive_status; | |
| 35 | - this.sp_desc = sp_desc; | |
| 36 | - this.source = source; | |
| 37 | - this.author = author; | |
| 38 | - this.page = page; | |
| 39 | - this.pageSize = pageSize; | |
| 40 | - this.orderByClause = orderByClause; | |
| 41 | - } | |
| 42 | - | |
| 43 | 32 | public String getTitle() { |
| 44 | 33 | return title; |
| 45 | 34 | } |
| ... | ... | @@ -64,22 +53,6 @@ public class ContentDTO implements Serializable { |
| 64 | 53 | this.content_tag = content_tag; |
| 65 | 54 | } |
| 66 | 55 | |
| 67 | - public String getStart_date() { | |
| 68 | - return start_date; | |
| 69 | - } | |
| 70 | - | |
| 71 | - public void setStart_date(String start_date) { | |
| 72 | - this.start_date = start_date; | |
| 73 | - } | |
| 74 | - | |
| 75 | - public String getEnd_date() { | |
| 76 | - return end_date; | |
| 77 | - } | |
| 78 | - | |
| 79 | - public void setEnd_date(String end_date) { | |
| 80 | - this.end_date = end_date; | |
| 81 | - } | |
| 82 | - | |
| 83 | 56 | public Integer getReceive_status() { |
| 84 | 57 | return receive_status; |
| 85 | 58 | } |
| ... | ... | @@ -135,4 +108,63 @@ public class ContentDTO implements Serializable { |
| 135 | 108 | public void setOrderByClause(String orderByClause) { |
| 136 | 109 | this.orderByClause = orderByClause; |
| 137 | 110 | } |
| 111 | + | |
| 112 | + | |
| 113 | + public Integer getSpid() { | |
| 114 | + return spid; | |
| 115 | + } | |
| 116 | + | |
| 117 | + public void setSpid(Integer spid) { | |
| 118 | + this.spid = spid; | |
| 119 | + } | |
| 120 | + | |
| 121 | + public String getUserId() { | |
| 122 | + return userId; | |
| 123 | + } | |
| 124 | + | |
| 125 | + public void setUserId(String userId) { | |
| 126 | + this.userId = userId; | |
| 127 | + } | |
| 128 | + | |
| 129 | + public String getsDate() { | |
| 130 | + return sDate; | |
| 131 | + } | |
| 132 | + | |
| 133 | + public void setsDate(String sDate) { | |
| 134 | + this.sDate = sDate; | |
| 135 | + } | |
| 136 | + | |
| 137 | + public String geteDate() { | |
| 138 | + return eDate; | |
| 139 | + } | |
| 140 | + | |
| 141 | + public void seteDate(String eDate) { | |
| 142 | + this.eDate = eDate; | |
| 143 | + } | |
| 144 | + | |
| 145 | + public String getUpdater() { | |
| 146 | + return updater; | |
| 147 | + } | |
| 148 | + | |
| 149 | + public void setUpdater(String updater) { | |
| 150 | + this.updater = updater; | |
| 151 | + } | |
| 152 | + | |
| 153 | + public ContentDTO(String title, String contentId, String content_tag, Integer receive_status, String sp_desc, String source, String author, Integer page, Integer pageSize, String orderByClause, String sDate, String eDate, Integer spid, String userId, String updater) { | |
| 154 | + this.title = title; | |
| 155 | + this.contentId = contentId; | |
| 156 | + this.content_tag = content_tag; | |
| 157 | + this.receive_status = receive_status; | |
| 158 | + this.sp_desc = sp_desc; | |
| 159 | + this.source = source; | |
| 160 | + this.author = author; | |
| 161 | + this.page = page; | |
| 162 | + this.pageSize = pageSize; | |
| 163 | + this.orderByClause = orderByClause; | |
| 164 | + this.sDate = sDate; | |
| 165 | + this.eDate = eDate; | |
| 166 | + this.spid = spid; | |
| 167 | + this.userId = userId; | |
| 168 | + this.updater = updater; | |
| 169 | + } | |
| 138 | 170 | } | ... | ... |
src/main/java/com/cnlive/shenhe/dto/LiveApplyDTO.java
| ... | ... | @@ -8,8 +8,8 @@ import java.io.Serializable; |
| 8 | 8 | * @create 2022-03-17 15:22 |
| 9 | 9 | */ |
| 10 | 10 | public class LiveApplyDTO implements Serializable { |
| 11 | - private String start_date; | |
| 12 | - private String end_date; | |
| 11 | + | |
| 12 | + | |
| 13 | 13 | private String theme; |
| 14 | 14 | private String business_model; |
| 15 | 15 | private Integer page = 1; |
| ... | ... | @@ -18,13 +18,17 @@ public class LiveApplyDTO implements Serializable { |
| 18 | 18 | private Integer receive; |
| 19 | 19 | private String sp_desc; |
| 20 | 20 | private String orderByClause; |
| 21 | + private Integer spid; | |
| 22 | + private String userId; | |
| 23 | + private String sDate; | |
| 24 | + private String eDate; | |
| 21 | 25 | |
| 22 | 26 | public LiveApplyDTO() { |
| 23 | 27 | } |
| 24 | 28 | |
| 25 | - public LiveApplyDTO(String start_date, String end_date, String theme, String business_model, Integer page, Integer pageSize, Integer shenhe_state, Integer receive, String sp_desc, String orderByClause) { | |
| 26 | - this.start_date = start_date; | |
| 27 | - this.end_date = end_date; | |
| 29 | + public LiveApplyDTO(String sDate, String eDate, String theme, String business_model, Integer page, Integer pageSize, Integer shenhe_state, Integer receive, String sp_desc, String orderByClause, Integer spid, String userId) { | |
| 30 | + this.sDate = sDate; | |
| 31 | + this.eDate = eDate; | |
| 28 | 32 | this.theme = theme; |
| 29 | 33 | this.business_model = business_model; |
| 30 | 34 | this.page = page; |
| ... | ... | @@ -33,22 +37,40 @@ public class LiveApplyDTO implements Serializable { |
| 33 | 37 | this.receive = receive; |
| 34 | 38 | this.sp_desc = sp_desc; |
| 35 | 39 | this.orderByClause = orderByClause; |
| 40 | + this.spid = spid; | |
| 41 | + this.userId = userId; | |
| 42 | + } | |
| 43 | + | |
| 44 | + public String getsDate() { | |
| 45 | + return sDate; | |
| 46 | + } | |
| 47 | + | |
| 48 | + public void setsDate(String sDate) { | |
| 49 | + this.sDate = sDate; | |
| 36 | 50 | } |
| 37 | 51 | |
| 38 | - public String getStart_date() { | |
| 39 | - return start_date; | |
| 52 | + public String geteDate() { | |
| 53 | + return eDate; | |
| 40 | 54 | } |
| 41 | 55 | |
| 42 | - public void setStart_date(String start_date) { | |
| 43 | - this.start_date = start_date; | |
| 56 | + public void seteDate(String eDate) { | |
| 57 | + this.eDate = eDate; | |
| 44 | 58 | } |
| 45 | 59 | |
| 46 | - public String getEnd_date() { | |
| 47 | - return end_date; | |
| 60 | + public Integer getSpid() { | |
| 61 | + return spid; | |
| 48 | 62 | } |
| 49 | 63 | |
| 50 | - public void setEnd_date(String end_date) { | |
| 51 | - this.end_date = end_date; | |
| 64 | + public void setSpid(Integer spid) { | |
| 65 | + this.spid = spid; | |
| 66 | + } | |
| 67 | + | |
| 68 | + public String getUserId() { | |
| 69 | + return userId; | |
| 70 | + } | |
| 71 | + | |
| 72 | + public void setUserId(String userId) { | |
| 73 | + this.userId = userId; | |
| 52 | 74 | } |
| 53 | 75 | |
| 54 | 76 | public String getTheme() { |
| ... | ... | @@ -114,4 +136,6 @@ public class LiveApplyDTO implements Serializable { |
| 114 | 136 | public void setOrderByClause(String orderByClause) { |
| 115 | 137 | this.orderByClause = orderByClause; |
| 116 | 138 | } |
| 139 | + | |
| 140 | + | |
| 117 | 141 | } | ... | ... |
src/main/java/com/cnlive/shenhe/dto/LiveDTO.java
| ... | ... | @@ -10,8 +10,6 @@ import java.io.Serializable; |
| 10 | 10 | public class LiveDTO implements Serializable { |
| 11 | 11 | |
| 12 | 12 | private String activity_id; |
| 13 | - private String start_date; | |
| 14 | - private String end_date; | |
| 15 | 13 | private String activity_name; |
| 16 | 14 | private Integer activity_status; |
| 17 | 15 | private Integer page = 1; |
| ... | ... | @@ -21,13 +19,16 @@ public class LiveDTO implements Serializable { |
| 21 | 19 | private Integer contentId; |
| 22 | 20 | private String orderByClause; |
| 23 | 21 | |
| 22 | + private Integer spid; | |
| 23 | + private String userId; | |
| 24 | + private String sDate; | |
| 25 | + private String eDate; | |
| 26 | + | |
| 24 | 27 | public LiveDTO() { |
| 25 | 28 | } |
| 26 | 29 | |
| 27 | - public LiveDTO(String activity_id, String start_date, String end_date, String activity_name, Integer activity_status, Integer page, Integer pageSize, Integer shenhe_state, String sp_desc, Integer contentId, String orderByClause) { | |
| 30 | + public LiveDTO(String activity_id, String activity_name, Integer activity_status, Integer page, Integer pageSize, Integer shenhe_state, String sp_desc, Integer contentId, String orderByClause, Integer spid, String userId, String sDate, String eDate) { | |
| 28 | 31 | this.activity_id = activity_id; |
| 29 | - this.start_date = start_date; | |
| 30 | - this.end_date = end_date; | |
| 31 | 32 | this.activity_name = activity_name; |
| 32 | 33 | this.activity_status = activity_status; |
| 33 | 34 | this.page = page; |
| ... | ... | @@ -36,6 +37,10 @@ public class LiveDTO implements Serializable { |
| 36 | 37 | this.sp_desc = sp_desc; |
| 37 | 38 | this.contentId = contentId; |
| 38 | 39 | this.orderByClause = orderByClause; |
| 40 | + this.spid = spid; | |
| 41 | + this.userId = userId; | |
| 42 | + this.sDate = sDate; | |
| 43 | + this.eDate = eDate; | |
| 39 | 44 | } |
| 40 | 45 | |
| 41 | 46 | public String getActivity_id() { |
| ... | ... | @@ -46,22 +51,6 @@ public class LiveDTO implements Serializable { |
| 46 | 51 | this.activity_id = activity_id; |
| 47 | 52 | } |
| 48 | 53 | |
| 49 | - public String getStart_date() { | |
| 50 | - return start_date; | |
| 51 | - } | |
| 52 | - | |
| 53 | - public void setStart_date(String start_date) { | |
| 54 | - this.start_date = start_date; | |
| 55 | - } | |
| 56 | - | |
| 57 | - public String getEnd_date() { | |
| 58 | - return end_date; | |
| 59 | - } | |
| 60 | - | |
| 61 | - public void setEnd_date(String end_date) { | |
| 62 | - this.end_date = end_date; | |
| 63 | - } | |
| 64 | - | |
| 65 | 54 | public String getActivity_name() { |
| 66 | 55 | return activity_name; |
| 67 | 56 | } |
| ... | ... | @@ -125,4 +114,36 @@ public class LiveDTO implements Serializable { |
| 125 | 114 | public void setOrderByClause(String orderByClause) { |
| 126 | 115 | this.orderByClause = orderByClause; |
| 127 | 116 | } |
| 117 | + | |
| 118 | + public Integer getSpid() { | |
| 119 | + return spid; | |
| 120 | + } | |
| 121 | + | |
| 122 | + public void setSpid(Integer spid) { | |
| 123 | + this.spid = spid; | |
| 124 | + } | |
| 125 | + | |
| 126 | + public String getUserId() { | |
| 127 | + return userId; | |
| 128 | + } | |
| 129 | + | |
| 130 | + public void setUserId(String userId) { | |
| 131 | + this.userId = userId; | |
| 132 | + } | |
| 133 | + | |
| 134 | + public String getsDate() { | |
| 135 | + return sDate; | |
| 136 | + } | |
| 137 | + | |
| 138 | + public void setsDate(String sDate) { | |
| 139 | + this.sDate = sDate; | |
| 140 | + } | |
| 141 | + | |
| 142 | + public String geteDate() { | |
| 143 | + return eDate; | |
| 144 | + } | |
| 145 | + | |
| 146 | + public void seteDate(String eDate) { | |
| 147 | + this.eDate = eDate; | |
| 148 | + } | |
| 128 | 149 | } | ... | ... |
src/main/java/com/cnlive/shenhe/dto/NotSpeakDTO.java
| ... | ... | @@ -15,10 +15,30 @@ public class NotSpeakDTO implements Serializable { |
| 15 | 15 | private Integer page = 1; |
| 16 | 16 | private Integer pageSize = 10; |
| 17 | 17 | private String orderByClause; |
| 18 | + private String userId; | |
| 18 | 19 | |
| 19 | 20 | public NotSpeakDTO() { |
| 20 | 21 | } |
| 21 | 22 | |
| 23 | + public String getUserId() { | |
| 24 | + return userId; | |
| 25 | + } | |
| 26 | + | |
| 27 | + public void setUserId(String userId) { | |
| 28 | + this.userId = userId; | |
| 29 | + } | |
| 30 | + | |
| 31 | + public NotSpeakDTO(String user_name, Integer user_id, Integer state, Integer page, Integer pageSize, String orderByClause, String userId) { | |
| 32 | + | |
| 33 | + this.user_name = user_name; | |
| 34 | + this.user_id = user_id; | |
| 35 | + this.state = state; | |
| 36 | + this.page = page; | |
| 37 | + this.pageSize = pageSize; | |
| 38 | + this.orderByClause = orderByClause; | |
| 39 | + this.userId = userId; | |
| 40 | + } | |
| 41 | + | |
| 22 | 42 | public NotSpeakDTO(String user_name, Integer user_id, Integer state, Integer page, Integer pageSize, String orderByClause) { |
| 23 | 43 | this.user_name = user_name; |
| 24 | 44 | this.user_id = user_id; | ... | ... |
src/main/java/com/cnlive/shenhe/dto/SitesDTO.java
| ... | ... | @@ -12,6 +12,7 @@ public class SitesDTO implements Serializable { |
| 12 | 12 | private Integer pageSize = 10; |
| 13 | 13 | private String orderByClause; |
| 14 | 14 | private String keyword; |
| 15 | + private Integer spId; | |
| 15 | 16 | |
| 16 | 17 | public SitesDTO() { |
| 17 | 18 | } |
| ... | ... | @@ -23,6 +24,22 @@ public class SitesDTO implements Serializable { |
| 23 | 24 | this.keyword = keyword; |
| 24 | 25 | } |
| 25 | 26 | |
| 27 | + public SitesDTO(Integer page, Integer pageSize, String orderByClause, String keyword, Integer spId) { | |
| 28 | + this.page = page; | |
| 29 | + this.pageSize = pageSize; | |
| 30 | + this.orderByClause = orderByClause; | |
| 31 | + this.keyword = keyword; | |
| 32 | + this.spId = spId; | |
| 33 | + } | |
| 34 | + | |
| 35 | + public Integer getSpId() { | |
| 36 | + return spId; | |
| 37 | + } | |
| 38 | + | |
| 39 | + public void setSpId(Integer spId) { | |
| 40 | + this.spId = spId; | |
| 41 | + } | |
| 42 | + | |
| 26 | 43 | public Integer getPage() { |
| 27 | 44 | return page; |
| 28 | 45 | } | ... | ... |
src/main/java/com/cnlive/shenhe/dto/TopicDTO.java
| ... | ... | @@ -12,30 +12,86 @@ public class TopicDTO implements Serializable { |
| 12 | 12 | private String topic_name; |
| 13 | 13 | private String topic_id; |
| 14 | 14 | private String topic_tag; |
| 15 | - private String start_date; | |
| 16 | - private String end_date; | |
| 17 | 15 | private Integer shenhe_status; |
| 18 | 16 | private String sp_desc; |
| 19 | 17 | private Integer page = 1; |
| 20 | 18 | private Integer pageSize = 10; |
| 21 | 19 | private Integer receive; |
| 22 | 20 | private String orderByClause; |
| 21 | + private String sDate; | |
| 22 | + private String eDate; | |
| 23 | + private Integer spid; | |
| 24 | + private String userId; | |
| 25 | + private String updater; | |
| 26 | + private String title; | |
| 23 | 27 | |
| 24 | 28 | public TopicDTO() { |
| 25 | 29 | } |
| 26 | 30 | |
| 27 | - public TopicDTO(String topic_name, String topic_id, String topic_tag, String start_date, String end_date, Integer shenhe_status, String sp_desc, Integer page, Integer pageSize, Integer receive, String orderByClause) { | |
| 31 | + public TopicDTO(String topic_name, String topic_id, String topic_tag, Integer shenhe_status, String sp_desc, Integer page, Integer pageSize, Integer receive, String orderByClause, String sDate, String eDate, Integer spid, String userId, String updater, String title) { | |
| 28 | 32 | this.topic_name = topic_name; |
| 29 | 33 | this.topic_id = topic_id; |
| 30 | 34 | this.topic_tag = topic_tag; |
| 31 | - this.start_date = start_date; | |
| 32 | - this.end_date = end_date; | |
| 33 | 35 | this.shenhe_status = shenhe_status; |
| 34 | 36 | this.sp_desc = sp_desc; |
| 35 | 37 | this.page = page; |
| 36 | 38 | this.pageSize = pageSize; |
| 37 | 39 | this.receive = receive; |
| 38 | 40 | this.orderByClause = orderByClause; |
| 41 | + this.sDate = sDate; | |
| 42 | + this.eDate = eDate; | |
| 43 | + this.spid = spid; | |
| 44 | + this.userId = userId; | |
| 45 | + this.updater = updater; | |
| 46 | + this.title = title; | |
| 47 | + } | |
| 48 | + | |
| 49 | + public String getTitle() { | |
| 50 | + return title; | |
| 51 | + } | |
| 52 | + | |
| 53 | + public void setTitle(String title) { | |
| 54 | + this.title = title; | |
| 55 | + } | |
| 56 | + | |
| 57 | + public String getsDate() { | |
| 58 | + return sDate; | |
| 59 | + } | |
| 60 | + | |
| 61 | + public void setsDate(String sDate) { | |
| 62 | + this.sDate = sDate; | |
| 63 | + } | |
| 64 | + | |
| 65 | + public String geteDate() { | |
| 66 | + return eDate; | |
| 67 | + } | |
| 68 | + | |
| 69 | + public void seteDate(String eDate) { | |
| 70 | + this.eDate = eDate; | |
| 71 | + } | |
| 72 | + | |
| 73 | + public Integer getSpid() { | |
| 74 | + return spid; | |
| 75 | + } | |
| 76 | + | |
| 77 | + public void setSpid(Integer spid) { | |
| 78 | + this.spid = spid; | |
| 79 | + } | |
| 80 | + | |
| 81 | + public String getUserId() { | |
| 82 | + return userId; | |
| 83 | + } | |
| 84 | + | |
| 85 | + public void setUserId(String userId) { | |
| 86 | + this.userId = userId; | |
| 87 | + } | |
| 88 | + | |
| 89 | + public String getUpdater() { | |
| 90 | + return updater; | |
| 91 | + } | |
| 92 | + | |
| 93 | + public void setUpdater(String updater) { | |
| 94 | + this.updater = updater; | |
| 39 | 95 | } |
| 40 | 96 | |
| 41 | 97 | public String getTopic_name() { |
| ... | ... | @@ -62,22 +118,6 @@ public class TopicDTO implements Serializable { |
| 62 | 118 | this.topic_tag = topic_tag; |
| 63 | 119 | } |
| 64 | 120 | |
| 65 | - public String getStart_date() { | |
| 66 | - return start_date; | |
| 67 | - } | |
| 68 | - | |
| 69 | - public void setStart_date(String start_date) { | |
| 70 | - this.start_date = start_date; | |
| 71 | - } | |
| 72 | - | |
| 73 | - public String getEnd_date() { | |
| 74 | - return end_date; | |
| 75 | - } | |
| 76 | - | |
| 77 | - public void setEnd_date(String end_date) { | |
| 78 | - this.end_date = end_date; | |
| 79 | - } | |
| 80 | - | |
| 81 | 121 | public Integer getShenhe_status() { |
| 82 | 122 | return shenhe_status; |
| 83 | 123 | } | ... | ... |
src/main/java/com/cnlive/shenhe/dto/VideosDTO.java
| ... | ... | @@ -10,8 +10,6 @@ import java.io.Serializable; |
| 10 | 10 | public class VideosDTO implements Serializable { |
| 11 | 11 | |
| 12 | 12 | private String video_title; |
| 13 | - private String start_date; | |
| 14 | - private String end_date; | |
| 15 | 13 | private Integer state; |
| 16 | 14 | private Integer receive; |
| 17 | 15 | private Integer page = 1; |
| ... | ... | @@ -25,14 +23,16 @@ public class VideosDTO implements Serializable { |
| 25 | 23 | private String shen_auditor_id; |
| 26 | 24 | private Integer contentId; |
| 27 | 25 | private String video_id; |
| 26 | + private String sDate; | |
| 27 | + private String eDate; | |
| 28 | + private Integer spid; | |
| 29 | + private String userId; | |
| 28 | 30 | |
| 29 | 31 | public VideosDTO() { |
| 30 | 32 | } |
| 31 | 33 | |
| 32 | - public VideosDTO(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, String source, String video_user_id, String shen_auditor_id, Integer contentId, String video_id) { | |
| 34 | + public VideosDTO(String video_title, Integer state, Integer receive, Integer page, Integer pageSize, String video_priority, String orderByClause, String sp_desc, String sp_Id, String source, String video_user_id, String shen_auditor_id, Integer contentId, String video_id, String sDate, String eDate, Integer spid, String userId) { | |
| 33 | 35 | this.video_title = video_title; |
| 34 | - this.start_date = start_date; | |
| 35 | - this.end_date = end_date; | |
| 36 | 36 | this.state = state; |
| 37 | 37 | this.receive = receive; |
| 38 | 38 | this.page = page; |
| ... | ... | @@ -46,6 +46,10 @@ public class VideosDTO implements Serializable { |
| 46 | 46 | this.shen_auditor_id = shen_auditor_id; |
| 47 | 47 | this.contentId = contentId; |
| 48 | 48 | this.video_id = video_id; |
| 49 | + this.sDate = sDate; | |
| 50 | + this.eDate = eDate; | |
| 51 | + this.spid = spid; | |
| 52 | + this.userId = userId; | |
| 49 | 53 | } |
| 50 | 54 | |
| 51 | 55 | public String getVideo_title() { |
| ... | ... | @@ -56,20 +60,20 @@ public class VideosDTO implements Serializable { |
| 56 | 60 | this.video_title = video_title; |
| 57 | 61 | } |
| 58 | 62 | |
| 59 | - public String getStart_date() { | |
| 60 | - return start_date; | |
| 63 | + public String getsDate() { | |
| 64 | + return sDate; | |
| 61 | 65 | } |
| 62 | 66 | |
| 63 | - public void setStart_date(String start_date) { | |
| 64 | - this.start_date = start_date; | |
| 67 | + public void setsDate(String sDate) { | |
| 68 | + this.sDate = sDate; | |
| 65 | 69 | } |
| 66 | 70 | |
| 67 | - public String getEnd_date() { | |
| 68 | - return end_date; | |
| 71 | + public String geteDate() { | |
| 72 | + return eDate; | |
| 69 | 73 | } |
| 70 | 74 | |
| 71 | - public void setEnd_date(String end_date) { | |
| 72 | - this.end_date = end_date; | |
| 75 | + public void seteDate(String eDate) { | |
| 76 | + this.eDate = eDate; | |
| 73 | 77 | } |
| 74 | 78 | |
| 75 | 79 | public Integer getState() { |
| ... | ... | @@ -175,4 +179,20 @@ public class VideosDTO implements Serializable { |
| 175 | 179 | public void setVideo_id(String video_id) { |
| 176 | 180 | this.video_id = video_id; |
| 177 | 181 | } |
| 182 | + | |
| 183 | + public Integer getSpid() { | |
| 184 | + return spid; | |
| 185 | + } | |
| 186 | + | |
| 187 | + public void setSpid(Integer spid) { | |
| 188 | + this.spid = spid; | |
| 189 | + } | |
| 190 | + | |
| 191 | + public String getUserId() { | |
| 192 | + return userId; | |
| 193 | + } | |
| 194 | + | |
| 195 | + public void setUserId(String userId) { | |
| 196 | + this.userId = userId; | |
| 197 | + } | |
| 178 | 198 | } | ... | ... |
src/main/java/com/cnlive/shenhe/serviceImpl/AudioServiceImpl.java
| ... | ... | @@ -3,6 +3,7 @@ package com.cnlive.shenhe.serviceImpl; |
| 3 | 3 | import com.alibaba.fastjson.JSONObject; |
| 4 | 4 | import com.cnlive.shenhe.bean.ErrorEnum; |
| 5 | 5 | import com.cnlive.shenhe.bean.ResponseBean; |
| 6 | +import com.cnlive.shenhe.dto.AudioDTO; | |
| 6 | 7 | import com.cnlive.shenhe.entity.*; |
| 7 | 8 | import com.cnlive.shenhe.mapper.ShyAudioMapper; |
| 8 | 9 | import com.cnlive.shenhe.mapper.ShyUsersMapper; |
| ... | ... | @@ -104,7 +105,7 @@ public class AudioServiceImpl { |
| 104 | 105 | String[] cids = ids.split(","); |
| 105 | 106 | for (String cid : cids) { |
| 106 | 107 | ShyAudio shyAudio = shyAudioMapper.selectByPrimaryKey(Integer.parseInt(cid)); |
| 107 | - if (CommonUtils.isNotNull(shyAudio) && shyAudio.getState() == CommonConst.AUDIT_INTT && shyAudio.getReceive() == CommonConst.RECEIVE_BEFORE) { | |
| 108 | + if (CommonUtils.isNotNull(shyAudio) && shyAudio.getState().equals(CommonConst.AUDIT_INTT) && shyAudio.getReceive().equals(CommonConst.RECEIVE_BEFORE)) { | |
| 108 | 109 | shyAudio.setReceive_user_id(userId); |
| 109 | 110 | shyAudio.setReceive(CommonConst.RECEIVE_AFTER); |
| 110 | 111 | shyAudioMapper.updateByPrimaryKeySelective(shyAudio); |
| ... | ... | @@ -116,7 +117,9 @@ public class AudioServiceImpl { |
| 116 | 117 | example.setOrderByClause("createTime desc"); |
| 117 | 118 | example.and().andEqualTo("state", CommonConst.AUDIT_INTT); |
| 118 | 119 | example.and().andEqualTo("receive", CommonConst.RECEIVE_BEFORE); |
| 119 | - if (CommonUtils.isNotNull(spid) && spid != 0) example.and().andEqualTo("spid", spid); | |
| 120 | + if (CommonUtils.isNotNull(spid) && spid != 0) { | |
| 121 | + example.and().andEqualTo("spid", spid); | |
| 122 | + } | |
| 120 | 123 | List<ShyAudio> shyCommentsList = shyAudioMapper.selectByExampleAndRowBounds(example, new RowBounds(0, num)); |
| 121 | 124 | if (!shyCommentsList.isEmpty()) { |
| 122 | 125 | for (ShyAudio shyComments : shyCommentsList) { |
| ... | ... | @@ -135,7 +138,7 @@ public class AudioServiceImpl { |
| 135 | 138 | String[] cids = ids.split(","); |
| 136 | 139 | for (String cid : cids) { |
| 137 | 140 | ShyAudio shyAudio = shyAudioMapper.selectByPrimaryKey(Integer.parseInt(cid)); |
| 138 | - if (shyAudio.getState() == CommonConst.AUDIT_INTT && shyAudio.getReceive() == CommonConst.RECEIVE_AFTER && shyAudio.getReceive_user_id().equals(userId)) { | |
| 141 | + if (shyAudio.getState().equals(CommonConst.AUDIT_INTT) && shyAudio.getReceive().equals(CommonConst.RECEIVE_AFTER) && shyAudio.getReceive_user_id().equals(userId)) { | |
| 139 | 142 | shyAudio.setReceive(CommonConst.RECEIVE_BEFORE); |
| 140 | 143 | shyAudio.setReceive_user_id(null); |
| 141 | 144 | int i = shyAudioMapper.updateByPrimaryKey(shyAudio); |
| ... | ... | @@ -201,51 +204,51 @@ public class AudioServiceImpl { |
| 201 | 204 | } |
| 202 | 205 | |
| 203 | 206 | //分页查询音频数据 |
| 204 | - public PageInfo<ShyAudio> 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) { | |
| 207 | + public PageInfo<ShyAudio> getListContent(AudioDTO audioDTO) { | |
| 205 | 208 | Example example = new Example(ShyAudio.class); |
| 206 | 209 | Example.Criteria criteria = example.createCriteria(); |
| 207 | 210 | Example.Criteria criteria2 = example.createCriteria(); |
| 208 | - if (CommonUtils.isNotEmpty(orderByClause)) { | |
| 209 | - example.setOrderByClause(orderByClause); | |
| 211 | + if (CommonUtils.isNotEmpty(audioDTO.getOrderByClause())) { | |
| 212 | + example.setOrderByClause(audioDTO.getOrderByClause()); | |
| 210 | 213 | } |
| 211 | - if (CommonUtils.isNotEmpty(start_date) && CommonUtils.isNotEmpty(end_date)) { | |
| 212 | - criteria.andGreaterThanOrEqualTo("createTime", start_date); | |
| 213 | - criteria2.andGreaterThanOrEqualTo("createTime", start_date); | |
| 214 | - criteria.andLessThanOrEqualTo("createTime", end_date); | |
| 215 | - criteria2.andLessThanOrEqualTo("createTime", end_date); | |
| 214 | + if (CommonUtils.isNotEmpty(audioDTO.getsDate()) && CommonUtils.isNotEmpty(audioDTO.geteDate())) { | |
| 215 | + criteria.andGreaterThanOrEqualTo("createTime", audioDTO.getsDate()); | |
| 216 | + criteria2.andGreaterThanOrEqualTo("createTime", audioDTO.getsDate()); | |
| 217 | + criteria.andLessThanOrEqualTo("createTime", audioDTO.geteDate()); | |
| 218 | + criteria2.andLessThanOrEqualTo("createTime", audioDTO.geteDate()); | |
| 216 | 219 | } |
| 217 | - if (CommonUtils.isNotEmpty(video_title)) { | |
| 218 | - criteria.andLike("audioTitle", "%" + video_title + "%"); | |
| 219 | - criteria2.andLike("audioTitle", "%" + video_title + "%"); | |
| 220 | + if (CommonUtils.isNotEmpty(audioDTO.getVideo_title())) { | |
| 221 | + criteria.andLike("audioTitle", "%" + audioDTO.getVideo_title() + "%"); | |
| 222 | + criteria2.andLike("audioTitle", "%" + audioDTO.getVideo_title() + "%"); | |
| 220 | 223 | } |
| 221 | 224 | |
| 222 | - if (CommonUtils.isNotEmpty(video_priority)) { | |
| 223 | - criteria.andEqualTo("priority", video_priority); | |
| 224 | - criteria2.andEqualTo("priority", video_priority); | |
| 225 | + if (CommonUtils.isNotEmpty(audioDTO.getVideo_priority())) { | |
| 226 | + criteria.andEqualTo("priority", audioDTO.getVideo_priority()); | |
| 227 | + criteria2.andEqualTo("priority", audioDTO.getVideo_priority()); | |
| 225 | 228 | } |
| 226 | 229 | |
| 227 | - if (CommonUtils.isNotNull(spid)) { | |
| 228 | - criteria.andEqualTo("spId", spid); | |
| 229 | - criteria2.andEqualTo("spId", spid); | |
| 230 | - } else if (CommonUtils.isNotEmpty(sp_Id)) { | |
| 231 | - criteria.andEqualTo("spId", sp_Id); | |
| 232 | - criteria2.andEqualTo("spId", sp_Id); | |
| 230 | + if (CommonUtils.isNotNull(audioDTO.getSpid())) { | |
| 231 | + criteria.andEqualTo("spId", audioDTO.getSpid()); | |
| 232 | + criteria2.andEqualTo("spId", audioDTO.getSpid()); | |
| 233 | + } else if (CommonUtils.isNotEmpty(audioDTO.getSp_Id())) { | |
| 234 | + criteria.andEqualTo("spId", audioDTO.getSp_Id()); | |
| 235 | + criteria2.andEqualTo("spId", audioDTO.getSp_Id()); | |
| 233 | 236 | } |
| 234 | 237 | |
| 235 | 238 | //领取状态 0-未领取 1-已领取 |
| 236 | - if (CommonUtils.isNotNull(receive)) { | |
| 237 | - criteria.andEqualTo("receive", receive); | |
| 238 | - criteria2.andEqualTo("receive", receive); | |
| 239 | - if (receive == CommonConst.RECEIVE_AFTER) { | |
| 240 | - criteria.andEqualTo("receive_user_id", userId); | |
| 241 | - criteria2.andEqualTo("receive_user_id", userId); | |
| 239 | + if (CommonUtils.isNotNull(audioDTO.getReceive())) { | |
| 240 | + criteria.andEqualTo("receive", audioDTO.getReceive()); | |
| 241 | + criteria2.andEqualTo("receive", audioDTO.getReceive()); | |
| 242 | + if (audioDTO.getReceive().equals(CommonConst.RECEIVE_AFTER)) { | |
| 243 | + criteria.andEqualTo("receive_user_id", audioDTO.getUserId()); | |
| 244 | + criteria2.andEqualTo("receive_user_id", audioDTO.getUserId()); | |
| 242 | 245 | } |
| 243 | 246 | } |
| 244 | 247 | |
| 245 | 248 | //审核状态 0-未审核 1-已审核 2-拒绝 |
| 246 | - if (CommonUtils.isNotNull(state) && state != 3) { | |
| 247 | - criteria.andEqualTo("state", state); | |
| 248 | - } else if (CommonUtils.isNotNull(state) && state == 3) { | |
| 249 | + if (CommonUtils.isNotNull(audioDTO.getState()) && audioDTO.getState() != 3) { | |
| 250 | + criteria.andEqualTo("state", audioDTO.getState()); | |
| 251 | + } else if (CommonUtils.isNotNull(audioDTO.getState()) && audioDTO.getState() == 3) { | |
| 249 | 252 | criteria.andEqualTo("state", 1); |
| 250 | 253 | criteria2.andEqualTo("state", 2); |
| 251 | 254 | example.or(criteria2); |
| ... | ... | @@ -253,7 +256,7 @@ public class AudioServiceImpl { |
| 253 | 256 | |
| 254 | 257 | //默认按上传时间倒序排序 |
| 255 | 258 | example.setOrderByClause("createTime desc"); |
| 256 | - PageHelper.startPage(page, pageSize, true); | |
| 259 | + PageHelper.startPage(audioDTO.getPage(), audioDTO.getPageSize(), true); | |
| 257 | 260 | List<ShyAudio> shyAudioList = shyAudioMapper.selectByExample(example); |
| 258 | 261 | PageInfo<ShyAudio> pageInfo = new PageInfo<>(shyAudioList); |
| 259 | 262 | return pageInfo; |
| ... | ... | @@ -262,7 +265,7 @@ public class AudioServiceImpl { |
| 262 | 265 | |
| 263 | 266 | public ShyAudio getDetailsContent(Integer id) { |
| 264 | 267 | ShyAudio shyAudio = shyAudioMapper.selectByPrimaryKey(id); |
| 265 | - if (shyAudio.getState() != CommonConst.AUDIT_INTT) { | |
| 268 | + if (!shyAudio.getState().equals(CommonConst.AUDIT_INTT)) { | |
| 266 | 269 | String updater = CommonUtils.isEmpty(shyAudio.getUploader()) || "null".equals(shyAudio.getUploader()) ? "白名单" : shyAudio.getUploader(); |
| 267 | 270 | String auditor_id = shyAudio.getAuditor_id(); |
| 268 | 271 | if (CommonUtils.isNotEmpty(auditor_id)) { |
| ... | ... | @@ -281,48 +284,40 @@ public class AudioServiceImpl { |
| 281 | 284 | /** |
| 282 | 285 | * 根据条件导出数据excel |
| 283 | 286 | * |
| 284 | - * @param video_title | |
| 285 | - * @param start_date | |
| 286 | - * @param end_date | |
| 287 | - * @param state | |
| 288 | - * @param receive | |
| 289 | - * @param video_priority | |
| 290 | - * @param orderByClause | |
| 291 | - * @param spid | |
| 292 | - * @param userId | |
| 287 | + * @param audioDTO | |
| 293 | 288 | * @return |
| 294 | 289 | */ |
| 295 | - public List<ShyAudio> findByCondition(String video_title, String start_date, String end_date, Integer state, Integer receive, String video_priority, String orderByClause, Integer spid, String userId) { | |
| 290 | + public List<ShyAudio> findByCondition(AudioDTO audioDTO) { | |
| 296 | 291 | Example example = new Example(ShyAudio.class); |
| 297 | 292 | Example.Criteria criteria = example.createCriteria(); |
| 298 | 293 | Example.Criteria criteria2 = example.createCriteria(); |
| 299 | - if (CommonUtils.isNotEmpty(orderByClause)) { | |
| 300 | - example.setOrderByClause(orderByClause); | |
| 294 | + if (CommonUtils.isNotEmpty(audioDTO.getOrderByClause())) { | |
| 295 | + example.setOrderByClause(audioDTO.getOrderByClause()); | |
| 301 | 296 | } |
| 302 | - if (CommonUtils.isNotEmpty(start_date) && CommonUtils.isNotEmpty(end_date)) { | |
| 303 | - criteria.andGreaterThanOrEqualTo("createTime", start_date); | |
| 304 | - criteria.andLessThanOrEqualTo("createTime", end_date); | |
| 297 | + if (CommonUtils.isNotEmpty(audioDTO.getsDate()) && CommonUtils.isNotEmpty(audioDTO.geteDate())) { | |
| 298 | + criteria.andGreaterThanOrEqualTo("createTime", audioDTO.getsDate()); | |
| 299 | + criteria.andLessThanOrEqualTo("createTime", audioDTO.geteDate()); | |
| 305 | 300 | } |
| 306 | - if (CommonUtils.isNotEmpty(video_title)) { | |
| 307 | - criteria.andLike("audioTitle", "%" + video_title + "%"); | |
| 301 | + if (CommonUtils.isNotEmpty(audioDTO.getVideo_title())) { | |
| 302 | + criteria.andLike("audioTitle", "%" + audioDTO.getVideo_title() + "%"); | |
| 308 | 303 | } |
| 309 | - if (CommonUtils.isNotNull(state) && state == 0) { | |
| 310 | - criteria.andEqualTo("state", state); | |
| 311 | - } else if (CommonUtils.isNotNull(state) && state == 1) { | |
| 312 | - criteria.andEqualTo("state", state); | |
| 304 | + if (CommonUtils.isNotNull(audioDTO.getState()) && audioDTO.getState() == 0) { | |
| 305 | + criteria.andEqualTo("state", audioDTO.getState()); | |
| 306 | + } else if (CommonUtils.isNotNull(audioDTO.getState()) && audioDTO.getState() == 1) { | |
| 307 | + criteria.andEqualTo("state", audioDTO.getState()); | |
| 313 | 308 | criteria2.andEqualTo("state", 2); |
| 314 | 309 | example.or(criteria2); |
| 315 | 310 | } |
| 316 | - if (CommonUtils.isNotEmpty(video_priority)) { | |
| 317 | - criteria.andEqualTo("priority", video_priority); | |
| 311 | + if (CommonUtils.isNotEmpty(audioDTO.getVideo_priority())) { | |
| 312 | + criteria.andEqualTo("priority", audioDTO.getVideo_priority()); | |
| 318 | 313 | } |
| 319 | - if (CommonUtils.isNotNull(spid)) { | |
| 320 | - criteria.andEqualTo("spId", spid); | |
| 314 | + if (CommonUtils.isNotNull(audioDTO.getSpid())) { | |
| 315 | + criteria.andEqualTo("spId", audioDTO.getSpid()); | |
| 321 | 316 | } |
| 322 | - if (CommonUtils.isNotNull(receive)) { | |
| 323 | - criteria.andEqualTo("receive", receive); | |
| 324 | - if (receive == CommonConst.RECEIVE_AFTER) { | |
| 325 | - criteria.andEqualTo("receive_user_id", userId); | |
| 317 | + if (CommonUtils.isNotNull(audioDTO.getReceive())) { | |
| 318 | + criteria.andEqualTo("receive", audioDTO.getReceive()); | |
| 319 | + if (audioDTO.getReceive().equals(CommonConst.RECEIVE_AFTER)) { | |
| 320 | + criteria.andEqualTo("receive_user_id", audioDTO.getUserId()); | |
| 326 | 321 | } |
| 327 | 322 | } |
| 328 | 323 | //默认按上传时间倒序排序 | ... | ... |
src/main/java/com/cnlive/shenhe/serviceImpl/ChannelServiceImpl.java
| 1 | 1 | package com.cnlive.shenhe.serviceImpl; |
| 2 | 2 | |
| 3 | 3 | import com.alibaba.fastjson.JSONObject; |
| 4 | +import com.cnlive.shenhe.dto.ChannelDTO; | |
| 4 | 5 | import com.cnlive.shenhe.entity.ShyChannel; |
| 5 | 6 | import com.cnlive.shenhe.entity.ShyUsers; |
| 6 | 7 | import com.cnlive.shenhe.mapper.ShyChannelMapper; |
| ... | ... | @@ -61,50 +62,50 @@ public class ChannelServiceImpl { |
| 61 | 62 | return true; |
| 62 | 63 | } |
| 63 | 64 | |
| 64 | - public PageInfo<ShyChannel> getPage(String channelId, String channelName, Integer receive, Date start_date, Date end_date, Integer shenhe_status, String updater, Integer page, Integer pageSize, String orderByClause, Integer spid, String userId) { | |
| 65 | + public PageInfo<ShyChannel> getPage(ChannelDTO channelDTO) { | |
| 65 | 66 | Example example = new Example(ShyChannel.class); |
| 66 | 67 | Example.Criteria criteria = example.createCriteria(); |
| 67 | - if (CommonUtils.isNotEmpty(orderByClause)) { | |
| 68 | - example.setOrderByClause(orderByClause); | |
| 68 | + if (CommonUtils.isNotEmpty(channelDTO.getOrderByClause())) { | |
| 69 | + example.setOrderByClause(channelDTO.getOrderByClause()); | |
| 69 | 70 | } else { |
| 70 | 71 | example.setOrderByClause("created_at desc"); |
| 71 | 72 | } |
| 72 | - if (CommonUtils.isNotNull(start_date)) { | |
| 73 | - criteria.andGreaterThanOrEqualTo("created_at", start_date); | |
| 73 | + if (CommonUtils.isNotNull(channelDTO.getsDate())) { | |
| 74 | + criteria.andGreaterThanOrEqualTo("created_at", channelDTO.getsDate()); | |
| 74 | 75 | } |
| 75 | - if (CommonUtils.isNotNull(end_date)) { | |
| 76 | - criteria.andLessThanOrEqualTo("created_at", end_date); | |
| 76 | + if (CommonUtils.isNotNull(channelDTO.geteDate())) { | |
| 77 | + criteria.andLessThanOrEqualTo("created_at", channelDTO.geteDate()); | |
| 77 | 78 | } |
| 78 | - if (CommonUtils.isNotEmpty(channelName)) { | |
| 79 | - criteria.andLike("channel_name", "%" + channelName + "%"); | |
| 79 | + if (CommonUtils.isNotEmpty(channelDTO.getChannel_name())) { | |
| 80 | + criteria.andLike("channel_name", "%" + channelDTO.getChannel_name() + "%"); | |
| 80 | 81 | } |
| 81 | - if (CommonUtils.isNotEmpty(updater)) { | |
| 82 | - criteria.andEqualTo("updater", updater); | |
| 82 | + if (CommonUtils.isNotEmpty(channelDTO.getUpdater())) { | |
| 83 | + criteria.andEqualTo("updater", channelDTO.getUpdater()); | |
| 83 | 84 | } |
| 84 | - if (CommonUtils.isNotNull(spid)) { | |
| 85 | - criteria.andEqualTo("sp_id", spid); | |
| 85 | + if (CommonUtils.isNotNull(channelDTO.getSpid())) { | |
| 86 | + criteria.andEqualTo("sp_id", channelDTO.getSpid()); | |
| 86 | 87 | } |
| 87 | 88 | |
| 88 | - if (CommonUtils.isNotEmpty(channelId)) { | |
| 89 | - criteria.andLike("channel_id", "%" + channelId + "%"); | |
| 89 | + if (CommonUtils.isNotEmpty(channelDTO.getChannel_id())) { | |
| 90 | + criteria.andLike("channel_id", "%" + channelDTO.getChannel_id() + "%"); | |
| 90 | 91 | } |
| 91 | 92 | |
| 92 | 93 | //已认领 加上用户id |
| 93 | - if (CommonUtils.isNotNull(receive) && receive == 1) { | |
| 94 | - criteria.andEqualTo("auditor", userId); | |
| 94 | + if (CommonUtils.isNotNull(channelDTO.getReceive()) && channelDTO.getReceive() == 1) { | |
| 95 | + criteria.andEqualTo("auditor", channelDTO.getUserId()); | |
| 95 | 96 | } |
| 96 | 97 | //不是 我的已审 进来的,只查一种状态 |
| 97 | - if (CommonUtils.isNotNull(shenhe_status) && shenhe_status != 3) { | |
| 98 | - criteria.andEqualTo("shenhe_status", shenhe_status); | |
| 98 | + if (CommonUtils.isNotNull(channelDTO.getShenhe_status()) && channelDTO.getShenhe_status() != 3) { | |
| 99 | + criteria.andEqualTo("shenhe_status", channelDTO.getShenhe_status()); | |
| 99 | 100 | //是 我的已审,查通过和拒绝的两种状态 |
| 100 | - } else if (CommonUtils.isNotNull(shenhe_status) && shenhe_status == 3) { | |
| 101 | + } else if (CommonUtils.isNotNull(channelDTO.getShenhe_status()) && channelDTO.getShenhe_status() == 3) { | |
| 101 | 102 | Example.Criteria criteria1 = example.createCriteria(); |
| 102 | 103 | criteria1.orEqualTo("shenhe_status", 1); |
| 103 | 104 | criteria1.orEqualTo("shenhe_status", 2); |
| 104 | 105 | example.and(criteria1); |
| 105 | 106 | } |
| 106 | 107 | |
| 107 | - PageHelper.startPage(page, pageSize, true); | |
| 108 | + PageHelper.startPage(channelDTO.getPage(), channelDTO.getPageSize(), true); | |
| 108 | 109 | List<ShyChannel> channelList = shyChannelMapper.selectByExample(example); |
| 109 | 110 | PageInfo<ShyChannel> pageInfo = new PageInfo<>(channelList); |
| 110 | 111 | return pageInfo; | ... | ... |
src/main/java/com/cnlive/shenhe/serviceImpl/CommentsServiceImpl.java
| 1 | 1 | package com.cnlive.shenhe.serviceImpl; |
| 2 | 2 | |
| 3 | 3 | import com.alibaba.fastjson.JSONObject; |
| 4 | +import com.cnlive.shenhe.dto.CommentsDTO; | |
| 4 | 5 | import com.cnlive.shenhe.entity.ShyComments; |
| 5 | 6 | import com.cnlive.shenhe.entity.ShySites; |
| 6 | 7 | import com.cnlive.shenhe.entity.ShyUsers; |
| ... | ... | @@ -78,45 +79,45 @@ public class CommentsServiceImpl { |
| 78 | 79 | return shyCommentsMapper.updateByPrimaryKeySelective(shyComments); |
| 79 | 80 | } |
| 80 | 81 | |
| 81 | - public PageInfo<ShyComments> getPage(String activity_id, String content, Integer is_hot, Date start_date, Date end_date, Integer states, Integer receive, String updater, Integer page, Integer pageSize, String orderByClause, Integer spid, String userId, Integer type, Integer comment_user_id) { | |
| 82 | + public PageInfo<ShyComments> getPage(CommentsDTO commentsDTO) { | |
| 82 | 83 | Example example = new Example(ShyComments.class); |
| 83 | 84 | Example.Criteria criteria = example.createCriteria(); |
| 84 | - if (CommonUtils.isNotEmpty(orderByClause)) { | |
| 85 | - example.setOrderByClause(orderByClause); | |
| 85 | + if (CommonUtils.isNotEmpty(commentsDTO.getOrderByClause())) { | |
| 86 | + example.setOrderByClause(commentsDTO.getOrderByClause()); | |
| 86 | 87 | } else { |
| 87 | 88 | example.setOrderByClause("comment_time desc"); |
| 88 | 89 | } |
| 89 | - if (CommonUtils.isNotNull(start_date) && CommonUtils.isNotNull(end_date)) { | |
| 90 | - criteria.andGreaterThanOrEqualTo("comment_time", start_date); | |
| 91 | - criteria.andLessThanOrEqualTo("comment_time", end_date); | |
| 90 | + if (CommonUtils.isNotNull(commentsDTO.getsDate()) && CommonUtils.isNotNull(commentsDTO.geteDate())) { | |
| 91 | + criteria.andGreaterThanOrEqualTo("comment_time", commentsDTO.getsDate()); | |
| 92 | + criteria.andLessThanOrEqualTo("comment_time", commentsDTO.geteDate()); | |
| 92 | 93 | } |
| 93 | - if (CommonUtils.isNotEmpty(content)) { | |
| 94 | - criteria.andLike("comment_content", "%" + content + "%"); | |
| 94 | + if (CommonUtils.isNotEmpty(commentsDTO.getContent())) { | |
| 95 | + criteria.andLike("comment_content", "%" + commentsDTO.getContent() + "%"); | |
| 95 | 96 | } |
| 96 | - if (CommonUtils.isNotEmpty(updater)) { | |
| 97 | - criteria.andEqualTo("updater", updater); | |
| 97 | + if (CommonUtils.isNotEmpty(commentsDTO.getUpdater())) { | |
| 98 | + criteria.andEqualTo("updater", commentsDTO.getUpdater()); | |
| 98 | 99 | } |
| 99 | - if (CommonUtils.isNotNull(spid)) { | |
| 100 | - criteria.andEqualTo("spid", spid); | |
| 100 | + if (CommonUtils.isNotNull(commentsDTO.getSpid())) { | |
| 101 | + criteria.andEqualTo("spid", commentsDTO.getSpid()); | |
| 101 | 102 | } |
| 102 | - if (CommonUtils.isNotNull(is_hot)) { | |
| 103 | - criteria.andEqualTo("is_hot", is_hot); | |
| 103 | + if (CommonUtils.isNotNull(commentsDTO.getIs_hot())) { | |
| 104 | + criteria.andEqualTo("is_hot", commentsDTO.getIs_hot()); | |
| 104 | 105 | } |
| 105 | - if (CommonUtils.isNotNull(comment_user_id)) { | |
| 106 | - criteria.andEqualTo("comment_user_id", comment_user_id); | |
| 106 | + if (CommonUtils.isNotNull(commentsDTO.getComment_user_id())) { | |
| 107 | + criteria.andEqualTo("comment_user_id", commentsDTO.getComment_user_id()); | |
| 107 | 108 | } |
| 108 | - if (CommonUtils.isNotNull(type) && type == 0) { | |
| 109 | + if (CommonUtils.isNotNull(commentsDTO.getType()) && commentsDTO.getType() == 0) { | |
| 109 | 110 | criteria.andEqualTo("type", CommonConst.CATEGORY_TOPIC); |
| 110 | - } else if (CommonUtils.isNotNull(type) && type == 1) { | |
| 111 | + } else if (CommonUtils.isNotNull(commentsDTO.getType()) && commentsDTO.getType() == 1) { | |
| 111 | 112 | criteria.andEqualTo("type", CommonConst.CATEGORY_ELSE); |
| 112 | 113 | } |
| 113 | - if (CommonUtils.isNotEmpty(activity_id)) { | |
| 114 | - criteria.andLike("activity_id", "%" + activity_id + "%"); | |
| 114 | + if (CommonUtils.isNotEmpty(commentsDTO.getActivity_id())) { | |
| 115 | + criteria.andLike("activity_id", "%" + commentsDTO.getActivity_id() + "%"); | |
| 115 | 116 | } |
| 116 | - if (CommonUtils.isNotNull(receive)) { | |
| 117 | - criteria.andEqualTo("receive", receive); | |
| 118 | - if (receive == CommonConst.RECEIVE_AFTER) { | |
| 119 | - criteria.andEqualTo("receive_user_id", userId); | |
| 117 | + if (CommonUtils.isNotNull(commentsDTO.getReceive())) { | |
| 118 | + criteria.andEqualTo("receive", commentsDTO.getReceive()); | |
| 119 | + if (commentsDTO.getReceive().equals(CommonConst.RECEIVE_AFTER) ) { | |
| 120 | + criteria.andEqualTo("receive_user_id", commentsDTO.getUserId()); | |
| 120 | 121 | } |
| 121 | 122 | } |
| 122 | 123 | |
| ... | ... | @@ -129,56 +130,56 @@ public class CommentsServiceImpl { |
| 129 | 130 | // example.and(criteria1); |
| 130 | 131 | // } |
| 131 | 132 | |
| 132 | - if (CommonUtils.isNotNull(states) && states != 3) { | |
| 133 | - criteria.andEqualTo("state", states); | |
| 134 | - } else if (CommonUtils.isNotNull(states) && states == 3) { | |
| 133 | + if (CommonUtils.isNotNull(commentsDTO.getState()) && commentsDTO.getState() != 3) { | |
| 134 | + criteria.andEqualTo("state", commentsDTO.getState()); | |
| 135 | + } else if (CommonUtils.isNotNull(commentsDTO.getState()) && commentsDTO.getState() == 3) { | |
| 135 | 136 | Example.Criteria criteria1 = example.createCriteria(); |
| 136 | 137 | criteria1.orEqualTo("state", 1); |
| 137 | 138 | criteria1.orEqualTo("state", 2); |
| 138 | 139 | example.and(criteria1); |
| 139 | 140 | } |
| 140 | 141 | |
| 141 | - PageHelper.startPage(page, pageSize, true); | |
| 142 | + PageHelper.startPage(commentsDTO.getPage(), commentsDTO.getPageSize(), true); | |
| 142 | 143 | List<ShyComments> commentsList = shyCommentsMapper.selectByExample(example); |
| 143 | 144 | PageInfo<ShyComments> pageInfo = new PageInfo<>(commentsList); |
| 144 | 145 | return pageInfo; |
| 145 | 146 | } |
| 146 | - public PageInfo<ShyComments> getPageExcel(String activity_id, String content, Integer is_hot, Date start_date, Date end_date, Integer states, Integer receive, String updater, Integer page, Integer pageSize, String orderByClause, Integer spid, String userId,Integer type) { | |
| 147 | + public PageInfo<ShyComments> getPageExcel(CommentsDTO commentsDTO) { | |
| 147 | 148 | Example example = new Example(ShyComments.class); |
| 148 | 149 | Example.Criteria criteria = example.createCriteria(); |
| 149 | - if (CommonUtils.isNotEmpty(orderByClause)) { | |
| 150 | - example.setOrderByClause(orderByClause); | |
| 150 | + if (CommonUtils.isNotEmpty(commentsDTO.getOrderByClause())) { | |
| 151 | + example.setOrderByClause(commentsDTO.getOrderByClause()); | |
| 151 | 152 | } else { |
| 152 | 153 | example.setOrderByClause("comment_time desc"); |
| 153 | 154 | } |
| 154 | - if (CommonUtils.isNotNull(start_date) && CommonUtils.isNotNull(end_date)) { | |
| 155 | - criteria.andGreaterThanOrEqualTo("comment_time", start_date); | |
| 156 | - criteria.andLessThanOrEqualTo("comment_time", end_date); | |
| 155 | + if (CommonUtils.isNotNull(commentsDTO.getsDate()) && CommonUtils.isNotNull(commentsDTO.geteDate())) { | |
| 156 | + criteria.andGreaterThanOrEqualTo("comment_time", commentsDTO.getsDate()); | |
| 157 | + criteria.andLessThanOrEqualTo("comment_time", commentsDTO.geteDate()); | |
| 157 | 158 | } |
| 158 | - if (CommonUtils.isNotEmpty(content)) { | |
| 159 | - criteria.andLike("comment_content", "%" + content + "%"); | |
| 159 | + if (CommonUtils.isNotEmpty(commentsDTO.getContent())) { | |
| 160 | + criteria.andLike("comment_content", "%" + commentsDTO.getContent() + "%"); | |
| 160 | 161 | } |
| 161 | - if (CommonUtils.isNotEmpty(updater)) { | |
| 162 | - criteria.andEqualTo("updater", updater); | |
| 162 | + if (CommonUtils.isNotEmpty(commentsDTO.getUpdater())) { | |
| 163 | + criteria.andEqualTo("updater", commentsDTO.getUpdater()); | |
| 163 | 164 | } |
| 164 | - if (CommonUtils.isNotNull(spid)) { | |
| 165 | - criteria.andEqualTo("spid", spid); | |
| 165 | + if (CommonUtils.isNotNull(commentsDTO.getSpid())) { | |
| 166 | + criteria.andEqualTo("spid", commentsDTO.getSpid()); | |
| 166 | 167 | } |
| 167 | - if (CommonUtils.isNotNull(is_hot)) { | |
| 168 | - criteria.andEqualTo("is_hot", is_hot); | |
| 168 | + if (CommonUtils.isNotNull(commentsDTO.getIs_hot())) { | |
| 169 | + criteria.andEqualTo("is_hot", commentsDTO.getIs_hot()); | |
| 169 | 170 | } |
| 170 | - if (CommonUtils.isNotNull(type)&&type==0) { | |
| 171 | + if (CommonUtils.isNotNull(commentsDTO.getType())&&commentsDTO.getType()==0) { | |
| 171 | 172 | criteria.andEqualTo("type", CommonConst.CATEGORY_TOPIC); |
| 172 | - }else if(CommonUtils.isNotNull(type)&&type==1){ | |
| 173 | + }else if(CommonUtils.isNotNull(commentsDTO.getType())&&commentsDTO.getType()==1){ | |
| 173 | 174 | criteria.andIsNull("type"); |
| 174 | 175 | } |
| 175 | - if (CommonUtils.isNotEmpty(activity_id)) { | |
| 176 | - criteria.andLike("activity_id", "%" + activity_id + "%"); | |
| 176 | + if (CommonUtils.isNotEmpty(commentsDTO.getActivity_id())) { | |
| 177 | + criteria.andLike("activity_id", "%" + commentsDTO.getActivity_id() + "%"); | |
| 177 | 178 | } |
| 178 | - if (CommonUtils.isNotNull(receive)) { | |
| 179 | - criteria.andEqualTo("receive", receive); | |
| 180 | - if (receive==CommonConst.RECEIVE_AFTER) { | |
| 181 | - criteria.andEqualTo("receive_user_id", userId); | |
| 179 | + if (CommonUtils.isNotNull(commentsDTO.getReceive())) { | |
| 180 | + criteria.andEqualTo("receive", commentsDTO.getReceive()); | |
| 181 | + if (commentsDTO.getReceive().equals(CommonConst.RECEIVE_AFTER)) { | |
| 182 | + criteria.andEqualTo("receive_user_id", commentsDTO.getUserId()); | |
| 182 | 183 | } |
| 183 | 184 | } |
| 184 | 185 | |
| ... | ... | @@ -191,9 +192,9 @@ public class CommentsServiceImpl { |
| 191 | 192 | // example.and(criteria1); |
| 192 | 193 | // } |
| 193 | 194 | |
| 194 | - if (CommonUtils.isNotNull(states) && states != 3) { | |
| 195 | - criteria.andEqualTo("state", states); | |
| 196 | - } else if (CommonUtils.isNotNull(states) && states == 3) { | |
| 195 | + if (CommonUtils.isNotNull(commentsDTO.getState()) && commentsDTO.getState() != 3) { | |
| 196 | + criteria.andEqualTo("state", commentsDTO.getState()); | |
| 197 | + } else if (CommonUtils.isNotNull(commentsDTO.getState()) && commentsDTO.getState() == 3) { | |
| 197 | 198 | Example.Criteria criteria1 = example.createCriteria(); |
| 198 | 199 | criteria1.orEqualTo("state", 1); |
| 199 | 200 | criteria1.orEqualTo("state", 2); |
| ... | ... | @@ -207,7 +208,7 @@ public class CommentsServiceImpl { |
| 207 | 208 | |
| 208 | 209 | public ShyComments getDetailsComment(Integer id) { |
| 209 | 210 | ShyComments comment = shyCommentsMapper.selectByPrimaryKey(id); |
| 210 | - if (comment.getState() != CommonConst.AUDIT_INTT) { | |
| 211 | + if (!comment.getState().equals(CommonConst.AUDIT_INTT)) { | |
| 211 | 212 | String updater = CommonUtils.isEmpty(comment.getUpdater()) || "null".equals(comment.getUpdater())? "白名单":comment.getUpdater(); |
| 212 | 213 | String auditor_id = comment.getAuditor_id(); |
| 213 | 214 | if (CommonUtils.isNotEmpty(auditor_id)) { |
| ... | ... | @@ -278,7 +279,7 @@ public class CommentsServiceImpl { |
| 278 | 279 | String[] cids = ids.split(","); |
| 279 | 280 | for (String cid : cids) { |
| 280 | 281 | ShyComments shyComments = shyCommentsMapper.selectByPrimaryKey(Integer.parseInt(cid)); |
| 281 | - if (CommonUtils.isNotNull(shyComments) && shyComments.getState() == CommonConst.AUDIT_INTT && shyComments.getReceive()==CommonConst.RECEIVE_BEFORE) { | |
| 282 | + if (CommonUtils.isNotNull(shyComments) && shyComments.getState().equals(CommonConst.AUDIT_INTT) && shyComments.getReceive().equals(CommonConst.RECEIVE_BEFORE)) { | |
| 282 | 283 | shyComments.setReceive_user_id(userId); |
| 283 | 284 | shyComments.setReceive(CommonConst.RECEIVE_AFTER); |
| 284 | 285 | shyCommentsMapper.updateByPrimaryKeySelective(shyComments); |
| ... | ... | @@ -290,7 +291,9 @@ public class CommentsServiceImpl { |
| 290 | 291 | example.setOrderByClause("created_at desc"); |
| 291 | 292 | example.and().andEqualTo("state", CommonConst.AUDIT_INTT); |
| 292 | 293 | example.and().andEqualTo("receive", CommonConst.RECEIVE_AFTER); |
| 293 | - if (CommonUtils.isNotNull(spid) && spid != 0) example.and().andEqualTo("spid", spid); | |
| 294 | + if (CommonUtils.isNotNull(spid) && spid != 0) { | |
| 295 | + example.and().andEqualTo("spid", spid); | |
| 296 | + } | |
| 294 | 297 | List<ShyComments> shyCommentsList = shyCommentsMapper.selectByExampleAndRowBounds(example, new RowBounds(0, num)); |
| 295 | 298 | if (!shyCommentsList.isEmpty()) { |
| 296 | 299 | for (ShyComments shyComments : shyCommentsList) { |
| ... | ... | @@ -309,11 +312,13 @@ public class CommentsServiceImpl { |
| 309 | 312 | String[] cids = ids.split(","); |
| 310 | 313 | for (String cid : cids) { |
| 311 | 314 | ShyComments shyComments = shyCommentsMapper.selectByPrimaryKey(Integer.parseInt(cid)); |
| 312 | - if (shyComments.getState() == CommonConst.AUDIT_INTT && shyComments.getReceive()==CommonConst.RECEIVE_AFTER && userId.equals(shyComments.getReceive_user_id())) { | |
| 315 | + if (shyComments.getState().equals(CommonConst.AUDIT_INTT) && shyComments.getReceive().equals(CommonConst.RECEIVE_AFTER) && userId.equals(shyComments.getReceive_user_id())) { | |
| 313 | 316 | shyComments.setReceive(CommonConst.RECEIVE_BEFORE); |
| 314 | 317 | shyComments.setReceive_user_id(null); |
| 315 | 318 | int i = shyCommentsMapper.updateByPrimaryKeySelective(shyComments); |
| 316 | - if (i == 1) n++; | |
| 319 | + if (i == 1) { | |
| 320 | + n++; | |
| 321 | + } | |
| 317 | 322 | } |
| 318 | 323 | } |
| 319 | 324 | return n; | ... | ... |
src/main/java/com/cnlive/shenhe/serviceImpl/ContentServiceImpl.java
| 1 | 1 | package com.cnlive.shenhe.serviceImpl; |
| 2 | 2 | |
| 3 | 3 | import com.alibaba.fastjson.JSONObject; |
| 4 | +import com.cnlive.shenhe.dto.ContentDTO; | |
| 4 | 5 | import com.cnlive.shenhe.entity.*; |
| 5 | 6 | import com.cnlive.shenhe.mapper.ShyCommentsMapper; |
| 6 | 7 | import com.cnlive.shenhe.mapper.ShyContentMapper; |
| ... | ... | @@ -93,49 +94,52 @@ public class ContentServiceImpl { |
| 93 | 94 | return shyCommentsMapper.updateByPrimaryKeySelective(shyComments); |
| 94 | 95 | } |
| 95 | 96 | |
| 96 | - public PageInfo<ShyContent> getPage(String title, String source, String author, String content_tag, String contentId, Date start_date, Date end_date, Integer receive_status, String updater, Integer page, Integer pageSize, String orderByClause, Integer spid, String userId) { | |
| 97 | + public PageInfo<ShyContent> getPage(ContentDTO contentDTO) { | |
| 98 | + //String title, String source, String author, String content_tag, | |
| 99 | + // String contentId, Date start_date, Date end_date, Integer receive_status, String updater, | |
| 100 | + // Integer page, Integer pageSize, String orderByClause, Integer spid, String userId | |
| 97 | 101 | Example example = new Example(ShyContent.class); |
| 98 | 102 | Example.Criteria criteria = example.createCriteria(); |
| 99 | - if (CommonUtils.isNotEmpty(orderByClause)) { | |
| 100 | - example.setOrderByClause(orderByClause); | |
| 103 | + if (CommonUtils.isNotEmpty(contentDTO.getOrderByClause())) { | |
| 104 | + example.setOrderByClause(contentDTO.getOrderByClause()); | |
| 101 | 105 | } else { |
| 102 | 106 | example.setOrderByClause("create_date desc"); |
| 103 | 107 | } |
| 104 | - if (CommonUtils.isNotNull(start_date)) { | |
| 105 | - criteria.andGreaterThanOrEqualTo("create_date", start_date); | |
| 108 | + if (CommonUtils.isNotNull(contentDTO.getsDate())) { | |
| 109 | + criteria.andGreaterThanOrEqualTo("create_date", contentDTO.getsDate()); | |
| 106 | 110 | } |
| 107 | - if (CommonUtils.isNotNull(end_date)) { | |
| 108 | - criteria.andLessThanOrEqualTo("create_date", end_date); | |
| 111 | + if (CommonUtils.isNotNull(contentDTO.geteDate())) { | |
| 112 | + criteria.andLessThanOrEqualTo("create_date", contentDTO.geteDate()); | |
| 109 | 113 | } |
| 110 | - if (CommonUtils.isNotEmpty(title)) { | |
| 111 | - criteria.andLike("title", "%" + title + "%"); | |
| 114 | + if (CommonUtils.isNotEmpty(contentDTO.getTitle())) { | |
| 115 | + criteria.andLike("title", "%" + contentDTO.getTitle() + "%"); | |
| 112 | 116 | } |
| 113 | - if (CommonUtils.isNotEmpty(source)) { | |
| 114 | - criteria.andLike("source", "%" + source + "%"); | |
| 117 | + if (CommonUtils.isNotEmpty(contentDTO.getSource())) { | |
| 118 | + criteria.andLike("source", "%" + contentDTO.getSource() + "%"); | |
| 115 | 119 | } |
| 116 | - if (CommonUtils.isNotEmpty(author)) { | |
| 117 | - criteria.andEqualTo("author", author); | |
| 120 | + if (CommonUtils.isNotEmpty(contentDTO.getAuthor())) { | |
| 121 | + criteria.andEqualTo("author", contentDTO.getAuthor()); | |
| 118 | 122 | } |
| 119 | - if (CommonUtils.isNotEmpty(updater)) { | |
| 120 | - criteria.andEqualTo("updater", updater); | |
| 123 | + if (CommonUtils.isNotEmpty(contentDTO.getUpdater())) { | |
| 124 | + criteria.andEqualTo("updater", contentDTO.getUpdater()); | |
| 121 | 125 | } |
| 122 | - if (CommonUtils.isNotEmpty(content_tag)) { | |
| 123 | - criteria.andEqualTo("content_tag", content_tag); | |
| 126 | + if (CommonUtils.isNotEmpty(contentDTO.getContent_tag())) { | |
| 127 | + criteria.andEqualTo("content_tag", contentDTO.getContent_tag()); | |
| 124 | 128 | } |
| 125 | - if (CommonUtils.isNotNull(spid)) { | |
| 126 | - criteria.andEqualTo("sp_id", spid); | |
| 129 | + if (CommonUtils.isNotNull(contentDTO.getSpid())) { | |
| 130 | + criteria.andEqualTo("sp_id", contentDTO.getSpid()); | |
| 127 | 131 | } |
| 128 | - if (CommonUtils.isNotEmpty(contentId)) { | |
| 129 | - criteria.andEqualTo("content_id", contentId); | |
| 132 | + if (CommonUtils.isNotEmpty(contentDTO.getContentId())) { | |
| 133 | + criteria.andEqualTo("content_id", contentDTO.getContentId()); | |
| 130 | 134 | } |
| 131 | - if (CommonUtils.isNotNull(receive_status)) { | |
| 132 | - criteria.andEqualTo("receive_status", receive_status); | |
| 133 | - if (receive_status != CommonConst.RECEIVE_BEFORE) { | |
| 134 | - criteria.andEqualTo("auditor_id", userId); | |
| 135 | + if (CommonUtils.isNotNull(contentDTO.getReceive_status())) { | |
| 136 | + criteria.andEqualTo("receive_status", contentDTO.getReceive_status()); | |
| 137 | + if (!contentDTO.getReceive_status().equals(CommonConst.RECEIVE_BEFORE)) { | |
| 138 | + criteria.andEqualTo("auditor_id", contentDTO.getUserId()); | |
| 135 | 139 | } |
| 136 | 140 | } |
| 137 | 141 | |
| 138 | - PageHelper.startPage(page, pageSize, true); | |
| 142 | + PageHelper.startPage(contentDTO.getPage(), contentDTO.getPageSize(), true); | |
| 139 | 143 | List<ShyContent> contentList = shyContentMapper.selectByExample(example); |
| 140 | 144 | PageInfo<ShyContent> pageInfo = new PageInfo<>(contentList); |
| 141 | 145 | return pageInfo; |
| ... | ... | @@ -146,37 +150,35 @@ public class ContentServiceImpl { |
| 146 | 150 | * |
| 147 | 151 | * @return |
| 148 | 152 | */ |
| 149 | - public List<ShyContent> findByCondition(String title, String content_tag, String contentId, Date start_date, | |
| 150 | - Date end_date, Integer receive_status, Integer page, | |
| 151 | - Integer pageSize, String orderByClause, Integer spid) { | |
| 153 | + public List<ShyContent> findByCondition(ContentDTO contentDTO) { | |
| 152 | 154 | |
| 153 | 155 | Example example = new Example(ShyContent.class); |
| 154 | 156 | Example.Criteria criteria = example.createCriteria(); |
| 155 | - if (CommonUtils.isNotEmpty(orderByClause)) { | |
| 156 | - example.setOrderByClause(orderByClause); | |
| 157 | + if (CommonUtils.isNotEmpty(contentDTO.getOrderByClause())) { | |
| 158 | + example.setOrderByClause(contentDTO.getOrderByClause()); | |
| 157 | 159 | } else { |
| 158 | 160 | example.setOrderByClause("create_date desc"); |
| 159 | 161 | } |
| 160 | - if (CommonUtils.isNotNull(start_date)) { | |
| 161 | - criteria.andGreaterThanOrEqualTo("create_date", start_date); | |
| 162 | + if (CommonUtils.isNotNull(contentDTO.getsDate())) { | |
| 163 | + criteria.andGreaterThanOrEqualTo("create_date", contentDTO.getsDate()); | |
| 162 | 164 | } |
| 163 | - if (CommonUtils.isNotNull(end_date)) { | |
| 164 | - criteria.andLessThanOrEqualTo("create_date", end_date); | |
| 165 | + if (CommonUtils.isNotNull(contentDTO.geteDate())) { | |
| 166 | + criteria.andLessThanOrEqualTo("create_date", contentDTO.geteDate()); | |
| 165 | 167 | } |
| 166 | - if (CommonUtils.isNotEmpty(title)) { | |
| 167 | - criteria.andLike("title", "%" + title + "%"); | |
| 168 | + if (CommonUtils.isNotEmpty(contentDTO.getTitle())) { | |
| 169 | + criteria.andLike("title", "%" + contentDTO.getTitle() + "%"); | |
| 168 | 170 | } |
| 169 | - if (CommonUtils.isNotNull(spid)) { | |
| 170 | - criteria.andEqualTo("sp_id", spid); | |
| 171 | + if (CommonUtils.isNotNull(contentDTO.getSpid())) { | |
| 172 | + criteria.andEqualTo("sp_id", contentDTO.getSpid()); | |
| 171 | 173 | } |
| 172 | - if (CommonUtils.isNotEmpty(contentId)) { | |
| 173 | - criteria.andEqualTo("content_id", contentId); | |
| 174 | + if (CommonUtils.isNotEmpty(contentDTO.getContentId())) { | |
| 175 | + criteria.andEqualTo("content_id", contentDTO.getContentId()); | |
| 174 | 176 | } |
| 175 | - if (CommonUtils.isNotEmpty(content_tag)) { | |
| 176 | - criteria.andEqualTo("content_tag", content_tag); | |
| 177 | + if (CommonUtils.isNotEmpty(contentDTO.getContent_tag())) { | |
| 178 | + criteria.andEqualTo("content_tag", contentDTO.getContent_tag()); | |
| 177 | 179 | } |
| 178 | - if (CommonUtils.isNotNull(receive_status)) { | |
| 179 | - criteria.andEqualTo("receive_status", receive_status); | |
| 180 | + if (CommonUtils.isNotNull(contentDTO.getReceive_status())) { | |
| 181 | + criteria.andEqualTo("receive_status", contentDTO.getReceive_status()); | |
| 180 | 182 | } |
| 181 | 183 | List<ShyContent> shyContentList = shyContentMapper.selectByExample(example); |
| 182 | 184 | return shyContentList; |
| ... | ... | @@ -186,7 +188,7 @@ public class ContentServiceImpl { |
| 186 | 188 | //****************************** |
| 187 | 189 | public ShyContent getDetailsContent(Integer id) { |
| 188 | 190 | ShyContent content = shyContentMapper.selectByPrimaryKey(id); |
| 189 | - if (content.getReceive_status() == CommonConst.RECEIVE_AUDIT) { | |
| 191 | + if (content.getReceive_status().equals(CommonConst.RECEIVE_AUDIT)) { | |
| 190 | 192 | String updater = CommonUtils.isEmpty(content.getUpdater()) || "null".equals(content.getUpdater()) ? "白名单" : content.getUpdater(); |
| 191 | 193 | String auditor_id = content.getAuditor_id(); |
| 192 | 194 | if (CommonUtils.isNotEmpty(auditor_id)) { |
| ... | ... | @@ -243,7 +245,7 @@ public class ContentServiceImpl { |
| 243 | 245 | if (CommonUtils.isNotEmpty(content.getContent_tag()) |
| 244 | 246 | && content.getContent_tag().equals("moment") |
| 245 | 247 | && CommonUtils.isNotEmpty(content.getVideo_id()) |
| 246 | - && state == CommonConst.AUDIT_REFUSE) { | |
| 248 | + && state.equals(CommonConst.AUDIT_REFUSE)) { | |
| 247 | 249 | ShyVideos shyVideos1 = new ShyVideos(); |
| 248 | 250 | shyVideos1.setVideo_id(content.getVideo_id()); |
| 249 | 251 | List<ShyVideos> listshyVideos = videosService.findshyVideo(shyVideos1); |
| ... | ... | @@ -296,7 +298,9 @@ public class ContentServiceImpl { |
| 296 | 298 | example.setOrderByClause("create_date desc"); |
| 297 | 299 | example.and().andEqualTo("receive_status", CommonConst.RECEIVE_BEFORE); |
| 298 | 300 | // example.and().andEqualTo("receive", CommonConst.RECEIVE_AFTER); |
| 299 | - if (CommonUtils.isNotNull(spid) && spid != 0) example.and().andEqualTo("spid", spid); | |
| 301 | + if (CommonUtils.isNotNull(spid) && spid != 0) { | |
| 302 | + example.and().andEqualTo("spid", spid); | |
| 303 | + } | |
| 300 | 304 | List<ShyContent> shyContentList = shyContentMapper.selectByExampleAndRowBounds(example, new RowBounds(0, num)); |
| 301 | 305 | if (!shyContentList.isEmpty()) { |
| 302 | 306 | for (ShyContent shyContent : shyContentList) { |
| ... | ... | @@ -317,12 +321,14 @@ public class ContentServiceImpl { |
| 317 | 321 | String[] cids = ids.split(","); |
| 318 | 322 | for (String cid : cids) { |
| 319 | 323 | ShyContent shyContent = shyContentMapper.selectByPrimaryKey(Integer.parseInt(cid)); |
| 320 | - if (shyContent.getReceive_status() == CommonConst.RECEIVE_AFTER && userId.equals(shyContent.getAuditor_id())) { | |
| 324 | + if (shyContent.getReceive_status().equals(CommonConst.RECEIVE_AFTER) && userId.equals(shyContent.getAuditor_id())) { | |
| 321 | 325 | shyContent.setReceive_status(CommonConst.RECEIVE_BEFORE); |
| 322 | 326 | shyContent.setAuditor_id(null); |
| 323 | 327 | shyContent.setLast_update(CommonUtils.getCurrentTime()); |
| 324 | 328 | int i = shyContentMapper.updateByPrimaryKeySelective(shyContent); |
| 325 | - if (i == 1) n++; | |
| 329 | + if (i == 1) { | |
| 330 | + n++; | |
| 331 | + } | |
| 326 | 332 | } |
| 327 | 333 | } |
| 328 | 334 | return n; | ... | ... |
src/main/java/com/cnlive/shenhe/serviceImpl/EmailServiceImpl.java
| 1 | 1 | package com.cnlive.shenhe.serviceImpl; |
| 2 | 2 | |
| 3 | 3 | import com.alibaba.fastjson.JSONObject; |
| 4 | +import com.cnlive.shenhe.dto.EmailDTO; | |
| 4 | 5 | import com.cnlive.shenhe.entity.ShyEmail; |
| 5 | 6 | import com.cnlive.shenhe.entity.ShySites; |
| 6 | 7 | import com.cnlive.shenhe.entity.ShyUsers; |
| ... | ... | @@ -34,23 +35,23 @@ public class EmailServiceImpl { |
| 34 | 35 | @Autowired |
| 35 | 36 | ShyEmailMapper shyEmailMapper; |
| 36 | 37 | |
| 37 | - public PageInfo<ShyEmail> getPage(Integer page, Integer pageSize, String orderByClause, | |
| 38 | - String remark,String email) { | |
| 38 | + public PageInfo<ShyEmail> getPage(EmailDTO emailDTO) { | |
| 39 | 39 | Example example = new Example(ShyEmail.class); |
| 40 | 40 | Example.Criteria criteria = example.createCriteria(); |
| 41 | - if (CommonUtils.isNotEmpty(orderByClause)) { | |
| 42 | - example.setOrderByClause(orderByClause); | |
| 41 | + if (CommonUtils.isNotEmpty(emailDTO.getOrderByClause())) { | |
| 42 | + example.setOrderByClause(emailDTO.getOrderByClause()); | |
| 43 | 43 | }else{ |
| 44 | 44 | example.setOrderByClause("created_at desc"); |
| 45 | 45 | } |
| 46 | - if (CommonUtils.isNotEmpty(remark)) { | |
| 47 | - criteria.andLike("remark", "%" + remark + "%"); | |
| 46 | + if (CommonUtils.isNotEmpty(emailDTO.getRemark())) { | |
| 47 | + criteria.andLike("remark", "%" + emailDTO.getRemark() + "%"); | |
| 48 | 48 | } |
| 49 | - if (CommonUtils.isNotEmpty(email)) { | |
| 50 | - criteria.andLike("email", "%" + email + "%"); | |
| 49 | + if (CommonUtils.isNotEmpty(emailDTO.getEmail())) { | |
| 50 | + criteria.andLike("email", "%" + emailDTO.getEmail() + "%"); | |
| 51 | 51 | } |
| 52 | 52 | criteria.andEqualTo("is_delete",false); |
| 53 | - PageHelper.startPage(page, pageSize, true); | |
| 53 | + PageHelper.startPage(emailDTO.getPage(), emailDTO.getPageSize(), true); | |
| 54 | + | |
| 54 | 55 | List<ShyEmail> ShyEmailList = shyEmailMapper.selectByExample(example); |
| 55 | 56 | PageInfo<ShyEmail> pageInfo = new PageInfo<ShyEmail>(ShyEmailList); |
| 56 | 57 | return pageInfo; | ... | ... |
src/main/java/com/cnlive/shenhe/serviceImpl/LiveApplyServiceImpl.java
| ... | ... | @@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSONArray; |
| 5 | 5 | import com.alibaba.fastjson.JSONObject; |
| 6 | 6 | import com.cnlive.shenhe.bean.ErrorEnum; |
| 7 | 7 | import com.cnlive.shenhe.bean.ResponseBean; |
| 8 | +import com.cnlive.shenhe.dto.LiveApplyDTO; | |
| 8 | 9 | import com.cnlive.shenhe.entity.ShyChannel; |
| 9 | 10 | import com.cnlive.shenhe.entity.ShyLive; |
| 10 | 11 | import com.cnlive.shenhe.entity.ShyLiveapply; |
| ... | ... | @@ -111,56 +112,54 @@ public class LiveApplyServiceImpl { |
| 111 | 112 | } |
| 112 | 113 | |
| 113 | 114 | //=============== |
| 114 | - public PageInfo<ShyLiveapply> getListLiveApply(String theme, String start_date, String end_date, | |
| 115 | - String business_model, Integer page, Integer pageSize, | |
| 116 | - Integer shenhe_state,Integer receive, String orderByClause, Integer spid, String userId) { | |
| 115 | + public PageInfo<ShyLiveapply> getListLiveApply(LiveApplyDTO liveApplyDTO) { | |
| 117 | 116 | Example example = new Example(ShyLiveapply.class); |
| 118 | 117 | Example.Criteria criteria = example.createCriteria(); |
| 119 | - if (CommonUtils.isNotEmpty(orderByClause)) { | |
| 120 | - example.setOrderByClause(orderByClause); | |
| 118 | + if (CommonUtils.isNotEmpty(liveApplyDTO.getOrderByClause())) { | |
| 119 | + example.setOrderByClause(liveApplyDTO.getOrderByClause()); | |
| 121 | 120 | }else{ |
| 122 | 121 | example.setOrderByClause("created_at desc"); |
| 123 | 122 | } |
| 124 | - if (CommonUtils.isNotEmpty(start_date)) { | |
| 123 | + if (CommonUtils.isNotEmpty(liveApplyDTO.getsDate())) { | |
| 125 | 124 | Timestamp startdate = null; |
| 126 | 125 | try { |
| 127 | - startdate = CommonUtils.parseDate(start_date, "yyyy-MM-dd"); | |
| 126 | + startdate = CommonUtils.parseDate(liveApplyDTO.getsDate(), "yyyy-MM-dd"); | |
| 128 | 127 | } catch (ParseException e) { |
| 129 | 128 | e.printStackTrace(); |
| 130 | 129 | } |
| 131 | 130 | criteria.andGreaterThanOrEqualTo("pre_start_time", startdate); |
| 132 | 131 | } |
| 133 | - if ( CommonUtils.isNotEmpty(end_date)) { | |
| 132 | + if ( CommonUtils.isNotEmpty(liveApplyDTO.geteDate())) { | |
| 134 | 133 | Timestamp enddate = null; |
| 135 | 134 | try { |
| 136 | - enddate = CommonUtils.parseDate(end_date, "yyyy-MM-dd"); | |
| 135 | + enddate = CommonUtils.parseDate(liveApplyDTO.geteDate(), "yyyy-MM-dd"); | |
| 137 | 136 | } catch (ParseException e) { |
| 138 | 137 | e.printStackTrace(); |
| 139 | 138 | } |
| 140 | 139 | criteria.andLessThanOrEqualTo("pre_end_time", enddate); |
| 141 | 140 | } |
| 142 | - if (CommonUtils.isNotEmpty(theme)) { | |
| 143 | - criteria.andLike("theme", "%" + theme + "%"); | |
| 141 | + if (CommonUtils.isNotEmpty(liveApplyDTO.getTheme())) { | |
| 142 | + criteria.andLike("theme", "%" + liveApplyDTO.getTheme() + "%"); | |
| 144 | 143 | } |
| 145 | 144 | |
| 146 | - if (CommonUtils.isNotNull(business_model)) { | |
| 147 | - criteria.andLike("organization", "%" + business_model + "%"); | |
| 145 | + if (CommonUtils.isNotNull(liveApplyDTO.getBusiness_model())) { | |
| 146 | + criteria.andLike("organization", "%" + liveApplyDTO.getBusiness_model() + "%"); | |
| 148 | 147 | } |
| 149 | - if (CommonUtils.isNotNull(spid)) { | |
| 150 | - criteria.andEqualTo("sp_id", spid); | |
| 148 | + if (CommonUtils.isNotNull(liveApplyDTO.getSpid())) { | |
| 149 | + criteria.andEqualTo("sp_id", liveApplyDTO.getSpid()); | |
| 151 | 150 | } |
| 152 | - if (CommonUtils.isNotNull(shenhe_state)&& shenhe_state != 3) { | |
| 153 | - criteria.andEqualTo("shenhe_state", shenhe_state); | |
| 154 | - }else if(CommonUtils.isNotNull(shenhe_state)&& shenhe_state == 3){ | |
| 151 | + if (CommonUtils.isNotNull(liveApplyDTO.getShenhe_state())&& liveApplyDTO.getShenhe_state() != 3) { | |
| 152 | + criteria.andEqualTo("shenhe_state", liveApplyDTO.getShenhe_state()); | |
| 153 | + }else if(CommonUtils.isNotNull(liveApplyDTO.getShenhe_state())&& liveApplyDTO.getShenhe_state() == 3){ | |
| 155 | 154 | criteria.andNotEqualTo("shenhe_state", 0); |
| 156 | 155 | } |
| 157 | - if (CommonUtils.isNotNull(receive)) { | |
| 158 | - criteria.andEqualTo("receive", receive); | |
| 159 | - if(receive!=0 && CommonUtils.isNotEmpty(userId)){ | |
| 160 | - criteria.andEqualTo("auditor", userId); | |
| 156 | + if (CommonUtils.isNotNull(liveApplyDTO.getReceive())) { | |
| 157 | + criteria.andEqualTo("receive", liveApplyDTO.getReceive()); | |
| 158 | + if(liveApplyDTO.getReceive()!=0 && CommonUtils.isNotEmpty(liveApplyDTO.getUserId())){ | |
| 159 | + criteria.andEqualTo("auditor", liveApplyDTO.getUserId()); | |
| 161 | 160 | } |
| 162 | 161 | } |
| 163 | - PageHelper.startPage(page, pageSize, true); | |
| 162 | + PageHelper.startPage(liveApplyDTO.getPage(), liveApplyDTO.getPageSize(), true); | |
| 164 | 163 | List<ShyLiveapply> shyLiveApplyList = shyLiveApplyMapper.selectByExample(example); |
| 165 | 164 | PageInfo<ShyLiveapply> pageInfo = new PageInfo<>(shyLiveApplyList); |
| 166 | 165 | return pageInfo; |
| ... | ... | @@ -169,7 +168,7 @@ public class LiveApplyServiceImpl { |
| 169 | 168 | //====================== |
| 170 | 169 | public ShyLiveapply getDetailsLive(Integer id) { |
| 171 | 170 | ShyLiveapply shyLiveapply = shyLiveApplyMapper.selectByPrimaryKey(id); |
| 172 | - if (shyLiveapply.getShenhe_state() != CommonConst.RECEIVE_BEFORE) { | |
| 171 | + if (!shyLiveapply.getShenhe_state().equals(CommonConst.RECEIVE_BEFORE)) { | |
| 173 | 172 | String updater = CommonUtils.isEmpty(shyLiveapply.getUpdater()) || "null".equals(shyLiveapply.getUpdater())? "自动通过":shyLiveapply.getUpdater(); |
| 174 | 173 | String auditor_id = shyLiveapply.getAuditor(); |
| 175 | 174 | if (CommonUtils.isNotEmpty(auditor_id)) { |
| ... | ... | @@ -205,7 +204,9 @@ public class LiveApplyServiceImpl { |
| 205 | 204 | example.setOrderByClause("pre_start_time asc"); |
| 206 | 205 | example.and().andEqualTo("shenhe_state", CommonConst.AUDIT_INTT); |
| 207 | 206 | example.and().andEqualTo("receive", CommonConst.RECEIVE_BEFORE); |
| 208 | - if (CommonUtils.isNotNull(spid) && spid != 0) example.and().andEqualTo("spid", spid); | |
| 207 | + if (CommonUtils.isNotNull(spid) && spid != 0) { | |
| 208 | + example.and().andEqualTo("spid", spid); | |
| 209 | + } | |
| 209 | 210 | List<ShyLiveapply> shyLiveapplyList = shyLiveApplyMapper.selectByExampleAndRowBounds(example, new RowBounds(0, num)); |
| 210 | 211 | if (!shyLiveapplyList.isEmpty()) { |
| 211 | 212 | for (ShyLiveapply shyLiveapply : shyLiveapplyList) { |
| ... | ... | @@ -225,7 +226,7 @@ public class LiveApplyServiceImpl { |
| 225 | 226 | String[] cids = ids.split(","); |
| 226 | 227 | for (String cid : cids) { |
| 227 | 228 | ShyLiveapply shyLiveapply = shyLiveApplyMapper.selectByPrimaryKey(Integer.parseInt(cid)); |
| 228 | - if (shyLiveapply.getShenhe_state() == CommonConst.AUDIT_INTT &­Liveapply.getReceive() == CommonConst.RECEIVE_AFTER && shyLiveapply.getAuditor().equals(userId)) { | |
| 229 | + if (shyLiveapply.getShenhe_state().equals(CommonConst.AUDIT_INTT) && shyLiveapply.getReceive().equals(CommonConst.RECEIVE_AFTER) && shyLiveapply.getAuditor().equals(userId)) { | |
| 229 | 230 | shyLiveapply.setShenhe_state(CommonConst.AUDIT_INTT); |
| 230 | 231 | shyLiveapply.setReceive(CommonConst.RECEIVE_BEFORE); |
| 231 | 232 | shyLiveapply.setAuditor(null); |
| ... | ... | @@ -244,53 +245,51 @@ public class LiveApplyServiceImpl { |
| 244 | 245 | * 根据条件导出数据excel |
| 245 | 246 | * @return |
| 246 | 247 | */ |
| 247 | - public List<ShyLiveapply> findByCondition(String theme, String start_date, String end_date, | |
| 248 | - String business_model, Integer page, Integer pageSize, | |
| 249 | - Integer shenhe_state,Integer receive, String orderByClause, Integer spid, String userId) { | |
| 248 | + public List<ShyLiveapply> findByCondition(LiveApplyDTO liveApplyDTO) { | |
| 250 | 249 | Example example = new Example(ShyLiveapply.class); |
| 251 | 250 | Example.Criteria criteria = example.createCriteria(); |
| 252 | - if (CommonUtils.isNotEmpty(orderByClause)) { | |
| 253 | - example.setOrderByClause(orderByClause); | |
| 251 | + if (CommonUtils.isNotEmpty(liveApplyDTO.getOrderByClause())) { | |
| 252 | + example.setOrderByClause(liveApplyDTO.getOrderByClause()); | |
| 254 | 253 | }else{ |
| 255 | 254 | example.setOrderByClause("pre_start_time"); |
| 256 | 255 | } |
| 257 | - if (CommonUtils.isNotEmpty(start_date)) { | |
| 256 | + if (CommonUtils.isNotEmpty(liveApplyDTO.getsDate())) { | |
| 258 | 257 | Timestamp startdate = null; |
| 259 | 258 | try { |
| 260 | - startdate = CommonUtils.parseDate(start_date, "yyyy-MM-dd"); | |
| 259 | + startdate = CommonUtils.parseDate(liveApplyDTO.getsDate(), "yyyy-MM-dd"); | |
| 261 | 260 | } catch (ParseException e) { |
| 262 | 261 | e.printStackTrace(); |
| 263 | 262 | } |
| 264 | 263 | criteria.andGreaterThanOrEqualTo("pre_start_time", startdate); |
| 265 | 264 | } |
| 266 | - if ( CommonUtils.isNotEmpty(end_date)) { | |
| 265 | + if ( CommonUtils.isNotEmpty(liveApplyDTO.geteDate())) { | |
| 267 | 266 | Timestamp enddate = null; |
| 268 | 267 | try { |
| 269 | - enddate = CommonUtils.parseDate(end_date, "yyyy-MM-dd"); | |
| 268 | + enddate = CommonUtils.parseDate(liveApplyDTO.geteDate(), "yyyy-MM-dd"); | |
| 270 | 269 | } catch (ParseException e) { |
| 271 | 270 | e.printStackTrace(); |
| 272 | 271 | } |
| 273 | 272 | criteria.andLessThanOrEqualTo("pre_end_time", enddate); |
| 274 | 273 | } |
| 275 | - if (CommonUtils.isNotEmpty(theme)) { | |
| 276 | - criteria.andLike("theme", "%" + theme + "%"); | |
| 274 | + if (CommonUtils.isNotEmpty(liveApplyDTO.getTheme())) { | |
| 275 | + criteria.andLike("theme", "%" + liveApplyDTO.getTheme() + "%"); | |
| 277 | 276 | } |
| 278 | 277 | |
| 279 | - if (CommonUtils.isNotNull(business_model)) { | |
| 280 | - criteria.andEqualTo("business_model", business_model); | |
| 278 | + if (CommonUtils.isNotNull(liveApplyDTO.getBusiness_model())) { | |
| 279 | + criteria.andEqualTo("business_model", liveApplyDTO.getBusiness_model()); | |
| 281 | 280 | } |
| 282 | - if (CommonUtils.isNotNull(spid)) { | |
| 283 | - criteria.andEqualTo("sp_id", spid); | |
| 281 | + if (CommonUtils.isNotNull(liveApplyDTO.getSpid())) { | |
| 282 | + criteria.andEqualTo("sp_id", liveApplyDTO.getSpid()); | |
| 284 | 283 | } |
| 285 | - if (CommonUtils.isNotNull(shenhe_state)&& shenhe_state != 3) { | |
| 286 | - criteria.andEqualTo("shenhe_state", shenhe_state); | |
| 287 | - }else if(CommonUtils.isNotNull(shenhe_state)&& shenhe_state == 3){ | |
| 284 | + if (CommonUtils.isNotNull(liveApplyDTO.getShenhe_state())&& liveApplyDTO.getShenhe_state() != 3) { | |
| 285 | + criteria.andEqualTo("shenhe_state", liveApplyDTO.getShenhe_state()); | |
| 286 | + }else if(CommonUtils.isNotNull(liveApplyDTO.getShenhe_state())&& liveApplyDTO.getShenhe_state() == 3){ | |
| 288 | 287 | criteria.andNotEqualTo("shenhe_state", 0); |
| 289 | 288 | } |
| 290 | - if (CommonUtils.isNotNull(receive)) { | |
| 291 | - criteria.andEqualTo("receive", receive); | |
| 292 | - if(receive!=0 && CommonUtils.isNotEmpty(userId)){ | |
| 293 | - criteria.andEqualTo("auditor", userId); | |
| 289 | + if (CommonUtils.isNotNull(liveApplyDTO.getReceive())) { | |
| 290 | + criteria.andEqualTo("receive", liveApplyDTO.getReceive()); | |
| 291 | + if(liveApplyDTO.getReceive()!=0 && CommonUtils.isNotEmpty(liveApplyDTO.getUserId())){ | |
| 292 | + criteria.andEqualTo("auditor", liveApplyDTO.getUserId()); | |
| 294 | 293 | } |
| 295 | 294 | } |
| 296 | 295 | List<ShyLiveapply> shyLiveApplyList = shyLiveApplyMapper.selectByExample(example); |
| ... | ... | @@ -299,7 +298,7 @@ public class LiveApplyServiceImpl { |
| 299 | 298 | |
| 300 | 299 | /** |
| 301 | 300 | * 获得审核类型 |
| 302 | - * @param shyChannel | |
| 301 | + * @param shyLiveApply | |
| 303 | 302 | */ |
| 304 | 303 | public void getShenheType(ShyLiveapply shyLiveApply){ |
| 305 | 304 | ... | ... |
src/main/java/com/cnlive/shenhe/serviceImpl/LiveServiceImpl.java
| ... | ... | @@ -2,6 +2,7 @@ package com.cnlive.shenhe.serviceImpl; |
| 2 | 2 | |
| 3 | 3 | import com.cnlive.shenhe.bean.ErrorEnum; |
| 4 | 4 | import com.cnlive.shenhe.bean.ResponseBean; |
| 5 | +import com.cnlive.shenhe.dto.LiveDTO; | |
| 5 | 6 | import com.cnlive.shenhe.entity.ShyLive; |
| 6 | 7 | import com.cnlive.shenhe.entity.ShyUsers; |
| 7 | 8 | import com.cnlive.shenhe.mapper.ShyLiveMapper; |
| ... | ... | @@ -84,53 +85,51 @@ public class LiveServiceImpl { |
| 84 | 85 | } |
| 85 | 86 | |
| 86 | 87 | //=============== |
| 87 | - public PageInfo<ShyLive> getListContent(String activity_name, String start_date, String end_date, | |
| 88 | - String activity_id, Integer activity_status, Integer page, Integer pageSize, | |
| 89 | - Integer shenhe_state, String orderByClause, Integer spid, String userId) { | |
| 88 | + public PageInfo<ShyLive> getListContent(LiveDTO liveDTO) { | |
| 90 | 89 | Example example = new Example(ShyLive.class); |
| 91 | 90 | Example.Criteria criteria = example.createCriteria(); |
| 92 | - if (CommonUtils.isNotEmpty(orderByClause)) { | |
| 93 | - example.setOrderByClause(orderByClause); | |
| 91 | + if (CommonUtils.isNotEmpty(liveDTO.getOrderByClause())) { | |
| 92 | + example.setOrderByClause(liveDTO.getOrderByClause()); | |
| 94 | 93 | } |
| 95 | - if (CommonUtils.isNotEmpty(start_date)) { | |
| 94 | + if (CommonUtils.isNotEmpty(liveDTO.getsDate())) { | |
| 96 | 95 | Timestamp startdate = null; |
| 97 | 96 | try { |
| 98 | - startdate = CommonUtils.parseDate(start_date, "yyyy-MM-dd"); | |
| 97 | + startdate = CommonUtils.parseDate(liveDTO.getsDate(), "yyyy-MM-dd"); | |
| 99 | 98 | } catch (ParseException e) { |
| 100 | 99 | e.printStackTrace(); |
| 101 | 100 | } |
| 102 | 101 | criteria.andGreaterThanOrEqualTo("activity_start_time", startdate); |
| 103 | 102 | } |
| 104 | - if ( CommonUtils.isNotEmpty(end_date)) { | |
| 103 | + if ( CommonUtils.isNotEmpty(liveDTO.geteDate())) { | |
| 105 | 104 | Timestamp enddate = null; |
| 106 | 105 | try { |
| 107 | - enddate = CommonUtils.parseDate(end_date, "yyyy-MM-dd"); | |
| 106 | + enddate = CommonUtils.parseDate(liveDTO.geteDate(), "yyyy-MM-dd"); | |
| 108 | 107 | } catch (ParseException e) { |
| 109 | 108 | e.printStackTrace(); |
| 110 | 109 | } |
| 111 | 110 | criteria.andLessThanOrEqualTo("activity_start_time", enddate); |
| 112 | 111 | } |
| 113 | - if (CommonUtils.isNotEmpty(activity_name)) { | |
| 114 | - criteria.andLike("activity_name", "%" + activity_name + "%"); | |
| 112 | + if (CommonUtils.isNotEmpty(liveDTO.getActivity_name())) { | |
| 113 | + criteria.andLike("activity_name", "%" + liveDTO.getActivity_name() + "%"); | |
| 115 | 114 | } |
| 116 | 115 | |
| 117 | - if (CommonUtils.isNotEmpty(activity_id)) { | |
| 118 | - criteria.andEqualTo("activity_id", activity_id); | |
| 116 | + if (CommonUtils.isNotEmpty(liveDTO.getActivity_id())) { | |
| 117 | + criteria.andEqualTo("activity_id", liveDTO.getActivity_id()); | |
| 119 | 118 | } |
| 120 | - if (CommonUtils.isNotNull(spid)) { | |
| 121 | - criteria.andEqualTo("sp_id", spid); | |
| 119 | + if (CommonUtils.isNotNull(liveDTO.getSpid())) { | |
| 120 | + criteria.andEqualTo("sp_id", liveDTO.getSpid()); | |
| 122 | 121 | } |
| 123 | - if (CommonUtils.isNotNull(shenhe_state)) { | |
| 124 | - criteria.andEqualTo("shenhe_state", shenhe_state); | |
| 125 | - if (shenhe_state != CommonConst.RECEIVE_BEFORE) { | |
| 126 | - criteria.andEqualTo("auditor", userId); | |
| 122 | + if (CommonUtils.isNotNull(liveDTO.getShenhe_state())) { | |
| 123 | + criteria.andEqualTo("shenhe_state", liveDTO.getShenhe_state()); | |
| 124 | + if (!liveDTO.getShenhe_state().equals(CommonConst.RECEIVE_BEFORE)) { | |
| 125 | + criteria.andEqualTo("auditor", liveDTO.getUserId()); | |
| 127 | 126 | } |
| 128 | 127 | } |
| 129 | - if (CommonUtils.isNotNull(activity_status) ) { | |
| 130 | - criteria.andEqualTo("activity_status", activity_status); | |
| 128 | + if (CommonUtils.isNotNull(liveDTO.getActivity_status()) ) { | |
| 129 | + criteria.andEqualTo("activity_status", liveDTO.getActivity_status()); | |
| 131 | 130 | } |
| 132 | 131 | criteria.andEqualTo("is_show", 1); |
| 133 | - PageHelper.startPage(page, pageSize, true); | |
| 132 | + PageHelper.startPage(liveDTO.getPage(), liveDTO.getPageSize(), true); | |
| 134 | 133 | List<ShyLive> shyLiveList = shyLiveMapper.selectByExample(example); |
| 135 | 134 | PageInfo<ShyLive> pageInfo = new PageInfo<>(shyLiveList); |
| 136 | 135 | return pageInfo; |
| ... | ... | @@ -139,7 +138,7 @@ public class LiveServiceImpl { |
| 139 | 138 | //====================== |
| 140 | 139 | public ShyLive getDetailsLive(Integer id) { |
| 141 | 140 | ShyLive shyLive = shyLiveMapper.selectByPrimaryKey(id); |
| 142 | - if (shyLive.getShenhe_state() != CommonConst.RECEIVE_BEFORE) { | |
| 141 | + if (!shyLive.getShenhe_state().equals(CommonConst.RECEIVE_BEFORE)) { | |
| 143 | 142 | String updater = CommonUtils.isEmpty(shyLive.getUpdater()) || "null".equals(shyLive.getUpdater())? "自动通过":shyLive.getUpdater(); |
| 144 | 143 | String auditor_id = shyLive.getAuditor(); |
| 145 | 144 | if (CommonUtils.isNotEmpty(auditor_id)) { |
| ... | ... | @@ -173,7 +172,9 @@ public class LiveServiceImpl { |
| 173 | 172 | Example example = new Example(ShyLive.class); |
| 174 | 173 | example.setOrderByClause("is_hot desc, activity_start_time asc"); |
| 175 | 174 | example.and().andEqualTo("shenhe_state", CommonConst.RECEIVE_BEFORE); |
| 176 | - if (CommonUtils.isNotNull(spid) && spid != 0) example.and().andEqualTo("spid", spid); | |
| 175 | + if (CommonUtils.isNotNull(spid) && spid != 0) { | |
| 176 | + example.and().andEqualTo("spid", spid); | |
| 177 | + } | |
| 177 | 178 | List<ShyLive> shyLiveList = shyLiveMapper.selectByExampleAndRowBounds(example, new RowBounds(0, num)); |
| 178 | 179 | if (!shyLiveList.isEmpty()) { |
| 179 | 180 | for (ShyLive shyLive : shyLiveList) { |
| ... | ... | @@ -192,7 +193,7 @@ public class LiveServiceImpl { |
| 192 | 193 | String[] cids = ids.split(","); |
| 193 | 194 | for (String cid : cids) { |
| 194 | 195 | ShyLive shyLive = shyLiveMapper.selectByPrimaryKey(Integer.parseInt(cid)); |
| 195 | - if (shyLive.getShenhe_state() == CommonConst.RECEIVE_AFTER && shyLive.getAuditor().equals(userId)) { | |
| 196 | + if (shyLive.getShenhe_state().equals(CommonConst.RECEIVE_AFTER) && shyLive.getAuditor().equals(userId)) { | |
| 196 | 197 | shyLive.setShenhe_state(CommonConst.RECEIVE_BEFORE); |
| 197 | 198 | shyLive.setAuditor(null); |
| 198 | 199 | int i = shyLiveMapper.updateByPrimaryKey(shyLive); |
| ... | ... | @@ -210,52 +211,50 @@ public class LiveServiceImpl { |
| 210 | 211 | * 根据条件导出数据excel |
| 211 | 212 | * @return |
| 212 | 213 | */ |
| 213 | - public List<ShyLive> findByCondition(String activity_name, String start_date, String end_date, | |
| 214 | - String activity_id, Integer activity_status, Integer page, Integer pageSize, | |
| 215 | - Integer shenhe_state, String orderByClause, Integer spid, String userId) { | |
| 214 | + public List<ShyLive> findByCondition(LiveDTO liveDTO) { | |
| 216 | 215 | Example example = new Example(ShyLive.class); |
| 217 | 216 | Example.Criteria criteria = example.createCriteria(); |
| 218 | - if (CommonUtils.isNotEmpty(orderByClause)) { | |
| 219 | - example.setOrderByClause(orderByClause); | |
| 217 | + if (CommonUtils.isNotEmpty(liveDTO.getOrderByClause())) { | |
| 218 | + example.setOrderByClause(liveDTO.getOrderByClause()); | |
| 220 | 219 | }else{ |
| 221 | 220 | example.setOrderByClause("activity_start_time"); |
| 222 | 221 | } |
| 223 | - if (CommonUtils.isNotEmpty(start_date)) { | |
| 222 | + if (CommonUtils.isNotEmpty(liveDTO.getsDate())) { | |
| 224 | 223 | Timestamp startdate = null; |
| 225 | 224 | try { |
| 226 | - startdate = CommonUtils.parseDate(start_date, "yyyy-MM-dd"); | |
| 225 | + startdate = CommonUtils.parseDate(liveDTO.getsDate(), "yyyy-MM-dd"); | |
| 227 | 226 | } catch (ParseException e) { |
| 228 | 227 | e.printStackTrace(); |
| 229 | 228 | } |
| 230 | 229 | criteria.andGreaterThanOrEqualTo("activity_start_time", startdate); |
| 231 | 230 | } |
| 232 | - if ( CommonUtils.isNotEmpty(end_date)) { | |
| 231 | + if (CommonUtils.isNotEmpty(liveDTO.geteDate())) { | |
| 233 | 232 | Timestamp enddate = null; |
| 234 | 233 | try { |
| 235 | - enddate = CommonUtils.parseDate(end_date, "yyyy-MM-dd"); | |
| 234 | + enddate = CommonUtils.parseDate(liveDTO.geteDate(), "yyyy-MM-dd"); | |
| 236 | 235 | } catch (ParseException e) { |
| 237 | 236 | e.printStackTrace(); |
| 238 | 237 | } |
| 239 | 238 | criteria.andLessThanOrEqualTo("activity_start_time", enddate); |
| 240 | 239 | } |
| 241 | - if (CommonUtils.isNotEmpty(activity_name)) { | |
| 242 | - criteria.andLike("activity_name", "%" + activity_name + "%"); | |
| 240 | + if (CommonUtils.isNotEmpty(liveDTO.getActivity_name())) { | |
| 241 | + criteria.andLike("activity_name", "%" + liveDTO.getActivity_name() + "%"); | |
| 243 | 242 | } |
| 244 | 243 | |
| 245 | - if (CommonUtils.isNotEmpty(activity_id)) { | |
| 246 | - criteria.andEqualTo("activity_id", activity_id); | |
| 244 | + if (CommonUtils.isNotEmpty(liveDTO.getActivity_id())) { | |
| 245 | + criteria.andEqualTo("activity_id", liveDTO.getActivity_id()); | |
| 247 | 246 | } |
| 248 | - if (CommonUtils.isNotNull(spid)) { | |
| 249 | - criteria.andEqualTo("sp_id", spid); | |
| 247 | + if (CommonUtils.isNotNull(liveDTO.getSpid())) { | |
| 248 | + criteria.andEqualTo("sp_id", liveDTO.getSpid()); | |
| 250 | 249 | } |
| 251 | - if (CommonUtils.isNotNull(shenhe_state)) { | |
| 252 | - criteria.andEqualTo("shenhe_state", shenhe_state); | |
| 253 | - if (shenhe_state != CommonConst.RECEIVE_BEFORE) { | |
| 254 | - criteria.andEqualTo("auditor", userId); | |
| 250 | + if (CommonUtils.isNotNull(liveDTO.getShenhe_state())) { | |
| 251 | + criteria.andEqualTo("shenhe_state", liveDTO.getShenhe_state()); | |
| 252 | + if (!liveDTO.getShenhe_state().equals(CommonConst.RECEIVE_BEFORE)) { | |
| 253 | + criteria.andEqualTo("auditor", liveDTO.getUserId()); | |
| 255 | 254 | } |
| 256 | 255 | } |
| 257 | - if (CommonUtils.isNotNull(activity_status) ) { | |
| 258 | - criteria.andEqualTo("activity_status", activity_status); | |
| 256 | + if (CommonUtils.isNotNull(liveDTO.getActivity_status()) ) { | |
| 257 | + criteria.andEqualTo("activity_status", liveDTO.getActivity_status()); | |
| 259 | 258 | } |
| 260 | 259 | criteria.andEqualTo("is_show", 1); |
| 261 | 260 | List<ShyLive> shyLiveList = shyLiveMapper.selectByExample(example); | ... | ... |
src/main/java/com/cnlive/shenhe/serviceImpl/NotspeakServiceImpl.java
| ... | ... | @@ -3,6 +3,7 @@ package com.cnlive.shenhe.serviceImpl; |
| 3 | 3 | import com.alibaba.fastjson.JSONArray; |
| 4 | 4 | import com.alibaba.fastjson.JSONObject; |
| 5 | 5 | import com.cnlive.shenhe.bean.ResponseBean; |
| 6 | +import com.cnlive.shenhe.dto.NotSpeakDTO; | |
| 6 | 7 | import com.cnlive.shenhe.entity.ShyComments; |
| 7 | 8 | import com.cnlive.shenhe.entity.ShyContent; |
| 8 | 9 | import com.cnlive.shenhe.entity.ShyLive; |
| ... | ... | @@ -162,7 +163,7 @@ public class NotspeakServiceImpl { |
| 162 | 163 | List<ShyNotspeak> shyNotspeakList = findshyNotspeak(shyNotspeak); |
| 163 | 164 | if(shyNotspeakList.size()>0){ |
| 164 | 165 | shyNotspeak =shyNotspeakList.get(0); |
| 165 | - return new ResponseBean(500,"当前用户已被禁言,禁言剩余时长:"+(shyNotspeak.getEnd_time().getTime()-new Date().getTime())/(1000*60)+"分钟,解禁时间:"+CommonUtils.formatDate(shyNotspeak.getEnd_time(), "yyyy-MM-dd HH:mm:ss")); | |
| 166 | + return new ResponseBean(500,"当前用户已被禁言,禁言剩余时长:"+(shyNotspeak.getEnd_time().getTime()-System.currentTimeMillis())/(1000*60)+"分钟,解禁时间:"+CommonUtils.formatDate(shyNotspeak.getEnd_time(), "yyyy-MM-dd HH:mm:ss")); | |
| 166 | 167 | } |
| 167 | 168 | return new ResponseBean(); |
| 168 | 169 | } |
| ... | ... | @@ -195,7 +196,7 @@ public class NotspeakServiceImpl { |
| 195 | 196 | } |
| 196 | 197 | String msg=CommonUtils.getCurrentDate("yyyy-MM-dd HH:mm:ss")+"解除禁言"; |
| 197 | 198 | shyNotspeak.setState(type); |
| 198 | - if(type==CommonConst.SPEAK_NOT){ | |
| 199 | + if(type.equals(CommonConst.SPEAK_NOT)){ | |
| 199 | 200 | shyNotspeak.setStart_time(CommonUtils.getCurrentTime()); |
| 200 | 201 | shyNotspeak.setTime(time); |
| 201 | 202 | shyNotspeak.setEnd_time(CommonUtils.getAddTime(time)); |
| ... | ... | @@ -266,26 +267,25 @@ public class NotspeakServiceImpl { |
| 266 | 267 | return result; |
| 267 | 268 | } |
| 268 | 269 | |
| 269 | - public PageInfo<ShyNotspeak> getPage( String user_name, Integer user_id,Integer state, | |
| 270 | - Integer page, Integer pageSize, String orderByClause) { | |
| 270 | + public PageInfo<ShyNotspeak> getPage(NotSpeakDTO notSpeakDTO) { | |
| 271 | 271 | Example example = new Example(ShyNotspeak.class); |
| 272 | 272 | Example.Criteria criteria = example.createCriteria(); |
| 273 | - if (CommonUtils.isNotEmpty(orderByClause)) { | |
| 274 | - example.setOrderByClause(orderByClause); | |
| 273 | + if (CommonUtils.isNotEmpty(notSpeakDTO.getOrderByClause())) { | |
| 274 | + example.setOrderByClause(notSpeakDTO.getOrderByClause()); | |
| 275 | 275 | } else { |
| 276 | 276 | example.setOrderByClause("state desc , updated_at desc"); |
| 277 | 277 | } |
| 278 | - if (CommonUtils.isNotEmpty(user_name)) { | |
| 279 | - criteria.andLike("user_name", "%" + user_name + "%"); | |
| 278 | + if (CommonUtils.isNotEmpty(notSpeakDTO.getUser_name())) { | |
| 279 | + criteria.andLike("user_name", "%" + notSpeakDTO.getUser_name() + "%"); | |
| 280 | 280 | } |
| 281 | - if (CommonUtils.isNotNull(user_id)) { | |
| 282 | - criteria.andEqualTo("user_id", user_id); | |
| 281 | + if (CommonUtils.isNotNull(notSpeakDTO.getUser_id())) { | |
| 282 | + criteria.andEqualTo("user_id", notSpeakDTO.getUser_id()); | |
| 283 | 283 | } |
| 284 | - if (CommonUtils.isNotNull(state)) { | |
| 285 | - criteria.andEqualTo("state", state); | |
| 284 | + if (CommonUtils.isNotNull(notSpeakDTO.getState())) { | |
| 285 | + criteria.andEqualTo("state", notSpeakDTO.getState()); | |
| 286 | 286 | } |
| 287 | 287 | |
| 288 | - PageHelper.startPage(page, pageSize, true); | |
| 288 | + PageHelper.startPage(notSpeakDTO.getPage(), notSpeakDTO.getPageSize(), true); | |
| 289 | 289 | List<ShyNotspeak> shyNotspeakList = shyNotspeakMapper.selectByExample(example); |
| 290 | 290 | PageInfo<ShyNotspeak> pageInfo = new PageInfo<>(shyNotspeakList); |
| 291 | 291 | return pageInfo; | ... | ... |
src/main/java/com/cnlive/shenhe/serviceImpl/SitesServiceImpl.java
| 1 | 1 | package com.cnlive.shenhe.serviceImpl; |
| 2 | 2 | |
| 3 | +import com.cnlive.shenhe.dto.SitesDTO; | |
| 3 | 4 | import com.cnlive.shenhe.entity.ShySites; |
| 4 | 5 | import com.cnlive.shenhe.entity.ShyUsers; |
| 5 | 6 | import com.cnlive.shenhe.mapper.ShySitesMapper; |
| ... | ... | @@ -27,22 +28,23 @@ public class SitesServiceImpl { |
| 27 | 28 | @Autowired |
| 28 | 29 | UsersServiceImpl usersService; |
| 29 | 30 | |
| 30 | - public PageInfo<ShySites> getPage(Integer page, Integer pageSize, String orderByClause, String key, Integer spId) { | |
| 31 | + public PageInfo<ShySites> getPage(SitesDTO sitesDTO) { | |
| 31 | 32 | Example example = new Example(ShySites.class); |
| 32 | 33 | Example.Criteria criteria = example.createCriteria(); |
| 33 | 34 | Example.Criteria criteria2 = example.createCriteria(); |
| 34 | - if (CommonUtils.isNotEmpty(orderByClause)) { | |
| 35 | - example.setOrderByClause(orderByClause); | |
| 35 | + if (CommonUtils.isNotEmpty(sitesDTO.getOrderByClause())) { | |
| 36 | + example.setOrderByClause(sitesDTO.getOrderByClause()); | |
| 36 | 37 | } |
| 37 | - if (CommonUtils.isNotEmpty(key)) { | |
| 38 | - criteria.andLike("name", "%" + key + "%"); | |
| 39 | - criteria2.andLike("spid", "%" + key + "%"); | |
| 38 | + if (CommonUtils.isNotEmpty(sitesDTO.getKeyword())) { | |
| 39 | + criteria.andLike("name", "%" + sitesDTO.getKeyword() + "%"); | |
| 40 | + criteria2.andLike("spid", "%" + sitesDTO.getKeyword() + "%"); | |
| 40 | 41 | example.or(criteria2); |
| 41 | 42 | } |
| 42 | - if (CommonUtils.isNotNull(spId)) | |
| 43 | - criteria.andEqualTo("spid", spId); | |
| 44 | - criteria2.andEqualTo("spid", spId); | |
| 45 | - PageHelper.startPage(page, pageSize, true); | |
| 43 | + if (CommonUtils.isNotNull(sitesDTO.getSpId())) { | |
| 44 | + criteria.andEqualTo("spid", sitesDTO.getSpId()); | |
| 45 | + criteria2.andEqualTo("spid", sitesDTO.getSpId()); | |
| 46 | + } | |
| 47 | + PageHelper.startPage(sitesDTO.getPage(), sitesDTO.getPageSize(), true); | |
| 46 | 48 | List<ShySites> shySitesList = shySitesMapper.selectByExample(example); |
| 47 | 49 | PageInfo<ShySites> pageInfo = new PageInfo<ShySites>(shySitesList); |
| 48 | 50 | return pageInfo; |
| ... | ... | @@ -65,8 +67,9 @@ public class SitesServiceImpl { |
| 65 | 67 | public ShySites findspidDescByspid(int spId) { |
| 66 | 68 | Example example = new Example(ShySites.class); |
| 67 | 69 | Example.Criteria criteria = example.createCriteria(); |
| 68 | - if (CommonUtils.isNotNull(spId)) | |
| 70 | + if (CommonUtils.isNotNull(spId)) { | |
| 69 | 71 | criteria.andEqualTo("spid", spId); |
| 72 | + } | |
| 70 | 73 | List<ShySites> shySites = shySitesMapper.selectByExample(example); |
| 71 | 74 | if(CommonUtils.isNotNull(shySites)&­Sites.size()>0){ |
| 72 | 75 | return shySites.get(0); |
| ... | ... | @@ -77,8 +80,9 @@ public class SitesServiceImpl { |
| 77 | 80 | public ShySites findspidBySpdesc(String sp_desc) { |
| 78 | 81 | Example example = new Example(ShySites.class); |
| 79 | 82 | Example.Criteria criteria = example.createCriteria(); |
| 80 | - if (CommonUtils.isNotEmpty(sp_desc)) | |
| 83 | + if (CommonUtils.isNotEmpty(sp_desc)) { | |
| 81 | 84 | criteria.andEqualTo("name", sp_desc); |
| 85 | + } | |
| 82 | 86 | List<ShySites> shySites = shySitesMapper.selectByExample(example); |
| 83 | 87 | if(CommonUtils.isNotNull(shySites)&­Sites.size()>0){ |
| 84 | 88 | return shySites.get(0); | ... | ... |
src/main/java/com/cnlive/shenhe/serviceImpl/TopicServiceImpl.java
| ... | ... | @@ -2,6 +2,7 @@ package com.cnlive.shenhe.serviceImpl; |
| 2 | 2 | |
| 3 | 3 | import com.alibaba.fastjson.JSONArray; |
| 4 | 4 | import com.alibaba.fastjson.JSONObject; |
| 5 | +import com.cnlive.shenhe.dto.TopicDTO; | |
| 5 | 6 | import com.cnlive.shenhe.entity.ShyComments; |
| 6 | 7 | import com.cnlive.shenhe.entity.ShyContent; |
| 7 | 8 | import com.cnlive.shenhe.entity.ShyLive; |
| ... | ... | @@ -107,48 +108,48 @@ public class TopicServiceImpl { |
| 107 | 108 | return shyCommentsMapper.updateByPrimaryKeySelective(shyComments); |
| 108 | 109 | } |
| 109 | 110 | |
| 110 | - public PageInfo<ShyTopic> getPage( String title,String topic_tag,String topicId, Date start_date, Date end_date, Integer shenhe_status, String updater, Integer page, Integer pageSize, String orderByClause, Integer spid, String userId,Integer receive) { | |
| 111 | + public PageInfo<ShyTopic> getPage(TopicDTO topicDTO) { | |
| 111 | 112 | Example example = new Example(ShyTopic.class); |
| 112 | 113 | Example.Criteria criteria = example.createCriteria(); |
| 113 | - if (CommonUtils.isNotEmpty(orderByClause)) { | |
| 114 | - example.setOrderByClause(orderByClause); | |
| 114 | + if (CommonUtils.isNotEmpty(topicDTO.getOrderByClause())) { | |
| 115 | + example.setOrderByClause(topicDTO.getOrderByClause()); | |
| 115 | 116 | } else { |
| 116 | 117 | example.setOrderByClause("create_date desc"); |
| 117 | 118 | } |
| 118 | - if (CommonUtils.isNotNull(start_date) ) { | |
| 119 | - criteria.andGreaterThanOrEqualTo("create_date", start_date); | |
| 119 | + if (CommonUtils.isNotNull(topicDTO.getsDate()) ) { | |
| 120 | + criteria.andGreaterThanOrEqualTo("create_date", topicDTO.getsDate()); | |
| 120 | 121 | } |
| 121 | - if ( CommonUtils.isNotNull(end_date)) { | |
| 122 | - criteria.andLessThanOrEqualTo("create_date", end_date); | |
| 122 | + if ( CommonUtils.isNotNull(topicDTO.geteDate())) { | |
| 123 | + criteria.andLessThanOrEqualTo("create_date", topicDTO.geteDate()); | |
| 123 | 124 | } |
| 124 | - if (CommonUtils.isNotEmpty(title)) { | |
| 125 | - criteria.andLike("title", "%" + title + "%"); | |
| 125 | + if (CommonUtils.isNotEmpty(topicDTO.getTopic_name())) { | |
| 126 | + criteria.andLike("title", "%" + topicDTO.getTopic_name() + "%"); | |
| 126 | 127 | } |
| 127 | - if (CommonUtils.isNotEmpty(updater)) { | |
| 128 | - criteria.andEqualTo("updater", updater); | |
| 128 | + if (CommonUtils.isNotEmpty(topicDTO.getUpdater())) { | |
| 129 | + criteria.andEqualTo("updater", topicDTO.getUpdater()); | |
| 129 | 130 | } |
| 130 | - if (CommonUtils.isNotEmpty(topic_tag)) { | |
| 131 | - criteria.andEqualTo("topic_tag", topic_tag); | |
| 131 | + if (CommonUtils.isNotEmpty(topicDTO.getTopic_tag())) { | |
| 132 | + criteria.andEqualTo("topic_tag", topicDTO.getTopic_tag()); | |
| 132 | 133 | } |
| 133 | - if (CommonUtils.isNotNull(spid)) { | |
| 134 | - criteria.andEqualTo("sp_id", spid); | |
| 134 | + if (CommonUtils.isNotNull(topicDTO.getSpid())) { | |
| 135 | + criteria.andEqualTo("sp_id", topicDTO.getSpid()); | |
| 135 | 136 | } |
| 136 | - if (CommonUtils.isNotEmpty(topicId)) { | |
| 137 | - criteria.andEqualTo("topic_id", topicId); | |
| 137 | + if (CommonUtils.isNotEmpty(topicDTO.getTopic_id())) { | |
| 138 | + criteria.andEqualTo("topic_id", topicDTO.getTopic_id()); | |
| 138 | 139 | } |
| 139 | - if (CommonUtils.isNotNull(receive)&&receive==CommonConst.RECEIVE_AFTER) { | |
| 140 | - criteria.andEqualTo("auditor_id", userId); | |
| 140 | + if (CommonUtils.isNotNull(topicDTO.getReceive())&& topicDTO.getReceive().equals(CommonConst.RECEIVE_AFTER)) { | |
| 141 | + criteria.andEqualTo("auditor_id", topicDTO.getUserId()); | |
| 141 | 142 | } |
| 142 | - if (CommonUtils.isNotNull(shenhe_status) && shenhe_status != 3) {//不是 我的已审 进来的,只查一种状态 | |
| 143 | - criteria.andEqualTo("shenhe_status", shenhe_status); | |
| 144 | - } else if (CommonUtils.isNotNull(shenhe_status) && shenhe_status == 3) {//是 我的已审,查通过和拒绝的两种状态 | |
| 143 | + if (CommonUtils.isNotNull(topicDTO.getShenhe_status()) && topicDTO.getShenhe_status() != 3) {//不是 我的已审 进来的,只查一种状态 | |
| 144 | + criteria.andEqualTo("shenhe_status", topicDTO.getShenhe_status()); | |
| 145 | + } else if (CommonUtils.isNotNull(topicDTO.getShenhe_status()) && topicDTO.getShenhe_status() == 3) {//是 我的已审,查通过和拒绝的两种状态 | |
| 145 | 146 | Example.Criteria criteria1 = example.createCriteria(); |
| 146 | 147 | criteria1.orEqualTo("shenhe_status", 1); |
| 147 | 148 | criteria1.orEqualTo("shenhe_status", 2); |
| 148 | 149 | example.and(criteria1); |
| 149 | 150 | } |
| 150 | 151 | |
| 151 | - PageHelper.startPage(page, pageSize, true); | |
| 152 | + PageHelper.startPage(topicDTO.getPage(), topicDTO.getPageSize(), true); | |
| 152 | 153 | List<ShyTopic> topicList = shyTopicMapper.selectByExample(example); |
| 153 | 154 | PageInfo<ShyTopic> pageInfo = new PageInfo<>(topicList); |
| 154 | 155 | return pageInfo; | ... | ... |
src/main/java/com/cnlive/shenhe/serviceImpl/UsersServiceImpl.java
| 1 | 1 | package com.cnlive.shenhe.serviceImpl; |
| 2 | 2 | |
| 3 | +import com.cnlive.shenhe.dto.UsersDTO; | |
| 3 | 4 | import com.cnlive.shenhe.entity.ShySites; |
| 4 | 5 | import com.cnlive.shenhe.entity.ShyUsers; |
| 5 | 6 | import com.cnlive.shenhe.mapper.ShyUsersMapper; |
| ... | ... | @@ -23,28 +24,27 @@ public class UsersServiceImpl { |
| 23 | 24 | @Autowired |
| 24 | 25 | ShyUsersMapper shyUsersMapper; |
| 25 | 26 | |
| 26 | - public PageInfo<ShyUsers> getPage(Integer page, Integer pageSize, String orderByClause, | |
| 27 | - String username,String mobile,Integer sp_id,String company_brief) { | |
| 27 | + public PageInfo<ShyUsers> getPage(UsersDTO usersDTO) { | |
| 28 | 28 | Example example = new Example(ShyUsers.class); |
| 29 | 29 | Example.Criteria criteria = example.createCriteria(); |
| 30 | - if (CommonUtils.isNotEmpty(orderByClause)) { | |
| 31 | - example.setOrderByClause(orderByClause); | |
| 30 | + if (CommonUtils.isNotEmpty(usersDTO.getOrderByClause())) { | |
| 31 | + example.setOrderByClause(usersDTO.getOrderByClause()); | |
| 32 | 32 | }else{ |
| 33 | 33 | example.setOrderByClause("created_at desc"); |
| 34 | 34 | } |
| 35 | - if (CommonUtils.isNotEmpty(username)) { | |
| 36 | - criteria.andLike("username", "%" + username + "%"); | |
| 35 | + if (CommonUtils.isNotEmpty(usersDTO.getUsername())) { | |
| 36 | + criteria.andLike("username", "%" + usersDTO.getUsername() + "%"); | |
| 37 | 37 | } |
| 38 | - if(CommonUtils.isNotEmpty(mobile)){ | |
| 39 | - criteria.andLike("mobile", "%" + mobile + "%" ); | |
| 38 | + if(CommonUtils.isNotEmpty(usersDTO.getMobile())){ | |
| 39 | + criteria.andLike("mobile", "%" + usersDTO.getMobile() + "%" ); | |
| 40 | 40 | } |
| 41 | - if(CommonUtils.isNotEmpty(company_brief)){ | |
| 42 | - criteria.andLike("company_brief", "%" + company_brief + "%" ); | |
| 41 | + if(CommonUtils.isNotEmpty(usersDTO.getCompany_brief())){ | |
| 42 | + criteria.andLike("company_brief", "%" + usersDTO.getCompany_brief() + "%" ); | |
| 43 | 43 | } |
| 44 | - if(CommonUtils.isNotNull(sp_id)){ | |
| 45 | - criteria.andEqualTo("sp_id", sp_id ); | |
| 44 | + if(CommonUtils.isNotNull(usersDTO.getSp_id())){ | |
| 45 | + criteria.andEqualTo("sp_id", usersDTO.getSp_id() ); | |
| 46 | 46 | } |
| 47 | - PageHelper.startPage(page, pageSize, true); | |
| 47 | + PageHelper.startPage(usersDTO.getPage(), usersDTO.getPageSize(), true); | |
| 48 | 48 | List<ShyUsers> ShyUsersList = shyUsersMapper.selectByExample(example); |
| 49 | 49 | PageInfo<ShyUsers> pageInfo = new PageInfo<ShyUsers>(ShyUsersList); |
| 50 | 50 | return pageInfo; | ... | ... |
src/main/java/com/cnlive/shenhe/serviceImpl/UsersfreeServiceImpl.java
| 1 | 1 | package com.cnlive.shenhe.serviceImpl; |
| 2 | 2 | |
| 3 | 3 | import com.alibaba.fastjson.JSONObject; |
| 4 | +import com.cnlive.shenhe.dto.UsersFreeDTO; | |
| 4 | 5 | import com.cnlive.shenhe.entity.ShyUsers; |
| 5 | 6 | import com.cnlive.shenhe.entity.ShyUsersfree; |
| 6 | 7 | import com.cnlive.shenhe.mapper.ShyUsersfreeMapper; |
| ... | ... | @@ -46,22 +47,21 @@ public class UsersfreeServiceImpl { |
| 46 | 47 | return shyUsersfreeMapper.updateByPrimaryKeySelective(shyUsersfree); |
| 47 | 48 | } |
| 48 | 49 | |
| 49 | - public PageInfo<ShyUsersfree> getpage(Integer page, Integer pageSize, String orderByClause, | |
| 50 | - String userId,String mobile) { | |
| 50 | + public PageInfo<ShyUsersfree> getpage(UsersFreeDTO usersFreeDTO) { | |
| 51 | 51 | Example example = new Example(ShyUsers.class); |
| 52 | 52 | Example.Criteria criteria = example.createCriteria(); |
| 53 | - if (CommonUtils.isNotEmpty(orderByClause)) { | |
| 54 | - example.setOrderByClause(orderByClause); | |
| 53 | + if (CommonUtils.isNotEmpty(usersFreeDTO.getOrderByClause())) { | |
| 54 | + example.setOrderByClause(usersFreeDTO.getOrderByClause()); | |
| 55 | 55 | }else{ |
| 56 | 56 | example.setOrderByClause("created_at desc"); |
| 57 | 57 | } |
| 58 | - if (CommonUtils.isNotEmpty(userId)) { | |
| 59 | - criteria.andEqualTo("user_id", userId ); | |
| 58 | + if (CommonUtils.isNotEmpty(usersFreeDTO.getUserId())) { | |
| 59 | + criteria.andEqualTo("user_id", usersFreeDTO.getUserId() ); | |
| 60 | 60 | } |
| 61 | - if(CommonUtils.isNotEmpty(mobile)){ | |
| 62 | - criteria.andLike("mobile", "%" + mobile + "%" ); | |
| 61 | + if(CommonUtils.isNotEmpty(usersFreeDTO.getMobile())){ | |
| 62 | + criteria.andLike("mobile", "%" + usersFreeDTO.getMobile() + "%" ); | |
| 63 | 63 | } |
| 64 | - PageHelper.startPage(page, pageSize, true); | |
| 64 | + PageHelper.startPage(usersFreeDTO.getPage(), usersFreeDTO.getPageSize(), true); | |
| 65 | 65 | List<ShyUsersfree> ShyUsersList = shyUsersfreeMapper.selectByExample(example); |
| 66 | 66 | PageInfo<ShyUsersfree> pageInfo = new PageInfo<ShyUsersfree>(ShyUsersList); |
| 67 | 67 | return pageInfo; | ... | ... |
src/main/java/com/cnlive/shenhe/serviceImpl/VideosServiceImpl.java
| ... | ... | @@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSONArray; |
| 4 | 4 | import com.alibaba.fastjson.JSONObject; |
| 5 | 5 | import com.cnlive.shenhe.bean.ErrorEnum; |
| 6 | 6 | import com.cnlive.shenhe.bean.ResponseBean; |
| 7 | +import com.cnlive.shenhe.dto.VideosDTO; | |
| 7 | 8 | import com.cnlive.shenhe.entity.ShyUsers; |
| 8 | 9 | import com.cnlive.shenhe.entity.ShyUsersfree; |
| 9 | 10 | import com.cnlive.shenhe.entity.ShyVideos; |
| ... | ... | @@ -110,96 +111,93 @@ public class VideosServiceImpl { |
| 110 | 111 | return shyVideosMapper.updateByPrimaryKey(shyVideos); |
| 111 | 112 | } |
| 112 | 113 | |
| 113 | - public PageInfo<ShyVideos> getListContent(String video_title, String start_date, String end_date, Integer state, Integer receive, Integer page, | |
| 114 | - Integer pageSize, String video_priority, String orderByClause, Integer spid, String userId, String sp_Id, | |
| 115 | - String source, String video_user_id, String shen_auditor_id, String video_id) { | |
| 114 | + public PageInfo<ShyVideos> getListContent(VideosDTO videosDTO) { | |
| 116 | 115 | Example example = new Example(ShyVideos.class); |
| 117 | 116 | Example.Criteria criteria = example.createCriteria(); |
| 118 | 117 | Example.Criteria criteria2 = example.createCriteria(); |
| 119 | - if (CommonUtils.isNotEmpty(orderByClause)) { | |
| 120 | - example.setOrderByClause(orderByClause); | |
| 118 | + if (CommonUtils.isNotEmpty(videosDTO.getOrderByClause())) { | |
| 119 | + example.setOrderByClause(videosDTO.getOrderByClause()); | |
| 121 | 120 | } |
| 122 | - if (CommonUtils.isNotEmpty(start_date) && CommonUtils.isNotEmpty(end_date)) { | |
| 123 | - Timestamp startdate = null; | |
| 124 | - Timestamp enddate = null; | |
| 121 | + if (CommonUtils.isNotEmpty(videosDTO.getsDate()) && CommonUtils.isNotEmpty(videosDTO.geteDate())) { | |
| 122 | + | |
| 125 | 123 | try { |
| 126 | - startdate = CommonUtils.parseDate(start_date, "yyyy-MM-dd"); | |
| 127 | - enddate = CommonUtils.parseDate(end_date, "yyyy-MM-dd"); | |
| 124 | + videosDTO.setsDate(String.valueOf(CommonUtils.parseDate(videosDTO.getsDate(), "yyyy-MM-dd"))); | |
| 125 | + videosDTO.seteDate(String.valueOf(CommonUtils.parseDate(videosDTO.geteDate(), "yyyy-MM-dd"))); | |
| 128 | 126 | } catch (ParseException e) { |
| 129 | 127 | e.printStackTrace(); |
| 130 | 128 | } |
| 131 | - criteria.andGreaterThanOrEqualTo("created_at", startdate); | |
| 132 | - criteria2.andGreaterThanOrEqualTo("created_at", startdate); | |
| 133 | - criteria.andLessThanOrEqualTo("created_at", enddate); | |
| 134 | - criteria2.andLessThanOrEqualTo("created_at", enddate); | |
| 129 | + criteria.andGreaterThanOrEqualTo("created_at", videosDTO.getsDate()); | |
| 130 | + criteria2.andGreaterThanOrEqualTo("created_at", videosDTO.getsDate()); | |
| 131 | + criteria.andLessThanOrEqualTo("created_at", videosDTO.geteDate()); | |
| 132 | + criteria2.andLessThanOrEqualTo("created_at", videosDTO.geteDate()); | |
| 135 | 133 | } |
| 136 | - if (CommonUtils.isNotEmpty(video_title)) { | |
| 137 | - criteria.andLike("video_title", "%" + video_title + "%"); | |
| 138 | - criteria2.andLike("video_title", "%" + video_title + "%"); | |
| 134 | + if (CommonUtils.isNotEmpty(videosDTO.getVideo_title())) { | |
| 135 | + criteria.andLike("video_title", "%" + videosDTO.getVideo_title() + "%"); | |
| 136 | + criteria2.andLike("video_title", "%" + videosDTO.getVideo_title() + "%"); | |
| 139 | 137 | } |
| 140 | 138 | |
| 141 | - if (CommonUtils.isNotEmpty(video_priority)) { | |
| 142 | - criteria.andEqualTo("video_priority", video_priority); | |
| 143 | - criteria2.andEqualTo("video_priority", video_priority); | |
| 139 | + if (CommonUtils.isNotEmpty(videosDTO.getVideo_priority())) { | |
| 140 | + criteria.andEqualTo("video_priority", videosDTO.getVideo_priority()); | |
| 141 | + criteria2.andEqualTo("video_priority", videosDTO.getVideo_priority()); | |
| 144 | 142 | } |
| 145 | 143 | |
| 146 | - if (CommonUtils.isNotEmpty(video_id)) { | |
| 147 | - criteria.andEqualTo("video_id", video_id); | |
| 148 | - criteria2.andEqualTo("video_id", video_id); | |
| 144 | + if (CommonUtils.isNotEmpty(videosDTO.getVideo_id())) { | |
| 145 | + criteria.andEqualTo("video_id", videosDTO.getVideo_id()); | |
| 146 | + criteria2.andEqualTo("video_id", videosDTO.getVideo_id()); | |
| 149 | 147 | } |
| 150 | 148 | |
| 151 | - if (CommonUtils.isNotEmpty(shen_auditor_id)) { | |
| 152 | - if ("白名单".equals(shen_auditor_id) || "自动审核".equals(shen_auditor_id)) { | |
| 153 | - criteria.andEqualTo("updater", shen_auditor_id); | |
| 154 | - criteria2.andEqualTo("updater", shen_auditor_id); | |
| 149 | + if (CommonUtils.isNotEmpty(videosDTO.getShen_auditor_id())) { | |
| 150 | + if ("白名单".equals(videosDTO.getShen_auditor_id()) || "自动审核".equals(videosDTO.getShen_auditor_id())) { | |
| 151 | + criteria.andEqualTo("updater", videosDTO.getShen_auditor_id()); | |
| 152 | + criteria2.andEqualTo("updater", videosDTO.getShen_auditor_id()); | |
| 155 | 153 | } else { |
| 156 | - criteria.andEqualTo("auditor_id", shen_auditor_id); | |
| 157 | - criteria2.andEqualTo("auditor_id", shen_auditor_id); | |
| 154 | + criteria.andEqualTo("auditor_id", videosDTO.getShen_auditor_id()); | |
| 155 | + criteria2.andEqualTo("auditor_id", videosDTO.getShen_auditor_id()); | |
| 158 | 156 | } |
| 159 | 157 | } |
| 160 | 158 | |
| 161 | - if (CommonUtils.isNotEmpty(source) && !"22".equals(source) && !"102".equals(source)) { | |
| 162 | - criteria.andEqualTo("source", source); | |
| 163 | - criteria2.andEqualTo("source", source); | |
| 164 | - } else if (CommonUtils.isNotEmpty(source) && "22".equals(source)) { | |
| 159 | + if (CommonUtils.isNotEmpty(videosDTO.getSource()) && !"22".equals(videosDTO.getSource()) && !"102".equals(videosDTO.getSource())) { | |
| 160 | + criteria.andEqualTo("source", videosDTO.getSource()); | |
| 161 | + criteria2.andEqualTo("source", videosDTO.getSource()); | |
| 162 | + } else if (CommonUtils.isNotEmpty(videosDTO.getSource()) && "22".equals(videosDTO.getSource())) { | |
| 165 | 163 | criteria.andEqualTo("category", "moment"); |
| 166 | 164 | criteria2.andEqualTo("category", "moment"); |
| 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); | |
| 165 | + } else if (CommonUtils.isNotEmpty(videosDTO.getSource()) && "102".equals(videosDTO.getSource())) { | |
| 166 | + criteria.andEqualTo("source", "102".equals(videosDTO.getSource()) ? "0" : videosDTO.getSource()); | |
| 167 | + criteria2.andEqualTo("source", "102".equals(videosDTO.getSource()) ? "0" : videosDTO.getSource()); | |
| 170 | 168 | } |
| 171 | 169 | |
| 172 | - if (CommonUtils.isNotEmpty(video_user_id)) { | |
| 173 | - criteria.andEqualTo("video_user_id", video_user_id); | |
| 174 | - criteria2.andEqualTo("video_user_id", video_user_id); | |
| 170 | + if (CommonUtils.isNotEmpty(videosDTO.getVideo_user_id())) { | |
| 171 | + criteria.andEqualTo("video_user_id", videosDTO.getVideo_user_id()); | |
| 172 | + criteria2.andEqualTo("video_user_id", videosDTO.getVideo_user_id()); | |
| 175 | 173 | } |
| 176 | 174 | |
| 177 | - if (CommonUtils.isNotNull(spid)) { | |
| 178 | - criteria.andEqualTo("spid", spid); | |
| 179 | - criteria2.andEqualTo("spid", spid); | |
| 180 | - } else if (CommonUtils.isNotEmpty(sp_Id)) { | |
| 181 | - criteria.andEqualTo("spid", sp_Id); | |
| 182 | - criteria2.andEqualTo("spid", sp_Id); | |
| 175 | + if (CommonUtils.isNotNull(videosDTO.getSpid())) { | |
| 176 | + criteria.andEqualTo("spid", videosDTO.getSpid()); | |
| 177 | + criteria2.andEqualTo("spid", videosDTO.getSpid()); | |
| 178 | + } else if (CommonUtils.isNotEmpty(videosDTO.getSp_Id())) { | |
| 179 | + criteria.andEqualTo("spid", videosDTO.getSp_Id()); | |
| 180 | + criteria2.andEqualTo("spid", videosDTO.getSp_Id()); | |
| 183 | 181 | } |
| 184 | 182 | |
| 185 | - if (CommonUtils.isNotNull(receive)) { | |
| 186 | - criteria.andEqualTo("receive", receive); | |
| 187 | - criteria2.andEqualTo("receive", receive); | |
| 188 | - if (receive == CommonConst.RECEIVE_AFTER) { | |
| 189 | - criteria.andEqualTo("receive_user_id", userId); | |
| 190 | - criteria2.andEqualTo("receive_user_id", userId); | |
| 183 | + if (CommonUtils.isNotNull(videosDTO.getReceive())) { | |
| 184 | + criteria.andEqualTo("receive", videosDTO.getReceive()); | |
| 185 | + criteria2.andEqualTo("receive", videosDTO.getReceive()); | |
| 186 | + if (videosDTO.getReceive().equals(CommonConst.RECEIVE_AFTER)) { | |
| 187 | + criteria.andEqualTo("receive_user_id", videosDTO.getUserId()); | |
| 188 | + criteria2.andEqualTo("receive_user_id", videosDTO.getUserId()); | |
| 191 | 189 | } |
| 192 | 190 | } |
| 193 | - if (CommonUtils.isNotNull(state) && state != 3) { | |
| 194 | - criteria.andEqualTo("state", state); | |
| 195 | - } else if (CommonUtils.isNotNull(state) && state == 3) { | |
| 191 | + if (CommonUtils.isNotNull(videosDTO.getState()) && videosDTO.getState() != 3) { | |
| 192 | + criteria.andEqualTo("state", videosDTO.getState()); | |
| 193 | + } else if (CommonUtils.isNotNull(videosDTO.getState()) && videosDTO.getState() == 3) { | |
| 196 | 194 | criteria.andEqualTo("state", 1); |
| 197 | 195 | criteria2.andEqualTo("state", 2); |
| 198 | 196 | example.or(criteria2); |
| 199 | 197 | } |
| 200 | 198 | //默认按上传时间倒序排序 |
| 201 | 199 | example.setOrderByClause("created_at desc"); |
| 202 | - PageHelper.startPage(page, pageSize, true); | |
| 200 | + PageHelper.startPage(videosDTO.getPage(), videosDTO.getPageSize(), true); | |
| 203 | 201 | List<ShyVideos> shyVideosList = shyVideosMapper.selectByExample(example); |
| 204 | 202 | PageInfo<ShyVideos> pageInfo = new PageInfo<>(shyVideosList); |
| 205 | 203 | return pageInfo; |
| ... | ... | @@ -207,7 +205,7 @@ public class VideosServiceImpl { |
| 207 | 205 | |
| 208 | 206 | public ShyVideos getDetailsContent(Integer id) { |
| 209 | 207 | ShyVideos shyVideos = shyVideosMapper.selectByPrimaryKey(id); |
| 210 | - if (shyVideos.getState() != CommonConst.AUDIT_INTT) { | |
| 208 | + if (!shyVideos.getState().equals(CommonConst.AUDIT_INTT)) { | |
| 211 | 209 | String updater = CommonUtils.isEmpty(shyVideos.getUpdater()) || "null".equals(shyVideos.getUpdater()) ? "白名单" : shyVideos.getUpdater(); |
| 212 | 210 | String auditor_id = shyVideos.getAuditor_id(); |
| 213 | 211 | if (CommonUtils.isNotEmpty(auditor_id)) { |
| ... | ... | @@ -241,7 +239,9 @@ public class VideosServiceImpl { |
| 241 | 239 | example.setOrderByClause("created_at desc"); |
| 242 | 240 | example.and().andEqualTo("state", CommonConst.AUDIT_INTT); |
| 243 | 241 | example.and().andEqualTo("receive", CommonConst.RECEIVE_BEFORE); |
| 244 | - if (CommonUtils.isNotNull(spid) && spid != 0) example.and().andEqualTo("spid", spid); | |
| 242 | + if (CommonUtils.isNotNull(spid) && spid != 0) { | |
| 243 | + example.and().andEqualTo("spid", spid); | |
| 244 | + } | |
| 245 | 245 | List<ShyVideos> shyCommentsList = shyVideosMapper.selectByExampleAndRowBounds(example, new RowBounds(0, num)); |
| 246 | 246 | if (!shyCommentsList.isEmpty()) { |
| 247 | 247 | for (ShyVideos shyComments : shyCommentsList) { |
| ... | ... | @@ -259,7 +259,7 @@ public class VideosServiceImpl { |
| 259 | 259 | String[] cids = ids.split(","); |
| 260 | 260 | for (String cid : cids) { |
| 261 | 261 | ShyVideos shyVideos = shyVideosMapper.selectByPrimaryKey(Integer.parseInt(cid)); |
| 262 | - if (shyVideos.getState() == CommonConst.AUDIT_INTT && shyVideos.getReceive() == CommonConst.RECEIVE_AFTER && shyVideos.getReceive_user_id().equals(userId)) { | |
| 262 | + if (shyVideos.getState().equals(CommonConst.AUDIT_INTT) && shyVideos.getReceive().equals(CommonConst.RECEIVE_AFTER) && shyVideos.getReceive_user_id().equals(userId)) { | |
| 263 | 263 | shyVideos.setReceive(CommonConst.RECEIVE_BEFORE); |
| 264 | 264 | shyVideos.setReceive_user_id(null); |
| 265 | 265 | int i = shyVideosMapper.updateByPrimaryKey(shyVideos); |
| ... | ... | @@ -276,61 +276,52 @@ public class VideosServiceImpl { |
| 276 | 276 | /** |
| 277 | 277 | * 根据条件导出数据excel |
| 278 | 278 | * |
| 279 | - * @param video_title | |
| 280 | - * @param start_date | |
| 281 | - * @param end_date | |
| 282 | - * @param state | |
| 283 | - * @param receive | |
| 284 | - * @param video_priority | |
| 285 | - * @param orderByClause | |
| 286 | - * @param spid | |
| 287 | - * @param userId | |
| 279 | + * @param videosDTO | |
| 288 | 280 | * @return |
| 289 | 281 | */ |
| 290 | - 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, String source, String video_user_id) { | |
| 282 | + public List<ShyVideos> findByCondition(VideosDTO videosDTO) { | |
| 291 | 283 | Example example = new Example(ShyVideos.class); |
| 292 | 284 | Example.Criteria criteria = example.createCriteria(); |
| 293 | 285 | Example.Criteria criteria2 = example.createCriteria(); |
| 294 | - if (CommonUtils.isNotEmpty(orderByClause)) { | |
| 295 | - example.setOrderByClause(orderByClause); | |
| 286 | + if (CommonUtils.isNotEmpty(videosDTO.getOrderByClause())) { | |
| 287 | + example.setOrderByClause(videosDTO.getOrderByClause()); | |
| 296 | 288 | } |
| 297 | - if (CommonUtils.isNotEmpty(start_date) && CommonUtils.isNotEmpty(end_date)) { | |
| 298 | - Timestamp startdate = null; | |
| 299 | - Timestamp enddate = null; | |
| 289 | + if (CommonUtils.isNotEmpty(videosDTO.getsDate()) && CommonUtils.isNotEmpty(videosDTO.geteDate())) { | |
| 290 | + | |
| 300 | 291 | try { |
| 301 | - startdate = CommonUtils.parseDate(start_date, "yyyy-MM-dd"); | |
| 302 | - enddate = CommonUtils.parseDate(end_date, "yyyy-MM-dd"); | |
| 292 | + videosDTO.setsDate(String.valueOf(CommonUtils.parseDate(videosDTO.getsDate(), "yyyy-MM-dd"))); | |
| 293 | + videosDTO.seteDate(String.valueOf(CommonUtils.parseDate(videosDTO.geteDate(), "yyyy-MM-dd"))); | |
| 303 | 294 | } catch (ParseException e) { |
| 304 | 295 | e.printStackTrace(); |
| 305 | 296 | } |
| 306 | - criteria.andGreaterThanOrEqualTo("created_at", startdate); | |
| 307 | - criteria.andLessThanOrEqualTo("created_at", enddate); | |
| 297 | + criteria.andGreaterThanOrEqualTo("created_at", videosDTO.getsDate()); | |
| 298 | + criteria.andLessThanOrEqualTo("created_at", videosDTO.geteDate()); | |
| 308 | 299 | } |
| 309 | - if (CommonUtils.isNotEmpty(video_title)) { | |
| 310 | - criteria.andLike("video_title", "%" + video_title + "%"); | |
| 300 | + if (CommonUtils.isNotEmpty(videosDTO.getVideo_title())) { | |
| 301 | + criteria.andLike("video_title", "%" + videosDTO.getVideo_title() + "%"); | |
| 311 | 302 | } |
| 312 | - if (CommonUtils.isNotNull(state)) { | |
| 313 | - criteria.andEqualTo("state", state); | |
| 303 | + if (CommonUtils.isNotNull(videosDTO.getState())) { | |
| 304 | + criteria.andEqualTo("state", videosDTO.getState()); | |
| 314 | 305 | } |
| 315 | - if (CommonUtils.isNotEmpty(video_priority)) { | |
| 316 | - criteria.andEqualTo("video_priority", video_priority); | |
| 306 | + if (CommonUtils.isNotEmpty(videosDTO.getVideo_priority())) { | |
| 307 | + criteria.andEqualTo("video_priority", videosDTO.getVideo_priority()); | |
| 317 | 308 | } |
| 318 | - if (CommonUtils.isNotEmpty(video_user_id)) { | |
| 319 | - criteria.andEqualTo("video_user_id", video_user_id); | |
| 309 | + if (CommonUtils.isNotEmpty(videosDTO.getVideo_user_id())) { | |
| 310 | + criteria.andEqualTo("video_user_id", videosDTO.getVideo_user_id()); | |
| 320 | 311 | } |
| 321 | 312 | |
| 322 | - if (source != null) { | |
| 323 | - criteria.andEqualTo("source", source); | |
| 313 | + if (videosDTO.getSource() != null) { | |
| 314 | + criteria.andEqualTo("source", videosDTO.getSource()); | |
| 324 | 315 | } |
| 325 | 316 | |
| 326 | - if (CommonUtils.isNotNull(spid)) { | |
| 327 | - criteria.andEqualTo("spid", spid); | |
| 317 | + if (CommonUtils.isNotNull(videosDTO.getSpid())) { | |
| 318 | + criteria.andEqualTo("spid", videosDTO.getSpid()); | |
| 328 | 319 | } |
| 329 | 320 | |
| 330 | - if (CommonUtils.isNotNull(receive)) { | |
| 331 | - criteria.andEqualTo("receive", receive); | |
| 332 | - if (receive == CommonConst.RECEIVE_AFTER) { | |
| 333 | - criteria.andEqualTo("receive_user_id", userId); | |
| 321 | + if (CommonUtils.isNotNull(videosDTO.getReceive())) { | |
| 322 | + criteria.andEqualTo("receive", videosDTO.getReceive()); | |
| 323 | + if (videosDTO.getReceive().equals(CommonConst.RECEIVE_AFTER)) { | |
| 324 | + criteria.andEqualTo("receive_user_id", videosDTO.getUserId()); | |
| 334 | 325 | } |
| 335 | 326 | } |
| 336 | 327 | //默认按上传时间倒序排序 |
| ... | ... | @@ -350,9 +341,9 @@ public class VideosServiceImpl { |
| 350 | 341 | shyVideos.setUpdater("自动审核"); |
| 351 | 342 | Integer plat = shyVideos.getPlat(); |
| 352 | 343 | String yuming = ""; |
| 353 | - if (plat == CommonConst.QINIU_PLAT) { | |
| 344 | + if (plat.equals(CommonConst.QINIU_PLAT)) { | |
| 354 | 345 | yuming = qn_domain + "/"; |
| 355 | - } else if (plat == CommonConst.KS_PLAT) { | |
| 346 | + } else if (plat.equals(CommonConst.KS_PLAT)) { | |
| 356 | 347 | yuming = ks_domain + "/"; |
| 357 | 348 | } |
| 358 | 349 | String url = ""; | ... | ... |
src/main/resources/application.properties
| ... | ... | @@ -2,7 +2,7 @@ spring.datasource.url=jdbc:mysql://120.92.102.31:3306/new_shy?serverTimezone=Asi |
| 2 | 2 | spring.datasource.username=root |
| 3 | 3 | spring.datasource.password=M345sdfss4! |
| 4 | 4 | |
| 5 | -spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver | |
| 5 | +spring.datasource.driver-class-name=com.mysql.jdbc.Driver | |
| 6 | 6 | |
| 7 | 7 | server.tomcat.protocol_header=x-forwarded-proto |
| 8 | 8 | server.use-forward-headers=true | ... | ... |