Commit ff8066ecc7320fb0a9ac7f4848749b2d70f2834e

Authored by liwei2917
1 parent 43cba551

修改直播审核的导出功能,实现直播完成后的导出

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