From aa925d851857f50eff0556411366690d9a78a0e5 Mon Sep 17 00:00:00 2001
From: 44323 <443237572@qq.com>
Date: 星期一, 27 十一月 2023 17:30:26 +0800
Subject: [PATCH] Merge branch 'master' of http://120.76.84.145:10101/gitblit/r/java/PlayPai

---
 cloud-server-account/src/main/java/com/dsh/account/service/impl/TStudentServiceImpl.java |  331 +++++++++++++++++++-----------------------------------
 1 files changed, 119 insertions(+), 212 deletions(-)

diff --git a/cloud-server-account/src/main/java/com/dsh/account/service/impl/TStudentServiceImpl.java b/cloud-server-account/src/main/java/com/dsh/account/service/impl/TStudentServiceImpl.java
index ed8066a..17ea143 100644
--- a/cloud-server-account/src/main/java/com/dsh/account/service/impl/TStudentServiceImpl.java
+++ b/cloud-server-account/src/main/java/com/dsh/account/service/impl/TStudentServiceImpl.java
@@ -116,13 +116,12 @@
     private TCourseInfoRecordService courseInfoRecordService;
 
 
-
     @Override
-    public ResultUtil addStuOfAppUser(StuDetailsReq stu,Integer appUserId) throws Exception {
+    public ResultUtil addStuOfAppUser(StuDetailsReq stu, Integer appUserId) throws Exception {
         TStudent student = new TStudent();
-        if(ToolUtil.isNotEmpty(stu.getName()) && ToolUtil.isNotEmpty(stu.getIdCard())){
+        if (ToolUtil.isNotEmpty(stu.getName()) && ToolUtil.isNotEmpty(stu.getIdCard())) {
             Boolean aBoolean = JuHeUtil.idcardAuthentication(stu.getIdCard(), stu.getName());
-            if(!aBoolean){
+            if (!aBoolean) {
                 return ResultUtil.error("身份证和姓名不匹配");
             }
         }
@@ -131,7 +130,7 @@
         student.setHeadImg(stu.getHeadImg());
         student.setPhone(ToolUtil.isNotEmpty(stu.getPhone()) ? stu.getPhone() : "");
         student.setSex(stu.getSex());
-        student.setIdCard(ToolUtil.isNotEmpty(stu.getIdCard())?stu.getIdCard() : "");
+        student.setIdCard(ToolUtil.isNotEmpty(stu.getIdCard()) ? stu.getIdCard() : "");
         SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
         student.setBirthday(sdf.parse(stu.getBirthday()));
         student.setHeight(stu.getHeight());
@@ -147,9 +146,9 @@
         student.setState(1);
 
         List<TStudent> tStudents = this.baseMapper.selectList(new LambdaQueryWrapper<TStudent>().eq(TStudent::getAppUserId, appUserId));
-        if(tStudents.size()>0){
+        if (tStudents.size() > 0) {
             student.setIsDefault(2);
-        }else {
+        } else {
             student.setIsDefault(1);
         }
         this.baseMapper.insert(student);
@@ -180,7 +179,7 @@
         getStuSessionList.setAppUserId(userIdFormRedis);
         List<StuSessionDetailsVo> stuSessionList = sessionNameClient.getStuSessionList(getStuSessionList);
         TStudent tStudent = this.baseMapper.selectById(stuId);
-        if (ToolUtil.isNotEmpty(tStudent)){
+        if (ToolUtil.isNotEmpty(tStudent)) {
             insVo.setStuId(tStudent.getId());
             insVo.setStuName(tStudent.getName());
             insVo.setStuImage(tStudent.getHeadImg());
@@ -204,10 +203,10 @@
             List<PurchaseRecordVo> purchaseRecordVos = sessionNameClient.queryCourseDetails(getStuSessionList);
             purchaseRecordVoList.addAll(purchaseRecordVos);
             List<TAppUser> tAppUsers = tauMapper.selectList(new QueryWrapper<TAppUser>()
-                    .eq("referralUserId",userIdFormRedis )
-                    .between("insertTime",localMonthStart ,localMonthEnd));
+                    .eq("referralUserId", userIdFormRedis)
+                    .between("insertTime", localMonthStart, localMonthEnd));
             List<Integer> userIds = tAppUsers.stream().map(TAppUser::getId).collect(Collectors.toList());
-            IntrduceOfUserRequest request  = new IntrduceOfUserRequest();
+            IntrduceOfUserRequest request = new IntrduceOfUserRequest();
             request.setStartTime(localMonthStart);
             request.setEndTime(localMonthEnd);
             request.setUserIds(userIds);
@@ -234,108 +233,8 @@
     }
 
     @Override
-    public List<PurchaseRecordVo> queryDeduRecordDetails(RecordTimeRequest timeRequest,Integer appUserId) {
-        List<PurchaseRecordVo> purchaseRecordVoList = new ArrayList<>();
-        String time = timeRequest.getTime();
-
+    public List<PurchaseRecordVo> queryDeduRecordDetails(RecordTimeRequest timeRequest, Integer appUserId) {
         List<PurchaseRecordVo> record1 = sessionNameClient.getRecord(timeRequest);
-
-//
-//        Date monthStart = null;
-//        Date monthEnd = null;
-//        if (StringUtils.hasText(time)) {
-//            monthStart = DateTimeHelper.getCurrentIdetMouthStart(time);
-//            monthEnd = DateTimeHelper.getCurrentIdeaMouthEnd(time);
-//        } else {
-//            monthStart = DateTimeHelper.getCurrentMouthStart();
-//            monthEnd = DateTimeHelper.getCurrentMouthEnd();
-//        }
-//
-//        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM");
-//        Date startTime = DateTimeHelper.getCurrentIdetMouthStart(simpleDateFormat.format(monthStart));
-//        Date endTime = DateTimeHelper.getCurrentIdeaMouthEnd(simpleDateFormat.format(monthEnd));
-//        GetStuSourseList getStuSourseList = new GetStuSourseList();
-//        getStuSourseList.setStartTime(startTime);
-//        getStuSourseList.setEndTime(endTime);
-//        getStuSourseList.setAppUserId(appUserId);
-//        // 报名赛事
-//        List<PurchaseRecordVo> stuSourseList = dcttClient.getStuSourseList1(getStuSourseList);
-//        purchaseRecordVoList.addAll(stuSourseList);
-//
-//        GetStuSessionList sessionList = new GetStuSessionList();
-//        sessionList.setStartTime(startTime);
-//        sessionList.setEndTime(endTime);
-//        sessionList.setStuId(timeRequest.getStuId());
-//        sessionList.setAppUserId(appUserId);
-//        List<PurchaseRecordVo> cancelCourseList = cancelcClient.getCancelCourseList(sessionList);
-//
-//        purchaseRecordVoList.addAll(cancelCourseList);
-//        GetStuSessionList getStuSessionList = new GetStuSessionList();
-//        getStuSessionList.setStartTime(startTime);
-//        getStuSessionList.setEndTime(endTime);
-//        getStuSessionList.setStuId(timeRequest.getStuId());
-//        getStuSessionList.setAppUserId(appUserId);
-//        // 购买课包
-//        List<PurchaseRecordVo> purchaseRecordVos = sessionNameClient.queryCourseDetails(getStuSessionList);
-//        purchaseRecordVoList.addAll(purchaseRecordVos);
-//        List<TAppUser> tAppUsers = tauMapper.selectList(new QueryWrapper<TAppUser>()
-//                .eq("referralUserId",appUserId )
-//                .between("insertTime",startTime ,endTime));
-//        if (ToolUtil.isNotEmpty(tAppUsers)){
-//            List<Integer> userIds = tAppUsers.stream().map(TAppUser::getId).collect(Collectors.toList());
-//            IntrduceOfUserRequest request  = new IntrduceOfUserRequest();
-//            request.setStartTime(startTime);
-//            request.setEndTime(endTime);
-//            request.setUserIds(userIds);
-//            // 介绍有礼
-//            List<PurchaseRecordVo> purchaseRecordVos1 = idrClient.queryAppUsersofIntroduce(request);
-//            purchaseRecordVoList.addAll(purchaseRecordVos1);
-//        }
-//
-//        LambdaQueryWrapper<TCourseInfoRecord> eq = new LambdaQueryWrapper<TCourseInfoRecord>().eq(TCourseInfoRecord::getUserId, appUserId);
-//        if(timeRequest.getType()!=null){
-//            eq.eq(TCourseInfoRecord::getType,timeRequest.getType());
-//        }
-//        if (timeRequest.getLessionId()!=null){
-//            eq.eq(TCourseInfoRecord::getCourseId,timeRequest.getLessionId());
-//
-//        }
-//        // 2.0其他记录
-//        List<TCourseInfoRecord> list = courseInfoRecordService.list(eq);
-//        List<PurchaseRecordVo> list1=new ArrayList<>();
-//        for (TCourseInfoRecord tCourseInfoRecord : list) {
-//            PurchaseRecordVo purchaseRecordVo = new PurchaseRecordVo();
-//            purchaseRecordVo.setPurchaseTime(new SimpleDateFormat("MM-dd HH:mm").format(tCourseInfoRecord.getTime()));
-//            purchaseRecordVo.setPurchaseType(tCourseInfoRecord.getName());
-//            if(tCourseInfoRecord.getType()==1){
-//                purchaseRecordVo.setPurchaseAmount("+"+tCourseInfoRecord.getNum());
-//            }else {
-//                purchaseRecordVo.setPurchaseAmount("-"+tCourseInfoRecord.getNum());
-//            }
-//            list1.add(purchaseRecordVo);
-//        }
-//        purchaseRecordVoList.addAll(list1);
-//
-//        if (purchaseRecordVoList.size() > 0 ){
-//            purchaseRecordVoList = purchaseRecordVoList.stream()
-//                    .filter(record -> {
-//                        String fieldValue = record.getPurchaseAmount();
-//                        if (ToolUtil.isNotEmpty(timeRequest.getType())){
-//                            switch (timeRequest.getType()){
-//                                case 2:
-//                                    return fieldValue != null && !fieldValue.isEmpty() && fieldValue.charAt(0) == '-';
-//                                case 1:
-//                                    return fieldValue != null && !fieldValue.isEmpty() && fieldValue.charAt(0) == '+';
-//                                default:
-//                                    break;
-//                            }
-//                        }
-//                        return true;
-//                    })
-//                    .collect(Collectors.toList());
-//        }
-//
-//        purchaseRecordVoList = dealDataOfTime(purchaseRecordVoList);
         return record1;
     }
 
@@ -417,7 +316,7 @@
         List<StuListVo> stuListVos = new ArrayList<>();
         List<TStudent> tStudents = this.baseMapper.selectList(new QueryWrapper<TStudent>()
                 .eq("appUserId", appUserId)
-                .eq("state",1));
+                .eq("state", 1));
         if (tStudents.size() > 0) {
             tStudents.forEach(sts -> {
                 if (Objects.equals(sts.getId(), stuId)) {
@@ -488,12 +387,12 @@
         try {
             switch (request.getPayType()) {
                 case 1:
-                    return WeChatPayment(code,request.getPayAmount(),hour);
+                    return WeChatPayment(code, request.getPayAmount(), hour);
                 case 2:
-                    return AlipayPayment(code,request.getPayAmount(),hour);
+                    return AlipayPayment(code, request.getPayAmount(), hour);
                 case 3:
-                    int i = PlaypaiGoldPayment(code,request);
-                    switch (i){
+                    int i = PlaypaiGoldPayment(code, request);
+                    switch (i) {
                         case 1:
                             return ResultUtil.success();
                         case 2:
@@ -506,33 +405,33 @@
                 default:
                     break;
             }
-        }catch (Exception e){
+        } catch (Exception e) {
             ResultUtil.runErr();
         }
         return ResultUtil.success();
     }
 
 
-    public ResultUtil WeChatPayment(String code,BigDecimal amount,Integer hour) throws Exception {
+    public ResultUtil WeChatPayment(String code, BigDecimal amount, Integer hour) throws Exception {
         ResultUtil weixinpay = payMoneyUtil.weixinpay("课包续费", "", code, amount.toString(),
                 "/base/coursePackage/wechatPaymentCallback", "APP", "");
-        if(weixinpay.getCode() == 200){
+        if (weixinpay.getCode() == 200) {
             new Thread(new Runnable() {
                 @Override
                 public void run() {
                     try {
                         int num = 1;
                         int wait = 0;
-                        while (num <= 10){
+                        while (num <= 10) {
                             int min = 5000;
                             wait += (min * num);
                             Thread.sleep(wait);
                             TCoursePackagePayment coursePackagePayment = couPayClient.getCoursePackagePaymentByCode(code);
-                            if(coursePackagePayment.getPayStatus() == 2){
+                            if (coursePackagePayment.getPayStatus() == 2) {
                                 break;
                             }
                             ResultUtil<Map<String, String>> resultUtil = payMoneyUtil.queryWXOrder(code, "");
-                            if(resultUtil.getCode() == 200 && coursePackagePayment.getPayStatus() == 1){
+                            if (resultUtil.getCode() == 200 && coursePackagePayment.getPayStatus() == 1) {
                                 /**
                                  * SUCCESS—支付成功,
                                  * REFUND—转入退款,
@@ -545,12 +444,12 @@
                                 Map<String, String> data1 = resultUtil.getData();
                                 String s = data1.get("trade_state");
                                 String transaction_id = data1.get("transaction_id");
-                                if("REFUND".equals(s) || "NOTPAY".equals(s) || "CLOSED".equals(s) || "REVOKED".equals(s) || "PAYERROR".equals(s) || num == 10){
+                                if ("REFUND".equals(s) || "NOTPAY".equals(s) || "CLOSED".equals(s) || "REVOKED".equals(s) || "PAYERROR".equals(s) || num == 10) {
                                     coursePackagePayment.setState(3);
                                     couPayClient.delPaymentCoursePackage(coursePackagePayment.getId());
                                     break;
                                 }
-                                if("SUCCESS".equals(s)){
+                                if ("SUCCESS".equals(s)) {
                                     coursePackagePayment.setPayStatus(2);
                                     coursePackagePayment.setTotalClassHours(hour);
                                     coursePackagePayment.setLaveClassHours(hour);
@@ -558,12 +457,12 @@
                                     couPayClient.updatePaymentCoursePackage(coursePackagePayment);
                                     break;
                                 }
-                                if("USERPAYING".equals(s)){
+                                if ("USERPAYING".equals(s)) {
                                     num++;
                                 }
                             }
                         }
-                    }catch (Exception e){
+                    } catch (Exception e) {
                         e.printStackTrace();
                     }
                 }
@@ -572,27 +471,27 @@
         return weixinpay;
     }
 
-    public ResultUtil AlipayPayment(String code,BigDecimal amount,Integer hour){
+    public ResultUtil AlipayPayment(String code, BigDecimal amount, Integer hour) {
         ResultUtil alipay = payMoneyUtil.alipay("课包续费", "课包续费", "", code, amount.toString(),
                 "/base/coursePackage/alipayPaymentCallback");
-        if(alipay.getCode() == 200){
+        if (alipay.getCode() == 200) {
             new Thread(new Runnable() {
                 @Override
                 public void run() {
                     try {
                         int num = 1;
                         int wait = 0;
-                        while (num <= 10){
+                        while (num <= 10) {
                             int min = 5000;
                             wait += (min * num);
                             Thread.sleep(wait);
                             TCoursePackagePayment coursePackagePayment = couPayClient.getCoursePackagePaymentByCode(code);
-                            if(coursePackagePayment.getPayStatus() == 2){
+                            if (coursePackagePayment.getPayStatus() == 2) {
                                 break;
                             }
                             AlipayTradeQueryResponse resultUtil = payMoneyUtil.queryALIOrder(code);
 
-                            if(resultUtil.getCode().equals("10000") && coursePackagePayment.getPayStatus() == 1){
+                            if (resultUtil.getCode().equals("10000") && coursePackagePayment.getPayStatus() == 1) {
                                 /**
                                  * WAIT_BUYER_PAY(交易创建,等待买家付款)、
                                  * TRADE_CLOSED(未付款交易超时关闭,或支付完成后全额退款)、
@@ -604,13 +503,13 @@
 //                                String tradeNo = data1.get("tradeNo");
                                 String tradeNo = resultUtil.getTradeNo();
                                 String tradeStatus = resultUtil.getTradeStatus();
-                                System.out.println("ssssss"+tradeStatus);
-                                if("TRADE_CLOSED".equals(tradeStatus) || "TRADE_FINISHED".equals(tradeStatus) || num == 10){
+                                System.out.println("ssssss" + tradeStatus);
+                                if ("TRADE_CLOSED".equals(tradeStatus) || "TRADE_FINISHED".equals(tradeStatus) || num == 10) {
                                     coursePackagePayment.setState(3);
                                     couPayClient.delPaymentCoursePackage(coursePackagePayment.getId());
                                     break;
                                 }
-                                if("TRADE_SUCCESS".equals(tradeStatus)){
+                                if ("TRADE_SUCCESS".equals(tradeStatus)) {
                                     coursePackagePayment.setPayStatus(2);
                                     coursePackagePayment.setTotalClassHours(hour);
                                     coursePackagePayment.setLaveClassHours(hour);
@@ -618,17 +517,14 @@
                                     couPayClient.updatePaymentCoursePackage(coursePackagePayment);
 
 
-
-
-
                                     break;
                                 }
-                                if("WAIT_BUYER_PAY".equals(tradeStatus)){
+                                if ("WAIT_BUYER_PAY".equals(tradeStatus)) {
                                     num++;
                                 }
                             }
                         }
-                    }catch (Exception e){
+                    } catch (Exception e) {
                         e.printStackTrace();
                     }
                 }
@@ -637,7 +533,7 @@
         return alipay;
     }
 
-    public int PlaypaiGoldPayment(String code,ClasspaymentRequest request){
+    public int PlaypaiGoldPayment(String code, ClasspaymentRequest request) {
         PlayPaiGoldCoursePackage paiGoldCoursePackage = new PlayPaiGoldCoursePackage();
         paiGoldCoursePackage.setCoursePackageId(request.getLessonId());
         paiGoldCoursePackage.setStuId(request.getStuId());
@@ -650,7 +546,7 @@
     @Override
     public ResultUtil insertVipPaymentCallback(String code, String orderNumber) {
         TCoursePackagePayment coursePackagePayment = couPayClient.getCoursePackagePaymentByCode(code);
-        if(coursePackagePayment.getPayStatus() != 1){
+        if (coursePackagePayment.getPayStatus() != 1) {
             return ResultUtil.success();
         }
         coursePackagePayment.setPayStatus(2);
@@ -660,16 +556,15 @@
     }
 
     /**
-     *
-     * @param stuId 学员id
-     * @param appUserId 用户id
-     * @param appointStatus  预约状态 0=全部 1=待上课 2=已完成 3=已取消
-     * @param timeType 时间类型 0=全部 1=近一周 2=近一个月 3=近一年
-     * @param search 课程名称
+     * @param stuId         学员id
+     * @param appUserId     用户id
+     * @param appointStatus 预约状态 0=全部 1=待上课 2=已完成 3=已取消
+     * @param timeType      时间类型 0=全部 1=近一周 2=近一个月 3=近一年
+     * @param search        课程名称
      * @return
      */
     @Override
-    public List<RecordAppoint> getAppointmentRecords(Integer stuId, Integer appUserId,Integer appointStatus,Integer timeType,String search,Integer pageNum) {
+    public List<RecordAppoint> getAppointmentRecords(Integer stuId, Integer appUserId, Integer appointStatus, Integer timeType, String search, Integer pageNum) {
         WeeksOfCourseRest courseRest = new WeeksOfCourseRest();
         courseRest.setAppUserId(appUserId);
         courseRest.setStuId(stuId);
@@ -677,16 +572,15 @@
         List<RecordAppoint> recordAppoints = couPayClient.obtainStudentClassDetailsData(courseRest);
         if (recordAppoints.size() > 0) {
             if (ToolUtil.isNotEmpty(appointStatus) && appointStatus != 0) {
-                if (appointStatus ==2){
+                if (appointStatus == 2) {
                     recordAppoints = recordAppoints.stream()
                             .filter(record -> record.getStatus().equals(3))
                             .collect(Collectors.toList());
-                }else if (appointStatus ==3){
+                } else if (appointStatus == 3) {
                     recordAppoints = recordAppoints.stream()
                             .filter(record -> record.getStatus().equals(4))
                             .collect(Collectors.toList());
-                }
-                else {
+                } else {
 
                     recordAppoints = recordAppoints.stream()
                             .filter(record -> record.getStatus().equals(appointStatus))
@@ -694,9 +588,9 @@
                 }
             }
             if (ToolUtil.isNotEmpty(search)) {
-                    recordAppoints = recordAppoints.stream()
-                            .filter(record -> record.getCoursePackageName().contains(search))
-                            .collect(Collectors.toList());
+                recordAppoints = recordAppoints.stream()
+                        .filter(record -> record.getCoursePackageName().contains(search))
+                        .collect(Collectors.toList());
             }
 
             if (ToolUtil.isNotEmpty(timeType) && timeType != 0) {
@@ -705,46 +599,46 @@
                 switch (timeType) {
                     case 1:
                         Date lastWeekStartDate = DateUtil.getLastWeekStartDate();
-                            recordAppoints = recordAppoints.stream()
-                                    .filter(record -> {
-                                        try {
-                                            SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm");
-                                            String substring = record.getTimeFrame().substring(11);
-                                            Date time = sdf.parse(substring);
-                                            return !time.before(lastWeekStartDate) && !time.after(lastOfDate);
-                                        } catch (ParseException e) {
-                                            return false;
-                                        }
-                                    })
-                                    .collect(Collectors.toList());
+                        recordAppoints = recordAppoints.stream()
+                                .filter(record -> {
+                                    try {
+                                        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm");
+                                        String substring = record.getTimeFrame().substring(11);
+                                        Date time = sdf.parse(substring);
+                                        return !time.before(lastWeekStartDate) && !time.after(lastOfDate);
+                                    } catch (ParseException e) {
+                                        return false;
+                                    }
+                                })
+                                .collect(Collectors.toList());
                         break;
                     case 2:
                         Date lastMonthStartDate = DateUtil.getLastMonthStartDate();
-                            recordAppoints = recordAppoints.stream()
-                                    .filter(record -> {
-                                        try {
-                                            SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
-                                            Date time = sdf.parse(record.getTimeFrame().substring(11));
-                                            return !time.before(lastMonthStartDate) && !time.after(lastOfDate);
-                                        } catch (ParseException e) {
-                                            return false;
-                                        }
-                                    })
-                                    .collect(Collectors.toList());
+                        recordAppoints = recordAppoints.stream()
+                                .filter(record -> {
+                                    try {
+                                        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
+                                        Date time = sdf.parse(record.getTimeFrame().substring(11));
+                                        return !time.before(lastMonthStartDate) && !time.after(lastOfDate);
+                                    } catch (ParseException e) {
+                                        return false;
+                                    }
+                                })
+                                .collect(Collectors.toList());
                         break;
                     case 3:
                         Date lastYearStartDate = DateUtil.getLastYearStartDate();
-                            recordAppoints = recordAppoints.stream()
-                                    .filter(record -> {
-                                        try {
-                                            SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm");
-                                            Date time = sdf.parse(record.getTimeFrame().substring(11));
-                                            return !time.before(lastYearStartDate) && !time.after(lastOfDate);
-                                        } catch (ParseException e) {
-                                            return false;
-                                        }
-                                    })
-                                    .collect(Collectors.toList());
+                        recordAppoints = recordAppoints.stream()
+                                .filter(record -> {
+                                    try {
+                                        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm");
+                                        Date time = sdf.parse(record.getTimeFrame().substring(11));
+                                        return !time.before(lastYearStartDate) && !time.after(lastOfDate);
+                                    } catch (ParseException e) {
+                                        return false;
+                                    }
+                                })
+                                .collect(Collectors.toList());
 
                         break;
                     default:
@@ -758,7 +652,7 @@
     @Override
     public ResultUtil cancelReservationOfCourse(Integer courseStuRecordId) {
         Integer integer = crClient.cancelCourseRecordClass(courseStuRecordId);
-        switch (integer){
+        switch (integer) {
             case 1:
                 ResultUtil.success();
                 break;
@@ -773,31 +667,30 @@
     }
 
     /**
-     *
-     * @param space 1=升序/2=降序
-     * @param cityCode 城市code
+     * @param space     1=升序/2=降序
+     * @param cityCode  城市code
      * @param latitude
      * @param longitude
      * @return
      */
     @Override
-    public List<StoreDetailList> queryStoreList(Integer space,String cityCode,String latitude,String longitude,String search) {
+    public List<StoreDetailList> queryStoreList(Integer space, String cityCode, String latitude, String longitude, String search) {
         StoreOfCitycodeResp citycodeResp = new StoreOfCitycodeResp();
         citycodeResp.setCityCode(cityCode);
         citycodeResp.setLongitude(latitude);
         citycodeResp.setLatitude(longitude);
         List<StoreDetailList> queryStoreList = storeClient.getQueryStoreList(citycodeResp);
-        if (queryStoreList.size() > 0){
-            if (ToolUtil.isEmpty(space) || space == 2){
+        if (queryStoreList.size() > 0) {
+            if (ToolUtil.isEmpty(space) || space == 2) {
                 queryStoreList = queryStoreList.stream()
                         .sorted(Comparator.comparing(StoreDetailList::getStoreDistance).reversed())
                         .collect(Collectors.toList());
 
-            }else {
-                queryStoreList =  queryStoreList.stream().sorted(Comparator.comparing(o -> o.getStoreDistance())).collect(Collectors.toList());
+            } else {
+                queryStoreList = queryStoreList.stream().sorted(Comparator.comparing(o -> o.getStoreDistance())).collect(Collectors.toList());
             }
-            if (ToolUtil.isNotEmpty(search)){
-                queryStoreList =  queryStoreList.stream().filter(o -> o.getStoreName().contains(search)).collect(Collectors.toList());
+            if (ToolUtil.isNotEmpty(search)) {
+                queryStoreList = queryStoreList.stream().filter(o -> o.getStoreName().contains(search)).collect(Collectors.toList());
             }
 
         }
@@ -809,14 +702,14 @@
         Store store = storeClient.queryStoreById(storeId);
         StoreDetailsVo detailsVo = new StoreDetailsVo();
         String realPicture = store.getRealPicture();
-        if (ToolUtil.isNotEmpty(realPicture)){
+        if (ToolUtil.isNotEmpty(realPicture)) {
             String[] split = realPicture.split(",");
             detailsVo.setImages(Arrays.asList(split));
         }
         detailsVo.setStoreId(store.getId());
         detailsVo.setStoreName(store.getName());
         detailsVo.setStoreAddress(store.getAddress());
-        detailsVo.setStoreTime(store.getStartTime() + "至" +store.getEndTime());
+        detailsVo.setStoreTime(store.getStartTime() + "至" + store.getEndTime());
         detailsVo.setStoreInfo(store.getIntroduce());
         detailsVo.setLon(store.getLon());
         detailsVo.setLat(store.getLat());
@@ -825,10 +718,10 @@
         List<StoreOfCourseVo> storeOfCourseList = culisClient.getStoreOfCourseList(storeId);
         System.out.println(storeOfCourseList);
         for (StoreOfCourseVo storeOfCourseVo : storeOfCourseList) {
-            if (storeOfCourseVo.getClassHours().equals("0")){
+            if (storeOfCourseVo.getClassHours().equals("0")) {
                 storeOfCourseVo.setClassHours(null);
             }
-            if (storeOfCourseVo.getClassStartTime().equals("-")){
+            if (storeOfCourseVo.getClassStartTime().equals("-")) {
                 storeOfCourseVo.setClassStartTime(null);
             }
         }
@@ -839,15 +732,15 @@
     @Override
     public ResultUtil commitEditStudentInfo(StuEditInfoReq stu, Integer userIdFormRedis) {
         TStudent tStudent = this.baseMapper.selectOne(new LambdaQueryWrapper<TStudent>()
-                .eq(TStudent::getId,stu.getId())
-                .eq(TStudent::getAppUserId,userIdFormRedis));
-        if (ToolUtil.isEmpty(tStudent)){
+                .eq(TStudent::getId, stu.getId())
+                .eq(TStudent::getAppUserId, userIdFormRedis));
+        if (ToolUtil.isEmpty(tStudent)) {
             ResultUtil.error("会员信息不存在!");
         }
         SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
         tStudent.setHeadImg(stu.getHeadImg());
         tStudent.setName(stu.getName());
-        tStudent.setPhone(ToolUtil.isEmpty(stu.getPhone()) ? "":stu.getPhone());
+        tStudent.setPhone(ToolUtil.isEmpty(stu.getPhone()) ? "" : stu.getPhone());
         try {
             tStudent.setBirthday(simpleDateFormat.parse(stu.getBirthday()));
         } catch (ParseException e) {
@@ -856,7 +749,7 @@
         tStudent.setSex(stu.getSex());
         tStudent.setHeight(stu.getHeight());
         tStudent.setWeight(stu.getWeight());
-        tStudent.setIdCard(ToolUtil.isEmpty(stu.getIdCard()) ? ""  : stu.getIdCard());
+        tStudent.setIdCard(ToolUtil.isEmpty(stu.getIdCard()) ? "" : stu.getIdCard());
         this.baseMapper.updateById(tStudent);
         return ResultUtil.success();
     }
@@ -873,7 +766,7 @@
 
     @Override
     public void createHistory(CreateHistoryDto createHistoryDto) {
-         this.baseMapper.createHistory(createHistoryDto);
+        this.baseMapper.createHistory(createHistoryDto);
     }
 
     @Override
@@ -886,9 +779,23 @@
         return this.baseMapper.getGiftSelect(giftSearchDto);
     }
 
+    @Resource
+    private SiteClient siteClient;
+
+
     @Override
     public List<Map<String, Object>> queryCom(Integer id) {
-        return this.baseMapper.queryCom(id);
+        List<Map<String, Object>> maps = this.baseMapper.queryCom(id);
+        for (Map<String, Object> map : maps) {
+            Integer coachId = (Integer) map.get("coachId");
+            System.err.println("==============XXXXXXXXXXXX"+coachId);
+            if (coachId!=null) {
+                User name = siteClient.queryUserName(coachId);
+                map.put("name",name.getName());
+            }
+        }
+
+    return maps;
     }
 
 

--
Gitblit v1.7.1