From 7cd3dea07f5b7cefad9dea9fd7daf992449aaac8 Mon Sep 17 00:00:00 2001 From: puzhibing <393733352@qq.com> Date: 星期二, 12 三月 2024 18:24:38 +0800 Subject: [PATCH] 修改bug --- cloud-server-communityWorldCup/src/main/java/com/dsh/communityWorldCup/controller/WorldCupController.java | 40 ++++++++++++++++++++++++++++++++++++++-- 1 files changed, 38 insertions(+), 2 deletions(-) diff --git a/cloud-server-communityWorldCup/src/main/java/com/dsh/communityWorldCup/controller/WorldCupController.java b/cloud-server-communityWorldCup/src/main/java/com/dsh/communityWorldCup/controller/WorldCupController.java index e0b910f..9681a55 100644 --- a/cloud-server-communityWorldCup/src/main/java/com/dsh/communityWorldCup/controller/WorldCupController.java +++ b/cloud-server-communityWorldCup/src/main/java/com/dsh/communityWorldCup/controller/WorldCupController.java @@ -195,7 +195,7 @@ Participant participant = participantClient.getParticipant(worldCupPaymentParticipant.getParticipantId()); worldCupPeopleVo.setName(participant.getName()); worldCupPeopleVo.setAge(null == participant.getBirthday() ? 0 : Integer.valueOf(sdf.format(new Date())) -Integer.valueOf(sdf.format(participant.getBirthday()))); - worldCupPeopleVo.setAvatar(appUser.getHeadImg()); + worldCupPeopleVo.setAvatar(participant.getHeadImg()); worldCupPeopleVo.setParticipantType(2); } return ResultUtil.success(worldCupPeopleVo); @@ -648,7 +648,10 @@ worldCup.setProvinceCode(provinceCode); worldCup.setCity(city.replace("市", "")); worldCup.setCityCode(cityCode); - worldCupService.updateById(worldCup); + WorldCup worldCup1 = worldCupService.getById(worldCup.getId()); + worldCup.setCreateTime(worldCup1.getCreateTime()); + worldCup.setMatchNumber(worldCup1.getMatchNumber()); + worldCupService.updateWorldCupAll(worldCup); return worldCup.getId(); } @@ -828,4 +831,37 @@ public Map<String, Object> userGameRecordList(@RequestBody UserGameRecordList userGameRecordList){ return worldCupCompetitorService.userGameRecordList(userGameRecordList); } + + + /** + * 获取已报名人数 + * @param worldCupId + * @return + */ + @ResponseBody + @PostMapping("/worldCup/getRegisteredNumber") + public int getRegisteredNumber(@RequestBody Integer worldCupId){ + List<WorldCupPayment> list = worldCupPaymentService.list(new QueryWrapper<WorldCupPayment>().eq("worldCupId", worldCupId) + .eq("payStatus", 2).eq("state", 1)); + List<Long> collect = list.stream().map(WorldCupPayment::getId).collect(Collectors.toList()); + if(collect.size() == 0){ + return 0; + } + return worldCupPaymentParticipantService.getCount(worldCupId, collect); + } + + + /** + * 获取支付记录 + * @param getWorldCupPayment + * @return + */ + @ResponseBody + @PostMapping("/worldCup/getWorldCupPayment") + public List<WorldCupPayment> getWorldCupPayment(@RequestBody GetWorldCupPayment getWorldCupPayment){ + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + return worldCupPaymentService.list(new QueryWrapper<WorldCupPayment>().eq("appUserId", getWorldCupPayment.getAppUserId()) + .eq("payType", getWorldCupPayment.getPayType()).ne("payStatus", 1).eq("state", 1) + .last(" and createTime between '" + sdf.format(getWorldCupPayment.getStartTime()) + "' and '" + sdf.format(getWorldCupPayment.getEndTime()) + "' order by createTime desc")); + } } -- Gitblit v1.7.1