Commit a2fed0ecac2521cd4b482a8eec59baf707c4add3

Authored by 王言钊
1 parent 0d987955

修复三个bug

@@ -247,6 +247,16 @@ @@ -247,6 +247,16 @@
247 <environment>dev</environment> 247 <environment>dev</environment>
248 </properties> 248 </properties>
249 </profile> 249 </profile>
  250 + <!-- 测试环境 -->
  251 +<!-- <profile>-->
  252 +<!-- <id>test</id>-->
  253 +<!-- <activation>-->
  254 +<!-- <activeByDefault>false</activeByDefault>-->
  255 +<!-- </activation>-->
  256 +<!-- <properties>-->
  257 +<!-- <environment>test</environment>-->
  258 +<!-- </properties>-->
  259 +<!-- </profile>-->
250 <!-- 生产环境 --> 260 <!-- 生产环境 -->
251 <profile> 261 <profile>
252 <id>prod</id> 262 <id>prod</id>
src/main/java/com/cnlive/shenhe/controller/CommentsController.java
@@ -374,15 +374,21 @@ public class CommentsController extends BaseController { @@ -374,15 +374,21 @@ public class CommentsController extends BaseController {
374 374
375 /*状态需要处理成用户可读*/ 375 /*状态需要处理成用户可读*/
376 String common_type = "";//评论类型,topic:话题 376 String common_type = "";//评论类型,topic:话题
377 - if (list.get(i).getType().equals(CommonConst.CATEGORY_TOPIC)) {  
378 - common_type = "话题"; 377 + String type = list.get(i).getType();
  378 + if (type != null) {
  379 + if (type.equals(CommonConst.CATEGORY_TOPIC)) {
  380 + common_type = "话题";
  381 + }
379 } else { 382 } else {
380 common_type = "其他"; 383 common_type = "其他";
381 } 384 }
382 cell = row.createCell(6);//列 385 cell = row.createCell(6);//列
383 cell.setCellValue(common_type); 386 cell.setCellValue(common_type);
384 cell = row.createCell(7);//列 387 cell = row.createCell(7);//列
385 - cell.setCellValue(list.get(i).getLevel()); 388 + Integer level = list.get(i).getLevel();
  389 + if (level != null) {
  390 + cell.setCellValue(level);
  391 + }
386 /*状态需要处理成用户可读*/ 392 /*状态需要处理成用户可读*/
387 String platform = "";//评论所属的平台 393 String platform = "";//评论所属的平台
388 if (list.get(i).getPlatform().equals("a")) { 394 if (list.get(i).getPlatform().equals("a")) {
src/main/java/com/cnlive/shenhe/controller/VideosController.java
@@ -347,13 +347,15 @@ public class VideosController extends BaseController { @@ -347,13 +347,15 @@ public class VideosController extends BaseController {
347 if (spid == 0) { 347 if (spid == 0) {
348 videosDTO.setSpid(null); 348 videosDTO.setSpid(null);
349 } 349 }
350 - if (videosDTO.getSp_Id() != null) { 350 + if (videosDTO.getSp_Id() != null && videosDTO.getSp_Id() != "") {
351 videosDTO.setSpid(Integer.valueOf(videosDTO.getSp_Id())); 351 videosDTO.setSpid(Integer.valueOf(videosDTO.getSp_Id()));
352 } 352 }
353 List<ShyVideos> shyVideosList = videosService.findByCondition(videosDTO); 353 List<ShyVideos> shyVideosList = videosService.findByCondition(videosDTO);
354 String fileName = "点播数据"; 354 String fileName = "点播数据";
355 - String updater = "";//审核员名字  
356 - String state1 = "";//审核状态 1已审核 2审核拒绝 0未审核 355 + //审核员名字
  356 + String updater = "";
  357 + //审核状态 1已审核 2审核拒绝 0未审核
  358 + String state1 = "";
357 XSSFWorkbook wb = new XSSFWorkbook(); 359 XSSFWorkbook wb = new XSSFWorkbook();
358 ServletOutputStream out = null; 360 ServletOutputStream out = null;
359 BufferedInputStream bis = null; 361 BufferedInputStream bis = null;
src/main/java/com/cnlive/shenhe/serviceImpl/CommentsServiceImpl.java
@@ -105,9 +105,9 @@ public class CommentsServiceImpl { @@ -105,9 +105,9 @@ public class CommentsServiceImpl {
105 if (CommonUtils.isNotNull(commentsDTO.getComment_user_id())) { 105 if (CommonUtils.isNotNull(commentsDTO.getComment_user_id())) {
106 criteria.andEqualTo("comment_user_id", commentsDTO.getComment_user_id()); 106 criteria.andEqualTo("comment_user_id", commentsDTO.getComment_user_id());
107 } 107 }
108 - if (CommonUtils.isNotEmpty(commentsDTO.getType()) && commentsDTO.getType() == "0") { 108 + if (CommonUtils.isNotEmpty(commentsDTO.getType()) && Integer.valueOf(commentsDTO.getType()) == 0) {
109 criteria.andEqualTo("type", CommonConst.CATEGORY_TOPIC); 109 criteria.andEqualTo("type", CommonConst.CATEGORY_TOPIC);
110 - } else if (CommonUtils.isNotEmpty(commentsDTO.getType()) && commentsDTO.getType() == "1") { 110 + } else if (CommonUtils.isNotEmpty(commentsDTO.getType()) && Integer.valueOf(commentsDTO.getType()) == 1) {
111 criteria.andEqualTo("type", CommonConst.CATEGORY_ELSE); 111 criteria.andEqualTo("type", CommonConst.CATEGORY_ELSE);
112 } 112 }
113 if (CommonUtils.isNotEmpty(commentsDTO.getActivity_id())) { 113 if (CommonUtils.isNotEmpty(commentsDTO.getActivity_id())) {
@@ -168,9 +168,9 @@ public class CommentsServiceImpl { @@ -168,9 +168,9 @@ public class CommentsServiceImpl {
168 if (CommonUtils.isNotNull(commentsDTO.getIs_hot())) { 168 if (CommonUtils.isNotNull(commentsDTO.getIs_hot())) {
169 criteria.andEqualTo("is_hot", commentsDTO.getIs_hot()); 169 criteria.andEqualTo("is_hot", commentsDTO.getIs_hot());
170 } 170 }
171 - if (CommonUtils.isNotEmpty(commentsDTO.getType()) && commentsDTO.getType() == "0") { 171 + if (CommonUtils.isNotEmpty(commentsDTO.getType()) && commentsDTO.getType().equals("0")) {
172 criteria.andEqualTo("type", CommonConst.CATEGORY_TOPIC); 172 criteria.andEqualTo("type", CommonConst.CATEGORY_TOPIC);
173 - } else if (CommonUtils.isNotEmpty(commentsDTO.getType()) && commentsDTO.getType() == "1") { 173 + } else if (CommonUtils.isNotEmpty(commentsDTO.getType()) && commentsDTO.getType().equals("0")) {
174 criteria.andIsNull("type"); 174 criteria.andIsNull("type");
175 } 175 }
176 if (CommonUtils.isNotEmpty(commentsDTO.getActivity_id())) { 176 if (CommonUtils.isNotEmpty(commentsDTO.getActivity_id())) {
@@ -183,14 +183,14 @@ public class CommentsServiceImpl { @@ -183,14 +183,14 @@ public class CommentsServiceImpl {
183 } 183 }
184 } 184 }
185 185
186 - if (CommonUtils.isNotEmpty(String.valueOf(commentsDTO.getState()))) {  
187 - Example.Criteria criteria1 = example.createCriteria();  
188 - String[] stas = String.valueOf(commentsDTO.getState()).split(",");  
189 - for (String s : stas) {  
190 - criteria1.orEqualTo("state", Integer.parseInt(s));  
191 - }  
192 - example.and(criteria1);  
193 - } 186 + //if (CommonUtils.isNotEmpty(String.valueOf(commentsDTO.getState()))) {
  187 + // Example.Criteria criteria1 = example.createCriteria();
  188 + // String[] stas = String.valueOf(commentsDTO.getState()).split(",");
  189 + // for (String s : stas) {
  190 + // criteria1.orEqualTo("state", Integer.parseInt(s));
  191 + // }
  192 + // example.and(criteria1);
  193 + //}
194 194
195 if (CommonUtils.isNotNull(commentsDTO.getState()) && commentsDTO.getState() != 3) { 195 if (CommonUtils.isNotNull(commentsDTO.getState()) && commentsDTO.getState() != 3) {
196 criteria.andEqualTo("state", commentsDTO.getState()); 196 criteria.andEqualTo("state", commentsDTO.getState());