Commit a2fed0ecac2521cd4b482a8eec59baf707c4add3

Authored by 王言钊
1 parent 0d987955

修复三个bug

... ... @@ -247,6 +247,16 @@
247 247 <environment>dev</environment>
248 248 </properties>
249 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 261 <profile>
252 262 <id>prod</id>
... ...
src/main/java/com/cnlive/shenhe/controller/CommentsController.java
... ... @@ -374,15 +374,21 @@ public class CommentsController extends BaseController {
374 374  
375 375 /*状态需要处理成用户可读*/
376 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 382 } else {
380 383 common_type = "其他";
381 384 }
382 385 cell = row.createCell(6);//列
383 386 cell.setCellValue(common_type);
384 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 393 String platform = "";//评论所属的平台
388 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 347 if (spid == 0) {
348 348 videosDTO.setSpid(null);
349 349 }
350   - if (videosDTO.getSp_Id() != null) {
  350 + if (videosDTO.getSp_Id() != null && videosDTO.getSp_Id() != "") {
351 351 videosDTO.setSpid(Integer.valueOf(videosDTO.getSp_Id()));
352 352 }
353 353 List<ShyVideos> shyVideosList = videosService.findByCondition(videosDTO);
354 354 String fileName = "点播数据";
355   - String updater = "";//审核员名字
356   - String state1 = "";//审核状态 1已审核 2审核拒绝 0未审核
  355 + //审核员名字
  356 + String updater = "";
  357 + //审核状态 1已审核 2审核拒绝 0未审核
  358 + String state1 = "";
357 359 XSSFWorkbook wb = new XSSFWorkbook();
358 360 ServletOutputStream out = null;
359 361 BufferedInputStream bis = null;
... ...
src/main/java/com/cnlive/shenhe/serviceImpl/CommentsServiceImpl.java
... ... @@ -105,9 +105,9 @@ public class CommentsServiceImpl {
105 105 if (CommonUtils.isNotNull(commentsDTO.getComment_user_id())) {
106 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 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 111 criteria.andEqualTo("type", CommonConst.CATEGORY_ELSE);
112 112 }
113 113 if (CommonUtils.isNotEmpty(commentsDTO.getActivity_id())) {
... ... @@ -168,9 +168,9 @@ public class CommentsServiceImpl {
168 168 if (CommonUtils.isNotNull(commentsDTO.getIs_hot())) {
169 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 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 174 criteria.andIsNull("type");
175 175 }
176 176 if (CommonUtils.isNotEmpty(commentsDTO.getActivity_id())) {
... ... @@ -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 195 if (CommonUtils.isNotNull(commentsDTO.getState()) && commentsDTO.getState() != 3) {
196 196 criteria.andEqualTo("state", commentsDTO.getState());
... ...