Authored by zhaoqing

bug修复

1 package com.yoho.activity.queue.convert; 1 package com.yoho.activity.queue.convert;
2 2
3 import java.util.ArrayList; 3 import java.util.ArrayList;
  4 +import java.util.HashMap;
4 import java.util.List; 5 import java.util.List;
5 import java.util.Map; 6 import java.util.Map;
6 7
@@ -36,6 +37,10 @@ public class DrawlineUserQueueConvert { @@ -36,6 +37,10 @@ public class DrawlineUserQueueConvert {
36 if (null == drawlineUserQueueList) { 37 if (null == drawlineUserQueueList) {
37 return null; 38 return null;
38 } 39 }
  40 + Map<Integer, Integer> uidAndSortMap = new HashMap<>();
  41 + for (DrawlineUserQueue drawlineUserQueue : drawlineUserQueueList){
  42 + uidAndSortMap.put(drawlineUserQueue.getUid(), drawlineUserQueue.getSort());
  43 + }
39 List<DrawlineUserQueueRespBO> drawlineUserQueueRespBOList = new ArrayList<DrawlineUserQueueRespBO>(); 44 List<DrawlineUserQueueRespBO> drawlineUserQueueRespBOList = new ArrayList<DrawlineUserQueueRespBO>();
40 DrawlineUserQueueRespBO drawlineUserQueueRespBO; 45 DrawlineUserQueueRespBO drawlineUserQueueRespBO;
41 DrawlineLuckyUser drawlineLuckyUser; 46 DrawlineLuckyUser drawlineLuckyUser;
@@ -52,6 +57,9 @@ public class DrawlineUserQueueConvert { @@ -52,6 +57,9 @@ public class DrawlineUserQueueConvert {
52 drawlineLuckyUser = drawlineLuckyUserMap.get(String.valueOf(uid) + "_" + String.valueOf(userType)); 57 drawlineLuckyUser = drawlineLuckyUserMap.get(String.valueOf(uid) + "_" + String.valueOf(userType));
53 userBaseRspBO = userBaseRspBOMap.get(uid); 58 userBaseRspBO = userBaseRspBOMap.get(uid);
54 drawlineVirtualUser = drawlineVirtualUserMap.get(uid); 59 drawlineVirtualUser = drawlineVirtualUserMap.get(uid);
  60 + if (!uidAndSortMap.get(drawlineUserQueue.getUid()).equals(drawlineUserQueue.getSort())){
  61 + drawlineVirtualUser = null;
  62 + }
55 drawlineUserQueueRespBO = toBOByDO(drawlineUserQueue, drawlineLuckyUser, userBaseRspBO, drawlineVirtualUser); 63 drawlineUserQueueRespBO = toBOByDO(drawlineUserQueue, drawlineLuckyUser, userBaseRspBO, drawlineVirtualUser);
56 if (null == drawlineUserQueueRespBO) { 64 if (null == drawlineUserQueueRespBO) {
57 continue; 65 continue;
@@ -45,7 +45,7 @@ public class DrawlineUserQueueRest { @@ -45,7 +45,7 @@ public class DrawlineUserQueueRest {
45 //对当前助力用户进行校验是否是重复助力排队 45 //对当前助力用户进行校验是否是重复助力排队
46 Boolean existFlag = drawlineUserQueueService.judgeHelpUserExist(drawlineUserQueueReqBO); 46 Boolean existFlag = drawlineUserQueueService.judgeHelpUserExist(drawlineUserQueueReqBO);
47 if (existFlag){ 47 if (existFlag){
48 - return new ApiResponse.ApiResponseBuilder().code(401).message("该用户已经助力过,不可重复助力").build(); 48 + return new ApiResponse.ApiResponseBuilder().code(9001).message("您已助力,不可重复助力").build();
49 } 49 }
50 int code = 200; 50 int code = 200;
51 String message = "操作成功"; 51 String message = "操作成功";
@@ -50,7 +50,7 @@ public class ProductLimitUserHelpRest { @@ -50,7 +50,7 @@ public class ProductLimitUserHelpRest {
50 Boolean flag = iProductLimitUserHelpService.judgeHelpUserExist(limitProductHelpUserRequestBO); 50 Boolean flag = iProductLimitUserHelpService.judgeHelpUserExist(limitProductHelpUserRequestBO);
51 if (flag){ 51 if (flag){
52 logger.info("ProductLimitUserHelpRest addHelpUserInfo can not help repeat"); 52 logger.info("ProductLimitUserHelpRest addHelpUserInfo can not help repeat");
53 - return new ApiResponse.ApiResponseBuilder().code(401).message("用户已经助力过,不可重复助力").build(); 53 + return new ApiResponse.ApiResponseBuilder().code(9001).message("您已参加过活动,请刷新重试").build();
54 } 54 }
55 iProductLimitUserHelpService.addHelpUserInfo(limitProductHelpUserRequestBO); 55 iProductLimitUserHelpService.addHelpUserInfo(limitProductHelpUserRequestBO);
56 logger.info("ProductLimitUserHelpRest addHelpUserInfo success"); 56 logger.info("ProductLimitUserHelpRest addHelpUserInfo success");