From 9486766c806fe1d9e082b2fd02ea1cc558f1b443 Mon Sep 17 00:00:00 2001
From: 无关风月 <443237572@qq.com>
Date: 星期四, 08 五月 2025 09:21:57 +0800
Subject: [PATCH] bug修改

---
 cloud-server-communityWorldCup/src/main/java/com/dsh/communityWorldCup/service/impl/WorldCupPaymentParticipantServiceImpl.java |   52 +++++++++++++++++++++++++++++++++++++++-------------
 1 files changed, 39 insertions(+), 13 deletions(-)

diff --git a/cloud-server-communityWorldCup/src/main/java/com/dsh/communityWorldCup/service/impl/WorldCupPaymentParticipantServiceImpl.java b/cloud-server-communityWorldCup/src/main/java/com/dsh/communityWorldCup/service/impl/WorldCupPaymentParticipantServiceImpl.java
index 2e4f746..ad368b2 100644
--- a/cloud-server-communityWorldCup/src/main/java/com/dsh/communityWorldCup/service/impl/WorldCupPaymentParticipantServiceImpl.java
+++ b/cloud-server-communityWorldCup/src/main/java/com/dsh/communityWorldCup/service/impl/WorldCupPaymentParticipantServiceImpl.java
@@ -120,7 +120,7 @@
      * @return
      */
     @Override
-    public MyWorldCupInfo getMyWorldCupInfo(String id, String lon, String lat) {
+    public MyWorldCupInfo getMyWorldCupInfo(Long id, String lon, String lat) {
         WorldCupPaymentParticipant worldCupPaymentParticipant = this.getById(id);
         Integer worldCupId = worldCupPaymentParticipant.getWorldCupId();
         WorldCupPayment worldCupPayment = worldCupPaymentService.getById(worldCupPaymentParticipant.getWorldCupPaymentId());
@@ -128,6 +128,7 @@
         WorldCup worldCup = worldCupService.getById(worldCupId);
         MyWorldCupInfo myWorldCupInfo = new MyWorldCupInfo();
         BeanUtils.copyProperties(worldCupInfo, myWorldCupInfo);
+        myWorldCupInfo.setId(worldCupPaymentParticipant.getId());
         myWorldCupInfo.setUnitPrice(worldCupPayment.getUnitPrice().doubleValue());
         myWorldCupInfo.setExpense(worldCupPayment.getAmount().doubleValue());
         myWorldCupInfo.setStatus(worldCup.getStatus());
@@ -202,6 +203,24 @@
             objects.add(map);
         }
         worldCupInfo.setStoreInfos(objects);
+        String address = worldCupInfo.getAddress();
+        String province = worldCupInfo.getProvince();
+        String city = worldCupInfo.getCity();
+        int index = address.indexOf("市");
+        if(index != -1){
+            address = address.substring(index + 1);
+            worldCupInfo.setAddress(address);
+        }
+        index = province.indexOf("省");
+        if(index != -1){
+            province = province.substring(0, index - 1);
+            worldCupInfo.setProvince(province);
+        }
+        index = city.indexOf("市");
+        if(index != -1){
+            city = city.substring(0, index - 1);
+            worldCupInfo.setCity(city);
+        }
         return myWorldCupInfo;
     }
 
@@ -217,8 +236,8 @@
                 .eq("payStatus", 2).eq("state", 1));
         List<Long> collect = list.stream().map(WorldCupPayment::getId).collect(Collectors.toList());
         List<ParticipantVo> datas = new ArrayList<>();
-        Set<Integer> csry = new HashSet<>();
-        Set<Integer> xy = new HashSet<>();
+        Set<Long> csry = new HashSet<>();
+        Set<Long> xy = new HashSet<>();
         if(collect.size() > 0){
             SimpleDateFormat sdf = new SimpleDateFormat("yyyy");
             List<WorldCupPaymentParticipant> list1 = this.list(new QueryWrapper<WorldCupPaymentParticipant>().in("worldCupPaymentId", collect));
@@ -239,19 +258,21 @@
                     participantVo.setPhone(tStudent.getPhone());
                     participantVo.setIsStudent(1);
                     datas.add(participantVo);
+                    xy.add(participantId);
                 }
                 //参赛人员
                 if(2 == participantType && !csry.contains(participantId)){
                     Participant participant = participantClient.getParticipant(participantId);
                     participantVo.setId(participant.getId());
                     participantVo.setName(participant.getName());
-                    participantVo.setAvatar(appUser.getHeadImg());
+                    participantVo.setAvatar(participant.getHeadImg());
                     int age = Integer.valueOf(sdf.format(new Date())) - Integer.valueOf(sdf.format(participant.getBirthday()));
                     participantVo.setAge(age);
                     participantVo.setIdcard(participant.getIdcard());
                     participantVo.setPhone(participant.getPhone());
                     participantVo.setIsStudent(0);
                     datas.add(participantVo);
+                    csry.add(participantId);
                 }
             }
         }
@@ -290,18 +311,20 @@
             map.put("total", 0);
             return map;
         }
-        List<WorldCupPaymentParticipant> list1 = this.list(new QueryWrapper<WorldCupPaymentParticipant>().in("worldCupPaymentId", collect));
+        List<WorldCupPaymentParticipant> list1 = this.list(new QueryWrapper<WorldCupPaymentParticipant>().in("worldCupPaymentId", collect).orderByDesc("createTime"));
         List<Map<String, Object>> list2 = new ArrayList<>();
         SimpleDateFormat sdf = new SimpleDateFormat("yyyy");
+        SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
         for (WorldCupPaymentParticipant on : list1) {
             WorldCupPayment worldCupPayment = worldCupPaymentService.getById(on.getWorldCupPaymentId());
             Map<String, Object> map1 = new HashMap<>();
+            AppUser appUser = appUserClient.getAppUser(on.getAppUserId());
             if(on.getParticipantType() == 1){
                 TStudent tStudent = studentClient.queryById(on.getParticipantId().intValue());
                 if(ToolUtil.isNotEmpty(name) && tStudent.getName().indexOf(name) == -1){
                     continue;
                 }
-                if(ToolUtil.isNotEmpty(phone) && tStudent.getPhone().indexOf(phone) == -1){
+                if(ToolUtil.isNotEmpty(phone) && (ToolUtil.isEmpty(tStudent.getPhone()) ? appUser.getPhone() : tStudent.getPhone()).indexOf(phone) == -1){
                     continue;
                 }
                 if(ToolUtil.isNotEmpty(idcode) && tStudent.getIdCard().indexOf(idcode) == -1){
@@ -312,15 +335,16 @@
                 map1.put("name", tStudent.getName());
                 map1.put("gender", tStudent.getSex() == 1 ? "男" : "女");
                 map1.put("age", Integer.valueOf(sdf.format(new Date())) - Integer.valueOf(sdf.format(tStudent.getBirthday())));
-                map1.put("phone", tStudent.getPhone());
+                map1.put("phone", ToolUtil.isEmpty(tStudent.getPhone()) ? appUser.getPhone() : tStudent.getPhone());
                 map1.put("idcard", tStudent.getIdCard());
                 map1.put("state", worldCupPayment.getPayStatus() - 1);
+                map1.put("insertTime", sdf1.format(worldCupPayment.getPayTime()));
             }else{
                 Participant participant = participantClient.getParticipant(on.getParticipantId());
                 if(ToolUtil.isNotEmpty(name) && participant.getName().indexOf(name) == -1){
                     continue;
                 }
-                if(ToolUtil.isNotEmpty(phone) && participant.getPhone().indexOf(phone) == -1){
+                if(ToolUtil.isNotEmpty(phone) && (ToolUtil.isNotEmpty(participant.getPhone()) ? participant.getPhone() : appUser.getPhone()).indexOf(phone) == -1){
                     continue;
                 }
                 if(ToolUtil.isNotEmpty(idcode) && participant.getIdcard().indexOf(idcode) == -1){
@@ -331,9 +355,10 @@
                 map1.put("name", participant.getName());
                 map1.put("gender", participant.getGender() == 1 ? "男" : "女");
                 map1.put("age", Integer.valueOf(sdf.format(new Date())) - Integer.valueOf(sdf.format(participant.getBirthday())));
-                map1.put("phone", participant.getPhone());
+                map1.put("phone", ToolUtil.isNotEmpty(participant.getPhone()) ? participant.getPhone() : appUser.getPhone());
                 map1.put("idcard", participant.getIdcard());
                 map1.put("state", worldCupPayment.getPayStatus() - 1);
+                map1.put("insertTime", sdf1.format(worldCupPayment.getPayTime()));
             }
             list2.add(map1);
         }
@@ -369,11 +394,12 @@
             Long participantId = Long.valueOf(map.get("participantId").toString());
             Integer appUserId = Integer.valueOf(map.get("appUserId").toString());
             Map<String, Object> userGameRecordList = worldCupCompetitorMapper.getUserGameRecordList(participantType, participantId);
+            Map<String, Object> userGameRecordList1 = worldCupCompetitorMapper.getUserGameRecordList1(participantType, participantId);
             Integer totalSession = 0;
             Integer win = 0;
             if(null != userGameRecordList){
-                totalSession = Integer.valueOf(null != userGameRecordList.get("totalSession") ? userGameRecordList.get("totalSession").toString() : "0");
-                win = Integer.valueOf(null != userGameRecordList.get("win") ? userGameRecordList.get("win").toString() : "0");
+                totalSession = Integer.valueOf(null != userGameRecordList && null != userGameRecordList.get("num") ? userGameRecordList.get("num").toString() : "0");
+                win = Integer.valueOf(null != userGameRecordList1 && null != userGameRecordList1.get("num") ? userGameRecordList1.get("num").toString() : "0");
             }else{
                 userGameRecordList = new HashMap<>();
             }
@@ -391,7 +417,7 @@
                 if(ToolUtil.isNotEmpty(name) && tStudent.getName().indexOf(name) == -1){
                     continue;
                 }
-                if(ToolUtil.isNotEmpty(phone) && tStudent.getPhone().indexOf(phone) == -1){
+                if(ToolUtil.isNotEmpty(phone) && (ToolUtil.isEmpty(tStudent.getPhone()) ? appUser.getPhone() : tStudent.getPhone()).indexOf(phone) == -1){
                     continue;
                 }
                 if(ToolUtil.isNotEmpty(idcard) && tStudent.getIdCard().indexOf(idcard) == -1){
@@ -406,7 +432,7 @@
                 if(ToolUtil.isNotEmpty(name) && participant.getName().indexOf(name) == -1){
                     continue;
                 }
-                if(ToolUtil.isNotEmpty(phone) && participant.getPhone().indexOf(phone) == -1){
+                if(ToolUtil.isNotEmpty(phone) && (ToolUtil.isNotEmpty(participant.getPhone()) ? participant.getPhone() : appUser.getPhone()).indexOf(phone) == -1){
                     continue;
                 }
                 if(ToolUtil.isNotEmpty(idcard) && participant.getIdcard().indexOf(idcard) == -1){

--
Gitblit v1.7.1