Commit ff8066ecc7320fb0a9ac7f4848749b2d70f2834e
1 parent
43cba551
修改直播审核的导出功能,实现直播完成后的导出
Showing
4 changed files
with
23 additions
and
26 deletions
src/main/java/com/cnlive/shenhe/controller/LiveController.java
| @@ -362,7 +362,7 @@ public class LiveController { | @@ -362,7 +362,7 @@ public class LiveController { | ||
| 362 | spid = null; | 362 | spid = null; |
| 363 | } | 363 | } |
| 364 | List<ShyLive> liveList = liveService.findByCondition(activity_name, start_date,end_date, | 364 | List<ShyLive> liveList = liveService.findByCondition(activity_name, start_date,end_date, |
| 365 | - activity_id, activity_status, page, pageSize, shenhe_state, orderByClause, spid); | 365 | + activity_id, activity_status, page, pageSize, shenhe_state, orderByClause, spid,userId); |
| 366 | 366 | ||
| 367 | String fileName = "直播数据"; | 367 | String fileName = "直播数据"; |
| 368 | 368 | ||
| @@ -464,7 +464,7 @@ public class LiveController { | @@ -464,7 +464,7 @@ public class LiveController { | ||
| 464 | if(Activity_count==0){ | 464 | if(Activity_count==0){ |
| 465 | Activity_endTime=CommonUtils.formatDate(liveList.get(i).getActivity_end_time(), "HH:mm"); | 465 | Activity_endTime=CommonUtils.formatDate(liveList.get(i).getActivity_end_time(), "HH:mm"); |
| 466 | }else if(Activity_count > 0){ | 466 | }else if(Activity_count > 0){ |
| 467 | - pre_endTime="跨"+Activity_count+"天 "+CommonUtils.formatDate(liveList.get(i).getActivity_end_time(), "HH:mm"); | 467 | + Activity_endTime="跨"+Activity_count+"天 "+CommonUtils.formatDate(liveList.get(i).getActivity_end_time(), "HH:mm"); |
| 468 | } | 468 | } |
| 469 | 469 | ||
| 470 | cell = row.createCell(10);//列 | 470 | cell = row.createCell(10);//列 |
src/main/java/com/cnlive/shenhe/controller/VideosController.java
| @@ -392,9 +392,9 @@ public class VideosController extends BaseController { | @@ -392,9 +392,9 @@ public class VideosController extends BaseController { | ||
| 392 | ShySites shySites = sitesService.findspidDescByspid(shyVideosList.get(i).getSpid()); | 392 | ShySites shySites = sitesService.findspidDescByspid(shyVideosList.get(i).getSpid()); |
| 393 | if (CommonUtils.isNotNull(shySites)) { | 393 | if (CommonUtils.isNotNull(shySites)) { |
| 394 | if(CommonUtils.isNotEmpty(shyVideosList.get(i).getCategory())&­VideosList.get(i).getCategory().equals(CommonConst.CATEGORY_WITNESS)){ | 394 | if(CommonUtils.isNotEmpty(shyVideosList.get(i).getCategory())&­VideosList.get(i).getCategory().equals(CommonConst.CATEGORY_WITNESS)){ |
| 395 | - cell.setCellValue(shySites.getName()+"目击者"); | 395 | + cell.setCellValue(shySites.getName()+"(目击者)"); |
| 396 | }else if(CommonUtils.isNotEmpty(shyVideosList.get(i).getCategory())&­VideosList.get(i).getCategory().equals(CommonConst.CATEGORY_MOMENT)){ | 396 | }else if(CommonUtils.isNotEmpty(shyVideosList.get(i).getCategory())&­VideosList.get(i).getCategory().equals(CommonConst.CATEGORY_MOMENT)){ |
| 397 | - cell.setCellValue(shySites.getName()+"朋友圈"); | 397 | + cell.setCellValue(shySites.getName()+"(朋友圈)"); |
| 398 | }else{ | 398 | }else{ |
| 399 | cell.setCellValue(shySites.getName()); | 399 | cell.setCellValue(shySites.getName()); |
| 400 | } | 400 | } |
src/main/java/com/cnlive/shenhe/serviceImpl/LiveServiceImpl.java
| @@ -89,7 +89,6 @@ public class LiveServiceImpl { | @@ -89,7 +89,6 @@ public class LiveServiceImpl { | ||
| 89 | Integer shenhe_state, String orderByClause, Integer spid, String userId) { | 89 | Integer shenhe_state, String orderByClause, Integer spid, String userId) { |
| 90 | Example example = new Example(ShyLive.class); | 90 | Example example = new Example(ShyLive.class); |
| 91 | Example.Criteria criteria = example.createCriteria(); | 91 | Example.Criteria criteria = example.createCriteria(); |
| 92 | -// Example.Criteria criteria2 = example.createCriteria(); | ||
| 93 | if (CommonUtils.isNotEmpty(orderByClause)) { | 92 | if (CommonUtils.isNotEmpty(orderByClause)) { |
| 94 | example.setOrderByClause(orderByClause); | 93 | example.setOrderByClause(orderByClause); |
| 95 | } | 94 | } |
| @@ -101,7 +100,6 @@ public class LiveServiceImpl { | @@ -101,7 +100,6 @@ public class LiveServiceImpl { | ||
| 101 | e.printStackTrace(); | 100 | e.printStackTrace(); |
| 102 | } | 101 | } |
| 103 | criteria.andGreaterThanOrEqualTo("activity_start_time", startdate); | 102 | criteria.andGreaterThanOrEqualTo("activity_start_time", startdate); |
| 104 | -// criteria2.andGreaterThanOrEqualTo("activity_start_time", startdate); | ||
| 105 | } | 103 | } |
| 106 | if ( CommonUtils.isNotEmpty(end_date)) { | 104 | if ( CommonUtils.isNotEmpty(end_date)) { |
| 107 | Timestamp enddate = null; | 105 | Timestamp enddate = null; |
| @@ -111,35 +109,27 @@ public class LiveServiceImpl { | @@ -111,35 +109,27 @@ public class LiveServiceImpl { | ||
| 111 | e.printStackTrace(); | 109 | e.printStackTrace(); |
| 112 | } | 110 | } |
| 113 | criteria.andLessThanOrEqualTo("activity_end_time", enddate); | 111 | criteria.andLessThanOrEqualTo("activity_end_time", enddate); |
| 114 | -// criteria2.andLessThanOrEqualTo("activity_end_time", enddate); | ||
| 115 | } | 112 | } |
| 116 | if (CommonUtils.isNotEmpty(activity_name)) { | 113 | if (CommonUtils.isNotEmpty(activity_name)) { |
| 117 | criteria.andLike("activity_name", "%" + activity_name + "%"); | 114 | criteria.andLike("activity_name", "%" + activity_name + "%"); |
| 118 | -// criteria2.andLike("activity_name", "%" + activity_name + "%"); | ||
| 119 | } | 115 | } |
| 120 | 116 | ||
| 121 | if (CommonUtils.isNotEmpty(activity_id)) { | 117 | if (CommonUtils.isNotEmpty(activity_id)) { |
| 122 | criteria.andEqualTo("activity_id", activity_id); | 118 | criteria.andEqualTo("activity_id", activity_id); |
| 123 | -// criteria2.andEqualTo("activity_id", activity_id); | ||
| 124 | } | 119 | } |
| 125 | if (CommonUtils.isNotNull(spid)) { | 120 | if (CommonUtils.isNotNull(spid)) { |
| 126 | criteria.andEqualTo("sp_id", spid); | 121 | criteria.andEqualTo("sp_id", spid); |
| 127 | -// criteria2.andEqualTo("spid", spid); | ||
| 128 | } | 122 | } |
| 129 | if (CommonUtils.isNotNull(shenhe_state)) { | 123 | if (CommonUtils.isNotNull(shenhe_state)) { |
| 130 | criteria.andEqualTo("shenhe_state", shenhe_state); | 124 | criteria.andEqualTo("shenhe_state", shenhe_state); |
| 131 | -// criteria2.andEqualTo("shenhe_state", shenhe_state); | ||
| 132 | if (shenhe_state != CommonConst.RECEIVE_BEFORE) { | 125 | if (shenhe_state != CommonConst.RECEIVE_BEFORE) { |
| 133 | criteria.andEqualTo("auditor", userId); | 126 | criteria.andEqualTo("auditor", userId); |
| 134 | -// criteria2.andEqualTo("auditor", userId); | ||
| 135 | } | 127 | } |
| 136 | } | 128 | } |
| 137 | if (CommonUtils.isNotNull(activity_status) ) { | 129 | if (CommonUtils.isNotNull(activity_status) ) { |
| 138 | criteria.andEqualTo("activity_status", activity_status); | 130 | criteria.andEqualTo("activity_status", activity_status); |
| 139 | } | 131 | } |
| 140 | criteria.andEqualTo("is_show", 1); | 132 | criteria.andEqualTo("is_show", 1); |
| 141 | - //排序 | ||
| 142 | -// example.setOrderByClause("is_hot desc, activity_start_time desc"); | ||
| 143 | PageHelper.startPage(page, pageSize, true); | 133 | PageHelper.startPage(page, pageSize, true); |
| 144 | List<ShyLive> shyLiveList = shyLiveMapper.selectByExample(example); | 134 | List<ShyLive> shyLiveList = shyLiveMapper.selectByExample(example); |
| 145 | PageInfo<ShyLive> pageInfo = new PageInfo<>(shyLiveList); | 135 | PageInfo<ShyLive> pageInfo = new PageInfo<>(shyLiveList); |
| @@ -220,16 +210,15 @@ public class LiveServiceImpl { | @@ -220,16 +210,15 @@ public class LiveServiceImpl { | ||
| 220 | * 根据条件导出数据excel | 210 | * 根据条件导出数据excel |
| 221 | * @return | 211 | * @return |
| 222 | */ | 212 | */ |
| 223 | - public List<ShyLive> findByCondition(String activity_id,String start_date,String end_date, | ||
| 224 | - String activity_name, Integer activity_status, Integer page,Integer pageSize, | ||
| 225 | - Integer shenhe_state, String orderByClause, Integer spid) { | 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) { | ||
| 226 | Example example = new Example(ShyLive.class); | 216 | Example example = new Example(ShyLive.class); |
| 227 | Example.Criteria criteria = example.createCriteria(); | 217 | Example.Criteria criteria = example.createCriteria(); |
| 228 | if (CommonUtils.isNotEmpty(orderByClause)) { | 218 | if (CommonUtils.isNotEmpty(orderByClause)) { |
| 229 | example.setOrderByClause(orderByClause); | 219 | example.setOrderByClause(orderByClause); |
| 230 | }else{ | 220 | }else{ |
| 231 | - //默认排序 | ||
| 232 | - example.setOrderByClause("activity_start_time asc"); | 221 | + example.setOrderByClause("activity_start_time"); |
| 233 | } | 222 | } |
| 234 | if (CommonUtils.isNotEmpty(start_date)) { | 223 | if (CommonUtils.isNotEmpty(start_date)) { |
| 235 | Timestamp startdate = null; | 224 | Timestamp startdate = null; |
| @@ -252,19 +241,23 @@ public class LiveServiceImpl { | @@ -252,19 +241,23 @@ public class LiveServiceImpl { | ||
| 252 | if (CommonUtils.isNotEmpty(activity_name)) { | 241 | if (CommonUtils.isNotEmpty(activity_name)) { |
| 253 | criteria.andLike("activity_name", "%" + activity_name + "%"); | 242 | criteria.andLike("activity_name", "%" + activity_name + "%"); |
| 254 | } | 243 | } |
| 255 | - if (CommonUtils.isNotNull(activity_status) ) { | ||
| 256 | - criteria.andEqualTo("activity_status", activity_status); | ||
| 257 | - } | 244 | + |
| 258 | if (CommonUtils.isNotEmpty(activity_id)) { | 245 | if (CommonUtils.isNotEmpty(activity_id)) { |
| 259 | criteria.andEqualTo("activity_id", activity_id); | 246 | criteria.andEqualTo("activity_id", activity_id); |
| 260 | } | 247 | } |
| 261 | if (CommonUtils.isNotNull(spid)) { | 248 | if (CommonUtils.isNotNull(spid)) { |
| 262 | - criteria.andEqualTo("spid", spid); | 249 | + criteria.andEqualTo("sp_id", spid); |
| 263 | } | 250 | } |
| 264 | if (CommonUtils.isNotNull(shenhe_state)) { | 251 | if (CommonUtils.isNotNull(shenhe_state)) { |
| 265 | criteria.andEqualTo("shenhe_state", shenhe_state); | 252 | criteria.andEqualTo("shenhe_state", shenhe_state); |
| 253 | + if (shenhe_state != CommonConst.RECEIVE_BEFORE) { | ||
| 254 | + criteria.andEqualTo("auditor", userId); | ||
| 255 | + } | ||
| 266 | } | 256 | } |
| 267 | - | 257 | + if (CommonUtils.isNotNull(activity_status) ) { |
| 258 | + criteria.andEqualTo("activity_status", activity_status); | ||
| 259 | + } | ||
| 260 | + criteria.andEqualTo("is_show", 1); | ||
| 268 | List<ShyLive> shyLiveList = shyLiveMapper.selectByExample(example); | 261 | List<ShyLive> shyLiveList = shyLiveMapper.selectByExample(example); |
| 269 | return shyLiveList; | 262 | return shyLiveList; |
| 270 | } | 263 | } |
src/main/java/com/cnlive/shenhe/serviceImpl/VideosServiceImpl.java
| @@ -103,8 +103,12 @@ public class VideosServiceImpl { | @@ -103,8 +103,12 @@ public class VideosServiceImpl { | ||
| 103 | ShyVideos shyVideos = shyVideosMapper.selectByPrimaryKey(id); | 103 | ShyVideos shyVideos = shyVideosMapper.selectByPrimaryKey(id); |
| 104 | shyVideos.setAuditor_id(auditor_id); | 104 | shyVideos.setAuditor_id(auditor_id); |
| 105 | shyVideos.setState(state); | 105 | shyVideos.setState(state); |
| 106 | - shyVideos.setAttr_tags(attr_tags); | ||
| 107 | - shyVideos.setMsg(msg); | 106 | + if(CommonUtils.isNotEmpty(attr_tags)){ |
| 107 | + shyVideos.setAttr_tags(attr_tags); | ||
| 108 | + } | ||
| 109 | + if(CommonUtils.isNotEmpty(msg)){ | ||
| 110 | + shyVideos.setMsg(msg); | ||
| 111 | + } | ||
| 108 | shyVideos.setUpdater(updater); | 112 | shyVideos.setUpdater(updater); |
| 109 | if(CommonUtils.isNotEmpty(auditor_id)){ | 113 | if(CommonUtils.isNotEmpty(auditor_id)){ |
| 110 | shyVideos.setReceive(CommonConst.RECEIVE_AFTER); | 114 | shyVideos.setReceive(CommonConst.RECEIVE_AFTER); |