cloud-server-communityWorldCup/src/main/java/com/dsh/communityWorldCup/service/impl/WorldCupCompetitorServiceImpl.java
@@ -81,7 +81,7 @@ for (int i = 0; i < mapList.size(); i++) { Map<String, Object> map = mapList.get(i); Integer participantType = Integer.valueOf(map.get("participantType").toString()); Integer participantId = Integer.valueOf(map.get("participantId").toString()); Long participantId = Long.valueOf(map.get("participantId").toString()); Integer num = Integer.valueOf(map.get("num").toString()); if(null != participantId && participantId.equals(entrantRank.getId()) && participantType.equals(entrantRank.getIsStudent())){ entrantRankVo.setNationalRank(i + 1); @@ -101,7 +101,7 @@ for (int i = 0; i < mapList1.size(); i++) { Map<String, Object> map = mapList1.get(i); Integer participantType = Integer.valueOf(map.get("participantType").toString()); Integer participantId = Integer.valueOf(map.get("participantId").toString()); Long participantId = Long.valueOf(map.get("participantId").toString()); Integer num = Integer.valueOf(map.get("num").toString()); if(null != participantId && participantId.equals(entrantRank.getId()) && participantType.equals(entrantRank.getIsStudent())){ entrantRankVo.setCityRank(i + 1); cloud-server-communityWorldCup/src/main/java/com/dsh/communityWorldCup/service/impl/WorldCupServiceImpl.java
@@ -165,6 +165,9 @@ // worldCupPaymentParticipant.setAlreadyEntered(1); // worldCupPaymentParticipantService.updateById(worldCupPaymentParticipant); } worldCup.setMatchNumber(worldCup.getMatchNumber() + 1); this.updateById(worldCup); //2、调起开启游戏的接口。 HashMap<String, String> map = new HashMap<>(); map.put("sign", "0DB011836143EEE2C2E072967C9F4E4B"); @@ -249,7 +252,7 @@ Collections.sort(worldCupList1, new Comparator<WorldCupListVo>() { @Override public int compare(WorldCupListVo o1, WorldCupListVo o2) { return o1.getDistance().compareTo(o2.getDistance()) * -1; return o1.getDistance().compareTo(o2.getDistance()); } }); } @@ -391,13 +394,16 @@ String cupIds = paymentWorldCup.getIds(); JSONArray jsonArray = JSON.parseArray(cupIds); if(jsonArray.size() != 6){ return ResultUtil.error("参赛人数只能是6人"); } List<WorldCupPayment> payments = worldCupPaymentService.list(new QueryWrapper<WorldCupPayment>().eq("worldCupId", worldCup.getId()) .eq("payStatus", 2).eq("state", 1)); List<Long> ids = payments.stream().map(WorldCupPayment::getId).collect(Collectors.toList()); if(ids.size() > 0){ int count = worldCupPaymentParticipantService.count(new QueryWrapper<WorldCupPaymentParticipant>().eq("worldCupId", worldCup.getId()) .eq("worldCupPaymentId", ids)); if((count + jsonArray.size()) >= worldCup.getMatchNumber()){ if((count + jsonArray.size()) >= worldCup.getMaxPeople()){ return ResultUtil.error("已超出最大报名人数"); } } cloud-server-communityWorldCup/src/main/resources/mapper/WorldCupCompetitorMapper.xml
@@ -13,7 +13,7 @@ participantId, count(*) as num from t_world_cup_competitor where DATE_FORMAT(NOW(), '%Y-%m-%d') = DATE_FORMAT(startTime, '%Y-%m-%d') where DATE_FORMAT(NOW(), '%Y') = DATE_FORMAT(startTime, '%Y') <if test="null != appUserIds and appUserIds.size() > 0"> and appUserId in <foreach collection="appUserIds" item="item" index="index" open="(" separator="," close=")"> cloud-server-communityWorldCup/src/main/resources/mapper/WorldCupMapper.xml
@@ -41,7 +41,7 @@ and a.name like CONCAT('%', #{item.content}, '%') </if> <if test="null != item.storeId"> and a.id in (select worldCupId from t_world_cup_store where storeId = #{item.storeId} and isOpen = 1) and a.id in (select worldCupId from t_world_cup_store where storeId = #{item.storeId}) </if> <if test="null != item.gender"> and #{item.gender} = a.gender