From 339d15eb99805ce78fdd07005d64faacb57d649d Mon Sep 17 00:00:00 2001
From: guohongjin <guohongjin@test.com>
Date: 星期三, 08 五月 2024 16:37:56 +0800
Subject: [PATCH] 修改最低价显示

---
 rest/src/main/java/cn/stylefeng/rest/modular/user/controller/CounsellingInfoController.java |   11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/rest/src/main/java/cn/stylefeng/rest/modular/user/controller/CounsellingInfoController.java b/rest/src/main/java/cn/stylefeng/rest/modular/user/controller/CounsellingInfoController.java
index b3e423d..309c5b3 100644
--- a/rest/src/main/java/cn/stylefeng/rest/modular/user/controller/CounsellingInfoController.java
+++ b/rest/src/main/java/cn/stylefeng/rest/modular/user/controller/CounsellingInfoController.java
@@ -308,7 +308,8 @@
             List<Customer> customerList = this.customerService.list(new LambdaQueryWrapper<Customer>().select(Customer::getCustomerId,Customer::getNickName).in(Customer::getCustomerId,custommerIds));
             //查询套餐最低价
             List<Map<String,Object>> lowMapList = this.counsellingSetMealService.listMaps(new QueryWrapper<CounsellingSetMeal>().select(" counselling_info_id counsellingInfoId,IFNULL(min(price),0) price ").lambda().in(CounsellingSetMeal::getCounsellingInfoId,counseIds)
-                    .eq(CounsellingSetMeal::getSetMealType,1).eq(CounsellingSetMeal::getIsDelete,0));
+                    .eq(CounsellingSetMeal::getSetMealType,1).eq(CounsellingSetMeal::getIsDelete,0)
+                    .groupBy(CounsellingSetMeal::getCounsellingInfoId));
 
             List<CounsellinginfoResponseDTO> counsellinginfoResponseDTOS = BeanUtil.copyToList(page.getRecords(),CounsellinginfoResponseDTO.class, CopyOptions.create());
             counsellinginfoResponseDTOS.stream().forEach(counsellinginfoResponseDTO -> {
@@ -335,7 +336,7 @@
 
                 if (CollectionUtil.isNotEmpty(lowMapList)){
                     lowMapList.stream().forEach(stringObjectMap -> {
-                        if (stringObjectMap.get("counsellingInfoId") != null){
+                        if (stringObjectMap.get("counsellingInfoId") != null && stringObjectMap.get("counsellingInfoId").toString().equals(counsellinginfoResponseDTO.getId().toString()) ){
                             counsellinginfoResponseDTO.setLowPrice(new BigDecimal(stringObjectMap.get("price").toString()));
                         }
                     });
@@ -710,8 +711,8 @@
 
             // 发送IM消息
             ImPushDataDTO pushData1 = ImPushDataDTO.builder()
-                    .type(ImPushTypeEnum.C_TO_W_IM_1V1_START_CONSULT.getCode())
-                    .title(ImPushTypeEnum.C_TO_W_IM_1V1_START_CONSULT.getName())
+                    .type(ImPushTypeEnum.C_TO_W_IM_1V1_START_CONSULT_FIRST.getCode())
+                    .title(ImPushTypeEnum.C_TO_W_IM_1V1_START_CONSULT_FIRST.getName())
                     .content("预约成功"+",请注意预约时间:"+counsellingReservationRequest.getDayTime()+counsellingReservationRequest.getTimePoint())
 //                    .content("预约成功!")
                     .objId(ObjUtil.toString(counsellingInfo.getId()))
@@ -798,7 +799,7 @@
             return new SuccessResponseData<>(counsellingOrderReservation);
         }catch (Exception ex){
             log.error("咨询预约服务异常",ex.getStackTrace());
-            throw new ServiceException("当前时间段已预约,请选择其他时间段!");
+            throw new ServiceException("当前时间段已在进行预约,请稍后再试!");
         }finally {
             if(tryLock){
                 lock.unlock();

--
Gitblit v1.7.1